import { B as e } from "./entities.browser.js";
import * as t from "react";
//#region ../../node_modules/markdown-to-jsx/dist/index.js
var n = 32, r = 9, i = 13, a = 10, o = 96, s = 126, c = 91, l = 94, u = 62, d = 35, f = 36, p = 37, m = 45, h = 61, g = 92, _ = 42, v = 95, y = 60, b = 64, x = 93, S = 33, C = 38, w = 58, T = 70, E = 102, D = 104, O = 119, k = 116, A = 112, j = 115, M = 160, N = 12, P = 44, F = 59, I = 63, L = 46, R = 47, z = 39, ee = 34, te = 43, ne = 124, B = 123, re = 125, ie = 40, ae = 41, oe = 30, se = 31, V = 48, H = 57, U = 65, W = 90, ce = 97, le = 122, ue = 128, de = 32, G = {
	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
};
function fe(e) {
	if (!xe(e, "---")) return null;
	let t = 3;
	for (; t < e.length && (e[t] === " " || e[t] === "	");) t++;
	if (t < e.length && e[t] === "\r" && t++, t >= e.length || e[t] !== "\n") return null;
	t++;
	let n = !1;
	for (; t < e.length;) {
		let r = t;
		for (; t < e.length && e[t] !== "\n" && e[t] !== "\r";) t++;
		if (t >= e.length) break;
		let i = t;
		if (e[t] === "\r" && t++, t < e.length && e[t] === "\n" && t++, xe(e, "---", r)) return {
			endPos: t,
			hasValidYaml: n
		};
		let a = e.indexOf(":", r);
		a !== -1 && a < i && (n = !0);
	}
	return null;
}
var pe = /&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi, me = {
	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"
};
function he(e) {
	var t = {};
	for (var n in e) {
		var r = me[n.toLowerCase()];
		if (r) t[r] = e[n];
		else {
			var i = n.indexOf(":");
			i === -1 ? t[n] = e[n] : t[n.slice(0, i) + n[i + 1].toUpperCase() + n.slice(i + 2)] = e[n];
		}
	}
	return t;
}
var ge = /(\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;
function _e(t) {
	return t.indexOf("&") === -1 ? t : t.replace(pe, (t, n) => {
		var r = e(n);
		if (r) return r;
		if (n[0] === "#") {
			var i = n[1] === "x" || n[1] === "X" ? parseInt(n.slice(2), 16) : parseInt(n.slice(1), 10);
			return i === 0 || i >= 55296 && i <= 57343 || i > 1114111 ? "�" : i <= 65535 ? String.fromCharCode(i) : String.fromCharCode(55296 + (i - 65536 >> 10), 56320 + (i - 65536 & 1023));
		}
		return t;
	});
}
var ve = /(javascript|vbscript|data(?!:image)):/i;
function K(e) {
	if (ve.test(e)) return null;
	if (e.indexOf("%") === -1) return e;
	try {
		let t = decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g, "");
		if (ve.test(t)) return null;
	} catch {
		return null;
	}
	return e;
}
var q = {}, J, ye;
for (J = [
	192,
	193,
	194,
	195,
	196,
	197,
	224,
	225,
	226,
	227,
	228,
	229,
	230,
	198
], ye = 0; ye < J.length; ye++) q[J[ye]] = "a";
for (q[231] = q[199] = "c", q[240] = q[208] = "d", J = [
	200,
	201,
	202,
	203,
	233,
	232,
	234,
	235
], ye = 0; ye < J.length; ye++) q[J[ye]] = "e";
for (J = [
	207,
	239,
	206,
	238,
	205,
	237,
	204,
	236
], ye = 0; ye < J.length; ye++) q[J[ye]] = "i";
for (q[209] = q[241] = "n", J = [
	248,
	216,
	339,
	338,
	213,
	245,
	212,
	244,
	211,
	243,
	210,
	242
], ye = 0; ye < J.length; ye++) q[J[ye]] = "o";
for (J = [
	220,
	252,
	219,
	251,
	218,
	250,
	217,
	249
], ye = 0; ye < J.length; ye++) q[J[ye]] = "u";
q[376] = q[255] = q[221] = q[253] = "y";
function be(e) {
	for (var t = e.toLowerCase(), r = "", i = -1, a = 0; a < t.length; a++) {
		var o = t.charCodeAt(a);
		if (o < ue && (Ne[o] & (Y | X)) !== 0) i < 0 && (i = a);
		else if (o === n || o === m) i >= 0 && (r += t.slice(i, a), i = -1), r += "-";
		else {
			i >= 0 && (r += t.slice(i, a), i = -1);
			var s = q[o];
			s && (r += s);
		}
	}
	return i >= 0 && (r += t.slice(i)), r;
}
function xe(e, t, n) {
	return e.startsWith(t, n);
}
var Se = 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"
]);
function Ce(e) {
	let t = e.toLowerCase();
	if (Se.has(t)) return !0;
	let n = t.indexOf(":");
	return n === -1 ? !1 : (t = t.slice(n + 1), Se.has(t));
}
var we = 1, Te = 2, Y = 4, X = 8, Ee = 16, De = 32, Oe = 64, ke = 1, Ae = 2, je = 3, Me = 4, Ne = (function() {
	let e = new Uint8Array(128), t;
	for (e[r] = we | De, e[a] = we | Ee, e[N] = we, e[i] = we | Ee, e[n] = we | De, t = S; t <= R; t++) e[t] = Te;
	for (t = w; t <= b; t++) e[t] = Te;
	for (t = c; t <= o; t++) e[t] = Te;
	for (t = B; t <= s; t++) e[t] = Te;
	for (t = V; t <= H; t++) e[t] = X;
	for (t = U; t <= W; t++) e[t] = Y | Oe;
	for (t = ce; t <= le; t++) e[t] = Y;
	return e;
})();
(function() {
	let e = new Uint8Array(128);
	return e[g] = Ae, e[c] = Me, e[_] = e[v] = e[s] = e[h] = je, e[o] = e[y] = e[b] = e[x] = e[a] = e[n] = e[S] = ke, e[E] = e[D] = e[O] = ke, e;
})();
var Pe = [];
function Fe(e) {
	var t = e.indexOf("\r"), n = e.indexOf("\0");
	if (t === -1 && n === -1) return e;
	var r = e.length;
	Pe.length = 0;
	var o = 0, s = 0;
	for (s = t === -1 ? n : n === -1 || t < n ? t : n; s < r; s++) {
		var c = e.charCodeAt(s);
		c === i ? (o < s && Pe.push(e.slice(o, s)), s + 1 < r && e.charCodeAt(s + 1) === a && s++, Pe.push("\n"), o = s + 1) : c === 0 && (o < s && Pe.push(e.slice(o, s)), Pe.push("�"), o = s + 1);
	}
	return o < r && Pe.push(e.slice(o)), Pe.join("");
}
function Ie(e, t, n) {
	for (var r = e, i = t.split("."), a = 0; a < i.length && (r = r?.[i[a]], r !== void 0);) a++;
	return r || n;
}
function Le(e) {
	for (var t = !1, r = 0; r < e.length; r++) {
		var i = e.charCodeAt(r);
		if (i <= n || i === ee || i === p || i === y || i === u || i === c || i === g || i === x || i === l || i === o || i >= 123) {
			t = !0;
			break;
		}
	}
	if (!t) return e;
	for (var a = "", r = 0; r < e.length; r++) {
		var i = e.charCodeAt(r);
		if (i === p && r + 2 < e.length) {
			var s = e.charCodeAt(r + 1), d = e.charCodeAt(r + 2);
			if ((s >= V && s <= H || s >= U && s <= T || s >= ce && s <= E) && (d >= V && d <= H || d >= U && d <= T || d >= ce && d <= E)) {
				a += e[r] + e[r + 1] + e[r + 2], r += 2;
				continue;
			}
		}
		a += encodeURI(e[r]);
	}
	return a;
}
function Re(...e) {
	return e.filter(Boolean).join(" ");
}
var ze = new Set([
	"title",
	"textarea",
	"style",
	"xmp",
	"iframe",
	"noembed",
	"noframes",
	"script",
	"plaintext"
]), Be = /<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;
function Ve(e) {
	return ze.has(e.toLowerCase());
}
function He(e) {
	return Be.lastIndex = 0, Be.test(e);
}
function Ue(e) {
	return Be.lastIndex = 0, e.replace(Be, function(e, t, n, r) {
		return "&lt;" + t + n + r;
	});
}
var We = /^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/, Ge = /^<[A-Z]/, Ke = [
	"script",
	"pre",
	"style",
	"textarea"
], qe = new Set(Ke), Je = /<(?:pre|script|style|textarea)\b/i, Ye = new Set([
	"table",
	"thead",
	"tbody",
	"tfoot",
	"tr",
	"td",
	"th"
]), Xe = new Uint8Array(128);
(function() {
	for (var e = [
		o,
		_,
		v,
		s,
		h,
		c,
		S,
		y,
		g,
		se,
		D,
		O,
		E
	], t = 0; t < e.length; t++) Xe[e[t]] = 1;
})();
var Ze = /([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;
function Qe(e) {
	return qe.has(e);
}
function $e(e) {
	return Je.test(e);
}
function et(e, t, i) {
	for (var a = t, o = i; a < o && (e.charCodeAt(a) === n || e.charCodeAt(a) === r);) a++;
	if (a >= o) return !1;
	e.charCodeAt(a) === ne && a++;
	for (var s = 0; a < o;) {
		for (; a < o && (e.charCodeAt(a) === n || e.charCodeAt(a) === r);) a++;
		if (a >= o) break;
		if (e.charCodeAt(a) === ne && s > 0) {
			for (var c = a + 1; c < o && (e.charCodeAt(c) === n || e.charCodeAt(c) === r);) c++;
			if (c >= o) return !0;
		}
		if (e.charCodeAt(a) === w && a++, a >= o || e.charCodeAt(a) !== m) return !1;
		for (; a < o && e.charCodeAt(a) === m;) a++;
		for (a < o && e.charCodeAt(a) === w && a++, s++; a < o && (e.charCodeAt(a) === n || e.charCodeAt(a) === r);) a++;
		if (a < o) if (e.charCodeAt(a) === ne) a++;
		else return !1;
	}
	return s > 0;
}
function tt(e, t) {
	if (e.charCodeAt(t) !== y) return null;
	let i = t + 1, s = e.length, c = !1;
	e.charCodeAt(i) === R && (i++, c = !0);
	let l = i, d = e.charCodeAt(i);
	if (!(d >= ce && d <= le || d >= U && d <= W)) return null;
	for (; i < s && (e.charCodeAt(i) >= ce && e.charCodeAt(i) <= le || e.charCodeAt(i) >= U && e.charCodeAt(i) <= W || e.charCodeAt(i) >= V && e.charCodeAt(i) <= H || e.charCodeAt(i) === m);) i++;
	let f = e.slice(l, i);
	if (!f) return null;
	let p = i;
	for (; i < s && (e.charCodeAt(i) === n || e.charCodeAt(i) === r || e.charCodeAt(i) === a);) i++;
	let g = e.slice(p, i);
	if (i === p && i < s) {
		var _ = e.charCodeAt(i);
		if (_ !== u && _ !== R) return null;
	}
	let b = i, x = {}, S = !1;
	for (; i < s;) {
		let t = e.charCodeAt(i);
		if (t === u) {
			let t = e.slice(b, i);
			return {
				tag: f,
				attrs: x,
				selfClosing: !1,
				end: i + 1,
				rawAttrs: t,
				whitespaceBeforeAttrs: g,
				isClosing: c,
				hasSpaceBeforeSlash: S
			};
		}
		if (t === n || t === r || t === a) {
			i++;
			continue;
		}
		if (t === R && i + 1 < s && e.charCodeAt(i + 1) === u) {
			let t = e.slice(b, i);
			return S = i > b && e.charCodeAt(i - 1) === n, {
				tag: f,
				attrs: x,
				selfClosing: !0,
				end: i + 2,
				rawAttrs: t,
				whitespaceBeforeAttrs: g,
				isClosing: c,
				hasSpaceBeforeSlash: S
			};
		}
		var C = i, T = e.charCodeAt(i);
		if (!(T >= ce && T <= le || T >= U && T <= W || T === v || T === w)) return null;
		for (i++; i < s;) {
			var E = e.charCodeAt(i);
			if (E >= ce && E <= le || E >= U && E <= W || E >= V && E <= H || E === v || E === L || E === w || E === m) i++;
			else break;
		}
		for (var D = e.slice(C, i); i < s && (e.charCodeAt(i) === n || e.charCodeAt(i) === r);) i++;
		if (e.charCodeAt(i) !== h) {
			x[D] = "";
			continue;
		}
		for (i++; i < s && (e.charCodeAt(i) === n || e.charCodeAt(i) === r);) i++;
		var O = e.charCodeAt(i);
		if (O === ee || O === z) {
			i++;
			for (var k = i; i < s && e.charCodeAt(i) !== O;) i++;
			if (i >= s) return null;
			if (x[D] = e.slice(k, i), i++, i < s) {
				var A = e.charCodeAt(i);
				if (A !== n && A !== r && A !== a && A !== u && A !== R) return null;
			}
		} else if (O === B) {
			var j = 1, k = i;
			for (i++; i < s && j > 0;) {
				var E = e.charCodeAt(i);
				E === B ? j++ : E === re && j--, i++;
			}
			x[D] = e.slice(k, i);
		} else {
			for (var k = i; i < s;) {
				var M = e.charCodeAt(i);
				if (M === n || M === r || M === u || M === a || M === ee || M === z || M === h || M === y || M === o) break;
				i++;
			}
			if (i === k) return null;
			x[D] = e.slice(k, i);
		}
	}
	return null;
}
function nt(e, t, i) {
	for (var f = 0, p = e.length, h = !1, g = !1; f < p;) {
		for (var y = e.indexOf("\n", f), b = y < 0 ? p : y, x = f, S = 0; x < b && S < 4;) if (e.charCodeAt(x) === n) S++, x++;
		else if (e.charCodeAt(x) === r) S += 4, x++;
		else break;
		if (x >= b) {
			h = !1, f = y < 0 ? p : y + 1;
			continue;
		}
		if (S < 4) {
			var C = e.charCodeAt(x);
			if (C === o || C === s) {
				for (var w = C, T = 0, E = x; E < b && e.charCodeAt(E) === w;) T++, E++;
				if (T >= 3) {
					var D = !0;
					if (w === o) {
						for (var O = E; O < b; O++) if (e.charCodeAt(O) === o) {
							D = !1;
							break;
						}
					}
					if (D) {
						h = !1;
						for (var k = y < 0 ? p : y + 1; k < p;) {
							for (var A = k, j = 0; A < p && j < 4;) {
								var M = e.charCodeAt(A);
								if (M === n) j++, A++;
								else if (M === r) j += 4, A++;
								else break;
							}
							if (j < 4 && A < p && e.charCodeAt(A) === w) {
								for (var N = 0; A < p && e.charCodeAt(A) === w;) N++, A++;
								if (N >= T) {
									for (; A < p && (e.charCodeAt(A) === n || e.charCodeAt(A) === r);) A++;
									if (A >= p || e.charCodeAt(A) === a) {
										f = A >= p ? p : A + 1;
										break;
									}
								}
							}
							for (; k < p && e.charCodeAt(k) !== a;) k++;
							k < p && k++;
						}
						k >= p && (f = p, g = !0);
						continue;
					}
				}
			}
		}
		for (var P = x; P < b && e.charCodeAt(P) === u;) {
			P++, P < b && e.charCodeAt(P) === n && P++;
			for (var F = 0; P < b && F < 4;) if (e.charCodeAt(P) === n) F++, P++;
			else if (e.charCodeAt(P) === r) F += 4, P++;
			else break;
			if (F >= 4) break;
			h = !1;
		}
		if (!h && S < 4 && P < b && e.charCodeAt(P) === c && !(P + 1 < p && e.charCodeAt(P + 1) === l)) {
			var I = rt(e, P, t);
			if (I) {
				f = I, h = !1;
				continue;
			}
		}
		var L = e.charCodeAt(x);
		if (L === d && S < 4) h = !1;
		else if (S < 4 && (L === m || L === _ || L === v)) {
			for (var R = x, z = 0; R < b;) {
				var ee = e.charCodeAt(R);
				if (ee === L) z++;
				else if (ee !== n && ee !== r) break;
				R++;
			}
			h = !(z >= 3 && R >= b);
		} else h = !0;
		f = y < 0 ? p : y + 1;
	}
	return g;
}
function rt(e, t, i) {
	let o = e.length;
	if (e.charCodeAt(t) !== c) return null;
	let s = t + 1 < o && e.charCodeAt(t + 1) === l, d = t + 1;
	for (; d < o;) {
		var f = e.charCodeAt(d);
		if (f === x) {
			d++;
			break;
		}
		if (f === c) return null;
		f === g && d + 1 < o && d++, d++;
	}
	if (d > o || e.charCodeAt(d - 1) !== x) return null;
	let p = e.slice(t + 1, d - 1);
	if (p.length > 999) return null;
	let m = dt(p);
	if (!m || d >= o || e.charCodeAt(d) !== w) return null;
	d++;
	let h = !1;
	for (; d < o;) {
		let t = e.charCodeAt(d);
		if (t === n || t === r) d++;
		else if (t === a && !h) h = !0, d++;
		else break;
	}
	if (s) {
		let t = e.indexOf("\n", d), n = t < 0 ? o : t;
		return i[m] = {
			target: e.slice(d, n).trim(),
			title: void 0
		}, t < 0 ? o : t + 1;
	}
	var _;
	if (d < o && e.charCodeAt(d) === y) {
		d++;
		for (var v = d; d < o && e.charCodeAt(d) !== u && e.charCodeAt(d) !== a;) e.charCodeAt(d) === g && d + 1 < o && d++, d++;
		if (d >= o || e.charCodeAt(d) !== u) return null;
		_ = e.slice(v, d), d++;
		for (var b = e.indexOf("\n", d), S = b < 0 ? o : b, C = d; C < S && (e.charCodeAt(C) === n || e.charCodeAt(C) === r);) C++;
		if (C < S) {
			if (C === d) return null;
			var T = e.charCodeAt(C);
			if (T !== ee && T !== z && T !== ie) return null;
		}
	} else {
		for (var v = d, E = 0; d < o;) {
			var f = e.charCodeAt(d);
			if (f === ie) E++;
			else if (f === ae) {
				if (E === 0) break;
				E--;
			} else {
				if (f === n || f === r || f === a) break;
				f === g && d + 1 < o && d++;
			}
			d++;
		}
		if (_ = e.slice(v, d), !_) return null;
	}
	for (; d < o && (e.charCodeAt(d) === n || e.charCodeAt(d) === r);) d++;
	var D = e.indexOf("\n", d), O = D < 0 ? o : D, k, A = !1, j = d, M = d;
	if (d === O && d < o) for (M = d + 1; M < o && (e.charCodeAt(M) === n || e.charCodeAt(M) === r);) M++;
	if (M < o) {
		var N = e.charCodeAt(M);
		if (N === ee || N === z || N === ie) {
			for (var P = N === ie ? 41 : N, F = M + 1, I = F; F < o;) {
				var L = e.charCodeAt(F);
				if (L === P) {
					for (var R = F + 1; R < o && (e.charCodeAt(R) === n || e.charCodeAt(R) === r);) R++;
					(R >= o || e.charCodeAt(R) === a) && (k = e.slice(I, F), A = !0, j = R < o ? R + 1 : o);
					break;
				}
				if (L === g && F + 1 < o) {
					F += 2;
					continue;
				}
				if (L === a && F + 1 < o && e.charCodeAt(F + 1) === a) break;
				F++;
			}
			if (!A && M === d) return null;
		}
	}
	if (A) return i[m] || (i[m] = {
		target: pt(_),
		title: k === void 0 ? k : _e(pt(k))
	}), j;
	for (; d < O && (e.charCodeAt(d) === n || e.charCodeAt(d) === r);) d++;
	return d < O ? null : (i[m] || (i[m] = {
		target: pt(_),
		title: k
	}), D < 0 ? o : D + 1);
}
var it = 1, at = 2, Z = 4, ot = 8, st = 16, ct = 32, lt = 64, Q = new Uint8Array(128);
Q[n] = it, Q[r] = it, Q[a] = it | at, Q[i] = it | at, Q[d] = ct | Z, Q[u] = ct | Z, Q[m] = ct | lt | Z, Q[te] = ct | Z, Q[_] = ct | lt | Z, Q[v] = ct | lt | Z, Q[o] = ct | lt | Z, Q[s] = ct | lt | Z, Q[y] = ct | lt | Z, Q[c] = lt | Z, Q[S] = lt | Z, Q[ne] = ct | Z;
for (let e = V; e <= H; e++) Q[e] = st | ct;
for (let e = U; e <= W; e++) Q[e] = ot;
for (let e = ce; e <= le; e++) Q[e] = ot;
Q[g] = Z, Q[x] = Z, Q[ie] = Z, Q[ae] = Z, Q[w] = Z, Q[ee] = Z, Q[z] = Z, Q[C] = Z, Q[h] = Z, Q[f] = Z, Q[p] = Z, Q[P] = Z, Q[L] = Z, Q[R] = Z, Q[F] = Z, Q[I] = Z, Q[b] = Z, Q[l] = Z, Q[B] = Z, Q[re] = Z;
function ut(e) {
	if (e.indexOf("[") < 0 && e.indexOf("]") < 0) return !1;
	for (var t = 0; t < e.length; t++) {
		if (e.charCodeAt(t) === g) {
			t++;
			continue;
		}
		if (e.charCodeAt(t) === c || e.charCodeAt(t) === x) return !0;
	}
	return !1;
}
function dt(e) {
	var t = e.replace(/\s+/g, " ").trim();
	return t.indexOf("ẞ") === -1 ? t.toLowerCase() : t.replace(/\u1E9E/g, "ss").toLowerCase();
}
function ft(e) {
	return e < ue ? Q[e] : e === M ? it : 0;
}
function pt(e) {
	return e.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
}
function mt(e, t) {
	var n = e.indexOf("\n", t);
	return n < 0 ? e.length : n;
}
function $(e, t) {
	let n = mt(e, t);
	return n < e.length ? n + 1 : n;
}
function ht(e, t, i) {
	for (; t < i;) {
		let i = e.charCodeAt(t);
		if (i !== n && i !== r) break;
		t++;
	}
	return t;
}
function gt(e, t) {
	let n = $(e, t);
	for (; n < e.length;) {
		let t = mt(e, n);
		if (xt(e, n, t)) return n;
		n = $(e, n);
	}
	return e.length;
}
function _t(e, t, n, r) {
	let i = 0;
	for (; t + i < n && e.charCodeAt(t + i) === r;) i++;
	return i;
}
var vt = 0, yt = 0;
function bt(e, t, i) {
	for (vt = 0, yt = 0; t + yt < i;) {
		let i = e.charCodeAt(t + yt);
		if (i === r) vt += 4 - vt % 4;
		else if (i === n) vt++;
		else break;
		yt++;
	}
}
function xt(e, t, n) {
	return ht(e, t, n) >= n;
}
function St(e, t, i, a) {
	let o = mt(e, t);
	if (bt(e, t, o), vt > 3) return null;
	let s = t + yt;
	if (e.charCodeAt(s) !== d) return null;
	let c = _t(e, s, o, 35);
	if (c < 1 || c > 6 || (s += c, s < o && e.charCodeAt(s) !== n && e.charCodeAt(s) !== r)) return null;
	s = ht(e, s, o);
	for (var l = o; l > s && e.charCodeAt(l - 1) === n;) l--;
	for (var u = l; l > s && e.charCodeAt(l - 1) === d;) l--;
	if (l < u) if (l === s || e.charCodeAt(l - 1) === n) for (; l > s && e.charCodeAt(l - 1) === n;) l--;
	else l = u;
	let f = e.slice(s, l), p = hn(f, 0, f.length, i, a), m = (a?.slugify || be)(f);
	return {
		node: {
			type: G.heading,
			level: c,
			children: p,
			id: m
		},
		end: $(e, o)
	};
}
function Ct(e, t, i) {
	var a = e.charCodeAt(t);
	if (a !== h && a !== m) return !1;
	for (var o = t; o < i && e.charCodeAt(o) === a;) o++;
	for (; o < i && (e.charCodeAt(o) === n || e.charCodeAt(o) === r);) o++;
	return o >= i;
}
function wt(e, t) {
	let i = mt(e, t);
	if (bt(e, t, i), vt > 3) return null;
	let a = t + yt, o = e.charCodeAt(a);
	if (o !== m && o !== _ && o !== v) return null;
	let s = 0;
	for (; a < i;) {
		let t = e.charCodeAt(a);
		if (t === o) s++;
		else if (t !== n && t !== r) return null;
		a++;
	}
	return s < 3 ? null : {
		node: { type: G.breakThematic },
		end: $(e, i)
	};
}
function Tt(e, t, i) {
	let c = mt(e, t);
	if (bt(e, t, c), vt > 3) return null;
	let l = vt, u = t + yt, d = e.charCodeAt(u);
	if (d !== o && d !== s) return null;
	let f = _t(e, u, c, d);
	if (f < 3) return null;
	u += f;
	let p = ht(e, u, c), m = c;
	if (d === o) {
		for (let t = p; t < c; t++) if (e.charCodeAt(t) === o) return null;
	}
	for (; m > p && (e.charCodeAt(m - 1) === n || e.charCodeAt(m - 1) === r);) m--;
	let h = e.slice(p, m), g = "", _ = "", v = h.indexOf(" ");
	v === -1 ? g = h : (g = h.slice(0, v), _ = h.slice(v + 1).trim()), g = pt(g);
	var y = void 0;
	if (_) {
		Ze.lastIndex = 0;
		for (var b; (b = Ze.exec(_)) !== null;) y ||= {}, y[b[1]] = b[2] === void 0 ? b[3] : b[2];
	}
	let x = $(e, c), S = x, C = e.length;
	for (; S < e.length;) {
		let t = mt(e, S);
		if (bt(e, S, t), vt < 4) {
			let n = S + yt;
			var w = _t(e, n, t, d);
			if (w >= f && xt(e, n + w, t)) {
				C = $(e, t);
				break;
			}
		}
		S = $(e, t);
	}
	var T;
	if (l === 0) T = S > x && e.charCodeAt(S - 1) === a ? e.slice(x, S - 1) : e.slice(x, S);
	else {
		T = "";
		for (var E = x; E < S;) {
			var D = mt(e, E);
			bt(e, E, D);
			var O = Math.min(yt, l);
			T += e.slice(E + O, D) + "\n", E = $(e, D);
		}
		T.length > 0 && T.charCodeAt(T.length - 1) === a && (T = T.slice(0, -1));
	}
	return {
		node: {
			type: G.codeBlock,
			lang: g || void 0,
			text: T,
			infoString: _ || void 0,
			attrs: y
		},
		end: C
	};
}
function Et(e, t) {
	if (bt(e, t, mt(e, t)), vt < 4) return null;
	let n = "", i = t;
	for (; i < e.length;) {
		let t = mt(e, i);
		if (bt(e, i, t), xt(e, i, t)) {
			for (var o = 0, s = $(e, t); s < e.length;) {
				var c = mt(e, s);
				if (xt(e, s, c)) {
					o++, s = $(e, c);
					continue;
				}
				if (bt(e, s, c), vt >= 4) {
					for (var l = 0; l <= o; l++) n += "\n";
					i = s;
					break;
				}
				break;
			}
			if (i !== s) break;
			continue;
		}
		if (vt < 4) break;
		let a = 0, m = 0;
		var u = 0;
		for (let n = i; n < t && m < 4; n++) {
			if (e.charCodeAt(n) === r) {
				var d = 4 - m % 4;
				m + d > 4 && (u = m + d - 4), m += d;
			} else m++;
			a++;
		}
		var f = "";
		if (u > 0) for (var p = 0; p < u; p++) f += " ";
		f += e.slice(i + a, t), n += f + "\n", i = $(e, t);
	}
	for (; n.length > 0 && n.charCodeAt(n.length - 1) === a;) n = n.slice(0, -1);
	for (; n.length > 0 && n.charCodeAt(n.length - 1) === a;) n = n.slice(0, -1);
	return n ? {
		node: {
			type: G.codeBlock,
			text: n
		},
		end: i
	} : null;
}
function Dt(e, t, i, a) {
	if (bt(e, t, mt(e, t)), vt > 3) return null;
	let c = t + yt;
	if (e.charCodeAt(c) !== u) return null;
	let l = "", f = t, p, h = !1, g = !1, b = !1;
	for (; f < e.length;) {
		let t = mt(e, f);
		bt(e, f, t);
		let i = f + yt;
		if (e.charCodeAt(i) === u) {
			let a = i + 1;
			var x = vt + 1, S = !1;
			if (a < t) {
				var C = e.charCodeAt(a);
				C === n ? (a++, x++, S = !0) : C === r && (S = !0);
			}
			for (var w = "", T = !1, E = a; E < t; E++) if (e.charCodeAt(E) === r) {
				T = !0;
				break;
			}
			if (T) {
				var D = x;
				if (S && a < t && e.charCodeAt(a) === r) {
					for (var O = 4 - D % 4, k = 0; k < O - 1; k++) w += " ";
					D += O, a++;
				}
				for (var A = a; A < t; A++) if (e.charCodeAt(A) === r) {
					for (var j = 4 - D % 4, M = 0; M < j; M++) w += " ";
					D += j;
				} else w += e[A], D++;
			} else w = e.slice(a, t);
			if (!l && !p) {
				let n = w.match(/^\[!([A-Za-z]+)\]\s*$/);
				if (n) {
					p = n[1].toUpperCase(), f = $(e, t);
					continue;
				}
			}
			l += w + "\n";
			var N = w.trimStart();
			N.startsWith("```") || N.startsWith("~~~") ? b = !b : w.startsWith("    ") || w.startsWith("	") ? b = !0 : N.length > 0 && !b && (b = !1), g = N.length > 0, f = $(e, t);
		} else if (l && !xt(e, f, t) && g) {
			if (vt < 4) {
				var P = f + yt, F = P < t ? e.charCodeAt(P) : 0;
				if (F === d || F === u || F === o || F === s || F === y || (F === m || F === _ || F === v) && wt(e, f) || (F === m || F === _ || F === te) && P + 1 < t && (e.charCodeAt(P + 1) === n || e.charCodeAt(P + 1) === r)) break;
				if (F >= V && F <= H) {
					for (var I = P; I < t && e.charCodeAt(I) >= V && e.charCodeAt(I) <= H;) I++;
					if (I < t && (e.charCodeAt(I) === L || e.charCodeAt(I) === ae)) break;
				}
			}
			if (b) break;
			l += e.slice(f, t) + "\n", h = !0, f = $(e, t);
		} else break;
	}
	if (!l && !p) return null;
	var { inBlockQuote: R, f: z } = i;
	i.inBlockQuote = !0, h && (i.f = !0);
	let ee = _n(l || "", i, a);
	i.inBlockQuote = R, i.f = z;
	let ne = {
		type: G.blockQuote,
		children: ee
	};
	return p && (ne.alert = p), {
		node: ne,
		end: f
	};
}
function Ot(e, t, n) {
	for (var i = 0, a = t; a < n; a++) e.charCodeAt(a) === r ? i += 4 - i % 4 : i++;
	return i;
}
function kt(e, t, i) {
	if (bt(e, t, i), vt > 3) return null;
	var o = t + yt;
	if (o >= i) return null;
	var s = e.charCodeAt(o), c = vt, l = o;
	if (s === m || s === _ || s === te) {
		if (l = o + 1, l < i && e.charCodeAt(l) !== n && e.charCodeAt(l) !== r && e.charCodeAt(l) !== a) return null;
	} else if (s >= V && s <= H) {
		for (var u = o; u < i && u - o < 9;) {
			var d = e.charCodeAt(u);
			if (d < V || d > H) break;
			u++;
		}
		if (u > o && u < i) {
			var f = e.charCodeAt(u);
			if (f === L || f === ae) {
				if (l = u + 1, l < i && e.charCodeAt(l) !== n && e.charCodeAt(l) !== r && e.charCodeAt(l) !== a) return null;
			} else return null;
		} else return null;
	} else return null;
	var p = l, h = Ot(e, t, l), g = 0, v = p, y = h;
	if (p >= i) return {
		ordered: s >= V && s <= H,
		marker: s >= V && s <= H ? e[u] : e[o],
		start: s >= V && s <= H ? parseInt(e.slice(o, u), 10) : void 0,
		contentStart: p,
		contentCol: h + 1,
		markerCol: c,
		isEmpty: !0
	};
	for (; v < i && (e.charCodeAt(v) === n || e.charCodeAt(v) === r);) {
		if (e.charCodeAt(v) === r) {
			var b = 4 - y % 4;
			y += b;
		} else y++;
		v++, g++;
	}
	var x = v >= i, S = y - h;
	return x || S > 4 ? (y = h + 1, v = p + 1, g = 1) : g === 0 && (y = h + 1, v = p, g = 1), {
		ordered: s >= V && s <= H,
		marker: s >= V && s <= H ? e[u] : e[o],
		start: s >= V && s <= H ? parseInt(e.slice(o, u), 10) : void 0,
		contentStart: v,
		contentCol: y,
		markerCol: c,
		isEmpty: x
	};
}
var At = 0;
function jt(e, t, i, a) {
	var o = 0, s = t;
	for (At = 0; s < i && o < a;) {
		var c = e.charCodeAt(s);
		if (c === r) {
			var l = 4 - o % 4;
			if (o + l > a) {
				At = o + l - a, s++, o = a;
				break;
			}
			o += l;
		} else if (c === n) o++;
		else break;
		s++;
	}
	return s;
}
function Mt(e, t, l, f) {
	var p = mt(e, t), h = kt(e, t, p);
	if (!h) return null;
	var g = [], b = t, S = h.contentCol, C = "", w = h.isEmpty, T = !1, E = !1;
	if (!h.isEmpty) {
		for (var D = !1, O = h.contentStart; O < p; O++) if (e.charCodeAt(O) === r) {
			D = !0;
			break;
		}
		if (D) {
			var k = "", A = Ot(e, t, h.contentStart), j = A - h.contentCol;
			if (j > 0) for (var M = 0; M < j; M++) k += " ";
			for (var N = h.contentStart; N < p; N++) if (e.charCodeAt(N) === r) {
				for (var P = 4 - A % 4, F = 0; F < P; F++) k += " ";
				A += P;
			} else k += e[N], A++;
			C = k + "\n";
		} else C = e.slice(h.contentStart, p) + "\n";
	}
	for (b = $(e, p); b < e.length;) {
		var I = mt(e, b);
		bt(e, b, I);
		var L = e.charCodeAt(b + yt);
		if (vt < S && (L === m || L === _ || L === v) && vt <= 3 && wt(e, b)) break;
		var R = kt(e, b, I);
		if (R && R.ordered === h.ordered && R.marker === h.marker && R.markerCol < S) {
			g.push({
				contentCol: S,
				raw: C,
				hasBlankAfter: T,
				isEmpty: w
			}), T && (E = !0), S = R.contentCol, w = R.isEmpty, T = !1, C = R.isEmpty ? "" : e.slice(R.contentStart, I) + "\n", b = $(e, I);
			continue;
		}
		if (xt(e, b, I)) {
			C += "\n", b = $(e, I);
			for (var z = !1, ee = 0; ee < C.length; ee++) {
				var ne = C.charCodeAt(ee);
				if (ne !== a && ne !== i && ne !== n && ne !== r) {
					z = !0;
					break;
				}
			}
			if (w && !z) if (b < e.length) {
				var B = mt(e, b), re = kt(e, b, B);
				if (!re || re.ordered !== h.ordered || re.marker !== h.marker) break;
				T = !0;
			} else break;
			if (b < e.length) {
				var ie = mt(e, b);
				bt(e, b, ie);
				var ae = e.charCodeAt(b + yt);
				if ((ae === m || ae === _ || ae === v) && vt <= 3 && wt(e, b)) break;
				var oe = kt(e, b, ie);
				if (oe && oe.ordered === h.ordered && oe.marker === h.marker && oe.markerCol < S) {
					T = !0;
					continue;
				}
				if (!xt(e, b, ie) && vt < S) break;
			}
			continue;
		}
		if (vt >= S) {
			var se = jt(e, b, I, S);
			if (At > 0) {
				for (var U = "", W = S, ce = 0; ce < At; ce++) U += " ", W++;
				for (var le = se; le < I; le++) if (e.charCodeAt(le) === r) {
					for (var ue = 4 - W % 4, de = 0; de < ue; de++) U += " ";
					W += ue;
				} else U += e[le], W++;
				C += U + "\n";
			} else C += e.slice(se, I) + "\n";
			b = $(e, I);
			continue;
		}
		for (var fe = !1, pe = 0; pe < C.length; pe++) {
			var me = C.charCodeAt(pe);
			if (me !== a && me !== i && me !== n && me !== r) {
				fe = !0;
				break;
			}
		}
		if (!T && fe && !w) {
			var he = b + yt, ge = e.charCodeAt(he);
			if (!(ge === d || ge === u || ge === y || ge === o || ge === s || (ge === m || ge === _ || ge === v || ge === te) && (wt(e, b) !== null || kt(e, b, I) !== null) || ge >= V && ge <= H && kt(e, b, I) !== null)) {
				C += "" + e.slice(he, I) + "\n", b = $(e, I);
				continue;
			}
		}
		break;
	}
	if (g.push({
		contentCol: S,
		raw: C,
		hasBlankAfter: T,
		isEmpty: w
	}), g.length === 0) return null;
	var _e = E;
	if (!_e) for (var ve = 0; ve < g.length; ve++) {
		if (g[ve].hasBlankAfter && ve < g.length - 1) {
			_e = !0;
			break;
		}
		if (!g[ve].isEmpty) {
			for (var K = g[ve].raw, q = K.length, J = 0, ye = !1, be = !1, xe = !1, Se = !1, Ce = 0, we = 0, Te = -1; J < q;) {
				var Y = K.indexOf("\n", J);
				if (Y < 0 && (Y = q), Se) {
					bt(K, J, Y);
					for (var X = K.slice(J + yt, Y), Ee = 0; Ee < X.length && X.charCodeAt(Ee) === Ce;) Ee++;
					Ee >= we && X.slice(Ee).trim() === "" && (Se = !1), J = Y < q ? Y + 1 : q;
					continue;
				}
				if (xt(K, J, Y)) {
					Te >= 0 ? xe = !0 : ye && (be = !0), J = Y < q ? Y + 1 : q;
					continue;
				}
				if (bt(K, J, Y), Te >= 0) {
					if (vt >= Te) {
						J = Y < q ? Y + 1 : q;
						continue;
					}
					var De = kt(K, J, Y);
					if (De && De.markerCol < Te && De.contentCol <= Te) {
						J = Y < q ? Y + 1 : q;
						continue;
					}
					if (De) {
						J = Y < q ? Y + 1 : q;
						continue;
					}
					Te = -1, xe &&= (be = !0, !1);
				}
				var Oe = K.slice(J + yt, Y), ke = Oe.charCodeAt(0);
				if ((ke === o || ke === s) && vt <= 3) {
					for (var Ae = 0; Ae < Oe.length && Oe.charCodeAt(Ae) === ke;) Ae++;
					if (Ae >= 3) {
						if (be && ye) {
							_e = !0;
							break;
						}
						Se = !0, Ce = ke, we = Ae, ye = !0, J = Y < q ? Y + 1 : q;
						continue;
					}
				}
				var je = vt <= 3 ? kt(K, J, Y) : null;
				if (je && ye) {
					if (be) {
						_e = !0;
						break;
					}
					Te = je.contentCol, xe = !1, J = Y < q ? Y + 1 : q, ye = !0;
					continue;
				}
				if (be) {
					_e = !0;
					break;
				}
				ye = !0, J = Y < q ? Y + 1 : q;
			}
			if (_e) break;
		}
	}
	for (var Me = [], Ne = 0; Ne < g.length; Ne++) {
		for (var Pe = g[Ne], Fe = Pe.raw, Ie = Fe.length; Ie > 0 && Fe.charCodeAt(Ie - 1) === a;) Ie--;
		var Le = Ie < Fe.length ? Fe.slice(0, Ie) : Fe, Re = null;
		if (Le.length >= 3 && Le.charCodeAt(0) === c) {
			var ze = Le[1];
			(ze === " " || ze === "x" || ze === "X") && Le.charCodeAt(2) === x && (Re = {
				type: G.gfmTask,
				completed: ze === "x" || ze === "X"
			}, Le = Le.slice(3));
		}
		var Be;
		if (Pe.isEmpty && Le.trim() === "") Be = [];
		else if (_e) {
			var Ve = l.inList;
			l.inList = !0, Be = _n(Le, l, f), l.inList = Ve;
		} else {
			var He = l.inList;
			if (l.inList = !0, Be = _n(Le, l, f), l.inList = He, Be.length === 1 && Be[0].type === G.paragraph) Be = Be[0].children;
			else {
				for (var Ue = [], We = 0; We < Be.length; We++) if (Be[We].type === G.paragraph) for (var Ge = Be[We].children, Ke = 0; Ke < Ge.length; Ke++) Ue.push(Ge[Ke]);
				else Ue.push(Be[We]);
				Be = Ue;
			}
		}
		Re ? Me.push([
			Re,
			{
				type: G.text,
				text: " "
			},
			...Be
		]) : Me.push(Be);
	}
	return {
		node: {
			type: h.ordered ? G.orderedList : G.unorderedList,
			start: h.ordered ? h.start : void 0,
			items: Me
		},
		end: b
	};
}
var Nt = new Set(/* @__PURE__ */ "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".split("."));
function Pt(e, t, n) {
	let r = {};
	for (let [o, s] of Object.entries(e)) {
		let e = o, l = o.toLowerCase();
		if (l === "style" && typeof s == "string") {
			let t = {}, n = [], i = 0, a = 0;
			for (let e = 0; e < s.length; e++) {
				let t = s.charCodeAt(e);
				t === ie ? i++ : t === ae ? i-- : t === F && i === 0 && (n.push(s.slice(a, e)), a = e + 1);
			}
			a < s.length && n.push(s.slice(a));
			let o = !1;
			n.forEach((e) => {
				let n = e.indexOf(":");
				if (n === -1) return;
				let r = e.slice(0, n).trim(), i = e.slice(n + 1).trim();
				if (r && i) {
					if (/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(i)) {
						o = !0;
						return;
					}
					let e = r.indexOf("-") === -1 ? r : r.replace(/-([a-z])/g, (e, t) => t.toUpperCase());
					t[e] = i;
				}
			}), !o && Object.keys(t).length > 0 && (r[e] = t);
		} else if ((l === "href" || l === "src") && n?.sanitizer) {
			let i = n.sanitizer(s, t, l);
			i !== null && (r[e] = i);
		} else if (s === "") r[e] = !0;
		else if (s.length >= 2 && s.charCodeAt(0) === B && s.charCodeAt(s.length - 1) === re) {
			var i = s.slice(1, -1);
			if (i.length > 0) {
				var a = i.charCodeAt(0);
				if (a === c || a === B) try {
					r[e] = JSON.parse(i);
					continue;
				} catch {}
			}
			if (i === "true") {
				r[e] = !0;
				continue;
			}
			if (i === "false") {
				r[e] = !1;
				continue;
			}
			if (n?.evalUnserializableExpressions) try {
				r[e] = (0, eval)("(" + i + ")");
				continue;
			} catch {}
			r[e] = i;
		} else r[e] = s;
	}
	return r;
}
function Ft(e, t, n) {
	let r = t.length;
	var i = t.charCodeAt(0);
	i >= U && i <= W && (i += de);
	for (let o = n; o <= e.length - r; o++) {
		var a = e.charCodeAt(o);
		if (a >= U && a <= W && (a += de), a !== i) continue;
		let n = !0;
		for (let i = 1; i < r; i++) {
			let r = e.charCodeAt(o + i), a = t.charCodeAt(i);
			if (r >= U && r <= W && (r += de), a >= U && a <= W && (a += de), r !== a) {
				n = !1;
				break;
			}
		}
		if (n) return o;
	}
	return -1;
}
function It(e, t, n) {
	let r = t.length;
	var i = t.charCodeAt(0);
	i >= U && i <= W && (i += de);
	for (let o = Math.min(n, e.length - r); o >= 0; o--) {
		var a = e.charCodeAt(o);
		if (a >= U && a <= W && (a += de), a !== i) continue;
		let n = !0;
		for (let i = 1; i < r; i++) {
			let r = e.charCodeAt(o + i), a = t.charCodeAt(i);
			if (r >= U && r <= W && (r += de), a >= U && a <= W && (a += de), r !== a) {
				n = !1;
				break;
			}
		}
		if (n) return o;
	}
	return -1;
}
var Lt = -1;
function Rt(e, t, i) {
	let o = i.toLowerCase(), s = "<" + o, c = "</" + o, l = 1, d = t, f = e.length;
	for (Lt = -1; d < f && l > 0;) {
		let t = Ft(e, s, d), i = Ft(e, c, d);
		if (i === -1) return -1;
		if (t !== -1 && t < i) {
			let n = tt(e, t);
			n ? (n.tag.toLowerCase() === o && !n.isClosing && !n.selfClosing && !Ce(n.tag) && l++, d = n.end) : d = t + 1;
		} else {
			var p = i + c.length, m = p < f ? e.charCodeAt(p) : 62;
			if ((m === u || m === n || m === r || m === a) && (l--, l === 0)) {
				Lt = i;
				let t = i + c.length;
				for (; t < f && e.charCodeAt(t) !== u;) t++;
				return t + 1;
			}
			d = i + 1;
		}
	}
	return -1;
}
function zt(e, t, i, o) {
	if (o.ignoreHTMLBlocks || o.disableParsingRawHTML) return null;
	var s = mt(e, t);
	if (bt(e, t, s), vt > 3 && !i.inHTML) return null;
	var c = t + yt;
	if (e.charCodeAt(c) !== y) return null;
	var l = e.indexOf(">", c + 1);
	if (l !== -1 && l < s) {
		var d = e.slice(c + 1, l);
		if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(d) || /^[^\s@]+@[^\s@]+$/.test(d)) return null;
	}
	var f = Bt(e, c);
	if (f >= 1 && f <= 5) {
		var p = e.length;
		if (f === 1) {
			for (var m = e.length, h = 0; h < Ke.length; h++) {
				var g = Ft(e, "</" + Ke[h] + ">", c);
				g >= 0 && g < m && (m = g);
			}
			if (m < e.length) {
				var _ = e.indexOf(">", m);
				p = _ >= 0 ? $(e, _ + 1) : e.length;
			}
		} else {
			var v = f === 2 ? "-->" : f === 3 ? "?>" : f === 4 ? ">" : "]]>", b = e.indexOf(v, c);
			b >= 0 && (p = $(e, b + v.length));
		}
		var x = e.slice(c, p);
		if (f >= 2) return {
			node: {
				type: G.htmlComment,
				text: x,
				raw: !0,
				endPos: p
			},
			end: p
		};
		var S = "div", C = x.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);
		C && (S = C[1]);
		var w = tt(e, c), T = {}, E;
		w && !w.isClosing && (T = Pt(w.attrs, S, o), E = w.whitespaceBeforeAttrs + w.rawAttrs);
		var D = [], O = Ft(x, "</" + S.toLowerCase(), 0), k = x, A = "";
		if (w && w.isClosing) for (k = x.slice(w.end - c); k.length > 0 && k.charCodeAt(k.length - 1) === a;) k = k.slice(0, -1);
		else if (w && !w.isClosing) {
			var j = w.end - c;
			if (O !== -1) for (k = x.slice(j), k.charCodeAt(0) === a && (k = k.slice(1)); k.length > 0 && k.charCodeAt(k.length - 1) === a;) k = k.slice(0, -1);
			else for (k = x; k.length > 0 && k.charCodeAt(k.length - 1) === a;) k = k.slice(0, -1);
			O !== -1 && (A = x.slice(j, O).trim());
		}
		var M = w ? w.isClosing : !1;
		return {
			node: {
				type: G.htmlBlock,
				tag: S,
				attrs: T,
				e: E,
				children: D,
				a: k,
				text: A,
				c: !0,
				b: M,
				endPos: p,
				canInterruptParagraph: !0
			},
			end: p
		};
	}
	if (f === 6 || f === 7) {
		var N = gt(e, t), P = N < e.length ? N : e.length, F = e.slice(c, P), I = N < e.length ? $(e, N) : e.length, L = tt(e, c);
		if (L) {
			var z = L.tag, ee = z.toLowerCase();
			if (L.isClosing) {
				var te = e.slice(L.end, P);
				return {
					node: {
						type: G.htmlBlock,
						tag: z,
						attrs: {},
						children: [],
						a: te,
						text: te,
						c: !0,
						b: !0,
						endPos: P,
						canInterruptParagraph: f === 6
					},
					end: I
				};
			}
			if (L.selfClosing || Ce(z)) return {
				node: {
					type: G.htmlBlock,
					tag: z,
					attrs: Pt(L.attrs, z, o),
					e: L.whitespaceBeforeAttrs + L.rawAttrs,
					children: [],
					a: "",
					text: "",
					c: !1,
					b: !1,
					endPos: L.end,
					canInterruptParagraph: f === 6
				},
				end: $(e, L.end)
			};
			var ne = i.d || 0, B = e.slice(c, P), re = -1, ie = -1;
			if (ne < 10) {
				for (var ae = "</" + ee, oe = L.end - c, se = 1, V = oe; V < B.length && se > 0;) {
					var H = Ft(B, "<" + ee, V), ce = Ft(B, ae, V);
					if (ce === -1) break;
					if (H !== -1 && H < ce) {
						var le = H + ee.length + 1;
						if (le < B.length) {
							var ue = B.charCodeAt(le);
							(ue === n || ue === r || ue === a || ue === u || ue === R) && se++;
						}
						V = H + 1;
					} else {
						var de = ce + ae.length;
						if (de < B.length) {
							var fe = B.charCodeAt(de);
							if ((fe === u || fe === n || fe === r || fe === a) && (se--, se === 0)) {
								re = ce;
								for (var pe = de; pe < B.length && B.charCodeAt(pe) !== u;) pe++;
								ie = pe + 1;
								break;
							}
						} else if (se--, se === 0) {
							re = ce, ie = B.length;
							break;
						}
						V = ce + 1;
					}
				}
				var me = !1;
				if (re === -1 && f === 6 && !L.isClosing && !Ye.has(ee)) {
					var he = Rt(e, L.end, ee);
					if (he !== -1) {
						var ge = Lt;
						if (e.substring(L.end, ge).indexOf("\n\n") !== -1) {
							var _e = mt(e, he);
							P = _e, I = $(e, _e), B = e.slice(c, P), F = e.slice(c, P), re = ge - c, ie = he - c, me = !0;
						}
					}
				}
			}
			var ve = L.rawAttrs.indexOf("\n") !== -1 || L.whitespaceBeforeAttrs.indexOf("\n") !== -1, K = !1;
			re !== -1 && (K = B.slice(ie).trim().length === 0);
			var q = !1, J = P, ye = I;
			if (re !== -1) {
				var be = c + ie, xe = mt(e, be - 1);
				if (be < xe) {
					for (var Se = be; Se < xe && (e.charCodeAt(Se) === n || e.charCodeAt(Se) === r);) Se++;
					if (Se < xe && e.charCodeAt(Se) === y) {
						var we = tt(e, Se);
						we && !we.isClosing && (q = !0, J = be, ye = be, K = !0);
					}
				}
				if (!q) {
					var Te = $(e, xe);
					if (Te < P) {
						for (var Y = Te; Y < P && (e.charCodeAt(Y) === n || e.charCodeAt(Y) === r);) Y++;
						Y < P && e.charCodeAt(Y) === y && tt(e, Y) && (q = !0, J = xe, ye = Te, K = !0);
					}
				}
				!q && i.inHTML && (q = !0, J = xe, ye = $(e, xe), K = e.slice(be, xe).trim().length === 0);
			}
			var X = [], Ee = "";
			if (re !== -1) {
				Ee = B.slice(L.end - c, re);
				var De = Ee.trim();
				if (De) {
					var { inline: Oe, inHTML: ke, d: Ae } = i;
					if (i.inHTML = !0, i.d = ne + 1, ee === "p") i.inline = !0, X = hn(De, 0, De.length, i, o);
					else {
						var je = Ee.indexOf("\n\n") !== -1, Me = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(De), Ne = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(De);
						je || Me || i.inHTML && Ne || Ne ? (i.inline = !1, X = _n(Ee, i, o)) : (i.inline = !0, X = hn(De, 0, De.length, i, o));
					}
					i.inline = Oe, i.inHTML = ke, i.d = Ae;
				}
			}
			var Pe = !1;
			if (f === 6 && re !== -1 && !i.inHTML && !ve) {
				var Fe = Ee, Ie = /<[a-zA-Z][^>]*>/.test(Fe), Le = /\n\n/.test(Fe) || /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(Fe);
				Ie && !Le && (Pe = !0);
			}
			if (i.inHTML || f === 7 || ve || !K || Pe) {
				var Re;
				if (re !== -1 && q) {
					var ze = !1;
					if (i.inHTML && ie < B.length) {
						for (var Be = ie; Be < B.length && B.charCodeAt(Be) !== a;) Be++;
						var Ve = B.slice(ie, Be).trim();
						ze = Ve.length > 1 && Ve.charCodeAt(0) === y && Ve.charCodeAt(1) !== R;
					}
					Re = ze ? B.slice(L.end - c) : Ee;
				} else (f === 7 || i.inHTML) && re !== -1 ? (Re = B.slice(L.end - c), Re.charCodeAt(0) === a && (Re = Re.slice(1))) : q ? Re = e.slice(c, J) : ve ? Re = F : (Re = B.slice(L.end - c), Re.charCodeAt(0) === a && (Re = Re.slice(1)));
				return {
					node: {
						type: G.htmlBlock,
						tag: z,
						attrs: Pt(L.attrs, z, o),
						e: L.whitespaceBeforeAttrs + L.rawAttrs,
						children: X,
						a: Re,
						text: Re,
						c: !0,
						b: !1,
						endPos: J,
						canInterruptParagraph: f === 6
					},
					end: ye
				};
			}
			return {
				node: {
					type: G.htmlBlock,
					tag: z,
					attrs: Pt(L.attrs, z, o),
					e: L.whitespaceBeforeAttrs + L.rawAttrs,
					children: X,
					a: me ? "" : Ee,
					text: Ee,
					c: !1,
					b: !1,
					endPos: J,
					canInterruptParagraph: f === 6
				},
				end: ye
			};
		}
		var He = F.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/), Ue = He ? He[2] : "div", We = He ? He[1] === "/" : !1, Ge = F;
		if (We) {
			var Je = F.indexOf(">");
			Je !== -1 && (Ge = F.slice(Je + 1));
		}
		return {
			node: {
				type: G.htmlBlock,
				tag: Ue,
				attrs: {},
				children: [],
				a: Ge,
				text: Ge,
				c: !0,
				b: We,
				endPos: P,
				canInterruptParagraph: f === 6
			},
			end: I
		};
	}
	var Xe = tt(e, c);
	if (!Xe) return null;
	var Ze = Xe.tag, Qe = Ze.toLowerCase(), $e = Ze.charCodeAt(0), et = $e >= U && $e <= W;
	if (!et && !Nt.has(Qe) && !qe.has(Qe) && !Qe.includes("-")) return null;
	if (Xe.isClosing) return {
		node: {
			type: G.htmlSelfClosing,
			tag: Ze,
			attrs: {},
			endPos: Xe.end,
			b: !0,
			a: e.slice(c, Xe.end)
		},
		end: Xe.end
	};
	var nt = Rt(e, Xe.end, Ze), rt = [];
	if (nt !== -1) {
		var it = Lt, at = e.slice(Xe.end, it), Z = at.trim();
		if (Z) {
			var ot = at.indexOf("\n\n") !== -1, st = /^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(Z), ct = /^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im.test(Z), lt = i.inline, Q = i.inHTML, ut = i.d;
			i.inHTML = !0, i.d = (i.d || 0) + 1, ot || st || ct ? (i.inline = !1, rt = _n(at, i, o)) : (i.inline = !0, rt = hn(Z, 0, Z.length, i, o)), i.inline = lt, i.inHTML = Q, i.d = ut;
		}
		var dt = mt(e, nt), ft = e.slice(nt, dt).trim() ? nt : $(e, nt), pt = et ? e.slice(c, nt) : e.slice(c, ft), ht = et ? nt : ft;
		return {
			node: {
				type: G.htmlBlock,
				tag: Ze,
				attrs: Pt(Xe.attrs, Ze, o),
				e: Xe.whitespaceBeforeAttrs + Xe.rawAttrs,
				children: rt,
				a: pt,
				text: et ? at : pt,
				c: !0,
				b: !1,
				endPos: ht,
				canInterruptParagraph: !1
			},
			end: ft
		};
	}
	var _t = gt(e, Xe.end), xt = _t < e.length ? $(e, _t) : _t, St = e.slice(Xe.end, _t);
	if (St.trim()) {
		var { inline: Ct, inHTML: wt, d: Tt } = i;
		i.inline = !1, i.inHTML = !0, i.d = (i.d || 0) + 1, rt = _n(St, i, o), i.inline = Ct, i.inHTML = wt, i.d = Tt;
	}
	var Et = e.slice(Xe.end, _t);
	return {
		node: {
			type: G.htmlBlock,
			tag: Ze,
			attrs: Pt(Xe.attrs, Ze, o),
			e: Xe.whitespaceBeforeAttrs + Xe.rawAttrs,
			children: rt,
			a: Et,
			text: St,
			c: !0,
			b: !1,
			endPos: _t,
			canInterruptParagraph: !1
		},
		end: xt
	};
}
function Bt(e, t) {
	if (e.charCodeAt(t) !== y) return 0;
	var i = t + 1, o = e.length;
	if (e.charCodeAt(i) === S && e.charCodeAt(i + 1) === m && e.charCodeAt(i + 2) === m) return 2;
	if (e.charCodeAt(i) === I) return 3;
	if (e.charCodeAt(i) === S) {
		var s = e.charCodeAt(i + 1);
		if (s >= U && s <= W) return 4;
		if (e.slice(i + 1, i + 8) === "[CDATA[") return 5;
	}
	for (var c = e.charCodeAt(i) === R, l = c ? i + 1 : i, d = l; d < o;) {
		var f = e.charCodeAt(d);
		if (f >= U && f <= W || f >= ce && f <= le || f >= V && f <= H || f === m) d++;
		else break;
	}
	if (d === l) return 0;
	var p = e.slice(l, d);
	if (qe.has(p.toLowerCase())) {
		if (c) return 0;
		var h = e.charCodeAt(d);
		return +(h === n || h === r || h === u || h === a || d >= o);
	}
	if (Nt.has(p.toLowerCase())) {
		if (c) {
			for (var g = d; g < o && (e.charCodeAt(g) === n || e.charCodeAt(g) === r);) g++;
			return g < o && e.charCodeAt(g) === u ? 6 : 0;
		}
		var _ = d < o ? e.charCodeAt(d) : -1;
		return _ === n || _ === r || _ === u || _ === a || _ === R || _ === -1 ? 6 : 0;
	}
	if (c) {
		for (var v = d; v < o && (e.charCodeAt(v) === n || e.charCodeAt(v) === r);) v++;
		if (v < o && e.charCodeAt(v) === u) {
			var b = mt(e, t);
			if (e.slice(v + 1, b).trim() === "") return 7;
		}
	} else {
		var x = mt(e, t), C = tt(e, t);
		if (C && C.end <= x && e.slice(C.end, x).trim() === "") return 7;
	}
	return 0;
}
function Vt(e, t, i) {
	for (var a = 0, s = e.length; a < s && (e.charCodeAt(a) === n || e.charCodeAt(a) === r);) a++;
	for (; s > a && (e.charCodeAt(s - 1) === n || e.charCodeAt(s - 1) === r);) s--;
	a < s && e.charCodeAt(a) === ne && a++, s > a && e.charCodeAt(s - 1) === ne && (s - 2 < a || e.charCodeAt(s - 2) !== g) && s--;
	for (var c = [], l = a, u = !1, d = [], f = a; f < s;) {
		var p = e.charCodeAt(f);
		if (p === g && f + 1 < s) {
			e.charCodeAt(f + 1) === ne ? (u || (u = !0, d = []), d.push(e.slice(l, f)), d.push("|"), f += 2, l = f) : f += 2;
			continue;
		}
		if (p === o) {
			for (var m = 0; f < s && e.charCodeAt(f) === o;) m++, f++;
			for (var h = !1; f < s && !h;) {
				for (var _ = 0; f < s && e.charCodeAt(f) === o;) _++, f++;
				_ === m ? h = !0 : _ === 0 && f++;
			}
			continue;
		}
		if (p === ne) {
			var v = u ? (d.push(e.slice(l, f)), d.join("")) : e.slice(l, f);
			c.push(v.trim()), f++, l = f, u = !1, d = [];
			continue;
		}
		f++;
	}
	var y = u ? (d.push(e.slice(l, s)), d.join("")) : e.slice(l, s);
	return c.push(y.trim()), c.map(function(e) {
		var n = e.indexOf("\\|") === -1 ? e : e.replace(/\\\|/g, "|");
		return hn(n, 0, n.length, t, i);
	});
}
function Ht(e, t, i, a) {
	let c = mt(e, t);
	var l = e.indexOf("|", t);
	if (l < 0 || l >= c) return null;
	let f = $(e, c);
	if (f >= e.length) return null;
	let p = mt(e, f);
	if (!et(e, f, p)) return null;
	let h = e.slice(t, c), g = e.slice(f, p);
	for (var y = [], b = 0, x = g.length; b < x && (g.charCodeAt(b) === n || g.charCodeAt(b) === r);) b++;
	for (b < x && g.charCodeAt(b) === ne && b++; b < x;) {
		for (; b < x && (g.charCodeAt(b) === n || g.charCodeAt(b) === r);) b++;
		if (b >= x || g.charCodeAt(b) === ne) break;
		var S = g.charCodeAt(b) === w;
		for (S && b++; b < x && g.charCodeAt(b) === m;) b++;
		var C = b < x && g.charCodeAt(b) === w;
		for (C && b++, y.push(S && C ? "center" : C ? "right" : S ? "left" : null); b < x && (g.charCodeAt(b) === n || g.charCodeAt(b) === r);) b++;
		b < x && g.charCodeAt(b) === ne && b++;
	}
	let T = Vt(h, i, a);
	if (y.length !== T.length) return null;
	let E = [], D = $(e, p);
	for (; D < e.length;) {
		let t = mt(e, D), n = e.slice(D, t);
		if (xt(e, D, t)) break;
		if (bt(e, D, t), vt < 4) {
			var O = e.charCodeAt(D + yt);
			if (O === u || O === d || (O === m || O === _ || O === v) && wt(e, D)) break;
			if (O === o || O === s) {
				for (var k = D + yt, A = 0; k < t && e.charCodeAt(k) === O;) A++, k++;
				if (A >= 3) break;
			}
		}
		E.push(Vt(n, i, a)), D = $(e, t);
	}
	if ((a.streaming || a.optimizeForStreaming) && E.length === 0) return null;
	for (var j = T.length, M = 0; M < E.length; M++) if (E[M].length < j) for (; E[M].length < j;) E[M].push([]);
	else E[M].length > j && (E[M].length = j);
	return {
		node: {
			type: G.table,
			header: T,
			cells: E,
			align: y
		},
		end: D
	};
}
function Ut(e, t, n) {
	if (bt(e, t, mt(e, t)), vt > 3) return null;
	var r = t + yt;
	if (e.charCodeAt(r) !== c) return null;
	if (r + 1 < e.length && e.charCodeAt(r + 1) === l) return Wt(e, r, n) || null;
	n.refs ||= {};
	var i = rt(e, r, n.refs);
	return i === null ? null : {
		node: { type: G.refCollection },
		end: i
	};
}
function Wt(e, t, i) {
	var o = e.length;
	if (e.charCodeAt(t) !== c || t + 1 >= o || e.charCodeAt(t + 1) !== l) return null;
	for (var s = t + 2, u = s; s < o && e.charCodeAt(s) !== x;) {
		if (e.charCodeAt(s) === a) return null;
		s++;
	}
	if (s >= o) return null;
	var d = ("^" + e.slice(u, s)).toLowerCase();
	if (s++, s >= o || e.charCodeAt(s) !== w) return null;
	for (s++; s < o && (e.charCodeAt(s) === n || e.charCodeAt(s) === r);) s++;
	if (s < o && e.charCodeAt(s) === a) for (s++; s < o && (e.charCodeAt(s) === n || e.charCodeAt(s) === r);) s++;
	var f = e.indexOf("\n", s);
	f < 0 && (f = o);
	for (var p = e.slice(s, f).trim(), m = f < o ? f + 1 : o; m < o;) {
		var h = mt(e, m);
		if (bt(e, m, h), vt >= 2 && !xt(e, m, h)) p += "\n" + e.slice(m, h), m = $(e, h);
		else if (xt(e, m, h)) {
			var g = $(e, h);
			if (g < o && (bt(e, g, mt(e, g)), vt >= 2)) {
				p += "\n", m = $(e, h);
				continue;
			}
			break;
		} else break;
	}
	return i.refs[d] || (i.refs[d] = {
		target: p,
		title: void 0
	}), {
		node: { type: G.footnote },
		end: m
	};
}
function Gt(e, t, c, l) {
	let f = t, p = 0, g = 0, b = -1;
	for (; f < e.length;) {
		let t = b >= 0 ? b : mt(e, f);
		if (b = -1, xt(e, f, t)) break;
		if (bt(e, f, t), vt < 4 && g > 0 && !c.f) {
			let i = e.charCodeAt(f + yt);
			if (i === h || i === m) {
				let a = f + yt;
				for (; a < t && e.charCodeAt(a) === i;) a++;
				for (; a < t && (e.charCodeAt(a) === n || e.charCodeAt(a) === r);) a++;
				if (a >= t) {
					p = i === h ? 1 : 2, f = $(e, t);
					break;
				}
			}
		}
		g = t;
		let i = $(e, t);
		if (i < e.length) {
			if (e.charCodeAt(i) === oe) {
				var x = mt(e, i);
				f = $(e, x), g = x;
				continue;
			}
			let t = mt(e, i);
			if (b = t, bt(e, i, t), vt < 4) {
				let a = e.charCodeAt(i + yt);
				if (a === u) {
					f = i;
					break;
				}
				if (a === d && St(e, i, c, l)) {
					f = i;
					break;
				}
				if (a === o || a === s) {
					for (var C = i + yt, w = 0; C < t && e.charCodeAt(C) === a;) w++, C++;
					if (w >= 3) {
						f = i;
						break;
					}
				}
				if (a === y) {
					var T = i + yt + 1, E = T < t ? e.charCodeAt(T) : 0, D = E === S || E === I;
					if (!D && E === R) {
						for (var O = T + 1, k = O; k < t && (e.charCodeAt(k) >= U && e.charCodeAt(k) <= W || e.charCodeAt(k) >= ce && e.charCodeAt(k) <= le || e.charCodeAt(k) >= V && e.charCodeAt(k) <= H || e.charCodeAt(k) === m);) k++;
						k > O && (D = Nt.has(e.slice(O, k).toLowerCase()));
					} else if (!D) {
						for (var A = T; A < t && (e.charCodeAt(A) >= U && e.charCodeAt(A) <= W || e.charCodeAt(A) >= ce && e.charCodeAt(A) <= le || e.charCodeAt(A) >= V && e.charCodeAt(A) <= H || e.charCodeAt(A) === m);) A++;
						if (A > T) {
							var j = e.slice(T, A).toLowerCase();
							D = Nt.has(j) || qe.has(j);
						}
					}
					if (D && zt(e, i, c, l)) {
						f = i;
						break;
					}
				}
				if (a === m || a === _ || a === te) {
					let a = i + yt + 1;
					if (a < t && (e.charCodeAt(a) === n || e.charCodeAt(a) === r) && ht(e, a, t) < t && !wt(e, i)) {
						f = i;
						break;
					}
				}
				if (a >= V && a <= H) {
					let a = i + yt;
					for (; a < t && e.charCodeAt(a) >= V && e.charCodeAt(a) <= H;) a++;
					if (a < t && (e.charCodeAt(a) === L || e.charCodeAt(a) === ae) && a - (i + yt) === 1 && e.charCodeAt(i + yt) === 49) {
						var M = a + 1;
						if (M < t && (e.charCodeAt(M) === n || e.charCodeAt(M) === r) && ht(e, M, t) < t) {
							f = i;
							break;
						}
					}
				}
				if (a === ne) {
					let n = $(e, t);
					if (n < e.length && et(e, n, mt(e, n))) {
						f = i;
						break;
					}
				}
				if ((a === m || a === _ || a === v) && wt(e, i)) {
					if (a !== m) {
						f = i;
						break;
					}
					let o = 0, s = i + yt;
					for (; s < t && e.charCodeAt(s) === m;) o++, s++;
					for (; s < t && (e.charCodeAt(s) === n || e.charCodeAt(s) === r);) s++;
					if (s < t) {
						f = i;
						break;
					}
				}
			}
		}
		f = $(e, t);
	}
	for (var N = p ? g : f; N > t && (e.charCodeAt(N - 1) === a || e.charCodeAt(N - 1) === i || e.charCodeAt(N - 1) === n || e.charCodeAt(N - 1) === r);) N--;
	for (var P = t; P < N && (e.charCodeAt(P) === n || e.charCodeAt(P) === r);) P++;
	if (P >= N) return null;
	for (var F = !1, z = P; z < N; z++) if (e.charCodeAt(z) === oe) {
		F = !0;
		break;
	}
	var ee = F ? e.slice(P, N).replace(/\u001E/g, "") : e.slice(P, N);
	if (!ee) return null;
	let B = Kt(ee, 0, ee.length, c, l);
	if (p) {
		let e = (l?.slugify || be)(ee);
		return {
			node: {
				type: G.heading,
				level: p,
				children: B,
				id: e
			},
			end: f
		};
	}
	return {
		node: {
			type: G.paragraph,
			children: B
		},
		end: f
	};
}
function Kt(e, t, r, i, s) {
	var c = e.indexOf("\n", t);
	if (c < 0 || c >= r) return hn(e, t, r, i, s);
	for (var l = "", u = t, d = t; d < r;) {
		var f = e.charCodeAt(d);
		if (f === o) {
			var p = Jt(e, d, r);
			if (p > d) {
				for (var m = !1, h = d; h < p; h++) if (e.charCodeAt(h) === a) {
					m = !0;
					break;
				}
				m && (l += e.slice(u, d), l += e.slice(d, p).replace(/\n/g, " "), u = p), d = p;
				continue;
			}
		}
		if (f === y) {
			var _ = Yt(e, d, r);
			if (_ > d) {
				d = _;
				continue;
			}
		}
		if (f === a) {
			var v = !1, b = 0;
			if (d > t && e.charCodeAt(d - 1) === g) v = !0, b = 1;
			else {
				for (var x = 0, S = d - 1; S >= t && e.charCodeAt(S) === n;) x++, S--;
				x >= 2 && (v = !0, b = x);
			}
			if (v) l += e.slice(u, d - b), l += "";
			else {
				for (var C = d; C > u && e.charCodeAt(C - 1) === n;) C--;
				l += e.slice(u, C) + "\n";
			}
			for (d++; d < r && e.charCodeAt(d) === n;) d++;
			u = d;
			continue;
		}
		d++;
	}
	return u < r && (l += e.slice(u, r)), hn(l, 0, l.length, i, s);
}
function qt(e, t, n) {
	if (e.charCodeAt(t) !== o) return null;
	let r = _t(e, t, n, 96), i = t + r;
	for (; i < n;) {
		let a = e.indexOf("`", i);
		if (a < 0 || a >= n) return null;
		let o = _t(e, a, n, 96);
		if (o === r) {
			let n = e.slice(t + r, a);
			return n = n.replace(/\n/g, " "), n.length > 0 && n[0] === " " && n[n.length - 1] === " " && n.trim().length > 0 && (n = n.slice(1, -1)), {
				node: {
					type: G.codeInline,
					text: n
				},
				end: a + o
			};
		}
		i = a + o;
	}
	return null;
}
function Jt(e, t, n) {
	if (e.charCodeAt(t) !== o) return t;
	let r = _t(e, t, n, 96), i = t + r;
	for (; i < n;) {
		let a = e.indexOf("`", i);
		if (a < 0 || a >= n) return t;
		let o = _t(e, a, n, 96);
		if (o === r) return a + o;
		i = a + o;
	}
	return t;
}
function Yt(e, t, n) {
	if (e.charCodeAt(t) !== y) return t;
	if (t + 1 < n && e.charCodeAt(t + 1) === R) {
		let r = t + 2;
		for (; r < n && e.charCodeAt(r) !== u;) r++;
		return r < n ? r + 1 : t;
	}
	if (t + 3 < n && e.charCodeAt(t + 1) === S && e.charCodeAt(t + 2) === m && e.charCodeAt(t + 3) === m) {
		let n = e.indexOf("-->", t + 4);
		return n >= 0 ? n + 3 : t;
	}
	let r = t + 1, i = r;
	for (; r < n;) {
		let t = e.charCodeAt(r);
		if (t >= U && t <= W || t >= ce && t <= le || t >= V && t <= H || t === m) r++;
		else break;
	}
	if (r === i) return t;
	let o = e.slice(i, r).toLowerCase(), s = !1;
	for (; r < n;) {
		let i = e.charCodeAt(r);
		if (i === u) {
			r++;
			break;
		}
		if (i === R && r + 1 < n && e.charCodeAt(r + 1) === u) {
			r += 2, s = !0;
			break;
		}
		if (i === ee || i === z) {
			var c = i;
			for (r++; r < n && e.charCodeAt(r) !== c;) r++;
			r < n && r++;
			continue;
		}
		if (i === a) return t;
		r++;
	}
	if (s || Ce(o)) return r;
	let l = 1;
	for (; r < n && l > 0;) if (e.charCodeAt(r) === y) if (r + 1 < n && e.charCodeAt(r + 1) === R) {
		let t = r + 2, i = t;
		for (; i < n && (e.charCodeAt(i) >= U && e.charCodeAt(i) <= W || e.charCodeAt(i) >= ce && e.charCodeAt(i) <= le);) i++;
		if (e.slice(t, i).toLowerCase() === o) {
			for (; i < n && e.charCodeAt(i) !== u;) i++;
			if (i < n && i++, l--, l === 0) return i;
		}
		r = i;
	} else {
		let t = r + 1, i = t;
		for (; i < n && (e.charCodeAt(i) >= U && e.charCodeAt(i) <= W || e.charCodeAt(i) >= ce && e.charCodeAt(i) <= le);) i++;
		e.slice(t, i).toLowerCase() === o && l++, r++;
	}
	else r++;
	return r;
}
function Xt(e, t, n, r, i) {
	if (e.charCodeAt(t) !== s || t + 1 >= n || e.charCodeAt(t + 1) !== s) return null;
	let a = t + 2;
	for (; a + 1 < n;) {
		let c = e.charCodeAt(a);
		if (c === o) {
			let t = Jt(e, a, n);
			if (t > a) {
				a = t;
				continue;
			}
		}
		if (c === s && e.charCodeAt(a + 1) === s) {
			let n = e.slice(t + 2, a), o = hn(n, 0, n.length, r, i);
			return {
				node: {
					type: G.textFormatted,
					tag: "del",
					children: o
				},
				end: a + 2
			};
		}
		c === g && a + 1 < n && a++, a++;
	}
	return null;
}
function Zt(e, t, n, r, i) {
	if (e.charCodeAt(t) !== h || t + 1 >= n || e.charCodeAt(t + 1) !== h) return null;
	let a = t + 2;
	for (; a + 1 < n;) {
		let s = e.charCodeAt(a);
		if (s === o) {
			let t = Jt(e, a, n);
			if (t > a) {
				a = t;
				continue;
			}
		}
		if (s === h && e.charCodeAt(a + 1) === h && a > t + 2) {
			let n = e.slice(t + 2, a), o = hn(n, 0, n.length, r, i);
			return {
				node: {
					type: G.textFormatted,
					tag: "mark",
					children: o
				},
				end: a + 2
			};
		}
		s === g && a + 1 < n && a++, a++;
	}
	return null;
}
var Qt = /[\p{P}\p{S}]/u;
function $t(e, t, n) {
	return e < ue ? !!(ft(e) & Z) : Qt.test(t[n]);
}
function en(e, t, n) {
	return e < ue ? !!(ft(e) & it) : /\p{Zs}/u.test(t[n]);
}
function tn(e, t, n) {
	var r = e.charCodeAt(t);
	if (r !== _ && r !== v) return null;
	var i = _t(e, t, n, r);
	if (i === 0) return null;
	var a = t > 0 ? e.charCodeAt(t - 1) : 32, o = t + i < n ? e.charCodeAt(t + i) : 32, s = en(a, e, t - 1), c = en(o, e, t + i), l = t > 0 ? $t(a, e, t - 1) : !1, u = t + i < n ? $t(o, e, t + i) : !1, d = !c && (!u || s || l), f = !s && (!l || c || u), p, m;
	return r === _ ? (p = d, m = f) : (p = d && (!f || l), m = f && (!d || u)), {
		len: i,
		canOpen: p,
		canClose: m
	};
}
function nn(e, t, n, r) {
	if (t.length !== 0) {
		for (var i = [], a = 0; a < 12; a++) i[a] = -1;
		for (var o = 0; o < t.length;) {
			var s = t[o];
			if (!s.active || !s.canClose) {
				o++;
				continue;
			}
			for (var c = (s.ch === _ ? 0 : 1) * 6 + s.len % 3 * 2 + +!!s.canOpen, l = i[c] === void 0 ? -1 : i[c], u = -1, d = o - 1; d > l; d--) {
				var f = t[d];
				if (!(!f.active || f.ch !== s.ch || !f.canOpen) && !((s.canOpen || f.canClose) && (f.len + s.len) % 3 == 0 && f.len % 3 != 0)) {
					u = d;
					break;
				}
			}
			if (u < 0) {
				i[c] = o - 1, !s.canOpen && (s.active = !1), o++;
				continue;
			}
			var p = t[u], m = p.len >= 2 && s.len >= 2, h = m ? 2 : 1;
			p.len -= h, s.len -= h;
			var g = e[p.idx], v = e[s.idx];
			g.text = g.text.slice(0, g.text.length - h), v.text = v.text.slice(h);
			var y = p.idx + 1, b = s.idx, x = e.slice(y, b), S = {
				type: G.textFormatted,
				tag: m ? "strong" : "em",
				children: x
			};
			e.splice(y, b - y, S);
			for (var C = b - y - 1, w = 0; w < t.length; w++) t[w].idx > p.idx && (t[w].idx -= C);
			for (var T = u + 1; T < o; T++) t[T].active = !1;
			if (p.len === 0 && (p.active = !1, g.text === "")) {
				e.splice(p.idx, 1);
				for (var E = 0; E < t.length; E++) t[E].idx > p.idx ? t[E].idx-- : t[E].idx === p.idx && (t[E].idx = -1);
			}
			if (s.len === 0) {
				s.active = !1;
				var D = s.idx;
				if (v.text === "") {
					e.splice(D, 1);
					for (var O = 0; O < t.length; O++) t[O].idx > D ? t[O].idx-- : t[O].idx === D && (t[O].idx = -1);
				}
			} else continue;
			o++;
		}
		for (var k = 0, A = 0; A < e.length; A++) {
			var j = e[A];
			if (j.type === G.text) {
				var M = j;
				if (M.text === "") continue;
				if (k > 0 && e[k - 1].type === G.text) {
					e[k - 1].text += M.text;
					continue;
				}
			}
			e[k++] = j;
		}
		e.length = k;
	}
}
function rn(e, t, r, i, s) {
	let l = e.charCodeAt(t) === S, d = l ? t + 1 : t;
	if (e.charCodeAt(d) !== c) return null;
	var f = e.indexOf("]", d + 1);
	if (f < 0 || f >= r) return null;
	for (var p = d + 1, m = 1; p < r && m > 0;) {
		var h = e.charCodeAt(p);
		if (h === g && p + 1 < r) {
			p += 2;
			continue;
		}
		if (h === o) {
			var _ = Jt(e, p, r);
			if (_ > p) {
				p = _;
				continue;
			}
		}
		if (h === y) {
			var v = an(e, p, r);
			if (v) {
				p = v.end;
				continue;
			}
			var b = Yt(e, p, r);
			if (b > p) {
				p = b;
				continue;
			}
		}
		h === c ? m++ : h === x && m--, p++;
	}
	if (m !== 0) return null;
	var C = p - 1, w = e.slice(d + 1, C), T = p < r ? e.charCodeAt(p) : 0, E = !1;
	if (T === ie) {
		var D = !0;
		for (p++; p < r && (e.charCodeAt(p) === n || e.charCodeAt(p) === a);) p++;
		var O = "", k = p;
		if (p < r && e.charCodeAt(p) === y) {
			for (p++, k = p; k < r && e.charCodeAt(k) !== u;) {
				if (e.charCodeAt(k) === g && k + 1 < r) {
					k += 2;
					continue;
				}
				if (e.charCodeAt(k) === a) {
					D = !1;
					break;
				}
				k++;
			}
			D && (k >= r || e.charCodeAt(k) !== u) && (D = !1), D && (O = e.slice(p, k), k++);
		} else if (D) {
			for (var A = 0; k < r;) {
				var j = e.charCodeAt(k);
				if (j === g && k + 1 < r) {
					k += 2;
					continue;
				}
				if (j === ie) A++;
				else if (j === ae) {
					if (A === 0) break;
					A--;
				} else if (j === n || j === a) break;
				k++;
			}
			O = e.slice(p, k);
		}
		if (D) {
			for (p = k; p < r && (e.charCodeAt(p) === n || e.charCodeAt(p) === a);) p++;
			var M;
			if (p < r) {
				var N = e.charCodeAt(p);
				if (N === ee || N === z || N === ie) {
					var P = N === ie ? 41 : N;
					p++;
					for (var F = p; p < r && e.charCodeAt(p) !== P;) e.charCodeAt(p) === g && p + 1 < r && p++, p++;
					p >= r ? D = !1 : (M = e.slice(F, p), p++);
				}
			}
			if (D) {
				for (; p < r && (e.charCodeAt(p) === n || e.charCodeAt(p) === a);) p++;
				(p >= r || e.charCodeAt(p) !== ae) && (D = !1);
			}
		}
		if (D) {
			p++, O = pt(O), M !== void 0 && (M = _e(pt(M)));
			var I = (s?.sanitizer || K)(O, l ? "img" : "a", l ? "src" : "href") === null ? null : O;
			if (l) {
				var L = un(hn(w, 0, w.length, i, s));
				return {
					node: {
						type: G.image,
						target: I,
						alt: L,
						title: M
					},
					end: p
				};
			} else {
				var R = i.inAnchor;
				i.inAnchor = !0;
				var te = R ? [{
					type: G.text,
					text: w
				}] : hn(w, 0, w.length, i, s);
				return i.inAnchor = R, !i.inAnchor && ln(te) ? null : {
					node: {
						type: G.link,
						target: I,
						title: M,
						children: te
					},
					end: p
				};
			}
		} else p = C + 1, E = !0;
	}
	var ne = "", B = p;
	if (!E && T === c) {
		var re = p + 1;
		B = re;
		for (var oe = !1; B < r && e.charCodeAt(B) !== x;) {
			if (e.charCodeAt(B) === g && B + 1 < r) {
				B += 2;
				continue;
			}
			if (e.charCodeAt(B) === c) {
				oe = !0;
				break;
			}
			B++;
		}
		if (oe || B >= r) return null;
		var se = e.slice(re, B);
		if (se.trim()) ne = dt(se);
		else {
			if (ut(w)) return null;
			ne = dt(w);
		}
		B += 1;
	} else {
		if (ut(w)) return null;
		ne = dt(w);
	}
	var V = i.refs[ne];
	if (!V) return null;
	if (l) return {
		node: {
			type: G.image,
			target: V.target,
			alt: un(hn(w, 0, w.length, i, s)),
			title: V.title
		},
		end: B
	};
	var H = i.inAnchor;
	i.inAnchor = !0;
	var te = H ? [{
		type: G.text,
		text: w
	}] : hn(w, 0, w.length, i, s);
	return i.inAnchor = H, !i.inAnchor && ln(te) ? null : {
		node: {
			type: G.link,
			target: V.target,
			title: V.title,
			children: te
		},
		end: B
	};
}
function an(e, t, r) {
	if (e.charCodeAt(t) !== y) return null;
	for (var o = t + 1; o < r;) {
		var s = e.charCodeAt(o);
		if (s === u) break;
		if (s === n || s === a || s === i || s === y) return null;
		o++;
	}
	if (o >= r || e.charCodeAt(o) !== u) return null;
	var c = e.slice(t + 1, o);
	return c.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/) ? {
		node: {
			type: G.link,
			target: c,
			children: [{
				type: G.text,
				text: c
			}]
		},
		end: o + 1
	} : c.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(c) ? {
		node: {
			type: G.link,
			target: "mailto:" + c,
			children: [{
				type: G.text,
				text: c
			}]
		},
		end: o + 1
	} : null;
}
function on(e, t, n, r) {
	if (e.charCodeAt(t) !== c || t + 1 >= n || e.charCodeAt(t + 1) !== l) return null;
	let i = t + 2;
	for (; i < n && e.charCodeAt(i) !== x && e.charCodeAt(i) !== a;) i++;
	if (i >= n || e.charCodeAt(i) !== x) return null;
	let o = e.slice(t + 2, i);
	return o ? {
		node: {
			type: G.footnoteReference,
			target: "#" + be(o),
			text: o
		},
		end: i + 1
	} : null;
}
function sn(e, t, o, s) {
	if (s.disableBareUrls) return null;
	var c = "", l = !1, d = e.charCodeAt(t);
	if (d === D || d === 72 ? t + 8 <= o && e.charCodeAt(t + 1) === k && e.charCodeAt(t + 2) === k && e.charCodeAt(t + 3) === A && (e.charCodeAt(t + 4) === j && e.charCodeAt(t + 5) === w && e.charCodeAt(t + 6) === R && e.charCodeAt(t + 7) === R ? c = "https://" : e.charCodeAt(t + 4) === w && e.charCodeAt(t + 5) === R && e.charCodeAt(t + 6) === R && (c = "http://")) : d === E || d === 70 ? t + 6 <= o && e.charCodeAt(t + 1) === k && e.charCodeAt(t + 2) === A && e.charCodeAt(t + 3) === w && e.charCodeAt(t + 4) === R && e.charCodeAt(t + 5) === R && (c = "ftp://") : (d === O || d === 87) && t + 4 <= o && e.charCodeAt(t + 1) === O && e.charCodeAt(t + 2) === O && e.charCodeAt(t + 3) === L && (c = "www.", l = !0), !c) return null;
	let f = t + c.length;
	for (; f < o;) {
		let t = e.charCodeAt(f);
		if (t === n || t === a || t === r || t === i || t === y || t === u) break;
		f++;
	}
	for (var p = 0, m = 0, h = t; h < f; h++) {
		var g = e.charCodeAt(h);
		g === ie ? p++ : g === ae && m++;
	}
	let _ = f;
	for (; _ > t + c.length;) {
		let n = e.charCodeAt(_ - 1);
		if (n === L || n === P || n === w || n === S || n === I || n === ae) {
			if (n === ae) {
				if (p >= m) break;
				m--;
			}
			_--;
		} else if (n === F) {
			for (var b = _ - 2; b > t && (e.charCodeAt(b) >= U && e.charCodeAt(b) <= W || e.charCodeAt(b) >= ce && e.charCodeAt(b) <= le || e.charCodeAt(b) >= V && e.charCodeAt(b) <= H);) b--;
			b >= t && e.charCodeAt(b) === C ? _ = b : _--;
		} else break;
	}
	if (_ <= t + c.length) return null;
	var x = t + (l ? 4 : c.length), T = e.indexOf("/", x);
	if ((T < 0 || T > _) && (T = _), l && e.indexOf(".", x) === -1) return null;
	for (var M = -1, N = -1, z = T - 1; z >= x; z--) if (e.charCodeAt(z) === L) if (M < 0) M = z;
	else {
		N = z;
		break;
	}
	for (var z = N >= 0 ? N + 1 : x; z < T; z++) if (e.charCodeAt(z) === v) return null;
	var ee = e.slice(t, _), te = l ? "http://" + ee : ee;
	return {
		node: {
			type: G.link,
			target: te,
			children: [{
				type: G.text,
				text: ee
			}]
		},
		end: _
	};
}
function cn(e, t, n, r) {
	if (r.disableBareUrls) return null;
	for (var i = t, a = i; i < n;) {
		var c = e.charCodeAt(i);
		if (c >= U && c <= W || c >= ce && c <= le || c >= V && c <= H || c === L || c === S || c === d || c === 36 || c === p || c === C || c === z || c === _ || c === te || c === R || c === h || c === I || c === l || c === v || c === o || c === B || c === ne || c === re || c === s || c === m) i++;
		else break;
	}
	if (i === a || i >= n || e.charCodeAt(i) !== b) return null;
	i++;
	for (var u = i, f = -1, g = i; i < n;) {
		var c = e.charCodeAt(i);
		if (c >= U && c <= W || c >= ce && c <= le || c >= V && c <= H) i++;
		else if ((c === m || c === v) && i > u) i++;
		else if (c === L) {
			if (i === u) break;
			var y = e.charCodeAt(i - 1);
			if (y === m || y === v || i - g > 63) break;
			if (i + 1 < n) {
				var x = e.charCodeAt(i + 1);
				if (x >= U && x <= W || x >= ce && x <= le || x >= V && x <= H) f = i, g = i + 1, i++;
				else break;
			} else break;
		} else break;
	}
	if (i - g > 63 || f < 0) return null;
	var w = e.charCodeAt(i - 1);
	if (!(w >= U && w <= W || w >= ce && w <= le || w >= V && w <= H) || i <= f + 1) return null;
	for (var T = -1, E = f - 1; E >= u; E--) if (e.charCodeAt(E) === L) {
		T = E;
		break;
	}
	for (var E = T >= 0 ? T + 1 : u; E < i; E++) if (e.charCodeAt(E) === v) return null;
	var D = e.slice(t, i);
	return {
		node: {
			type: G.link,
			target: "mailto:" + D,
			children: [{
				type: G.text,
				text: D
			}]
		},
		end: i
	};
}
function ln(e) {
	for (var t = 0; t < e.length; t++) if (e[t].type === G.link || "children" in e[t] && Array.isArray(e[t].children) && ln(e[t].children)) return !0;
	return !1;
}
function un(e) {
	for (var t = "", n = 0; n < e.length; n++) {
		var r = e[n];
		r.type === G.text ? t += r.text : r.type === G.breakLine ? t += " " : r.type === G.codeInline ? t += r.text : "children" in r && Array.isArray(r.children) ? t += un(r.children) : r.type === G.image ? t += r.alt || "" : r.type === G.link && (t += un(r.children));
	}
	return t;
}
function dn(e) {
	let t = e.includes("&") ? _e(e) : e;
	return {
		type: G.text,
		text: t
	};
}
function fn(e, t, i, o, s) {
	if (e.charCodeAt(t) !== y) return null;
	var l = t + 1;
	if (l >= i) return null;
	var d = e.charCodeAt(l);
	if (d === S && l + 1 < i && e.charCodeAt(l + 1) === m && l + 2 < i && e.charCodeAt(l + 2) === m) {
		var f = l + 3;
		if (f < i && e.charCodeAt(f) === u) return {
			node: {
				type: G.htmlComment,
				text: "",
				endsWithGreaterThan: !0
			},
			end: f + 1
		};
		if (f + 1 < i && e.charCodeAt(f) === m && e.charCodeAt(f + 1) === u) return {
			node: {
				type: G.htmlComment,
				text: "-",
				endsWithGreaterThan: !0
			},
			end: f + 2
		};
		var p = e.indexOf("-->", f);
		return p !== -1 && p <= i - 3 ? {
			node: {
				type: G.htmlComment,
				text: e.slice(t + 4, p)
			},
			end: p + 3
		} : null;
	}
	if (d === I) {
		var h = e.indexOf("?>", l + 1);
		return h !== -1 && h < i ? {
			node: {
				type: G.htmlSelfClosing,
				tag: "?",
				attrs: {},
				a: e.slice(t, h + 2)
			},
			end: h + 2
		} : null;
	}
	if (d === S && l + 1 < i) {
		var g = e.charCodeAt(l + 1);
		if (g === c && e.slice(l + 1, l + 8) === "[CDATA[") {
			var _ = e.indexOf("]]>", l + 8);
			return _ !== -1 && _ < i ? {
				node: {
					type: G.htmlSelfClosing,
					tag: "![CDATA[",
					attrs: {},
					a: e.slice(t, _ + 3)
				},
				end: _ + 3
			} : null;
		}
		if (g >= U && g <= W) {
			var v = e.indexOf(">", l + 2);
			return v !== -1 && v < i ? {
				node: {
					type: G.htmlSelfClosing,
					tag: "!" + e.slice(l + 1, v),
					attrs: {},
					a: e.slice(t, v + 1)
				},
				end: v + 1
			} : null;
		}
	}
	if (d === R) {
		var b = l + 1;
		if (b >= i) return null;
		var x = e.charCodeAt(b);
		if (!(x >= U && x <= W || x >= ce && x <= le)) return null;
		for (b++; b < i;) {
			var C = e.charCodeAt(b);
			if (C >= U && C <= W || C >= ce && C <= le || C >= V && C <= H || C === m) b++;
			else break;
		}
		for (; b < i && (e.charCodeAt(b) === n || e.charCodeAt(b) === r || e.charCodeAt(b) === a);) b++;
		if (b < i && e.charCodeAt(b) === u) {
			var w = e.slice(l + 1, b).trim();
			return {
				node: {
					type: G.htmlSelfClosing,
					tag: w,
					attrs: {},
					a: e.slice(t, b + 1),
					b: !0
				},
				end: b + 1
			};
		}
		return null;
	}
	if (!(d >= U && d <= W || d >= ce && d <= le)) return null;
	var T = tt(e, t);
	if (!T) return null;
	var E = T.tag, D = E.toLowerCase();
	if (T.selfClosing || Ce(E)) return {
		node: {
			type: G.htmlSelfClosing,
			tag: E,
			attrs: Pt(T.attrs, E, s),
			a: e.slice(t, T.end)
		},
		end: T.end
	};
	var O = qe.has(D), k = Rt(e.slice(0, i), T.end, E);
	if (k === -1) return {
		node: {
			type: G.htmlSelfClosing,
			tag: E,
			attrs: Pt(T.attrs, E, s),
			a: e.slice(t, T.end)
		},
		end: T.end
	};
	var A = It(e, "</" + D, k), j = e.slice(T.end, A), M = [];
	if (O) j.trim() && (M = [{
		type: G.text,
		text: j
	}]);
	else {
		var N = j.trim();
		if (N) {
			var { inAnchor: P, inline: F } = o;
			D === "a" && (o.inAnchor = !0), N.indexOf("\n\n") !== -1 || /^#{1,6}\s/.test(N) ? (o.inline = !1, M = _n(N, o, s)) : M = hn(N, 0, N.length, o, s), o.inAnchor = P, o.inline = F;
		}
	}
	return {
		node: {
			type: G.htmlBlock,
			tag: E,
			attrs: Pt(T.attrs, E, s),
			e: T.rawAttrs,
			children: M,
			text: j,
			c: !1
		},
		end: k
	};
}
var pn = 200, mn = 0;
function hn(e, t, n, r, i) {
	if (mn++, mn > pn) return mn--, [{
		type: G.text,
		text: e.slice(t, n)
	}];
	let a = r;
	if (i.streaming || i.optimizeForStreaming) {
		let r = function(e, t) {
			for (var n = 1, r = t + 1; r < e.length; r++) {
				var i = e.charCodeAt(r);
				if (i === c) n++;
				else if (i === x && (n--, n === 0)) return r;
			}
			return -1;
		}, i = e.slice(t, n), a = i;
		for (var u = 0, d = 0, f = 0, p = 0, m = 0, b = -1, C = -1, w = -1, T = -1, k = -1, A = 0; A < i.length; A++) {
			var j = i.charCodeAt(A);
			j === _ ? A + 1 < i.length && i.charCodeAt(A + 1) === _ ? (u++, b = A, A++) : (d++, C = A) : j === v ? A + 1 < i.length && i.charCodeAt(A + 1) === v ? (f++, w = A, A++) : (p++, T = A) : j === s && A + 1 < i.length && i.charCodeAt(A + 1) === s && (m++, k = A, A++);
		}
		var M = [];
		m % 2 == 1 && k >= 0 && M.push([k, 2]), f % 2 == 1 && w >= 0 && M.push([w, 2]), p % 2 == 1 && T >= 0 && M.push([T, 1]), u % 2 == 1 && b >= 0 && M.push([b, 2]), d % 2 == 1 && C >= 0 && M.push([C, 1]), M.sort(function(e, t) {
			return t[0] - e[0];
		});
		for (var N = 0; N < M.length; N++) {
			var P = M[N][0], F = M[N][1];
			i = i.slice(0, P) + i.slice(P + F);
		}
		let l = 0, h = -1;
		for (let e = 0; e < i.length; e++) i.charCodeAt(e) === o && (l++, h = e);
		if (l % 2 == 1 && h !== -1) {
			let e = !1, t = -1, n = 0;
			for (; n < i.length;) i.charCodeAt(n) === o && (e ? (e = !1, t = -1) : (t = n, e = !0)), n++;
			e && t !== -1 && (i = i.slice(0, t));
		}
		for (var I = !0; I;) {
			I = !1;
			for (var L = -1, R = -1, z = -1, ee = !1, te = 0; te < i.length; te++) if (i.charCodeAt(te) === c && (te === 0 || i.charCodeAt(te - 1) !== g)) {
				var ne = te > 0 && i.charCodeAt(te - 1) === S, B = ne ? te - 1 : te, re = r(i, te);
				if (re === -1) L = B, ee = ne, R = te + 1, z = i.length;
				else {
					var ae = re + 1;
					if (ae >= i.length) L = B, ee = ne, R = te + 1, z = re;
					else if (i.charCodeAt(ae) === ie) {
						var oe = i.indexOf(")", ae + 1);
						oe === -1 ? (L = B, ee = ne, R = te + 1, z = re, te = i.length) : te = oe;
					} else if (i.charCodeAt(ae) === c) {
						var de = i.indexOf("]", ae + 1);
						de === -1 ? (L = B, ee = ne, R = te + 1, z = re, te = i.length) : te = de;
					} else te = re;
				}
			}
			if (L >= 0) {
				var fe = ee ? "" : i.slice(R, z);
				i = i.slice(0, L) + fe, I = !0;
			}
		}
		let y = i.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);
		if (y && y.index !== void 0) {
			for (var pe = !1, me = 0, he = 0; he < y.index; he++) i.charCodeAt(he) === o && me++;
			if (pe = me % 2 == 1, !pe) {
				let e = y[1];
				Ft(i, "</" + e, 0) === -1 && (i = i.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/, "$1"));
			}
		}
		i !== a && (e = e.slice(0, t) + i, n = t + i.length);
	}
	let ge = [];
	var _e = [];
	let ve = t;
	var K = i.disableAutoLink || i.disableBareUrls || a.inAnchor ? -1 : e.indexOf("@", t);
	for (K >= n && (K = -1); t < n;) {
		let r = e.charCodeAt(t), u = null;
		if (r === o) {
			if (u = qt(e, t, n), !u) {
				var q = _t(e, t, n, o);
				t += q - 1;
			}
		} else if (r === _ || r === v) {
			var J = tn(e, t, n);
			if (J) {
				if (J.canOpen || J.canClose) {
					t > ve && ge.push(dn(e.slice(ve, t)));
					var ye = dn(e.slice(t, t + J.len));
					_e.push({
						idx: ge.length,
						ch: r,
						len: J.len,
						canOpen: J.canOpen,
						canClose: J.canClose,
						active: !0
					}), ge.push(ye), t += J.len, ve = t;
					continue;
				}
				t += J.len - 1;
			}
		} else r === s ? u = Xt(e, t, n, a, i) : r === h ? u = Zt(e, t, n, a, i) : r === c ? (t + 1 < n && e.charCodeAt(t + 1) === l && (u = on(e, t, n, a)), u ||= rn(e, t, n, a, i)) : r === S && t + 1 < n && e.charCodeAt(t + 1) === c ? u = rn(e, t, n, a, i) : r === y ? (u = an(e, t, n), !u && !i.disableParsingRawHTML && !i.ignoreHTMLBlocks && (u = fn(e, t, n, a, i))) : (r === D || r === O || r === E) && !a.inAnchor && !i.disableAutoLink && (t === 0 || e.charCodeAt(t - 1) !== y) && (u = sn(e, t, n, i));
		if (!u && K >= 0 && K - t <= 64 && !a.inAnchor && !i.disableAutoLink && !i.disableBareUrls && (r >= U && r <= W || r >= ce && r <= le || r >= V && r <= H) && (u = cn(e, t, n, i), !u && t >= K && (K = e.indexOf("@", t + 1), K >= n && (K = -1))), r === se) {
			t > ve && ge.push(dn(e.slice(ve, t))), ge.push({ type: G.breakLine }), t++, ve = t;
			continue;
		}
		if (u) t > ve && ge.push(dn(e.slice(ve, t))), ge.push(u.node), t = u.end, ve = t;
		else {
			if (r === g && t + 1 < n && ft(e.charCodeAt(t + 1)) & Z) {
				t > ve && ge.push(dn(e.slice(ve, t))), ge.push(dn(e[t + 1])), t += 2, ve = t;
				continue;
			}
			if (t++, K < 0 || K - t > 64) for (; t < n;) {
				var be = e.charCodeAt(t);
				if (be < ue && !Xe[be]) t++;
				else break;
			}
		}
	}
	if (n > ve) {
		let t = e.slice(ve, n);
		(i.streaming || i.optimizeForStreaming) && (t = t.replace(/\*\*([^*]+)$/, "$1"), t.match(/\*[^*]+$/) && (t = t.replace(/\*([^*]+)$/, "$1")), t = t.replace(/__([^_]+)$/, "$1"), t.match(/_[^_]+$/) && (t = t.replace(/_([^_]+)$/, "$1")), t = t.replace(/~~([^~]+)$/, "$1"), t = t.replace(/\[([^\]]+)$/, "$1"), t = t.replace(/\[([^\]]+)\]\([^)]*$/, "$1")), t && ge.push(dn(t));
	}
	return _e.length > 0 && nn(ge, _e, r, i), mn--, ge;
}
var gn = 500;
function _n(e, t, i) {
	var l = t.g || 0;
	if (l > gn) return [{
		type: G.text,
		text: e
	}];
	if (t.g = l + 1, (i.streaming || i.optimizeForStreaming) && !t.h) {
		var f = e.length;
		f > 0 && e.charCodeAt(f - 1) === a && f--;
		for (var p = f; p > 0 && e.charCodeAt(p - 1) !== a;) p--;
		if (p > 0 && e.charCodeAt(p) === ne) {
			for (var h = !0, g = p; g < f; g++) {
				var b = e.charCodeAt(g);
				if (b !== n && b !== r && b !== m && b !== w && b !== ne) {
					h = !1;
					break;
				}
			}
			if (h) {
				for (var x = p - 1; x > 0 && e.charCodeAt(x - 1) !== a;) x--;
				e.charCodeAt(x) === ne && (e = e.slice(0, x).trimEnd());
			}
		}
		var S = e.trim(), C = S.lastIndexOf("\n"), T = C === -1 ? S : S.slice(C + 1);
		if (T.length > 0 && T.charCodeAt(0) === ne) {
			for (var E = !1, D = !1, O = 1; O < T.length; O++) {
				var k = T.charCodeAt(O);
				k === ne && (E = !0), k === m && (D = !0);
			}
			E && D && (e = C === -1 ? "" : e.slice(0, e.lastIndexOf(T)).trimEnd());
		}
		for (var A = -1, j = -1, M = -1, N = e.length - 1; N >= 0; N--) if (e.charCodeAt(N) === y) {
			var P = N + 1 < e.length ? e.charCodeAt(N + 1) : 0;
			if (P >= U && P <= W || P >= ce && P <= le) {
				for (var F = N + 2; F < e.length;) {
					var I = e.charCodeAt(F);
					if (I >= U && I <= W || I >= ce && I <= le || I >= V && I <= H) F++;
					else break;
				}
				for (var R = F; R < e.length && e.charCodeAt(R) !== u;) R++;
				if (R < e.length) {
					for (var z = !1, ee = R + 1; ee < e.length; ee++) if (e.charCodeAt(ee) === y) {
						z = !0;
						break;
					}
					z || (A = N, j = F, M = R + 1);
				}
			}
			break;
		}
		if (A >= 0) {
			for (var B = 0, re = 0; re < A; re++) e.charCodeAt(re) === o && B++;
			if (B % 2 == 0) {
				var ie = e.slice(A + 1, j);
				Ft(e, "</" + ie, 0) === -1 && (e = e.slice(0, A) + e.slice(M));
			}
		}
		for (var se = e.length; se > 0 && e.charCodeAt(se - 1) === a;) se--;
		if (se > 0) {
			for (var ue = se; ue > 0 && e.charCodeAt(ue - 1) !== a;) ue--;
			for (var de = ue, pe = 0; de < se && e.charCodeAt(de) === n && pe < 3;) de++, pe++;
			if (ue > 0 && de < se && Ct(e, de, se)) {
				for (var me = ue - 1, he = me; he > 0 && e.charCodeAt(he - 1) !== a;) he--;
				xt(e, he, me) || (e = e.slice(0, ue).trimEnd());
			}
		}
		var ge = e.length;
		if (ge > 0) {
			for (var _e = e.lastIndexOf("\n"), ve = _e === -1 ? 0 : _e + 1, K = ge, q = ve, J = 0; q < K && e.charCodeAt(q) === n && J < 3;) q++, J++;
			if (q < K) {
				var ye = e.charCodeAt(q), be = !1;
				if (ye === _ || ye === m || ye === te) {
					var xe = q + 1;
					if (xe >= K || e.charCodeAt(xe) === n || e.charCodeAt(xe) === r) {
						for (var Se = xe; Se < K && (e.charCodeAt(Se) === n || e.charCodeAt(Se) === r);) Se++;
						Se >= K && (be = !0);
					}
				} else if (ye >= V && ye <= H) {
					for (var Ce = q; Ce < K && e.charCodeAt(Ce) >= V && e.charCodeAt(Ce) <= H;) Ce++;
					if (Ce < K && (e.charCodeAt(Ce) === L || e.charCodeAt(Ce) === ae)) {
						var we = Ce + 1;
						if (we >= K || e.charCodeAt(we) === n || e.charCodeAt(we) === r) {
							for (var Te = we; Te < K && (e.charCodeAt(Te) === n || e.charCodeAt(Te) === r);) Te++;
							Te >= K && (be = !0);
						}
					}
				}
				be && (e = e.slice(0, ve).trimEnd());
			}
		}
	}
	if (t.inline) return hn(e, 0, e.length, t, i);
	let Y = [], X = 0, Ee = e.length;
	if (X === 0 && e.startsWith("---")) {
		let t = fe(e);
		if (t && t.hasValidYaml) {
			if (i.preserveFrontmatter !== !1) {
				let n = e.slice(0, t.endPos).trimEnd();
				Y.push({
					type: G.frontmatter,
					text: n
				});
			}
			X = t.endPos;
		}
	}
	for (; X < Ee;) {
		for (var De = e.indexOf("\n", X), Oe = De < 0 ? Ee : De; X < Ee && xt(e, X, Oe);) X = Oe < Ee ? Oe + 1 : Oe, X < Ee && (De = e.indexOf("\n", X), Oe = De < 0 ? Ee : De);
		if (X >= Ee) break;
		e.charCodeAt(X), bt(e, X, Oe);
		let n = null;
		if (e.charCodeAt(X) !== oe && vt >= 4 && !t.inHTML) n = Et(e, X);
		else if (e.charCodeAt(X) !== oe) {
			let r = X + yt, a = e.charCodeAt(r);
			a === d ? n = St(e, X, t, i) : a === u ? n = Dt(e, X, t, i) : a === o || a === s ? n = Tt(e, X, t) : a === m || a === _ || a === v ? (n = wt(e, X), !n && (n = Mt(e, X, t, i))) : a === te || a >= V && a <= H ? n = Mt(e, X, t, i) : a === y ? n = zt(e, X, t, i) : a === ne ? n = Ht(e, X, t, i) : a === c && (n = Ut(e, X, t));
		}
		if (!n) {
			for (var ke = !1, Ae = X; Ae < Oe; Ae++) if (e.charCodeAt(Ae) === ne) {
				ke = !0;
				break;
			}
			ke && (n = Ht(e, X, t, i));
		}
		if (n ||= Gt(e, X, t, i), n) n.node.type !== G.refCollection && Y.push(n.node), X = n.end;
		else {
			var je = e.indexOf("\n", X);
			X = je < 0 ? Ee : je + 1;
		}
	}
	return t.g = l, Y;
}
function vn(e, t, n, r) {
	var i = tt(e, t);
	return i ? {
		tagName: i.tag,
		tagLower: i.tag.toLowerCase(),
		attrs: i.rawAttrs,
		whitespaceBeforeAttrs: i.whitespaceBeforeAttrs,
		isSelfClosing: i.selfClosing,
		hasSpaceBeforeSlash: i.hasSpaceBeforeSlash,
		isClosing: i.isClosing,
		hasNewline: i.whitespaceBeforeAttrs.includes("\n") || i.rawAttrs.includes("\n"),
		endPos: i.end
	} : null;
}
function yn(e, t, n) {
	mn = 0, e = Fe(e), !t.refs && (t.refs = {}), t.h = nt(e, t.refs, n);
	let r = _n(e, t, n);
	return t.refs && Object.keys(t.refs).length > 0 ? [{
		type: G.refCollection,
		refs: t.refs
	}, ...r] : r;
}
var bn = /^\n+/, xn;
try {
	xn = t.createElement("div").$$typeof;
} catch {
	xn = Symbol.for("react.transitional.element");
}
function Sn(e, t, n) {
	return {
		$$typeof: xn,
		type: e,
		key: n == null ? null : "" + n,
		ref: null,
		props: t,
		i: null
	};
}
var Cn = typeof t.createContext < "u" ? t.createContext(void 0) : void 0;
function wn(e, n, r, i, a, o, s, c) {
	switch (e.type) {
		case G.blockQuote: {
			let t = { key: r.key };
			return e.alert && (t.className = "markdown-alert-" + o(e.alert.toLowerCase(), be), e.children.unshift({
				attrs: {},
				children: [{
					type: G.text,
					text: e.alert
				}],
				c: !0,
				type: G.htmlBlock,
				tag: "header"
			})), i("blockquote", t, n(e.children, r));
		}
		case G.breakLine: return i("br", { key: r.key });
		case G.breakThematic: return i("hr", { key: r.key });
		case G.frontmatter: return c.preserveFrontmatter ? i("pre", { key: r.key }, e.text) : null;
		case G.codeBlock:
			let h = e.lang ? _e(e.lang) : "";
			return i("pre", { key: r.key }, i("code", {
				...he(e.attrs || {}),
				className: h ? `language-${h} lang-${h}` : ""
			}, e.text));
		case G.codeInline: return i("code", { key: r.key }, e.text);
		case G.footnoteReference: return i("a", {
			key: r.key,
			href: a(e.target, "a", "href") || void 0
		}, i("sup", { key: r.key }, e.text));
		case G.gfmTask: return i("input", {
			checked: e.completed,
			key: r.key,
			readOnly: !0,
			type: "checkbox"
		});
		case G.heading: return i(`h${e.level}`, {
			id: e.id,
			key: r.key
		}, n(e.children, r));
		case G.htmlBlock: {
			let h = e;
			if (c.tagfilter && Ve(h.tag)) {
				var l = "";
				if (h.attrs) for (var u in h.attrs) {
					var d = h.attrs[u];
					d === !0 ? l += " " + u : d != null && d !== !1 && (l += " " + u + "=\"" + String(d) + "\"");
				}
				return i("span", { key: r.key }, "<" + h.tag + l + ">");
			}
			if (h.a && h.c) {
				let l = function(e) {
					if ((e.type === G.htmlSelfClosing || e.type === G.htmlBlock) && e.b) return [];
					if (e.type === G.paragraph) {
						let t = e.children;
						return t ? t.flatMap(l) : [];
					}
					return e.type === G.text ? e.text?.trim() ? [e] : [] : e.type === G.htmlBlock && e.children ? [{
						...e,
						children: e.children?.flatMap(l)
					}] : [e];
				}, u = function(e) {
					for (var t = 0; t < e.length; t++) e[t].type === G.htmlBlock && (e[t].c = !1), "children" in e[t] && e[t].children && u(e[t].children);
				}, d = function(e, t) {
					for (var n = 0; n < e.length; n++) {
						var r = e[n];
						if (r.type === G.paragraph && r.children) for (var i = r.children, a = 0; a < i.length; a++) {
							var o = i[a];
							if (o.type === G.htmlSelfClosing && o.b && o.tag.toLowerCase() === t) {
								var s = e.slice(0, n);
								a > 0 && s.push({
									type: G.paragraph,
									children: i.slice(0, a)
								});
								var c = [];
								if (a + 1 < i.length) {
									var l = i.slice(a + 1);
									l = l.filter(function(e) {
										return !(e.type === G.htmlSelfClosing && e.b);
									}), l.length > 0 && (c = l);
								}
								return c = c.concat(e.slice(n + 1)), {
									found: !0,
									beforeClose: s,
									afterClose: c
								};
							}
						}
						if ((r.type === G.htmlSelfClosing || r.type === G.htmlBlock) && r.b && r.tag.toLowerCase() === t) return {
							found: !0,
							beforeClose: e.slice(0, n),
							afterClose: e.slice(n + 1)
						};
					}
					return {
						found: !1,
						beforeClose: e,
						afterClose: []
					};
				}, g = h.tag.toLowerCase(), _ = Qe(g), v = h.children && h.children.length > 0, y = /<[a-z][^>]{0,100}>/i.test(h.a);
				if (_) {
					let t = h.a.replace(RegExp("\\s*</" + g + ">\\s*$", "i"), "");
					return c.tagfilter && (t = Ue(t)), y ? i(e.tag, {
						key: r.key,
						...he(e.attrs || {}),
						dangerouslySetInnerHTML: { __html: t }
					}) : i(e.tag, {
						key: r.key,
						...he(e.attrs || {})
					}, t);
				}
				let b = RegExp(`^<${h.tag}(\\s|>)`, "i").test(h.a);
				if (v && !b && c.tagfilter && He(h.a)) return i(e.tag, {
					key: r.key,
					...he(e.attrs || {})
				}, n(h.children, r));
				if ($e(h.a)) {
					let t = c.tagfilter ? Ue(h.a) : h.a;
					return i(e.tag, {
						key: r.key,
						...he(e.attrs || {}),
						dangerouslySetInnerHTML: { __html: t }
					});
				}
				let x = {
					slugify: (e) => o(e, be),
					sanitizer: a,
					tagfilter: !0
				}, S = h.a.replace(/>\s+</g, "><").replace(/\n+/g, " ").trim();
				if (RegExp(`^<${h.tag}(\\s[^>]*)?>(\\s*</${h.tag}>)?$`, "i").test(S)) return h.children && h.children.length > 0 ? i(e.tag, {
					key: r.key,
					...he(e.attrs || {})
				}, n(h.children, r)) : i(e.tag, {
					key: r.key,
					...he(e.attrs || {})
				});
				let C = yn(S, {
					inline: !1,
					refs: s,
					inHTML: !1
				}, x);
				u(C);
				let w = h.tag.toLowerCase(), T = "</" + w + ">", E = RegExp(`^<${h.tag}(\\s|>)`, "i").test(S), D = S.toLowerCase().trimEnd().endsWith(T), O = E && D;
				if (O && v) return i(e.tag, {
					key: r.key,
					...he(e.attrs || {})
				}, n(h.children, r));
				if (O) return n(C.flatMap(l), r);
				var f = d(C, w);
				if (f.found && f.afterClose.length > 0) {
					var p = f.beforeClose.flatMap(l), m = f.afterClose.flatMap(l);
					return Sn(t.Fragment, { children: [i(e.tag, {
						key: r.key,
						...he(e.attrs || {})
					}, n(p, r)), n(m, r)] }, null);
				}
				return i(e.tag, {
					key: r.key,
					...he(e.attrs || {})
				}, n(C.flatMap(l), r));
			}
			return Ce(e.tag) ? i(e.tag, {
				key: r.key,
				...he(e.attrs || {})
			}) : i(e.tag, {
				key: r.key,
				...he(e.attrs || {})
			}, e.children ? n(e.children, r) : "");
		}
		case G.htmlSelfClosing: {
			let t = e;
			if (c.tagfilter && Ve(t.tag)) {
				var l = "";
				if (t.attrs) for (var u in t.attrs) {
					var d = t.attrs[u];
					d === !0 ? l += " " + u : d != null && d !== !1 && (l += " " + u + "=\"" + String(d) + "\"");
				}
				return i("span", { key: r.key }, "<" + t.tag + l + " />");
			}
			return i(e.tag, {
				key: r.key,
				...he(e.attrs || {})
			});
		}
		case G.image: {
			let t = e.target == null ? null : a(e.target, "img", "src");
			return i("img", {
				key: r.key,
				alt: e.alt && e.alt.length > 0 ? e.alt : void 0,
				title: e.title || void 0,
				src: t || void 0
			});
		}
		case G.link: {
			let t = { key: r.key };
			return e.target != null && (t.href = Le(e.target)), e.title && (t.title = e.title), i("a", t, n(e.children, r));
		}
		case G.table: {
			let t = e;
			return i("table", { key: r.key }, i("thead", null, i("tr", null, t.header.map(function(e, a) {
				return i("th", {
					key: a,
					style: t.align[a] == null ? {} : { textAlign: t.align[a] }
				}, n(e, r));
			}))), i("tbody", null, t.cells.map(function(e, a) {
				return i("tr", { key: a }, e.map(function(e, a) {
					return i("td", {
						key: a,
						style: t.align[a] == null ? {} : { textAlign: t.align[a] }
					}, n(e, r));
				}));
			})));
		}
		case G.text: return e.text;
		case G.textFormatted: return i(e.tag, { key: r.key }, n(e.children, r));
		case G.orderedList:
		case G.unorderedList: return i(e.type === G.orderedList ? "ol" : "ul", {
			key: r.key,
			start: e.type === G.orderedList ? e.start : void 0
		}, e.items.map(function(e, t) {
			return i("li", { key: t }, n(e, r));
		}));
		case G.paragraph: return i("p", { key: r.key }, n(e.children, r));
		case G.ref: return null;
		default: return null;
	}
}
var Tn = (e, t, n, r, i, a) => {
	var o = (e) => e.map(function(e) {
		return "text" in e ? e.text : "";
	}), s = (c, l = {}) => {
		var u = (l.renderDepth || 0) + 1;
		if (u > 2500) return o(c);
		l.renderDepth = u;
		for (var d = l.key, f = [], p = !1, m = 0; m < c.length; m++) {
			l.key = m;
			var h = e ? e(wn.bind(null, c[m], s, l, t, n, r, i, a), c[m], s, l) : wn(c[m], s, l, t, n, r, i, a), g = typeof h == "string";
			if (g && p) f[f.length - 1] += h;
			else if (h !== null) if (Array.isArray(h)) for (var _ = 0; _ < h.length; _++) f.push(h[_]);
			else f.push(h);
			p = g;
		}
		return l.key = d, l.renderDepth = u - 1, f;
	};
	return s;
}, En = (e, t) => {
	let n = Ie(t, e, void 0);
	return n ? typeof n == "function" || typeof n == "object" && "render" in n ? n : Ie(t, `${e}.component`, e) : e;
};
function Dn(e, t) {
	let n = { ...t || {} };
	n.overrides = n.overrides || {};
	let r = n.slugify || be, i = n.sanitizer || K, a = n.createElement, o = n.overrides && Object.keys(n.overrides).length > 0, s = (e) => On(e, {
		...n,
		wrapper: null
	});
	function c(e, t, ...r) {
		var i = t || {};
		for (var c in i) {
			var l = i[c];
			if (typeof l == "string" && l.length > 0 && l.charCodeAt(0) === y && (We.test(l) || Ge.test(l) || vn(l, 0))) {
				var u = s(l.trim());
				i[c] = c === "innerHTML" && Array.isArray(u) ? u[0] : u;
			}
		}
		var d = e;
		if (o) {
			var f = Ie(n.overrides, e + ".props", {});
			d = En(e, n.overrides), i = {
				...i,
				...f,
				className: Re(i.className, f.className) || void 0
			};
		}
		if (!a) {
			var p = i.key;
			return p != null && delete i.key, r.length === 1 ? i.children = r[0] : r.length > 1 && (i.children = r), Sn(d, i, p);
		}
		return a(d, i, ...r);
	}
	let u = {
		...n,
		slugify: (e) => r(e, be),
		sanitizer: i,
		tagfilter: n.tagfilter !== !1
	}, d = e[0] && e[0].type === G.refCollection ? e[0].refs : {}, f = Tn(n.renderRule, c, i, r, d, n), p = f(e, {
		inline: n.forceInline,
		refs: d
	}), m = [];
	for (let e in d) e.charCodeAt(0) === l && m.push({
		identifier: e,
		footnote: d[e].target
	});
	if (m.length && p.push(c("footer", { key: "footer" }, m.map(function(e) {
		let t = e.identifier.charCodeAt(0) === l ? e.identifier.slice(1) : e.identifier, n = yn(e.footnote, {
			inline: !0,
			refs: d
		}, u);
		return c("div", {
			id: r(t, be),
			key: e.identifier
		}, t + ": ", f(n, {
			inline: !0,
			refs: d
		}));
	}))), n.wrapper === null) return p;
	let h = n.wrapper || (n.forceInline ? "span" : "div"), g;
	if (p.length > 1 || n.forceWrapper) g = p;
	else return p.length === 1 ? p[0] : null;
	var _ = n.wrapperProps ? { ...n.wrapperProps } : {};
	return _.children = g, Sn(h, _, "outer");
}
function On(e = "", t = {}) {
	let n = { ...t || {} };
	n.overrides = n.overrides || {};
	let r = n.slugify || be, i = n.sanitizer || K;
	function a(e) {
		let t = n.forceInline || !n.forceBlock && !ge.test(e), a = {
			...n,
			slugify: (e) => r(e, be),
			sanitizer: i,
			tagfilter: n.tagfilter !== !1
		};
		t || nt(e, o, a);
		let s = e;
		if (!t) {
			let e = s.length;
			for (; e > 0 && (s[e - 1] === "\n" || s[e - 1] === "\r");) e--;
			s = s.slice(0, e), s = `${s.replace(bn, "")}

`;
		}
		if (n.optimizeForStreaming) {
			let e = s.lastIndexOf("<");
			e !== -1 && s.slice(e).indexOf(">") === -1 && (s = s.slice(0, e));
		}
		return Dn(yn(t ? e : s, {
			inline: t,
			refs: o
		}, a), {
			...a,
			forceInline: t
		});
	}
	let o = {};
	return a(e);
}
var kn = ({ children: e, options: n, ...r }) => {
	if (!(typeof t.useContext < "u")) {
		let t = {
			...n,
			overrides: { ...n?.overrides },
			wrapperProps: {
				...n?.wrapperProps,
				...r
			}
		};
		return On(e ?? "", t);
	}
	let i = t.useContext(Cn), a = t.useMemo(() => ({
		...i,
		...n,
		overrides: {
			...i?.overrides,
			...n?.overrides
		},
		wrapperProps: {
			...i?.wrapperProps,
			...n?.wrapperProps,
			...r
		}
	}), [
		i,
		n,
		r
	]), o = e ?? "";
	return t.useMemo(() => On(o, a), [o, a]);
};
//#endregion
export { G as A, kn as N5 };

//# sourceMappingURL=index.js.map