Skip to content

Instantly share code, notes, and snippets.

@d1y
Created September 1, 2025 08:21
Show Gist options
  • Select an option

  • Save d1y/f3526ea0bdf4cd8d5650b4a4b1ebc6e6 to your computer and use it in GitHub Desktop.

Select an option

Save d1y/f3526ea0bdf4cd8d5650b4a4b1ebc6e6 to your computer and use it in GitHub Desktop.
var D;
(function(e) {
e.Root = "root", e.Text = "text", e.Directive = "directive", e.Comment = "comment", e.Script = "script", e.Style = "style", e.Tag = "tag", e.CDATA = "cdata", e.Doctype = "doctype";
})(D || (D = {}));
function Ea(e) {
return e.type === D.Tag || e.type === D.Script || e.type === D.Style;
}
const zu = D.Root, e0 = D.Text, Ta = D.Directive, u0 = D.Comment, ma = D.Script, Aa = D.Style, wu = D.Tag, _a = D.CDATA, pa = D.Doctype;
class t0 {
constructor() {
this.parent = null, this.prev = null, this.next = null, this.startIndex = null, this.endIndex = null;
}
// Read-write aliases for properties
/**
* Same as {@link parent}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get parentNode() {
return this.parent;
}
set parentNode(u) {
this.parent = u;
}
/**
* Same as {@link prev}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get previousSibling() {
return this.prev;
}
set previousSibling(u) {
this.prev = u;
}
/**
* Same as {@link next}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get nextSibling() {
return this.next;
}
set nextSibling(u) {
this.next = u;
}
/**
* Clone this node, and optionally its children.
*
* @param recursive Clone child nodes as well.
* @returns A clone of the node.
*/
cloneNode(u = !1) {
return ve(this, u);
}
}
class Zu extends t0 {
/**
* @param data The content of the data node
*/
constructor(u) {
super(), this.data = u;
}
/**
* Same as {@link data}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get nodeValue() {
return this.data;
}
set nodeValue(u) {
this.data = u;
}
}
class He extends Zu {
constructor() {
super(...arguments), this.type = D.Text;
}
get nodeType() {
return 3;
}
}
class Ju extends Zu {
constructor() {
super(...arguments), this.type = D.Comment;
}
get nodeType() {
return 8;
}
}
class et extends Zu {
constructor(u, t) {
super(t), this.name = u, this.type = D.Directive;
}
get nodeType() {
return 1;
}
}
class ut extends t0 {
/**
* @param children Children of the node. Only certain node types can have children.
*/
constructor(u) {
super(), this.children = u;
}
// Aliases
/** First child of the node. */
get firstChild() {
var u;
return (u = this.children[0]) !== null && u !== void 0 ? u : null;
}
/** Last child of the node. */
get lastChild() {
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
}
/**
* Same as {@link children}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get childNodes() {
return this.children;
}
set childNodes(u) {
this.children = u;
}
}
class a0 extends ut {
constructor() {
super(...arguments), this.type = D.CDATA;
}
get nodeType() {
return 4;
}
}
class be extends ut {
constructor() {
super(...arguments), this.type = D.Root;
}
get nodeType() {
return 9;
}
}
class tt extends ut {
/**
* @param name Name of the tag, eg. `div`, `span`.
* @param attribs Object mapping attribute names to attribute values.
* @param children Children of the node.
*/
constructor(u, t, a = [], r = u === "script" ? D.Script : u === "style" ? D.Style : D.Tag) {
super(a), this.name = u, this.attribs = t, this.type = r;
}
get nodeType() {
return 1;
}
// DOM Level 1 aliases
/**
* Same as {@link name}.
* [DOM spec](https://dom.spec.whatwg.org)-compatible alias.
*/
get tagName() {
return this.name;
}
set tagName(u) {
this.name = u;
}
get attributes() {
return Object.keys(this.attribs).map((u) => {
var t, a;
return {
name: u,
value: this.attribs[u],
namespace: (t = this["x-attribsNamespace"]) === null || t === void 0 ? void 0 : t[u],
prefix: (a = this["x-attribsPrefix"]) === null || a === void 0 ? void 0 : a[u]
};
});
}
}
function x(e) {
return Ea(e);
}
function bu(e) {
return e.type === D.CDATA;
}
function Z(e) {
return e.type === D.Text;
}
function Eu(e) {
return e.type === D.Comment;
}
function Uu(e) {
return e.type === D.Directive;
}
function ce(e) {
return e.type === D.Root;
}
function M(e) {
return Object.prototype.hasOwnProperty.call(e, "children");
}
function ve(e, u = !1) {
let t;
if (Z(e))
t = new He(e.data);
else if (Eu(e))
t = new Ju(e.data);
else if (x(e)) {
const a = u ? Cu(e.children) : [], r = new tt(e.name, { ...e.attribs }, a);
a.forEach((n) => n.parent = r), e.namespace != null && (r.namespace = e.namespace), e["x-attribsNamespace"] && (r["x-attribsNamespace"] = { ...e["x-attribsNamespace"] }), e["x-attribsPrefix"] && (r["x-attribsPrefix"] = { ...e["x-attribsPrefix"] }), t = r;
} else if (bu(e)) {
const a = u ? Cu(e.children) : [], r = new a0(a);
a.forEach((n) => n.parent = r), t = r;
} else if (ce(e)) {
const a = u ? Cu(e.children) : [], r = new be(a);
a.forEach((n) => n.parent = r), e["x-mode"] && (r["x-mode"] = e["x-mode"]), t = r;
} else if (Uu(e)) {
const a = new et(e.name, e.data);
e["x-name"] != null && (a["x-name"] = e["x-name"], a["x-publicId"] = e["x-publicId"], a["x-systemId"] = e["x-systemId"]), t = a;
} else
throw new Error(`Not implemented yet: ${e.type}`);
return t.startIndex = e.startIndex, t.endIndex = e.endIndex, e.sourceCodeLocation != null && (t.sourceCodeLocation = e.sourceCodeLocation), t;
}
function Cu(e) {
const u = e.map((t) => ve(t, !0));
for (let t = 1; t < u.length; t++)
u[t].prev = u[t - 1], u[t - 1].next = u[t];
return u;
}
const gt = {
withStartIndices: !1,
withEndIndices: !1,
xmlMode: !1
};
class ga {
/**
* @param callback Called once parsing has completed.
* @param options Settings for the handler.
* @param elementCB Callback whenever a tag is closed.
*/
constructor(u, t, a) {
this.dom = [], this.root = new be(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null, typeof t == "function" && (a = t, t = gt), typeof u == "object" && (t = u, u = void 0), this.callback = u ?? null, this.options = t ?? gt, this.elementCB = a ?? null;
}
onparserinit(u) {
this.parser = u;
}
// Resets the handler back to starting state
onreset() {
this.dom = [], this.root = new be(this.dom), this.done = !1, this.tagStack = [this.root], this.lastNode = null, this.parser = null;
}
// Signals the handler that parsing is done
onend() {
this.done || (this.done = !0, this.parser = null, this.handleCallback(null));
}
onerror(u) {
this.handleCallback(u);
}
onclosetag() {
this.lastNode = null;
const u = this.tagStack.pop();
this.options.withEndIndices && (u.endIndex = this.parser.endIndex), this.elementCB && this.elementCB(u);
}
onopentag(u, t) {
const a = this.options.xmlMode ? D.Tag : void 0, r = new tt(u, t, void 0, a);
this.addNode(r), this.tagStack.push(r);
}
ontext(u) {
const { lastNode: t } = this;
if (t && t.type === D.Text)
t.data += u, this.options.withEndIndices && (t.endIndex = this.parser.endIndex);
else {
const a = new He(u);
this.addNode(a), this.lastNode = a;
}
}
oncomment(u) {
if (this.lastNode && this.lastNode.type === D.Comment) {
this.lastNode.data += u;
return;
}
const t = new Ju(u);
this.addNode(t), this.lastNode = t;
}
oncommentend() {
this.lastNode = null;
}
oncdatastart() {
const u = new He(""), t = new a0([u]);
this.addNode(t), u.parent = t, this.lastNode = u;
}
oncdataend() {
this.lastNode = null;
}
onprocessinginstruction(u, t) {
const a = new et(u, t);
this.addNode(a);
}
handleCallback(u) {
if (typeof this.callback == "function")
this.callback(u, this.dom);
else if (u)
throw u;
}
addNode(u) {
const t = this.tagStack[this.tagStack.length - 1], a = t.children[t.children.length - 1];
this.options.withStartIndices && (u.startIndex = this.parser.startIndex), this.options.withEndIndices && (u.endIndex = this.parser.endIndex), t.children.push(u), a && (u.prev = a, a.next = u), u.parent = t, this.lastNode = null;
}
}
const Nt = /["&'<>$\x80-\uFFFF]/g, Na = /* @__PURE__ */ new Map([
[34, "&quot;"],
[38, "&amp;"],
[39, "&apos;"],
[60, "&lt;"],
[62, "&gt;"]
]), Ia = (
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
String.prototype.codePointAt != null ? (e, u) => e.codePointAt(u) : (
// http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
(e, u) => (e.charCodeAt(u) & 64512) === 55296 ? (e.charCodeAt(u) - 55296) * 1024 + e.charCodeAt(u + 1) - 56320 + 65536 : e.charCodeAt(u)
)
);
function s0(e) {
let u = "", t = 0, a;
for (; (a = Nt.exec(e)) !== null; ) {
const r = a.index, n = e.charCodeAt(r), i = Na.get(n);
i !== void 0 ? (u += e.substring(t, r) + i, t = r + 1) : (u += `${e.substring(t, r)}&#x${Ia(e, r).toString(16)};`, t = Nt.lastIndex += +((n & 64512) === 55296));
}
return u + e.substr(t);
}
function r0(e, u) {
return function(a) {
let r, n = 0, i = "";
for (; r = e.exec(a); )
n !== r.index && (i += a.substring(n, r.index)), i += u.get(r[0].charCodeAt(0)), n = r.index + 1;
return i + a.substring(n);
};
}
const Sa = r0(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, "&quot;"],
[38, "&amp;"],
[160, "&nbsp;"]
])), Ca = r0(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&amp;"],
[60, "&lt;"],
[62, "&gt;"],
[160, "&nbsp;"]
])), xa = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath"
].map((e) => [e.toLowerCase(), e])), Oa = new Map([
"definitionURL",
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan"
].map((e) => [e.toLowerCase(), e])), La = /* @__PURE__ */ new Set([
"style",
"script",
"xmp",
"iframe",
"noembed",
"noframes",
"plaintext",
"noscript"
]);
function Da(e) {
return e.replace(/"/g, "&quot;");
}
function Ra(e, u) {
var t;
if (!e)
return;
const a = ((t = u.encodeEntities) !== null && t !== void 0 ? t : u.decodeEntities) === !1 ? Da : u.xmlMode || u.encodeEntities !== "utf8" ? s0 : Sa;
return Object.keys(e).map((r) => {
var n, i;
const f = (n = e[r]) !== null && n !== void 0 ? n : "";
return u.xmlMode === "foreign" && (r = (i = Oa.get(r)) !== null && i !== void 0 ? i : r), !u.emptyAttrs && !u.xmlMode && f === "" ? r : `${r}="${a(f)}"`;
}).join(" ");
}
const It = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]);
function Tu(e, u = {}) {
const t = "length" in e ? e : [e];
let a = "";
for (let r = 0; r < t.length; r++)
a += Pa(t[r], u);
return a;
}
function Pa(e, u) {
switch (e.type) {
case zu:
return Tu(e.children, u);
// @ts-expect-error We don't use `Doctype` yet
case pa:
case Ta:
return Ba(e);
case u0:
return Ua(e);
case _a:
return wa(e);
case ma:
case Aa:
case wu:
return ka(e, u);
case e0:
return Fa(e, u);
}
}
const ya = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignObject",
"desc",
"title"
]), Ma = /* @__PURE__ */ new Set(["svg", "math"]);
function ka(e, u) {
var t;
u.xmlMode === "foreign" && (e.name = (t = xa.get(e.name)) !== null && t !== void 0 ? t : e.name, e.parent && ya.has(e.parent.name) && (u = { ...u, xmlMode: !1 })), !u.xmlMode && Ma.has(e.name) && (u = { ...u, xmlMode: "foreign" });
let a = `<${e.name}`;
const r = Ra(e.attribs, u);
return r && (a += ` ${r}`), e.children.length === 0 && (u.xmlMode ? (
// In XML mode or foreign mode, and user hasn't explicitly turned off self-closing tags
u.selfClosingTags !== !1
) : (
// User explicitly asked for self-closing tags, even in HTML mode
u.selfClosingTags && It.has(e.name)
)) ? (u.xmlMode || (a += " "), a += "/>") : (a += ">", e.children.length > 0 && (a += Tu(e.children, u)), (u.xmlMode || !It.has(e.name)) && (a += `</${e.name}>`)), a;
}
function Ba(e) {
return `<${e.data}>`;
}
function Fa(e, u) {
var t;
let a = e.data || "";
return ((t = u.encodeEntities) !== null && t !== void 0 ? t : u.decodeEntities) !== !1 && !(!u.xmlMode && e.parent && La.has(e.parent.name)) && (a = u.xmlMode || u.encodeEntities !== "utf8" ? s0(a) : Ca(a)), a;
}
function wa(e) {
return `<![CDATA[${e.children[0].data}]]>`;
}
function Ua(e) {
return `<!--${e.data}-->`;
}
function n0(e, u) {
return Tu(e, u);
}
function Ha(e, u) {
return M(e) ? e.children.map((t) => n0(t, u)).join("") : "";
}
function uu(e) {
return Array.isArray(e) ? e.map(uu).join("") : x(e) ? e.name === "br" ? `
` : uu(e.children) : bu(e) ? uu(e.children) : Z(e) ? e.data : "";
}
function Ne(e) {
return Array.isArray(e) ? e.map(Ne).join("") : M(e) && !Eu(e) ? Ne(e.children) : Z(e) ? e.data : "";
}
function au(e) {
return Array.isArray(e) ? e.map(au).join("") : M(e) && (e.type === D.Tag || bu(e)) ? au(e.children) : Z(e) ? e.data : "";
}
function mu(e) {
return M(e) ? e.children : [];
}
function i0(e) {
return e.parent || null;
}
function c0(e) {
const u = i0(e);
if (u != null)
return mu(u);
const t = [e];
let { prev: a, next: r } = e;
for (; a != null; )
t.unshift(a), { prev: a } = a;
for (; r != null; )
t.push(r), { next: r } = r;
return t;
}
function va(e, u) {
var t;
return (t = e.attribs) === null || t === void 0 ? void 0 : t[u];
}
function qa(e, u) {
return e.attribs != null && Object.prototype.hasOwnProperty.call(e.attribs, u) && e.attribs[u] != null;
}
function Ya(e) {
return e.name;
}
function at(e) {
let { next: u } = e;
for (; u !== null && !x(u); )
({ next: u } = u);
return u;
}
function st(e) {
let { prev: u } = e;
for (; u !== null && !x(u); )
({ prev: u } = u);
return u;
}
function Te(e) {
if (e.prev && (e.prev.next = e.next), e.next && (e.next.prev = e.prev), e.parent) {
const u = e.parent.children, t = u.lastIndexOf(e);
t >= 0 && u.splice(t, 1);
}
e.next = null, e.prev = null, e.parent = null;
}
function Va(e, u) {
const t = u.prev = e.prev;
t && (t.next = u);
const a = u.next = e.next;
a && (a.prev = u);
const r = u.parent = e.parent;
if (r) {
const n = r.children;
n[n.lastIndexOf(e)] = u, e.parent = null;
}
}
function Ga(e, u) {
if (Te(u), u.next = null, u.parent = e, e.children.push(u) > 1) {
const t = e.children[e.children.length - 2];
t.next = u, u.prev = t;
} else
u.prev = null;
}
function Qa(e, u) {
Te(u);
const { parent: t } = e, a = e.next;
if (u.next = a, u.prev = e, e.next = u, u.parent = t, a) {
if (a.prev = u, t) {
const r = t.children;
r.splice(r.lastIndexOf(a), 0, u);
}
} else t && t.children.push(u);
}
function Wa(e, u) {
if (Te(u), u.parent = e, u.prev = null, e.children.unshift(u) !== 1) {
const t = e.children[1];
t.prev = u, u.next = t;
} else
u.next = null;
}
function Xa(e, u) {
Te(u);
const { parent: t } = e;
if (t) {
const a = t.children;
a.splice(a.indexOf(e), 0, u);
}
e.prev && (e.prev.next = u), u.parent = t, u.prev = e.prev, u.next = e, e.prev = u;
}
function Qe(e, u, t = !0, a = 1 / 0) {
return rt(e, Array.isArray(u) ? u : [u], t, a);
}
function rt(e, u, t, a) {
const r = [], n = [Array.isArray(u) ? u : [u]], i = [0];
for (; ; ) {
if (i[0] >= n[0].length) {
if (i.length === 1)
return r;
n.shift(), i.shift();
continue;
}
const f = n[0][i[0]++];
if (e(f) && (r.push(f), --a <= 0))
return r;
t && M(f) && f.children.length > 0 && (i.unshift(0), n.unshift(f.children));
}
}
function Ka(e, u) {
return u.find(e);
}
function nt(e, u, t = !0) {
const a = Array.isArray(u) ? u : [u];
for (let r = 0; r < a.length; r++) {
const n = a[r];
if (x(n) && e(n))
return n;
if (t && M(n) && n.children.length > 0) {
const i = nt(e, n.children, !0);
if (i)
return i;
}
}
return null;
}
function o0(e, u) {
return (Array.isArray(u) ? u : [u]).some((t) => x(t) && e(t) || M(t) && o0(e, t.children));
}
function ja(e, u) {
const t = [], a = [Array.isArray(u) ? u : [u]], r = [0];
for (; ; ) {
if (r[0] >= a[0].length) {
if (a.length === 1)
return t;
a.shift(), r.shift();
continue;
}
const n = a[0][r[0]++];
x(n) && e(n) && t.push(n), M(n) && n.children.length > 0 && (r.unshift(0), a.unshift(n.children));
}
}
const su = {
tag_name(e) {
return typeof e == "function" ? (u) => x(u) && e(u.name) : e === "*" ? x : (u) => x(u) && u.name === e;
},
tag_type(e) {
return typeof e == "function" ? (u) => e(u.type) : (u) => u.type === e;
},
tag_contains(e) {
return typeof e == "function" ? (u) => Z(u) && e(u.data) : (u) => Z(u) && u.data === e;
}
};
function it(e, u) {
return typeof u == "function" ? (t) => x(t) && u(t.attribs[e]) : (t) => x(t) && t.attribs[e] === u;
}
function $a(e, u) {
return (t) => e(t) || u(t);
}
function d0(e) {
const u = Object.keys(e).map((t) => {
const a = e[t];
return Object.prototype.hasOwnProperty.call(su, t) ? su[t](a) : it(t, a);
});
return u.length === 0 ? null : u.reduce($a);
}
function za(e, u) {
const t = d0(e);
return t ? t(u) : !0;
}
function Za(e, u, t, a = 1 / 0) {
const r = d0(e);
return r ? Qe(r, u, t, a) : [];
}
function Ja(e, u, t = !0) {
return Array.isArray(u) || (u = [u]), nt(it("id", e), u, t);
}
function Se(e, u, t = !0, a = 1 / 0) {
return Qe(su.tag_name(e), u, t, a);
}
function es(e, u, t = !0, a = 1 / 0) {
return Qe(it("class", e), u, t, a);
}
function us(e, u, t = !0, a = 1 / 0) {
return Qe(su.tag_type(e), u, t, a);
}
function ts(e) {
let u = e.length;
for (; --u >= 0; ) {
const t = e[u];
if (u > 0 && e.lastIndexOf(t, u - 1) >= 0) {
e.splice(u, 1);
continue;
}
for (let a = t.parent; a; a = a.parent)
if (e.includes(a)) {
e.splice(u, 1);
break;
}
}
return e;
}
var W;
(function(e) {
e[e.DISCONNECTED = 1] = "DISCONNECTED", e[e.PRECEDING = 2] = "PRECEDING", e[e.FOLLOWING = 4] = "FOLLOWING", e[e.CONTAINS = 8] = "CONTAINS", e[e.CONTAINED_BY = 16] = "CONTAINED_BY";
})(W || (W = {}));
function f0(e, u) {
const t = [], a = [];
if (e === u)
return 0;
let r = M(e) ? e : e.parent;
for (; r; )
t.unshift(r), r = r.parent;
for (r = M(u) ? u : u.parent; r; )
a.unshift(r), r = r.parent;
const n = Math.min(t.length, a.length);
let i = 0;
for (; i < n && t[i] === a[i]; )
i++;
if (i === 0)
return W.DISCONNECTED;
const f = t[i - 1], l = f.children, b = t[i], m = a[i];
return l.indexOf(b) > l.indexOf(m) ? f === u ? W.FOLLOWING | W.CONTAINED_BY : W.FOLLOWING : f === e ? W.PRECEDING | W.CONTAINS : W.PRECEDING;
}
function Ce(e) {
return e = e.filter((u, t, a) => !a.includes(u, t + 1)), e.sort((u, t) => {
const a = f0(u, t);
return a & W.PRECEDING ? -1 : a & W.FOLLOWING ? 1 : 0;
}), e;
}
function as(e) {
const u = ru(cs, e);
return u ? u.name === "feed" ? ss(u) : rs(u) : null;
}
function ss(e) {
var u;
const t = e.children, a = {
type: "atom",
items: Se("entry", t).map((i) => {
var f;
const { children: l } = i, b = { media: l0(l) };
V(b, "id", "id", l), V(b, "title", "title", l);
const m = (f = ru("link", l)) === null || f === void 0 ? void 0 : f.attribs.href;
m && (b.link = m);
const p = re("summary", l) || re("content", l);
p && (b.description = p);
const g = re("updated", l);
return g && (b.pubDate = new Date(g)), b;
})
};
V(a, "id", "id", t), V(a, "title", "title", t);
const r = (u = ru("link", t)) === null || u === void 0 ? void 0 : u.attribs.href;
r && (a.link = r), V(a, "description", "subtitle", t);
const n = re("updated", t);
return n && (a.updated = new Date(n)), V(a, "author", "email", t, !0), a;
}
function rs(e) {
var u, t;
const a = (t = (u = ru("channel", e.children)) === null || u === void 0 ? void 0 : u.children) !== null && t !== void 0 ? t : [], r = {
type: e.name.substr(0, 3),
id: "",
items: Se("item", e.children).map((i) => {
const { children: f } = i, l = { media: l0(f) };
V(l, "id", "guid", f), V(l, "title", "title", f), V(l, "link", "link", f), V(l, "description", "description", f);
const b = re("pubDate", f) || re("dc:date", f);
return b && (l.pubDate = new Date(b)), l;
})
};
V(r, "title", "title", a), V(r, "link", "link", a), V(r, "description", "description", a);
const n = re("lastBuildDate", a);
return n && (r.updated = new Date(n)), V(r, "author", "managingEditor", a, !0), r;
}
const ns = ["url", "type", "lang"], is = [
"fileSize",
"bitrate",
"framerate",
"samplingrate",
"channels",
"duration",
"height",
"width"
];
function l0(e) {
return Se("media:content", e).map((u) => {
const { attribs: t } = u, a = {
medium: t.medium,
isDefault: !!t.isDefault
};
for (const r of ns)
t[r] && (a[r] = t[r]);
for (const r of is)
t[r] && (a[r] = parseInt(t[r], 10));
return t.expression && (a.expression = t.expression), a;
});
}
function ru(e, u) {
return Se(e, u, !0, 1)[0];
}
function re(e, u, t = !1) {
return Ne(Se(e, u, t, 1)).trim();
}
function V(e, u, t, a, r = !1) {
const n = re(t, a, r);
n && (e[u] = n);
}
function cs(e) {
return e === "rss" || e === "feed" || e === "rdf:RDF";
}
const Au = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
get DocumentPosition() {
return W;
},
append: Qa,
appendChild: Ga,
compareDocumentPosition: f0,
existsOne: o0,
filter: Qe,
find: rt,
findAll: ja,
findOne: nt,
findOneChild: Ka,
getAttributeValue: va,
getChildren: mu,
getElementById: Ja,
getElements: Za,
getElementsByClassName: es,
getElementsByTagName: Se,
getElementsByTagType: us,
getFeed: as,
getInnerHTML: Ha,
getName: Ya,
getOuterHTML: n0,
getParent: i0,
getSiblings: c0,
getText: uu,
hasAttrib: qa,
hasChildren: M,
innerText: au,
isCDATA: bu,
isComment: Eu,
isDocument: ce,
isTag: x,
isText: Z,
nextElementSibling: at,
prepend: Xa,
prependChild: Wa,
prevElementSibling: st,
removeElement: Te,
removeSubsets: ts,
replaceElement: Va,
testElement: za,
textContent: Ne,
uniqueSort: Ce
}, Symbol.toStringTag, { value: "Module" })), os = {
_useHtmlParser2: !1
};
function Hu(e, u) {
if (!e)
return u ?? os;
const t = {
_useHtmlParser2: !!e.xmlMode,
...u,
...e
};
return e.xml ? (t._useHtmlParser2 = !0, t.xmlMode = !0, e.xml !== !0 && Object.assign(t, e.xml)) : e.xmlMode && (t._useHtmlParser2 = !0), t;
}
function h0(e, u, t) {
return e ? e(u ?? e._root.children, null, void 0, t).toString() : "";
}
function ds(e, u) {
return typeof e == "object" && e != null && !("length" in e) && !("type" in e);
}
function fs(e, u) {
const t = ds(e) ? (u = e, void 0) : e, a = {
...this === null || this === void 0 ? void 0 : this._options,
...Hu(u)
};
return h0(this, t, a);
}
function ls(e) {
const u = { ...this._options, xmlMode: !0 };
return h0(this, e, u);
}
function qe(e) {
const u = e ?? (this ? this.root() : []);
let t = "";
for (let a = 0; a < u.length; a++)
t += Ne(u[a]);
return t;
}
function hs(e, u, t = typeof u == "boolean" ? u : !1) {
if (!e || typeof e != "string")
return null;
typeof u == "boolean" && (t = u);
const a = this.load(e, this._options, !1);
return t || a("script").remove(), [...a.root()[0].children];
}
function bs() {
return this(this._root);
}
function ct(e, u) {
if (u === e)
return !1;
let t = u;
for (; t && t !== t.parent; )
if (t = t.parent, t === e)
return !0;
return !1;
}
function Es(e) {
return this.root().extract(e);
}
function b0(e, u) {
if (!St(e) || !St(u))
return;
let t = e.length;
const a = +u.length;
for (let r = 0; r < a; r++)
e[t++] = u[r];
return e.length = t, e;
}
function St(e) {
if (Array.isArray(e))
return !0;
if (typeof e != "object" || e === null || !("length" in e) || typeof e.length != "number" || e.length < 0)
return !1;
for (let u = 0; u < e.length; u++)
if (!(u in e))
return !1;
return !0;
}
const Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
contains: ct,
extract: Es,
html: fs,
merge: b0,
parseHTML: hs,
root: bs,
text: qe,
xml: ls
}, Symbol.toStringTag, { value: "Module" }));
function te(e) {
return e.cheerio != null;
}
function ms(e) {
return e.replace(/[._-](\w|$)/g, (u, t) => t.toUpperCase());
}
function As(e) {
return e.replace(/[A-Z]/g, "-$&").toLowerCase();
}
function y(e, u) {
const t = e.length;
for (let a = 0; a < t; a++)
u(e[a], a);
return e;
}
var le;
(function(e) {
e[e.LowerA = 97] = "LowerA", e[e.LowerZ = 122] = "LowerZ", e[e.UpperA = 65] = "UpperA", e[e.UpperZ = 90] = "UpperZ", e[e.Exclamation = 33] = "Exclamation";
})(le || (le = {}));
function vu(e) {
const u = e.indexOf("<");
if (u === -1 || u > e.length - 3)
return !1;
const t = e.charCodeAt(u + 1);
return (t >= le.LowerA && t <= le.LowerZ || t >= le.UpperA && t <= le.UpperZ || t === le.Exclamation) && e.includes(">", u + 2);
}
const _s = /* @__PURE__ */ new Uint16Array(
// prettier-ignore
/* @__PURE__ */ 'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e) => e.charCodeAt(0))
), ps = /* @__PURE__ */ new Uint16Array(
// prettier-ignore
/* @__PURE__ */ "Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((e) => e.charCodeAt(0))
);
var xu;
const gs = /* @__PURE__ */ new Map([
[0, 65533],
// C1 Unicode control character reference replacements
[128, 8364],
[130, 8218],
[131, 402],
[132, 8222],
[133, 8230],
[134, 8224],
[135, 8225],
[136, 710],
[137, 8240],
[138, 352],
[139, 8249],
[140, 338],
[142, 381],
[145, 8216],
[146, 8217],
[147, 8220],
[148, 8221],
[149, 8226],
[150, 8211],
[151, 8212],
[152, 732],
[153, 8482],
[154, 353],
[155, 8250],
[156, 339],
[158, 382],
[159, 376]
]), Ct = (
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, n/no-unsupported-features/es-builtins
(xu = String.fromCodePoint) !== null && xu !== void 0 ? xu : function(e) {
let u = "";
return e > 65535 && (e -= 65536, u += String.fromCharCode(e >>> 10 & 1023 | 55296), e = 56320 | e & 1023), u += String.fromCharCode(e), u;
}
);
function Ns(e) {
var u;
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (u = gs.get(e)) !== null && u !== void 0 ? u : e;
}
var H;
(function(e) {
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
})(H || (H = {}));
const Is = 32;
var ne;
(function(e) {
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
})(ne || (ne = {}));
function qu(e) {
return e >= H.ZERO && e <= H.NINE;
}
function Ss(e) {
return e >= H.UPPER_A && e <= H.UPPER_F || e >= H.LOWER_A && e <= H.LOWER_F;
}
function Cs(e) {
return e >= H.UPPER_A && e <= H.UPPER_Z || e >= H.LOWER_A && e <= H.LOWER_Z || qu(e);
}
function xs(e) {
return e === H.EQUALS || Cs(e);
}
var w;
(function(e) {
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
})(w || (w = {}));
var $;
(function(e) {
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
})($ || ($ = {}));
let Os = class {
constructor(u, t, a) {
this.decodeTree = u, this.emitCodePoint = t, this.errors = a, this.state = w.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = $.Strict;
}
/** Resets the instance to make it reusable. */
startEntity(u) {
this.decodeMode = u, this.state = w.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
}
/**
* Write an entity to the decoder. This can be called multiple times with partial entities.
* If the entity is incomplete, the decoder will return -1.
*
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
* entity is incomplete, and resume when the next string is written.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
write(u, t) {
switch (this.state) {
case w.EntityStart:
return u.charCodeAt(t) === H.NUM ? (this.state = w.NumericStart, this.consumed += 1, this.stateNumericStart(u, t + 1)) : (this.state = w.NamedEntity, this.stateNamedEntity(u, t));
case w.NumericStart:
return this.stateNumericStart(u, t);
case w.NumericDecimal:
return this.stateNumericDecimal(u, t);
case w.NumericHex:
return this.stateNumericHex(u, t);
case w.NamedEntity:
return this.stateNamedEntity(u, t);
}
}
/**
* Switches between the numeric decimal and hexadecimal states.
*
* Equivalent to the `Numeric character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericStart(u, t) {
return t >= u.length ? -1 : (u.charCodeAt(t) | Is) === H.LOWER_X ? (this.state = w.NumericHex, this.consumed += 1, this.stateNumericHex(u, t + 1)) : (this.state = w.NumericDecimal, this.stateNumericDecimal(u, t));
}
addToNumericResult(u, t, a, r) {
if (t !== a) {
const n = a - t;
this.result = this.result * Math.pow(r, n) + Number.parseInt(u.substr(t, n), r), this.consumed += n;
}
}
/**
* Parses a hexadecimal numeric entity.
*
* Equivalent to the `Hexademical character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericHex(u, t) {
const a = t;
for (; t < u.length; ) {
const r = u.charCodeAt(t);
if (qu(r) || Ss(r))
t += 1;
else
return this.addToNumericResult(u, a, t, 16), this.emitNumericEntity(r, 3);
}
return this.addToNumericResult(u, a, t, 16), -1;
}
/**
* Parses a decimal numeric entity.
*
* Equivalent to the `Decimal character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericDecimal(u, t) {
const a = t;
for (; t < u.length; ) {
const r = u.charCodeAt(t);
if (qu(r))
t += 1;
else
return this.addToNumericResult(u, a, t, 10), this.emitNumericEntity(r, 2);
}
return this.addToNumericResult(u, a, t, 10), -1;
}
/**
* Validate and emit a numeric entity.
*
* Implements the logic from the `Hexademical character reference start
* state` and `Numeric character reference end state` in the HTML spec.
*
* @param lastCp The last code point of the entity. Used to see if the
* entity was terminated with a semicolon.
* @param expectedLength The minimum number of characters that should be
* consumed. Used to validate that at least one digit
* was consumed.
* @returns The number of characters that were consumed.
*/
emitNumericEntity(u, t) {
var a;
if (this.consumed <= t)
return (a = this.errors) === null || a === void 0 || a.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
if (u === H.SEMI)
this.consumed += 1;
else if (this.decodeMode === $.Strict)
return 0;
return this.emitCodePoint(Ns(this.result), this.consumed), this.errors && (u !== H.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
}
/**
* Parses a named entity.
*
* Equivalent to the `Named character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNamedEntity(u, t) {
const { decodeTree: a } = this;
let r = a[this.treeIndex], n = (r & ne.VALUE_LENGTH) >> 14;
for (; t < u.length; t++, this.excess++) {
const i = u.charCodeAt(t);
if (this.treeIndex = Ls(a, r, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0)
return this.result === 0 || // If we are parsing an attribute
this.decodeMode === $.Attribute && // We shouldn't have consumed any characters after the entity,
(n === 0 || // And there should be no invalid characters.
xs(i)) ? 0 : this.emitNotTerminatedNamedEntity();
if (r = a[this.treeIndex], n = (r & ne.VALUE_LENGTH) >> 14, n !== 0) {
if (i === H.SEMI)
return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
this.decodeMode !== $.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
}
}
return -1;
}
/**
* Emit a named entity that was not terminated with a semicolon.
*
* @returns The number of characters consumed.
*/
emitNotTerminatedNamedEntity() {
var u;
const { result: t, decodeTree: a } = this, r = (a[t] & ne.VALUE_LENGTH) >> 14;
return this.emitNamedEntityData(t, r, this.consumed), (u = this.errors) === null || u === void 0 || u.missingSemicolonAfterCharacterReference(), this.consumed;
}
/**
* Emit a named entity.
*
* @param result The index of the entity in the decode tree.
* @param valueLength The number of bytes in the entity.
* @param consumed The number of characters consumed.
*
* @returns The number of characters consumed.
*/
emitNamedEntityData(u, t, a) {
const { decodeTree: r } = this;
return this.emitCodePoint(t === 1 ? r[u] & ~ne.VALUE_LENGTH : r[u + 1], a), t === 3 && this.emitCodePoint(r[u + 2], a), a;
}
/**
* Signal to the parser that the end of the input was reached.
*
* Remaining data will be emitted and relevant errors will be produced.
*
* @returns The number of characters consumed.
*/
end() {
var u;
switch (this.state) {
case w.NamedEntity:
return this.result !== 0 && (this.decodeMode !== $.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
// Otherwise, emit a numeric entity if we have one.
case w.NumericDecimal:
return this.emitNumericEntity(0, 2);
case w.NumericHex:
return this.emitNumericEntity(0, 3);
case w.NumericStart:
return (u = this.errors) === null || u === void 0 || u.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
case w.EntityStart:
return 0;
}
}
};
function Ls(e, u, t, a) {
const r = (u & ne.BRANCH_LENGTH) >> 7, n = u & ne.JUMP_TABLE;
if (r === 0)
return n !== 0 && a === n ? t : -1;
if (n) {
const l = a - n;
return l < 0 || l >= r ? -1 : e[t + l] - 1;
}
let i = t, f = i + r - 1;
for (; i <= f; ) {
const l = i + f >>> 1, b = e[l];
if (b < a)
i = l + 1;
else if (b > a)
f = l - 1;
else
return e[l + r];
}
return -1;
}
var S;
(function(e) {
e[e.Tab = 9] = "Tab", e[e.NewLine = 10] = "NewLine", e[e.FormFeed = 12] = "FormFeed", e[e.CarriageReturn = 13] = "CarriageReturn", e[e.Space = 32] = "Space", e[e.ExclamationMark = 33] = "ExclamationMark", e[e.Number = 35] = "Number", e[e.Amp = 38] = "Amp", e[e.SingleQuote = 39] = "SingleQuote", e[e.DoubleQuote = 34] = "DoubleQuote", e[e.Dash = 45] = "Dash", e[e.Slash = 47] = "Slash", e[e.Zero = 48] = "Zero", e[e.Nine = 57] = "Nine", e[e.Semi = 59] = "Semi", e[e.Lt = 60] = "Lt", e[e.Eq = 61] = "Eq", e[e.Gt = 62] = "Gt", e[e.Questionmark = 63] = "Questionmark", e[e.UpperA = 65] = "UpperA", e[e.LowerA = 97] = "LowerA", e[e.UpperF = 70] = "UpperF", e[e.LowerF = 102] = "LowerF", e[e.UpperZ = 90] = "UpperZ", e[e.LowerZ = 122] = "LowerZ", e[e.LowerX = 120] = "LowerX", e[e.OpeningSquareBracket = 91] = "OpeningSquareBracket";
})(S || (S = {}));
var A;
(function(e) {
e[e.Text = 1] = "Text", e[e.BeforeTagName = 2] = "BeforeTagName", e[e.InTagName = 3] = "InTagName", e[e.InSelfClosingTag = 4] = "InSelfClosingTag", e[e.BeforeClosingTagName = 5] = "BeforeClosingTagName", e[e.InClosingTagName = 6] = "InClosingTagName", e[e.AfterClosingTagName = 7] = "AfterClosingTagName", e[e.BeforeAttributeName = 8] = "BeforeAttributeName", e[e.InAttributeName = 9] = "InAttributeName", e[e.AfterAttributeName = 10] = "AfterAttributeName", e[e.BeforeAttributeValue = 11] = "BeforeAttributeValue", e[e.InAttributeValueDq = 12] = "InAttributeValueDq", e[e.InAttributeValueSq = 13] = "InAttributeValueSq", e[e.InAttributeValueNq = 14] = "InAttributeValueNq", e[e.BeforeDeclaration = 15] = "BeforeDeclaration", e[e.InDeclaration = 16] = "InDeclaration", e[e.InProcessingInstruction = 17] = "InProcessingInstruction", e[e.BeforeComment = 18] = "BeforeComment", e[e.CDATASequence = 19] = "CDATASequence", e[e.InSpecialComment = 20] = "InSpecialComment", e[e.InCommentLike = 21] = "InCommentLike", e[e.BeforeSpecialS = 22] = "BeforeSpecialS", e[e.BeforeSpecialT = 23] = "BeforeSpecialT", e[e.SpecialStartSequence = 24] = "SpecialStartSequence", e[e.InSpecialTag = 25] = "InSpecialTag", e[e.InEntity = 26] = "InEntity";
})(A || (A = {}));
function J(e) {
return e === S.Space || e === S.NewLine || e === S.Tab || e === S.FormFeed || e === S.CarriageReturn;
}
function ze(e) {
return e === S.Slash || e === S.Gt || J(e);
}
function Ds(e) {
return e >= S.LowerA && e <= S.LowerZ || e >= S.UpperA && e <= S.UpperZ;
}
var z;
(function(e) {
e[e.NoValue = 0] = "NoValue", e[e.Unquoted = 1] = "Unquoted", e[e.Single = 2] = "Single", e[e.Double = 3] = "Double";
})(z || (z = {}));
const k = {
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
// CDATA[
CdataEnd: new Uint8Array([93, 93, 62]),
// ]]>
CommentEnd: new Uint8Array([45, 45, 62]),
// `-->`
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
// `<\/script`
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
// `</style`
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
// `</title`
TextareaEnd: new Uint8Array([
60,
47,
116,
101,
120,
116,
97,
114,
101,
97
]),
// `</textarea`
XmpEnd: new Uint8Array([60, 47, 120, 109, 112])
// `</xmp`
};
let Rs = class {
constructor({ xmlMode: u = !1, decodeEntities: t = !0 }, a) {
this.cbs = a, this.state = A.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = A.Text, this.isSpecial = !1, this.running = !0, this.offset = 0, this.currentSequence = void 0, this.sequenceIndex = 0, this.xmlMode = u, this.decodeEntities = t, this.entityDecoder = new Os(u ? ps : _s, (r, n) => this.emitCodePoint(r, n));
}
reset() {
this.state = A.Text, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = A.Text, this.currentSequence = void 0, this.running = !0, this.offset = 0;
}
write(u) {
this.offset += this.buffer.length, this.buffer = u, this.parse();
}
end() {
this.running && this.finish();
}
pause() {
this.running = !1;
}
resume() {
this.running = !0, this.index < this.buffer.length + this.offset && this.parse();
}
stateText(u) {
u === S.Lt || !this.decodeEntities && this.fastForwardTo(S.Lt) ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = A.BeforeTagName, this.sectionStart = this.index) : this.decodeEntities && u === S.Amp && this.startEntity();
}
stateSpecialStartSequence(u) {
const t = this.sequenceIndex === this.currentSequence.length;
if (!(t ? (
// If we are at the end of the sequence, make sure the tag name has ended
ze(u)
) : (
// Otherwise, do a case-insensitive comparison
(u | 32) === this.currentSequence[this.sequenceIndex]
)))
this.isSpecial = !1;
else if (!t) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0, this.state = A.InTagName, this.stateInTagName(u);
}
/** Look for an end tag. For <title> tags, also decode entities. */
stateInSpecialTag(u) {
if (this.sequenceIndex === this.currentSequence.length) {
if (u === S.Gt || J(u)) {
const t = this.index - this.currentSequence.length;
if (this.sectionStart < t) {
const a = this.index;
this.index = t, this.cbs.ontext(this.sectionStart, t), this.index = a;
}
this.isSpecial = !1, this.sectionStart = t + 2, this.stateInClosingTagName(u);
return;
}
this.sequenceIndex = 0;
}
(u | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === k.TitleEnd ? this.decodeEntities && u === S.Amp && this.startEntity() : this.fastForwardTo(S.Lt) && (this.sequenceIndex = 1) : this.sequenceIndex = +(u === S.Lt);
}
stateCDATASequence(u) {
u === k.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === k.Cdata.length && (this.state = A.InCommentLike, this.currentSequence = k.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = A.InDeclaration, this.stateInDeclaration(u));
}
/**
* When we wait for one specific character, we can speed things up
* by skipping through the buffer until we find it.
*
* @returns Whether the character was found.
*/
fastForwardTo(u) {
for (; ++this.index < this.buffer.length + this.offset; )
if (this.buffer.charCodeAt(this.index - this.offset) === u)
return !0;
return this.index = this.buffer.length + this.offset - 1, !1;
}
/**
* Comments and CDATA end with `-->` and `]]>`.
*
* Their common qualities are:
* - Their end sequences have a distinct character they start with.
* - That character is then repeated, so we have to check multiple repeats.
* - All characters but the start character of the sequence can be skipped.
*/
stateInCommentLike(u) {
u === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === k.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index, 2) : this.cbs.oncomment(this.sectionStart, this.index, 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = A.Text) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : u !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
}
/**
* HTML only allows ASCII alpha characters (a-z and A-Z) at the beginning of a tag name.
*
* XML allows a lot more characters here (@see https://www.w3.org/TR/REC-xml/#NT-NameStartChar).
* We allow anything that wouldn't end the tag.
*/
isTagStartChar(u) {
return this.xmlMode ? !ze(u) : Ds(u);
}
startSpecial(u, t) {
this.isSpecial = !0, this.currentSequence = u, this.sequenceIndex = t, this.state = A.SpecialStartSequence;
}
stateBeforeTagName(u) {
if (u === S.ExclamationMark)
this.state = A.BeforeDeclaration, this.sectionStart = this.index + 1;
else if (u === S.Questionmark)
this.state = A.InProcessingInstruction, this.sectionStart = this.index + 1;
else if (this.isTagStartChar(u)) {
const t = u | 32;
this.sectionStart = this.index, this.xmlMode ? this.state = A.InTagName : t === k.ScriptEnd[2] ? this.state = A.BeforeSpecialS : t === k.TitleEnd[2] || t === k.XmpEnd[2] ? this.state = A.BeforeSpecialT : this.state = A.InTagName;
} else u === S.Slash ? this.state = A.BeforeClosingTagName : (this.state = A.Text, this.stateText(u));
}
stateInTagName(u) {
ze(u) && (this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = A.BeforeAttributeName, this.stateBeforeAttributeName(u));
}
stateBeforeClosingTagName(u) {
J(u) || (u === S.Gt ? this.state = A.Text : (this.state = this.isTagStartChar(u) ? A.InClosingTagName : A.InSpecialComment, this.sectionStart = this.index));
}
stateInClosingTagName(u) {
(u === S.Gt || J(u)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = A.AfterClosingTagName, this.stateAfterClosingTagName(u));
}
stateAfterClosingTagName(u) {
(u === S.Gt || this.fastForwardTo(S.Gt)) && (this.state = A.Text, this.sectionStart = this.index + 1);
}
stateBeforeAttributeName(u) {
u === S.Gt ? (this.cbs.onopentagend(this.index), this.isSpecial ? (this.state = A.InSpecialTag, this.sequenceIndex = 0) : this.state = A.Text, this.sectionStart = this.index + 1) : u === S.Slash ? this.state = A.InSelfClosingTag : J(u) || (this.state = A.InAttributeName, this.sectionStart = this.index);
}
stateInSelfClosingTag(u) {
u === S.Gt ? (this.cbs.onselfclosingtag(this.index), this.state = A.Text, this.sectionStart = this.index + 1, this.isSpecial = !1) : J(u) || (this.state = A.BeforeAttributeName, this.stateBeforeAttributeName(u));
}
stateInAttributeName(u) {
(u === S.Eq || ze(u)) && (this.cbs.onattribname(this.sectionStart, this.index), this.sectionStart = this.index, this.state = A.AfterAttributeName, this.stateAfterAttributeName(u));
}
stateAfterAttributeName(u) {
u === S.Eq ? this.state = A.BeforeAttributeValue : u === S.Slash || u === S.Gt ? (this.cbs.onattribend(z.NoValue, this.sectionStart), this.sectionStart = -1, this.state = A.BeforeAttributeName, this.stateBeforeAttributeName(u)) : J(u) || (this.cbs.onattribend(z.NoValue, this.sectionStart), this.state = A.InAttributeName, this.sectionStart = this.index);
}
stateBeforeAttributeValue(u) {
u === S.DoubleQuote ? (this.state = A.InAttributeValueDq, this.sectionStart = this.index + 1) : u === S.SingleQuote ? (this.state = A.InAttributeValueSq, this.sectionStart = this.index + 1) : J(u) || (this.sectionStart = this.index, this.state = A.InAttributeValueNq, this.stateInAttributeValueNoQuotes(u));
}
handleInAttributeValue(u, t) {
u === t || !this.decodeEntities && this.fastForwardTo(t) ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(t === S.DoubleQuote ? z.Double : z.Single, this.index + 1), this.state = A.BeforeAttributeName) : this.decodeEntities && u === S.Amp && this.startEntity();
}
stateInAttributeValueDoubleQuotes(u) {
this.handleInAttributeValue(u, S.DoubleQuote);
}
stateInAttributeValueSingleQuotes(u) {
this.handleInAttributeValue(u, S.SingleQuote);
}
stateInAttributeValueNoQuotes(u) {
J(u) || u === S.Gt ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(z.Unquoted, this.index), this.state = A.BeforeAttributeName, this.stateBeforeAttributeName(u)) : this.decodeEntities && u === S.Amp && this.startEntity();
}
stateBeforeDeclaration(u) {
u === S.OpeningSquareBracket ? (this.state = A.CDATASequence, this.sequenceIndex = 0) : this.state = u === S.Dash ? A.BeforeComment : A.InDeclaration;
}
stateInDeclaration(u) {
(u === S.Gt || this.fastForwardTo(S.Gt)) && (this.cbs.ondeclaration(this.sectionStart, this.index), this.state = A.Text, this.sectionStart = this.index + 1);
}
stateInProcessingInstruction(u) {
(u === S.Gt || this.fastForwardTo(S.Gt)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = A.Text, this.sectionStart = this.index + 1);
}
stateBeforeComment(u) {
u === S.Dash ? (this.state = A.InCommentLike, this.currentSequence = k.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = A.InDeclaration;
}
stateInSpecialComment(u) {
(u === S.Gt || this.fastForwardTo(S.Gt)) && (this.cbs.oncomment(this.sectionStart, this.index, 0), this.state = A.Text, this.sectionStart = this.index + 1);
}
stateBeforeSpecialS(u) {
const t = u | 32;
t === k.ScriptEnd[3] ? this.startSpecial(k.ScriptEnd, 4) : t === k.StyleEnd[3] ? this.startSpecial(k.StyleEnd, 4) : (this.state = A.InTagName, this.stateInTagName(u));
}
stateBeforeSpecialT(u) {
switch (u | 32) {
case k.TitleEnd[3]: {
this.startSpecial(k.TitleEnd, 4);
break;
}
case k.TextareaEnd[3]: {
this.startSpecial(k.TextareaEnd, 4);
break;
}
case k.XmpEnd[3]: {
this.startSpecial(k.XmpEnd, 4);
break;
}
default:
this.state = A.InTagName, this.stateInTagName(u);
}
}
startEntity() {
this.baseState = this.state, this.state = A.InEntity, this.entityStart = this.index, this.entityDecoder.startEntity(this.xmlMode ? $.Strict : this.baseState === A.Text || this.baseState === A.InSpecialTag ? $.Legacy : $.Attribute);
}
stateInEntity() {
const u = this.entityDecoder.write(this.buffer, this.index - this.offset);
u >= 0 ? (this.state = this.baseState, u === 0 && (this.index = this.entityStart)) : this.index = this.offset + this.buffer.length - 1;
}
/**
* Remove data that has already been consumed from the buffer.
*/
cleanup() {
this.running && this.sectionStart !== this.index && (this.state === A.Text || this.state === A.InSpecialTag && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === A.InAttributeValueDq || this.state === A.InAttributeValueSq || this.state === A.InAttributeValueNq) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
}
shouldContinue() {
return this.index < this.buffer.length + this.offset && this.running;
}
/**
* Iterates through the buffer, calling the function corresponding to the current state.
*
* States that are more likely to be hit are higher up, as a performance improvement.
*/
parse() {
for (; this.shouldContinue(); ) {
const u = this.buffer.charCodeAt(this.index - this.offset);
switch (this.state) {
case A.Text: {
this.stateText(u);
break;
}
case A.SpecialStartSequence: {
this.stateSpecialStartSequence(u);
break;
}
case A.InSpecialTag: {
this.stateInSpecialTag(u);
break;
}
case A.CDATASequence: {
this.stateCDATASequence(u);
break;
}
case A.InAttributeValueDq: {
this.stateInAttributeValueDoubleQuotes(u);
break;
}
case A.InAttributeName: {
this.stateInAttributeName(u);
break;
}
case A.InCommentLike: {
this.stateInCommentLike(u);
break;
}
case A.InSpecialComment: {
this.stateInSpecialComment(u);
break;
}
case A.BeforeAttributeName: {
this.stateBeforeAttributeName(u);
break;
}
case A.InTagName: {
this.stateInTagName(u);
break;
}
case A.InClosingTagName: {
this.stateInClosingTagName(u);
break;
}
case A.BeforeTagName: {
this.stateBeforeTagName(u);
break;
}
case A.AfterAttributeName: {
this.stateAfterAttributeName(u);
break;
}
case A.InAttributeValueSq: {
this.stateInAttributeValueSingleQuotes(u);
break;
}
case A.BeforeAttributeValue: {
this.stateBeforeAttributeValue(u);
break;
}
case A.BeforeClosingTagName: {
this.stateBeforeClosingTagName(u);
break;
}
case A.AfterClosingTagName: {
this.stateAfterClosingTagName(u);
break;
}
case A.BeforeSpecialS: {
this.stateBeforeSpecialS(u);
break;
}
case A.BeforeSpecialT: {
this.stateBeforeSpecialT(u);
break;
}
case A.InAttributeValueNq: {
this.stateInAttributeValueNoQuotes(u);
break;
}
case A.InSelfClosingTag: {
this.stateInSelfClosingTag(u);
break;
}
case A.InDeclaration: {
this.stateInDeclaration(u);
break;
}
case A.BeforeDeclaration: {
this.stateBeforeDeclaration(u);
break;
}
case A.BeforeComment: {
this.stateBeforeComment(u);
break;
}
case A.InProcessingInstruction: {
this.stateInProcessingInstruction(u);
break;
}
case A.InEntity: {
this.stateInEntity();
break;
}
}
this.index++;
}
this.cleanup();
}
finish() {
this.state === A.InEntity && (this.entityDecoder.end(), this.state = this.baseState), this.handleTrailingData(), this.cbs.onend();
}
/** Handle any trailing data. */
handleTrailingData() {
const u = this.buffer.length + this.offset;
this.sectionStart >= u || (this.state === A.InCommentLike ? this.currentSequence === k.CdataEnd ? this.cbs.oncdata(this.sectionStart, u, 0) : this.cbs.oncomment(this.sectionStart, u, 0) : this.state === A.InTagName || this.state === A.BeforeAttributeName || this.state === A.BeforeAttributeValue || this.state === A.AfterAttributeName || this.state === A.InAttributeName || this.state === A.InAttributeValueSq || this.state === A.InAttributeValueDq || this.state === A.InAttributeValueNq || this.state === A.InClosingTagName || this.cbs.ontext(this.sectionStart, u));
}
emitCodePoint(u, t) {
this.baseState !== A.Text && this.baseState !== A.InSpecialTag ? (this.sectionStart < this.entityStart && this.cbs.onattribdata(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.onattribentity(u)) : (this.sectionStart < this.entityStart && this.cbs.ontext(this.sectionStart, this.entityStart), this.sectionStart = this.entityStart + t, this.index = this.sectionStart - 1, this.cbs.ontextentity(u, this.sectionStart));
}
};
const pe = /* @__PURE__ */ new Set([
"input",
"option",
"optgroup",
"select",
"button",
"datalist",
"textarea"
]), R = /* @__PURE__ */ new Set(["p"]), xt = /* @__PURE__ */ new Set(["thead", "tbody"]), Ot = /* @__PURE__ */ new Set(["dd", "dt"]), Lt = /* @__PURE__ */ new Set(["rt", "rp"]), Ps = /* @__PURE__ */ new Map([
["tr", /* @__PURE__ */ new Set(["tr", "th", "td"])],
["th", /* @__PURE__ */ new Set(["th"])],
["td", /* @__PURE__ */ new Set(["thead", "th", "td"])],
["body", /* @__PURE__ */ new Set(["head", "link", "script"])],
["li", /* @__PURE__ */ new Set(["li"])],
["p", R],
["h1", R],
["h2", R],
["h3", R],
["h4", R],
["h5", R],
["h6", R],
["select", pe],
["input", pe],
["output", pe],
["button", pe],
["datalist", pe],
["textarea", pe],
["option", /* @__PURE__ */ new Set(["option"])],
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
["dd", Ot],
["dt", Ot],
["address", R],
["article", R],
["aside", R],
["blockquote", R],
["details", R],
["div", R],
["dl", R],
["fieldset", R],
["figcaption", R],
["figure", R],
["footer", R],
["form", R],
["header", R],
["hr", R],
["main", R],
["nav", R],
["ol", R],
["pre", R],
["section", R],
["table", R],
["ul", R],
["rt", Lt],
["rp", Lt],
["tbody", xt],
["tfoot", xt]
]), ys = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]), Dt = /* @__PURE__ */ new Set(["math", "svg"]), Rt = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignobject",
"desc",
"title"
]), Ms = /\s|\//;
let ks = class {
constructor(u, t = {}) {
var a, r, n, i, f, l;
this.options = t, this.startIndex = 0, this.endIndex = 0, this.openTagStart = 0, this.tagname = "", this.attribname = "", this.attribvalue = "", this.attribs = null, this.stack = [], this.buffers = [], this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1, this.cbs = u ?? {}, this.htmlMode = !this.options.xmlMode, this.lowerCaseTagNames = (a = t.lowerCaseTags) !== null && a !== void 0 ? a : this.htmlMode, this.lowerCaseAttributeNames = (r = t.lowerCaseAttributeNames) !== null && r !== void 0 ? r : this.htmlMode, this.recognizeSelfClosing = (n = t.recognizeSelfClosing) !== null && n !== void 0 ? n : !this.htmlMode, this.tokenizer = new ((i = t.Tokenizer) !== null && i !== void 0 ? i : Rs)(this.options, this), this.foreignContext = [!this.htmlMode], (l = (f = this.cbs).onparserinit) === null || l === void 0 || l.call(f, this);
}
// Tokenizer event handlers
/** @internal */
ontext(u, t) {
var a, r;
const n = this.getSlice(u, t);
this.endIndex = t - 1, (r = (a = this.cbs).ontext) === null || r === void 0 || r.call(a, n), this.startIndex = t;
}
/** @internal */
ontextentity(u, t) {
var a, r;
this.endIndex = t - 1, (r = (a = this.cbs).ontext) === null || r === void 0 || r.call(a, Ct(u)), this.startIndex = t;
}
/**
* Checks if the current tag is a void element. Override this if you want
* to specify your own additional void elements.
*/
isVoidElement(u) {
return this.htmlMode && ys.has(u);
}
/** @internal */
onopentagname(u, t) {
this.endIndex = t;
let a = this.getSlice(u, t);
this.lowerCaseTagNames && (a = a.toLowerCase()), this.emitOpenTag(a);
}
emitOpenTag(u) {
var t, a, r, n;
this.openTagStart = this.startIndex, this.tagname = u;
const i = this.htmlMode && Ps.get(u);
if (i)
for (; this.stack.length > 0 && i.has(this.stack[0]); ) {
const f = this.stack.shift();
(a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, f, !0);
}
this.isVoidElement(u) || (this.stack.unshift(u), this.htmlMode && (Dt.has(u) ? this.foreignContext.unshift(!0) : Rt.has(u) && this.foreignContext.unshift(!1))), (n = (r = this.cbs).onopentagname) === null || n === void 0 || n.call(r, u), this.cbs.onopentag && (this.attribs = {});
}
endOpenTag(u) {
var t, a;
this.startIndex = this.openTagStart, this.attribs && ((a = (t = this.cbs).onopentag) === null || a === void 0 || a.call(t, this.tagname, this.attribs, u), this.attribs = null), this.cbs.onclosetag && this.isVoidElement(this.tagname) && this.cbs.onclosetag(this.tagname, !0), this.tagname = "";
}
/** @internal */
onopentagend(u) {
this.endIndex = u, this.endOpenTag(!1), this.startIndex = u + 1;
}
/** @internal */
onclosetag(u, t) {
var a, r, n, i, f, l, b, m;
this.endIndex = t;
let p = this.getSlice(u, t);
if (this.lowerCaseTagNames && (p = p.toLowerCase()), this.htmlMode && (Dt.has(p) || Rt.has(p)) && this.foreignContext.shift(), this.isVoidElement(p))
this.htmlMode && p === "br" && ((i = (n = this.cbs).onopentagname) === null || i === void 0 || i.call(n, "br"), (l = (f = this.cbs).onopentag) === null || l === void 0 || l.call(f, "br", {}, !0), (m = (b = this.cbs).onclosetag) === null || m === void 0 || m.call(b, "br", !1));
else {
const g = this.stack.indexOf(p);
if (g !== -1)
for (let N = 0; N <= g; N++) {
const C = this.stack.shift();
(r = (a = this.cbs).onclosetag) === null || r === void 0 || r.call(a, C, N !== g);
}
else this.htmlMode && p === "p" && (this.emitOpenTag("p"), this.closeCurrentTag(!0));
}
this.startIndex = t + 1;
}
/** @internal */
onselfclosingtag(u) {
this.endIndex = u, this.recognizeSelfClosing || this.foreignContext[0] ? (this.closeCurrentTag(!1), this.startIndex = u + 1) : this.onopentagend(u);
}
closeCurrentTag(u) {
var t, a;
const r = this.tagname;
this.endOpenTag(u), this.stack[0] === r && ((a = (t = this.cbs).onclosetag) === null || a === void 0 || a.call(t, r, !u), this.stack.shift());
}
/** @internal */
onattribname(u, t) {
this.startIndex = u;
const a = this.getSlice(u, t);
this.attribname = this.lowerCaseAttributeNames ? a.toLowerCase() : a;
}
/** @internal */
onattribdata(u, t) {
this.attribvalue += this.getSlice(u, t);
}
/** @internal */
onattribentity(u) {
this.attribvalue += Ct(u);
}
/** @internal */
onattribend(u, t) {
var a, r;
this.endIndex = t, (r = (a = this.cbs).onattribute) === null || r === void 0 || r.call(a, this.attribname, this.attribvalue, u === z.Double ? '"' : u === z.Single ? "'" : u === z.NoValue ? void 0 : null), this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname) && (this.attribs[this.attribname] = this.attribvalue), this.attribvalue = "";
}
getInstructionName(u) {
const t = u.search(Ms);
let a = t < 0 ? u : u.substr(0, t);
return this.lowerCaseTagNames && (a = a.toLowerCase()), a;
}
/** @internal */
ondeclaration(u, t) {
this.endIndex = t;
const a = this.getSlice(u, t);
if (this.cbs.onprocessinginstruction) {
const r = this.getInstructionName(a);
this.cbs.onprocessinginstruction(`!${r}`, `!${a}`);
}
this.startIndex = t + 1;
}
/** @internal */
onprocessinginstruction(u, t) {
this.endIndex = t;
const a = this.getSlice(u, t);
if (this.cbs.onprocessinginstruction) {
const r = this.getInstructionName(a);
this.cbs.onprocessinginstruction(`?${r}`, `?${a}`);
}
this.startIndex = t + 1;
}
/** @internal */
oncomment(u, t, a) {
var r, n, i, f;
this.endIndex = t, (n = (r = this.cbs).oncomment) === null || n === void 0 || n.call(r, this.getSlice(u, t - a)), (f = (i = this.cbs).oncommentend) === null || f === void 0 || f.call(i), this.startIndex = t + 1;
}
/** @internal */
oncdata(u, t, a) {
var r, n, i, f, l, b, m, p, g, N;
this.endIndex = t;
const C = this.getSlice(u, t - a);
!this.htmlMode || this.options.recognizeCDATA ? ((n = (r = this.cbs).oncdatastart) === null || n === void 0 || n.call(r), (f = (i = this.cbs).ontext) === null || f === void 0 || f.call(i, C), (b = (l = this.cbs).oncdataend) === null || b === void 0 || b.call(l)) : ((p = (m = this.cbs).oncomment) === null || p === void 0 || p.call(m, `[CDATA[${C}]]`), (N = (g = this.cbs).oncommentend) === null || N === void 0 || N.call(g)), this.startIndex = t + 1;
}
/** @internal */
onend() {
var u, t;
if (this.cbs.onclosetag) {
this.endIndex = this.startIndex;
for (let a = 0; a < this.stack.length; a++)
this.cbs.onclosetag(this.stack[a], !0);
}
(t = (u = this.cbs).onend) === null || t === void 0 || t.call(u);
}
/**
* Resets the parser to a blank state, ready to parse a new HTML document
*/
reset() {
var u, t, a, r;
(t = (u = this.cbs).onreset) === null || t === void 0 || t.call(u), this.tokenizer.reset(), this.tagname = "", this.attribname = "", this.attribs = null, this.stack.length = 0, this.startIndex = 0, this.endIndex = 0, (r = (a = this.cbs).onparserinit) === null || r === void 0 || r.call(a, this), this.buffers.length = 0, this.foreignContext.length = 0, this.foreignContext.unshift(!this.htmlMode), this.bufferOffset = 0, this.writeIndex = 0, this.ended = !1;
}
/**
* Resets the parser, then parses a complete document and
* pushes it to the handler.
*
* @param data Document to parse.
*/
parseComplete(u) {
this.reset(), this.end(u);
}
getSlice(u, t) {
for (; u - this.bufferOffset >= this.buffers[0].length; )
this.shiftBuffer();
let a = this.buffers[0].slice(u - this.bufferOffset, t - this.bufferOffset);
for (; t - this.bufferOffset > this.buffers[0].length; )
this.shiftBuffer(), a += this.buffers[0].slice(0, t - this.bufferOffset);
return a;
}
shiftBuffer() {
this.bufferOffset += this.buffers[0].length, this.writeIndex--, this.buffers.shift();
}
/**
* Parses a chunk of data and calls the corresponding callbacks.
*
* @param chunk Chunk to parse.
*/
write(u) {
var t, a;
if (this.ended) {
(a = (t = this.cbs).onerror) === null || a === void 0 || a.call(t, new Error(".write() after done!"));
return;
}
this.buffers.push(u), this.tokenizer.running && (this.tokenizer.write(u), this.writeIndex++);
}
/**
* Parses the end of the buffer and clears the stack, calls onend.
*
* @param chunk Optional final chunk to parse.
*/
end(u) {
var t, a;
if (this.ended) {
(a = (t = this.cbs).onerror) === null || a === void 0 || a.call(t, new Error(".end() after done!"));
return;
}
u && this.write(u), this.ended = !0, this.tokenizer.end();
}
/**
* Pauses parsing. The parser won't emit events until `resume` is called.
*/
pause() {
this.tokenizer.pause();
}
/**
* Resumes parsing after `pause` was called.
*/
resume() {
for (this.tokenizer.resume(); this.tokenizer.running && this.writeIndex < this.buffers.length; )
this.tokenizer.write(this.buffers[this.writeIndex++]);
this.ended && this.tokenizer.end();
}
/**
* Alias of `write`, for backwards compatibility.
*
* @param chunk Chunk to parse.
* @deprecated
*/
parseChunk(u) {
this.write(u);
}
/**
* Alias of `end`, for backwards compatibility.
*
* @param chunk Optional final chunk to parse.
* @deprecated
*/
done(u) {
this.end(u);
}
};
function Bs(e, u) {
const t = new ga(void 0, u);
return new ks(t, u).end(e), t.root;
}
var Ou;
const Ye = (
// @ts-expect-error `hasOwn` is a standard object method
(Ou = Object.hasOwn) !== null && Ou !== void 0 ? Ou : ((e, u) => Object.prototype.hasOwnProperty.call(e, u))
), Ve = /\s+/, Yu = "data-", ot = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, Fs = /^{[^]*}$|^\[[^]*]$/;
function nu(e, u, t) {
var a;
if (!(!e || !x(e))) {
if ((a = e.attribs) !== null && a !== void 0 || (e.attribs = {}), !u)
return e.attribs;
if (Ye(e.attribs, u))
return !t && ot.test(u) ? u : e.attribs[u];
if (e.name === "option" && u === "value")
return qe(e.children);
if (e.name === "input" && (e.attribs.type === "radio" || e.attribs.type === "checkbox") && u === "value")
return "on";
}
}
function ge(e, u, t) {
t === null ? T0(e, u) : e.attribs[u] = `${t}`;
}
function ws(e, u) {
if (typeof e == "object" || u !== void 0) {
if (typeof u == "function") {
if (typeof e != "string")
throw new Error("Bad combination of arguments.");
return y(this, (t, a) => {
x(t) && ge(t, e, u.call(t, a, t.attribs[e]));
});
}
return y(this, (t) => {
if (x(t))
if (typeof e == "object")
for (const a of Object.keys(e)) {
const r = e[a];
ge(t, a, r);
}
else
ge(t, e, u);
});
}
return arguments.length > 1 ? this : nu(this[0], e, this.options.xmlMode);
}
function Pt(e, u, t) {
return u in e ? (
// @ts-expect-error TS doesn't like us accessing the value directly here.
e[u]
) : !t && ot.test(u) ? nu(e, u, !1) !== void 0 : nu(e, u, t);
}
function Lu(e, u, t, a) {
u in e ? e[u] = t : ge(e, u, !a && ot.test(u) ? t ? "" : null : `${t}`);
}
function Us(e, u) {
var t;
if (typeof e == "string" && u === void 0) {
const a = this[0];
if (!a)
return;
switch (e) {
case "style": {
const r = this.css(), n = Object.keys(r);
for (let i = 0; i < n.length; i++)
r[i] = n[i];
return r.length = n.length, r;
}
case "tagName":
case "nodeName":
return x(a) ? a.name.toUpperCase() : void 0;
case "href":
case "src": {
if (!x(a))
return;
const r = (t = a.attribs) === null || t === void 0 ? void 0 : t[e];
return typeof URL < "u" && (e === "href" && (a.tagName === "a" || a.tagName === "link") || e === "src" && (a.tagName === "img" || a.tagName === "iframe" || a.tagName === "audio" || a.tagName === "video" || a.tagName === "source")) && r !== void 0 && this.options.baseURI ? new URL(r, this.options.baseURI).href : r;
}
case "innerText":
return au(a);
case "textContent":
return Ne(a);
case "outerHTML":
return a.type === zu ? this.html() : this.clone().wrap("<container />").parent().html();
case "innerHTML":
return this.html();
default:
return x(a) ? Pt(a, e, this.options.xmlMode) : void 0;
}
}
if (typeof e == "object" || u !== void 0) {
if (typeof u == "function") {
if (typeof e == "object")
throw new TypeError("Bad combination of arguments.");
return y(this, (a, r) => {
x(a) && Lu(a, e, u.call(a, r, Pt(a, e, this.options.xmlMode)), this.options.xmlMode);
});
}
return y(this, (a) => {
if (x(a))
if (typeof e == "object")
for (const r of Object.keys(e)) {
const n = e[r];
Lu(a, r, n, this.options.xmlMode);
}
else
Lu(a, e, u, this.options.xmlMode);
});
}
}
function yt(e, u, t) {
var a;
(a = e.data) !== null && a !== void 0 || (e.data = {}), typeof u == "object" ? Object.assign(e.data, u) : typeof u == "string" && t !== void 0 && (e.data[u] = t);
}
function Hs(e) {
for (const u of Object.keys(e.attribs)) {
if (!u.startsWith(Yu))
continue;
const t = ms(u.slice(Yu.length));
Ye(e.data, t) || (e.data[t] = E0(e.attribs[u]));
}
return e.data;
}
function vs(e, u) {
const t = Yu + As(u), a = e.data;
if (Ye(a, u))
return a[u];
if (Ye(e.attribs, t))
return a[u] = E0(e.attribs[t]);
}
function E0(e) {
if (e === "null")
return null;
if (e === "true")
return !0;
if (e === "false")
return !1;
const u = Number(e);
if (e === String(u))
return u;
if (Fs.test(e))
try {
return JSON.parse(e);
} catch {
}
return e;
}
function qs(e, u) {
var t;
const a = this[0];
if (!a || !x(a))
return;
const r = a;
return (t = r.data) !== null && t !== void 0 || (r.data = {}), e == null ? Hs(r) : typeof e == "object" || u !== void 0 ? (y(this, (n) => {
x(n) && (typeof e == "object" ? yt(n, e) : yt(n, e, u));
}), this) : vs(r, e);
}
function Ys(e) {
const u = arguments.length === 0, t = this[0];
if (!t || !x(t))
return u ? void 0 : this;
switch (t.name) {
case "textarea":
return this.text(e);
case "select": {
const a = this.find("option:selected");
if (!u) {
if (this.attr("multiple") == null && typeof e == "object")
return this;
this.find("option").removeAttr("selected");
const r = typeof e == "object" ? e : [e];
for (const n of r)
this.find(`option[value="${n}"]`).attr("selected", "");
return this;
}
return this.attr("multiple") ? a.toArray().map((r) => qe(r.children)) : a.attr("value");
}
case "input":
case "option":
return u ? this.attr("value") : this.attr("value", e);
}
}
function T0(e, u) {
!e.attribs || !Ye(e.attribs, u) || delete e.attribs[u];
}
function iu(e) {
return e ? e.trim().split(Ve) : [];
}
function Vs(e) {
const u = iu(e);
for (const t of u)
y(this, (a) => {
x(a) && T0(a, t);
});
return this;
}
function Gs(e) {
return this.toArray().some((u) => {
const t = x(u) && u.attribs.class;
let a = -1;
if (t && e.length > 0)
for (; (a = t.indexOf(e, a + 1)) > -1; ) {
const r = a + e.length;
if ((a === 0 || Ve.test(t[a - 1])) && (r === t.length || Ve.test(t[r])))
return !0;
}
return !1;
});
}
function m0(e) {
if (typeof e == "function")
return y(this, (a, r) => {
if (x(a)) {
const n = a.attribs.class || "";
m0.call([a], e.call(a, r, n));
}
});
if (!e || typeof e != "string")
return this;
const u = e.split(Ve), t = this.length;
for (let a = 0; a < t; a++) {
const r = this[a];
if (!x(r))
continue;
const n = nu(r, "class", !1);
if (n) {
let i = ` ${n} `;
for (const f of u) {
const l = `${f} `;
i.includes(` ${l}`) || (i += l);
}
ge(r, "class", i.trim());
} else
ge(r, "class", u.join(" ").trim());
}
return this;
}
function A0(e) {
if (typeof e == "function")
return y(this, (r, n) => {
x(r) && A0.call([r], e.call(r, n, r.attribs.class || ""));
});
const u = iu(e), t = u.length, a = arguments.length === 0;
return y(this, (r) => {
if (x(r))
if (a)
r.attribs.class = "";
else {
const n = iu(r.attribs.class);
let i = !1;
for (let f = 0; f < t; f++) {
const l = n.indexOf(u[f]);
l !== -1 && (n.splice(l, 1), i = !0, f--);
}
i && (r.attribs.class = n.join(" "));
}
});
}
function _0(e, u) {
if (typeof e == "function")
return y(this, (i, f) => {
x(i) && _0.call([i], e.call(i, f, i.attribs.class || "", u), u);
});
if (!e || typeof e != "string")
return this;
const t = e.split(Ve), a = t.length, r = typeof u == "boolean" ? u ? 1 : -1 : 0, n = this.length;
for (let i = 0; i < n; i++) {
const f = this[i];
if (!x(f))
continue;
const l = iu(f.attribs.class);
for (let b = 0; b < a; b++) {
const m = l.indexOf(t[b]);
r >= 0 && m === -1 ? l.push(t[b]) : r <= 0 && m !== -1 && l.splice(m, 1);
}
f.attribs.class = l.join(" ");
}
return this;
}
const Qs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
addClass: m0,
attr: ws,
data: qs,
hasClass: Gs,
prop: Us,
removeAttr: Vs,
removeClass: A0,
toggleClass: _0,
val: Ys
}, Symbol.toStringTag, { value: "Module" }));
var I;
(function(e) {
e.Attribute = "attribute", e.Pseudo = "pseudo", e.PseudoElement = "pseudo-element", e.Tag = "tag", e.Universal = "universal", e.Adjacent = "adjacent", e.Child = "child", e.Descendant = "descendant", e.Parent = "parent", e.Sibling = "sibling", e.ColumnCombinator = "column-combinator";
})(I || (I = {}));
var F;
(function(e) {
e.Any = "any", e.Element = "element", e.End = "end", e.Equals = "equals", e.Exists = "exists", e.Hyphen = "hyphen", e.Not = "not", e.Start = "start";
})(F || (F = {}));
const Mt = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/, Ws = /\\([\da-f]{1,6}\s?|(\s)|.)/gi, Xs = /* @__PURE__ */ new Map([
[126, F.Element],
[94, F.Start],
[36, F.End],
[42, F.Any],
[33, F.Not],
[124, F.Hyphen]
]), Ks = /* @__PURE__ */ new Set([
"has",
"not",
"matches",
"is",
"where",
"host",
"host-context"
]);
function Me(e) {
switch (e.type) {
case I.Adjacent:
case I.Child:
case I.Descendant:
case I.Parent:
case I.Sibling:
case I.ColumnCombinator:
return !0;
default:
return !1;
}
}
const js = /* @__PURE__ */ new Set(["contains", "icontains"]);
function $s(e, u, t) {
const a = parseInt(u, 16) - 65536;
return a !== a || t ? u : a < 0 ? (
// BMP codepoint
String.fromCharCode(a + 65536)
) : (
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode(a >> 10 | 55296, a & 1023 | 56320)
);
}
function De(e) {
return e.replace(Ws, $s);
}
function Du(e) {
return e === 39 || e === 34;
}
function kt(e) {
return e === 32 || e === 9 || e === 10 || e === 12 || e === 13;
}
function _u(e) {
const u = [], t = p0(u, `${e}`, 0);
if (t < e.length)
throw new Error(`Unmatched selector: ${e.slice(t)}`);
return u;
}
function p0(e, u, t) {
let a = [];
function r(g) {
const N = u.slice(t + g).match(Mt);
if (!N)
throw new Error(`Expected name, found ${u.slice(t)}`);
const [C] = N;
return t += g + C.length, De(C);
}
function n(g) {
for (t += g; t < u.length && kt(u.charCodeAt(t)); )
t++;
}
function i() {
t += 1;
const g = t;
let N = 1;
for (; N > 0 && t < u.length; t++)
u.charCodeAt(t) === 40 && !f(t) ? N++ : u.charCodeAt(t) === 41 && !f(t) && N--;
if (N)
throw new Error("Parenthesis not matched");
return De(u.slice(g, t - 1));
}
function f(g) {
let N = 0;
for (; u.charCodeAt(--g) === 92; )
N++;
return (N & 1) === 1;
}
function l() {
if (a.length > 0 && Me(a[a.length - 1]))
throw new Error("Did not expect successive traversals.");
}
function b(g) {
if (a.length > 0 && a[a.length - 1].type === I.Descendant) {
a[a.length - 1].type = g;
return;
}
l(), a.push({ type: g });
}
function m(g, N) {
a.push({
type: I.Attribute,
name: g,
action: N,
value: r(1),
namespace: null,
ignoreCase: "quirks"
});
}
function p() {
if (a.length && a[a.length - 1].type === I.Descendant && a.pop(), a.length === 0)
throw new Error("Empty sub-selector");
e.push(a);
}
if (n(0), u.length === t)
return t;
e: for (; t < u.length; ) {
const g = u.charCodeAt(t);
switch (g) {
// Whitespace
case 32:
case 9:
case 10:
case 12:
case 13: {
(a.length === 0 || a[0].type !== I.Descendant) && (l(), a.push({ type: I.Descendant })), n(1);
break;
}
// Traversals
case 62: {
b(I.Child), n(1);
break;
}
case 60: {
b(I.Parent), n(1);
break;
}
case 126: {
b(I.Sibling), n(1);
break;
}
case 43: {
b(I.Adjacent), n(1);
break;
}
// Special attribute selectors: .class, #id
case 46: {
m("class", F.Element);
break;
}
case 35: {
m("id", F.Equals);
break;
}
case 91: {
n(1);
let N, C = null;
u.charCodeAt(t) === 124 ? N = r(1) : u.startsWith("*|", t) ? (C = "*", N = r(2)) : (N = r(0), u.charCodeAt(t) === 124 && u.charCodeAt(t + 1) !== 61 && (C = N, N = r(1))), n(0);
let B = F.Exists;
const X = Xs.get(u.charCodeAt(t));
if (X) {
if (B = X, u.charCodeAt(t + 1) !== 61)
throw new Error("Expected `=`");
n(2);
} else u.charCodeAt(t) === 61 && (B = F.Equals, n(1));
let Ae = "", _e = null;
if (B !== "exists") {
if (Du(u.charCodeAt(t))) {
const $e = u.charCodeAt(t);
let de = t + 1;
for (; de < u.length && (u.charCodeAt(de) !== $e || f(de)); )
de += 1;
if (u.charCodeAt(de) !== $e)
throw new Error("Attribute value didn't end");
Ae = De(u.slice(t + 1, de)), t = de + 1;
} else {
const $e = t;
for (; t < u.length && (!kt(u.charCodeAt(t)) && u.charCodeAt(t) !== 93 || f(t)); )
t += 1;
Ae = De(u.slice($e, t));
}
n(0);
const Le = u.charCodeAt(t) | 32;
Le === 115 ? (_e = !1, n(1)) : Le === 105 && (_e = !0, n(1));
}
if (u.charCodeAt(t) !== 93)
throw new Error("Attribute selector didn't terminate");
t += 1;
const Oe = {
type: I.Attribute,
name: N,
action: B,
value: Ae,
namespace: C,
ignoreCase: _e
};
a.push(Oe);
break;
}
case 58: {
if (u.charCodeAt(t + 1) === 58) {
a.push({
type: I.PseudoElement,
name: r(2).toLowerCase(),
data: u.charCodeAt(t) === 40 ? i() : null
});
continue;
}
const N = r(1).toLowerCase();
let C = null;
if (u.charCodeAt(t) === 40)
if (Ks.has(N)) {
if (Du(u.charCodeAt(t + 1)))
throw new Error(`Pseudo-selector ${N} cannot be quoted`);
if (C = [], t = p0(C, u, t + 1), u.charCodeAt(t) !== 41)
throw new Error(`Missing closing parenthesis in :${N} (${u})`);
t += 1;
} else {
if (C = i(), js.has(N)) {
const B = C.charCodeAt(0);
B === C.charCodeAt(C.length - 1) && Du(B) && (C = C.slice(1, -1));
}
C = De(C);
}
a.push({ type: I.Pseudo, name: N, data: C });
break;
}
case 44: {
p(), a = [], n(1);
break;
}
default: {
if (u.startsWith("/*", t)) {
const B = u.indexOf("*/", t + 2);
if (B < 0)
throw new Error("Comment was not terminated");
t = B + 2, a.length === 0 && n(0);
break;
}
let N = null, C;
if (g === 42)
t += 1, C = "*";
else if (g === 124) {
if (C = "", u.charCodeAt(t + 1) === 124) {
b(I.ColumnCombinator), n(2);
break;
}
} else if (Mt.test(u.slice(t)))
C = r(0);
else
break e;
u.charCodeAt(t) === 124 && u.charCodeAt(t + 1) !== 124 && (N = C, u.charCodeAt(t + 1) === 42 ? (C = "*", t += 2) : C = r(1)), a.push(C === "*" ? { type: I.Universal, namespace: N } : { type: I.Tag, name: C, namespace: N });
}
}
}
return p(), t;
}
function zs(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var Ru, Bt;
function Zs() {
return Bt || (Bt = 1, Ru = {
trueFunc: function() {
return !0;
},
falseFunc: function() {
return !1;
}
}), Ru;
}
var cu = Zs();
const O = /* @__PURE__ */ zs(cu), g0 = /* @__PURE__ */ new Map([
[I.Universal, 50],
[I.Tag, 30],
[I.Attribute, 1],
[I.Pseudo, 0]
]);
function dt(e) {
return !g0.has(e.type);
}
const Js = /* @__PURE__ */ new Map([
[F.Exists, 10],
[F.Equals, 8],
[F.Not, 7],
[F.Start, 6],
[F.End, 6],
[F.Any, 5]
]);
function er(e) {
const u = e.map(N0);
for (let t = 1; t < e.length; t++) {
const a = u[t];
if (!(a < 0))
for (let r = t - 1; r >= 0 && a < u[r]; r--) {
const n = e[r + 1];
e[r + 1] = e[r], e[r] = n, u[r + 1] = u[r], u[r] = a;
}
}
}
function N0(e) {
var u, t;
let a = (u = g0.get(e.type)) !== null && u !== void 0 ? u : -1;
return e.type === I.Attribute ? (a = (t = Js.get(e.action)) !== null && t !== void 0 ? t : 4, e.action === F.Equals && e.name === "id" && (a = 9), e.ignoreCase && (a >>= 1)) : e.type === I.Pseudo && (e.data ? e.name === "has" || e.name === "contains" ? a = 0 : Array.isArray(e.data) ? (a = Math.min(...e.data.map((r) => Math.min(...r.map(N0)))), a < 0 && (a = 0)) : a = 2 : a = 3), a;
}
const ur = /[-[\]{}()*+?.,\\^$|#\s]/g;
function Ft(e) {
return e.replace(ur, "\\$&");
}
const tr = /* @__PURE__ */ new Set([
"accept",
"accept-charset",
"align",
"alink",
"axis",
"bgcolor",
"charset",
"checked",
"clear",
"codetype",
"color",
"compact",
"declare",
"defer",
"dir",
"direction",
"disabled",
"enctype",
"face",
"frame",
"hreflang",
"http-equiv",
"lang",
"language",
"link",
"media",
"method",
"multiple",
"nohref",
"noresize",
"noshade",
"nowrap",
"readonly",
"rel",
"rev",
"rules",
"scope",
"scrolling",
"selected",
"shape",
"target",
"text",
"type",
"valign",
"valuetype",
"vlink"
]);
function fe(e, u) {
return typeof e.ignoreCase == "boolean" ? e.ignoreCase : e.ignoreCase === "quirks" ? !!u.quirksMode : !u.xmlMode && tr.has(e.name);
}
const ar = {
equals(e, u, t) {
const { adapter: a } = t, { name: r } = u;
let { value: n } = u;
return fe(u, t) ? (n = n.toLowerCase(), (i) => {
const f = a.getAttributeValue(i, r);
return f != null && f.length === n.length && f.toLowerCase() === n && e(i);
}) : (i) => a.getAttributeValue(i, r) === n && e(i);
},
hyphen(e, u, t) {
const { adapter: a } = t, { name: r } = u;
let { value: n } = u;
const i = n.length;
return fe(u, t) ? (n = n.toLowerCase(), function(l) {
const b = a.getAttributeValue(l, r);
return b != null && (b.length === i || b.charAt(i) === "-") && b.substr(0, i).toLowerCase() === n && e(l);
}) : function(l) {
const b = a.getAttributeValue(l, r);
return b != null && (b.length === i || b.charAt(i) === "-") && b.substr(0, i) === n && e(l);
};
},
element(e, u, t) {
const { adapter: a } = t, { name: r, value: n } = u;
if (/\s/.test(n))
return O.falseFunc;
const i = new RegExp(`(?:^|\\s)${Ft(n)}(?:$|\\s)`, fe(u, t) ? "i" : "");
return function(l) {
const b = a.getAttributeValue(l, r);
return b != null && b.length >= n.length && i.test(b) && e(l);
};
},
exists(e, { name: u }, { adapter: t }) {
return (a) => t.hasAttrib(a, u) && e(a);
},
start(e, u, t) {
const { adapter: a } = t, { name: r } = u;
let { value: n } = u;
const i = n.length;
return i === 0 ? O.falseFunc : fe(u, t) ? (n = n.toLowerCase(), (f) => {
const l = a.getAttributeValue(f, r);
return l != null && l.length >= i && l.substr(0, i).toLowerCase() === n && e(f);
}) : (f) => {
var l;
return !!(!((l = a.getAttributeValue(f, r)) === null || l === void 0) && l.startsWith(n)) && e(f);
};
},
end(e, u, t) {
const { adapter: a } = t, { name: r } = u;
let { value: n } = u;
const i = -n.length;
return i === 0 ? O.falseFunc : fe(u, t) ? (n = n.toLowerCase(), (f) => {
var l;
return ((l = a.getAttributeValue(f, r)) === null || l === void 0 ? void 0 : l.substr(i).toLowerCase()) === n && e(f);
}) : (f) => {
var l;
return !!(!((l = a.getAttributeValue(f, r)) === null || l === void 0) && l.endsWith(n)) && e(f);
};
},
any(e, u, t) {
const { adapter: a } = t, { name: r, value: n } = u;
if (n === "")
return O.falseFunc;
if (fe(u, t)) {
const i = new RegExp(Ft(n), "i");
return function(l) {
const b = a.getAttributeValue(l, r);
return b != null && b.length >= n.length && i.test(b) && e(l);
};
}
return (i) => {
var f;
return !!(!((f = a.getAttributeValue(i, r)) === null || f === void 0) && f.includes(n)) && e(i);
};
},
not(e, u, t) {
const { adapter: a } = t, { name: r } = u;
let { value: n } = u;
return n === "" ? (i) => !!a.getAttributeValue(i, r) && e(i) : fe(u, t) ? (n = n.toLowerCase(), (i) => {
const f = a.getAttributeValue(i, r);
return (f == null || f.length !== n.length || f.toLowerCase() !== n) && e(i);
}) : (i) => a.getAttributeValue(i, r) !== n && e(i);
}
}, sr = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]), wt = 48, rr = 57;
function nr(e) {
if (e = e.trim().toLowerCase(), e === "even")
return [2, 0];
if (e === "odd")
return [2, 1];
let u = 0, t = 0, a = n(), r = i();
if (u < e.length && e.charAt(u) === "n" && (u++, t = a * (r ?? 1), f(), u < e.length ? (a = n(), f(), r = i()) : a = r = 0), r === null || u < e.length)
throw new Error(`n-th rule couldn't be parsed ('${e}')`);
return [t, a * r];
function n() {
return e.charAt(u) === "-" ? (u++, -1) : (e.charAt(u) === "+" && u++, 1);
}
function i() {
const l = u;
let b = 0;
for (; u < e.length && e.charCodeAt(u) >= wt && e.charCodeAt(u) <= rr; )
b = b * 10 + (e.charCodeAt(u) - wt), u++;
return u === l ? null : b;
}
function f() {
for (; u < e.length && sr.has(e.charCodeAt(u)); )
u++;
}
}
function ir(e) {
const u = e[0], t = e[1] - 1;
if (t < 0 && u <= 0)
return O.falseFunc;
if (u === -1)
return (n) => n <= t;
if (u === 0)
return (n) => n === t;
if (u === 1)
return t < 0 ? O.trueFunc : (n) => n >= t;
const a = Math.abs(u), r = (t % a + a) % a;
return u > 1 ? (n) => n >= t && n % a === r : (n) => n <= t && n % a === r;
}
function Ze(e) {
return ir(nr(e));
}
function Je(e, u) {
return (t) => {
const a = u.getParent(t);
return a != null && u.isTag(a) && e(t);
};
}
const Vu = {
contains(e, u, { adapter: t }) {
return function(r) {
return e(r) && t.getText(r).includes(u);
};
},
icontains(e, u, { adapter: t }) {
const a = u.toLowerCase();
return function(n) {
return e(n) && t.getText(n).toLowerCase().includes(a);
};
},
// Location specific methods
"nth-child"(e, u, { adapter: t, equals: a }) {
const r = Ze(u);
return r === O.falseFunc ? O.falseFunc : r === O.trueFunc ? Je(e, t) : function(i) {
const f = t.getSiblings(i);
let l = 0;
for (let b = 0; b < f.length && !a(i, f[b]); b++)
t.isTag(f[b]) && l++;
return r(l) && e(i);
};
},
"nth-last-child"(e, u, { adapter: t, equals: a }) {
const r = Ze(u);
return r === O.falseFunc ? O.falseFunc : r === O.trueFunc ? Je(e, t) : function(i) {
const f = t.getSiblings(i);
let l = 0;
for (let b = f.length - 1; b >= 0 && !a(i, f[b]); b--)
t.isTag(f[b]) && l++;
return r(l) && e(i);
};
},
"nth-of-type"(e, u, { adapter: t, equals: a }) {
const r = Ze(u);
return r === O.falseFunc ? O.falseFunc : r === O.trueFunc ? Je(e, t) : function(i) {
const f = t.getSiblings(i);
let l = 0;
for (let b = 0; b < f.length; b++) {
const m = f[b];
if (a(i, m))
break;
t.isTag(m) && t.getName(m) === t.getName(i) && l++;
}
return r(l) && e(i);
};
},
"nth-last-of-type"(e, u, { adapter: t, equals: a }) {
const r = Ze(u);
return r === O.falseFunc ? O.falseFunc : r === O.trueFunc ? Je(e, t) : function(i) {
const f = t.getSiblings(i);
let l = 0;
for (let b = f.length - 1; b >= 0; b--) {
const m = f[b];
if (a(i, m))
break;
t.isTag(m) && t.getName(m) === t.getName(i) && l++;
}
return r(l) && e(i);
};
},
// TODO determine the actual root element
root(e, u, { adapter: t }) {
return (a) => {
const r = t.getParent(a);
return (r == null || !t.isTag(r)) && e(a);
};
},
scope(e, u, t, a) {
const { equals: r } = t;
return !a || a.length === 0 ? Vu.root(e, u, t) : a.length === 1 ? (n) => r(a[0], n) && e(n) : (n) => a.includes(n) && e(n);
},
hover: Pu("isHovered"),
visited: Pu("isVisited"),
active: Pu("isActive")
};
function Pu(e) {
return function(t, a, { adapter: r }) {
const n = r[e];
return typeof n != "function" ? O.falseFunc : function(f) {
return n(f) && t(f);
};
};
}
const Ut = {
empty(e, { adapter: u }) {
return !u.getChildren(e).some((t) => (
// FIXME: `getText` call is potentially expensive.
u.isTag(t) || u.getText(t) !== ""
));
},
"first-child"(e, { adapter: u, equals: t }) {
if (u.prevElementSibling)
return u.prevElementSibling(e) == null;
const a = u.getSiblings(e).find((r) => u.isTag(r));
return a != null && t(e, a);
},
"last-child"(e, { adapter: u, equals: t }) {
const a = u.getSiblings(e);
for (let r = a.length - 1; r >= 0; r--) {
if (t(e, a[r]))
return !0;
if (u.isTag(a[r]))
break;
}
return !1;
},
"first-of-type"(e, { adapter: u, equals: t }) {
const a = u.getSiblings(e), r = u.getName(e);
for (let n = 0; n < a.length; n++) {
const i = a[n];
if (t(e, i))
return !0;
if (u.isTag(i) && u.getName(i) === r)
break;
}
return !1;
},
"last-of-type"(e, { adapter: u, equals: t }) {
const a = u.getSiblings(e), r = u.getName(e);
for (let n = a.length - 1; n >= 0; n--) {
const i = a[n];
if (t(e, i))
return !0;
if (u.isTag(i) && u.getName(i) === r)
break;
}
return !1;
},
"only-of-type"(e, { adapter: u, equals: t }) {
const a = u.getName(e);
return u.getSiblings(e).every((r) => t(e, r) || !u.isTag(r) || u.getName(r) !== a);
},
"only-child"(e, { adapter: u, equals: t }) {
return u.getSiblings(e).every((a) => t(e, a) || !u.isTag(a));
}
};
function Ht(e, u, t, a) {
if (t === null) {
if (e.length > a)
throw new Error(`Pseudo-class :${u} requires an argument`);
} else if (e.length === a)
throw new Error(`Pseudo-class :${u} doesn't have any arguments`);
}
const cr = {
// Links
"any-link": ":is(a, area, link)[href]",
link: ":any-link:not(:visited)",
// Forms
// https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
disabled: `:is(
:is(button, input, select, textarea, optgroup, option)[disabled],
optgroup[disabled] > option,
fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
)`,
enabled: ":not(:disabled)",
checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
required: ":is(input, select, textarea)[required]",
optional: ":is(input, select, textarea):not([required])",
// JQuery extensions
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
checkbox: "[type=checkbox]",
file: "[type=file]",
password: "[type=password]",
radio: "[type=radio]",
reset: "[type=reset]",
image: "[type=image]",
submit: "[type=submit]",
parent: ":not(:empty)",
header: ":is(h1, h2, h3, h4, h5, h6)",
button: ":is(button, input[type=button])",
input: ":is(input, textarea, select, button)",
text: "input:is(:not([type!='']), [type=text])"
}, I0 = {};
function or(e, u) {
return e === O.falseFunc ? O.falseFunc : (t) => u.isTag(t) && e(t);
}
function S0(e, u) {
const t = u.getSiblings(e);
if (t.length <= 1)
return [];
const a = t.indexOf(e);
return a < 0 || a === t.length - 1 ? [] : t.slice(a + 1).filter(u.isTag);
}
function Gu(e) {
return {
xmlMode: !!e.xmlMode,
lowerCaseAttributeNames: !!e.lowerCaseAttributeNames,
lowerCaseTags: !!e.lowerCaseTags,
quirksMode: !!e.quirksMode,
cacheResults: !!e.cacheResults,
pseudos: e.pseudos,
adapter: e.adapter,
equals: e.equals
};
}
const yu = (e, u, t, a, r) => {
const n = r(u, Gu(t), a);
return n === O.trueFunc ? e : n === O.falseFunc ? O.falseFunc : (i) => n(i) && e(i);
}, Mu = {
is: yu,
/**
* `:matches` and `:where` are aliases for `:is`.
*/
matches: yu,
where: yu,
not(e, u, t, a, r) {
const n = r(u, Gu(t), a);
return n === O.falseFunc ? e : n === O.trueFunc ? O.falseFunc : (i) => !n(i) && e(i);
},
has(e, u, t, a, r) {
const { adapter: n } = t, i = Gu(t);
i.relativeSelector = !0;
const f = u.some((m) => m.some(dt)) ? (
// Used as a placeholder. Will be replaced with the actual element.
[I0]
) : void 0, l = r(u, i, f);
if (l === O.falseFunc)
return O.falseFunc;
const b = or(l, n);
if (f && l !== O.trueFunc) {
const { shouldTestNextSiblings: m = !1 } = l;
return (p) => {
if (!e(p))
return !1;
f[0] = p;
const g = n.getChildren(p), N = m ? [...g, ...S0(p, n)] : g;
return n.existsOne(b, N);
};
}
return (m) => e(m) && n.existsOne(b, n.getChildren(m));
}
};
function dr(e, u, t, a, r) {
var n;
const { name: i, data: f } = u;
if (Array.isArray(f)) {
if (!(i in Mu))
throw new Error(`Unknown pseudo-class :${i}(${f})`);
return Mu[i](e, f, t, a, r);
}
const l = (n = t.pseudos) === null || n === void 0 ? void 0 : n[i], b = typeof l == "string" ? l : cr[i];
if (typeof b == "string") {
if (f != null)
throw new Error(`Pseudo ${i} doesn't have any arguments`);
const m = _u(b);
return Mu.is(e, m, t, a, r);
}
if (typeof l == "function")
return Ht(l, i, f, 1), (m) => l(m, f) && e(m);
if (i in Vu)
return Vu[i](e, f, t, a);
if (i in Ut) {
const m = Ut[i];
return Ht(m, i, f, 2), (p) => m(p, t, f) && e(p);
}
throw new Error(`Unknown pseudo-class :${i}`);
}
function ku(e, u) {
const t = u.getParent(e);
return t && u.isTag(t) ? t : null;
}
function fr(e, u, t, a, r) {
const { adapter: n, equals: i } = t;
switch (u.type) {
case I.PseudoElement:
throw new Error("Pseudo-elements are not supported by css-select");
case I.ColumnCombinator:
throw new Error("Column combinators are not yet supported by css-select");
case I.Attribute: {
if (u.namespace != null)
throw new Error("Namespaced attributes are not yet supported by css-select");
return (!t.xmlMode || t.lowerCaseAttributeNames) && (u.name = u.name.toLowerCase()), ar[u.action](e, u, t);
}
case I.Pseudo:
return dr(e, u, t, a, r);
// Tags
case I.Tag: {
if (u.namespace != null)
throw new Error("Namespaced tag names are not yet supported by css-select");
let { name: f } = u;
return (!t.xmlMode || t.lowerCaseTags) && (f = f.toLowerCase()), function(b) {
return n.getName(b) === f && e(b);
};
}
// Traversal
case I.Descendant: {
if (t.cacheResults === !1 || typeof WeakSet > "u")
return function(b) {
let m = b;
for (; m = ku(m, n); )
if (e(m))
return !0;
return !1;
};
const f = /* @__PURE__ */ new WeakSet();
return function(b) {
let m = b;
for (; m = ku(m, n); )
if (!f.has(m)) {
if (n.isTag(m) && e(m))
return !0;
f.add(m);
}
return !1;
};
}
case "_flexibleDescendant":
return function(l) {
let b = l;
do
if (e(b))
return !0;
while (b = ku(b, n));
return !1;
};
case I.Parent:
return function(l) {
return n.getChildren(l).some((b) => n.isTag(b) && e(b));
};
case I.Child:
return function(l) {
const b = n.getParent(l);
return b != null && n.isTag(b) && e(b);
};
case I.Sibling:
return function(l) {
const b = n.getSiblings(l);
for (let m = 0; m < b.length; m++) {
const p = b[m];
if (i(l, p))
break;
if (n.isTag(p) && e(p))
return !0;
}
return !1;
};
case I.Adjacent:
return n.prevElementSibling ? function(l) {
const b = n.prevElementSibling(l);
return b != null && e(b);
} : function(l) {
const b = n.getSiblings(l);
let m;
for (let p = 0; p < b.length; p++) {
const g = b[p];
if (i(l, g))
break;
n.isTag(g) && (m = g);
}
return !!m && e(m);
};
case I.Universal: {
if (u.namespace != null && u.namespace !== "*")
throw new Error("Namespaced universal selectors are not yet supported by css-select");
return e;
}
}
}
function C0(e) {
return e.type === I.Pseudo && (e.name === "scope" || Array.isArray(e.data) && e.data.some((u) => u.some(C0)));
}
const lr = { type: I.Descendant }, hr = {
type: "_flexibleDescendant"
}, br = {
type: I.Pseudo,
name: "scope",
data: null
};
function Er(e, { adapter: u }, t) {
const a = !!t?.every((r) => {
const n = u.isTag(r) && u.getParent(r);
return r === I0 || n && u.isTag(n);
});
for (const r of e) {
if (!(r.length > 0 && dt(r[0]) && r[0].type !== I.Descendant)) if (a && !r.some(C0))
r.unshift(lr);
else
continue;
r.unshift(br);
}
}
function x0(e, u, t) {
var a;
e.forEach(er), t = (a = u.context) !== null && a !== void 0 ? a : t;
const r = Array.isArray(t), n = t && (Array.isArray(t) ? t : [t]);
if (u.relativeSelector !== !1)
Er(e, u, n);
else if (e.some((l) => l.length > 0 && dt(l[0])))
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
let i = !1;
const f = e.map((l) => {
if (l.length >= 2) {
const [b, m] = l;
b.type !== I.Pseudo || b.name !== "scope" || (r && m.type === I.Descendant ? l[1] = hr : (m.type === I.Adjacent || m.type === I.Sibling) && (i = !0));
}
return Tr(l, u, n);
}).reduce(mr, O.falseFunc);
return f.shouldTestNextSiblings = i, f;
}
function Tr(e, u, t) {
var a;
return e.reduce((r, n) => r === O.falseFunc ? O.falseFunc : fr(r, n, u, t, x0), (a = u.rootFunc) !== null && a !== void 0 ? a : O.trueFunc);
}
function mr(e, u) {
return u === O.falseFunc || e === O.trueFunc ? e : e === O.falseFunc || u === O.trueFunc ? u : function(a) {
return e(a) || u(a);
};
}
const O0 = (e, u) => e === u, Ar = {
adapter: Au,
equals: O0
};
function _r(e) {
var u, t, a, r;
const n = e ?? Ar;
return (u = n.adapter) !== null && u !== void 0 || (n.adapter = Au), (t = n.equals) !== null && t !== void 0 || (n.equals = (r = (a = n.adapter) === null || a === void 0 ? void 0 : a.equals) !== null && r !== void 0 ? r : O0), n;
}
function pr(e) {
return function(t, a, r) {
const n = _r(a);
return e(t, n, r);
};
}
const ft = pr(x0);
function L0(e, u, t = !1) {
return t && (e = gr(e, u)), Array.isArray(e) ? u.removeSubsets(e) : u.getChildren(e);
}
function gr(e, u) {
const t = Array.isArray(e) ? e.slice(0) : [e], a = t.length;
for (let r = 0; r < a; r++) {
const n = S0(t[r], u);
t.push(...n);
}
return t;
}
const Nr = /* @__PURE__ */ new Set([
"first",
"last",
"eq",
"gt",
"nth",
"lt",
"even",
"odd"
]);
function ou(e) {
return e.type !== "pseudo" ? !1 : Nr.has(e.name) ? !0 : e.name === "not" && Array.isArray(e.data) ? e.data.some((u) => u.some(ou)) : !1;
}
function Ir(e, u, t) {
const a = u != null ? parseInt(u, 10) : NaN;
switch (e) {
case "first":
return 1;
case "nth":
case "eq":
return isFinite(a) ? a >= 0 ? a + 1 : 1 / 0 : 0;
case "lt":
return isFinite(a) ? a >= 0 ? Math.min(a, t) : 1 / 0 : 0;
case "gt":
return isFinite(a) ? 1 / 0 : 0;
case "odd":
return 2 * t;
case "even":
return 2 * t - 1;
case "last":
case "not":
return 1 / 0;
}
}
function Sr(e) {
for (; e.parent; )
e = e.parent;
return e;
}
function lt(e) {
const u = [], t = [];
for (const a of e)
a.some(ou) ? u.push(a) : t.push(a);
return [t, u];
}
const Cr = {
type: I.Universal,
namespace: null
}, xr = {
type: I.Pseudo,
name: "scope",
data: null
};
function D0(e, u, t = {}) {
return R0([e], u, t);
}
function R0(e, u, t = {}) {
if (typeof u == "function")
return e.some(u);
const [a, r] = lt(_u(u));
return a.length > 0 && e.some(ft(a, t)) || r.some((n) => M0(n, e, t).length > 0);
}
function Or(e, u, t, a) {
const r = typeof t == "string" ? parseInt(t, 10) : NaN;
switch (e) {
case "first":
case "lt":
return u;
case "last":
return u.length > 0 ? [u[u.length - 1]] : u;
case "nth":
case "eq":
return isFinite(r) && Math.abs(r) < u.length ? [r < 0 ? u[u.length + r] : u[r]] : [];
case "gt":
return isFinite(r) ? u.slice(r + 1) : [];
case "even":
return u.filter((n, i) => i % 2 === 0);
case "odd":
return u.filter((n, i) => i % 2 === 1);
case "not": {
const n = new Set(y0(t, u, a));
return u.filter((i) => !n.has(i));
}
}
}
function P0(e, u, t = {}) {
return y0(_u(e), u, t);
}
function y0(e, u, t) {
if (u.length === 0)
return [];
const [a, r] = lt(e);
let n;
if (a.length) {
const i = Wu(u, a, t);
if (r.length === 0)
return i;
i.length && (n = new Set(i));
}
for (let i = 0; i < r.length && n?.size !== u.length; i++) {
const f = r[i];
if ((n ? u.filter((m) => x(m) && !n.has(m)) : u).length === 0)
break;
const b = M0(f, u, t);
if (b.length)
if (n)
b.forEach((m) => n.add(m));
else {
if (i === r.length - 1)
return b;
n = new Set(b);
}
}
return typeof n < "u" ? n.size === u.length ? u : (
// Filter elements to preserve order
u.filter((i) => n.has(i))
) : [];
}
function M0(e, u, t) {
var a;
if (e.some(Me)) {
const r = (a = t.root) !== null && a !== void 0 ? a : Sr(u[0]), n = { ...t, context: u, relativeSelector: !1 };
return e.push(xr), du(r, e, n, !0, u.length);
}
return du(u, e, t, !1, u.length);
}
function Lr(e, u, t = {}, a = 1 / 0) {
if (typeof e == "function")
return k0(u, e);
const [r, n] = lt(_u(e)), i = n.map((f) => du(u, f, t, !0, a));
return r.length && i.push(Qu(u, r, t, a)), i.length === 0 ? [] : i.length === 1 ? i[0] : Ce(i.reduce((f, l) => [...f, ...l]));
}
function du(e, u, t, a, r) {
const n = u.findIndex(ou), i = u.slice(0, n), f = u[n], l = u.length - 1 === n ? r : 1 / 0, b = Ir(f.name, f.data, l);
if (b === 0)
return [];
const p = (i.length === 0 && !Array.isArray(e) ? mu(e).filter(x) : i.length === 0 ? (Array.isArray(e) ? e : [e]).filter(x) : a || i.some(Me) ? Qu(e, [i], t, b) : Wu(e, [i], t)).slice(0, b);
let g = Or(f.name, p, f.data, t);
if (g.length === 0 || u.length === n + 1)
return g;
const N = u.slice(n + 1), C = N.some(Me);
if (C) {
if (Me(N[0])) {
const { type: B } = N[0];
(B === I.Sibling || B === I.Adjacent) && (g = L0(g, Au, !0)), N.unshift(Cr);
}
t = {
...t,
// Avoid absolutizing the selector
relativeSelector: !1,
/*
* Add a custom root func, to make sure traversals don't match elements
* that aren't a part of the considered tree.
*/
rootFunc: (B) => g.includes(B)
};
} else t.rootFunc && t.rootFunc !== cu.trueFunc && (t = { ...t, rootFunc: cu.trueFunc });
return N.some(ou) ? du(g, N, t, !1, r) : C ? (
// Query existing elements to resolve traversal.
Qu(g, [N], t, r)
) : (
// If we don't have any more traversals, simply filter elements.
Wu(g, [N], t)
);
}
function Qu(e, u, t, a) {
const r = ft(u, t, e);
return k0(e, r, a);
}
function k0(e, u, t = 1 / 0) {
const a = L0(e, Au, u.shouldTestNextSiblings);
return rt((r) => x(r) && u(r), a, !0, t);
}
function Wu(e, u, t) {
const a = (Array.isArray(e) ? e : [e]).filter(x);
if (a.length === 0)
return a;
const r = ft(u, t);
return r === cu.trueFunc ? a : a.filter(r);
}
const Dr = /^\s*[+~]/;
function Rr(e) {
if (!e)
return this._make([]);
if (typeof e != "string") {
const u = te(e) ? e.toArray() : [e], t = this.toArray();
return this._make(u.filter((a) => t.some((r) => ct(r, a))));
}
return this._findBySelector(e, Number.POSITIVE_INFINITY);
}
function Pr(e, u) {
var t;
const a = this.toArray(), r = Dr.test(e) ? a : this.children().toArray(), n = {
context: a,
root: (t = this._root) === null || t === void 0 ? void 0 : t[0],
// Pass options that are recognized by `cheerio-select`
xmlMode: this.options.xmlMode,
lowerCaseTags: this.options.lowerCaseTags,
lowerCaseAttributeNames: this.options.lowerCaseAttributeNames,
pseudos: this.options.pseudos,
quirksMode: this.options.quirksMode
};
return this._make(Lr(e, r, n, u));
}
function ht(e) {
return function(u, ...t) {
return function(a) {
var r;
let n = e(u, this);
return a && (n = Tt(n, a, this.options.xmlMode, (r = this._root) === null || r === void 0 ? void 0 : r[0])), this._make(
// Post processing is only necessary if there is more than one element.
this.length > 1 && n.length > 1 ? t.reduce((i, f) => f(i), n) : n
);
};
};
}
const We = ht((e, u) => {
let t = [];
for (let a = 0; a < u.length; a++) {
const r = e(u[a]);
r.length > 0 && (t = t.concat(r));
}
return t;
}), bt = ht((e, u) => {
const t = [];
for (let a = 0; a < u.length; a++) {
const r = e(u[a]);
r !== null && t.push(r);
}
return t;
});
function Et(e, ...u) {
let t = null;
const a = ht((r, n) => {
const i = [];
return y(n, (f) => {
for (let l; (l = r(f)) && !t?.(l, i.length); f = l)
i.push(l);
}), i;
})(e, ...u);
return function(r, n) {
t = typeof r == "string" ? (f) => D0(f, r, this.options) : r ? Xe(r) : null;
const i = a.call(this, n);
return t = null, i;
};
}
function xe(e) {
return e.length > 1 ? Array.from(new Set(e)) : e;
}
const yr = bt(({ parent: e }) => e && !ce(e) ? e : null, xe), Mr = We((e) => {
const u = [];
for (; e.parent && !ce(e.parent); )
u.push(e.parent), e = e.parent;
return u;
}, Ce, (e) => e.reverse()), kr = Et(({ parent: e }) => e && !ce(e) ? e : null, Ce, (e) => e.reverse());
function Br(e) {
var u;
const t = [];
if (!e)
return this._make(t);
const a = {
xmlMode: this.options.xmlMode,
root: (u = this._root) === null || u === void 0 ? void 0 : u[0]
}, r = typeof e == "string" ? (n) => D0(n, e, a) : Xe(e);
return y(this, (n) => {
for (n && !ce(n) && !x(n) && (n = n.parent); n && x(n); ) {
if (r(n, 0)) {
t.includes(n) || t.push(n);
break;
}
n = n.parent;
}
}), this._make(t);
}
const Fr = bt((e) => at(e)), wr = We((e) => {
const u = [];
for (; e.next; )
e = e.next, x(e) && u.push(e);
return u;
}, xe), Ur = Et((e) => at(e), xe), Hr = bt((e) => st(e)), vr = We((e) => {
const u = [];
for (; e.prev; )
e = e.prev, x(e) && u.push(e);
return u;
}, xe), qr = Et((e) => st(e), xe), Yr = We((e) => c0(e).filter((u) => x(u) && u !== e), Ce), Vr = We((e) => mu(e).filter(x), xe);
function Gr() {
const e = this.toArray().reduce((u, t) => M(t) ? u.concat(t.children) : u, []);
return this._make(e);
}
function Qr(e) {
let u = 0;
const t = this.length;
for (; u < t && e.call(this[u], u, this[u]) !== !1; )
++u;
return this;
}
function Wr(e) {
let u = [];
for (let t = 0; t < this.length; t++) {
const a = this[t], r = e.call(a, t, a);
r != null && (u = u.concat(r));
}
return this._make(u);
}
function Xe(e) {
return typeof e == "function" ? (u, t) => e.call(u, t, u) : te(e) ? (u) => Array.prototype.includes.call(e, u) : function(u) {
return e === u;
};
}
function Xr(e) {
var u;
return this._make(Tt(this.toArray(), e, this.options.xmlMode, (u = this._root) === null || u === void 0 ? void 0 : u[0]));
}
function Tt(e, u, t, a) {
return typeof u == "string" ? P0(u, e, { xmlMode: t, root: a }) : e.filter(Xe(u));
}
function Kr(e) {
const u = this.toArray();
return typeof e == "string" ? R0(u.filter(x), e, this.options) : e ? u.some(Xe(e)) : !1;
}
function jr(e) {
let u = this.toArray();
if (typeof e == "string") {
const t = new Set(P0(e, u, this.options));
u = u.filter((a) => !t.has(a));
} else {
const t = Xe(e);
u = u.filter((a, r) => !t(a, r));
}
return this._make(u);
}
function $r(e) {
return this.filter(typeof e == "string" ? (
// Using the `:has` selector here short-circuits searches.
`:has(${e})`
) : (u, t) => this._make(t).find(e).length > 0);
}
function zr() {
return this.length > 1 ? this._make(this[0]) : this;
}
function Zr() {
return this.length > 0 ? this._make(this[this.length - 1]) : this;
}
function Jr(e) {
var u;
return e = +e, e === 0 && this.length <= 1 ? this : (e < 0 && (e = this.length + e), this._make((u = this[e]) !== null && u !== void 0 ? u : []));
}
function en(e) {
return e == null ? this.toArray() : this[e < 0 ? this.length + e : e];
}
function un() {
return Array.prototype.slice.call(this);
}
function tn(e) {
let u, t;
return e == null ? (u = this.parent().children(), t = this[0]) : typeof e == "string" ? (u = this._make(e), t = this[0]) : (u = this, t = te(e) ? e[0] : e), Array.prototype.indexOf.call(u, t);
}
function an(e, u) {
return this._make(Array.prototype.slice.call(this, e, u));
}
function sn() {
var e;
return (e = this.prevObject) !== null && e !== void 0 ? e : this._make([]);
}
function rn(e, u) {
const t = this._make(e, u), a = Ce([...this.get(), ...t.get()]);
return this._make(a);
}
function nn(e) {
return this.prevObject ? this.add(e ? this.prevObject.filter(e) : this.prevObject) : this;
}
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
_findBySelector: Pr,
add: rn,
addBack: nn,
children: Vr,
closest: Br,
contents: Gr,
each: Qr,
end: sn,
eq: Jr,
filter: Xr,
filterArray: Tt,
find: Rr,
first: zr,
get: en,
has: $r,
index: tn,
is: Kr,
last: Zr,
map: Wr,
next: Fr,
nextAll: wr,
nextUntil: Ur,
not: jr,
parent: yr,
parents: Mr,
parentsUntil: kr,
prev: Hr,
prevAll: vr,
prevUntil: qr,
siblings: Yr,
slice: an,
toArray: un
}, Symbol.toStringTag, { value: "Module" }));
function on(e) {
return function(t, a, r, n) {
if (typeof Buffer < "u" && Buffer.isBuffer(t) && (t = t.toString()), typeof t == "string")
return e(t, a, r, n);
const i = t;
if (!Array.isArray(i) && ce(i))
return i;
const f = new be([]);
return Ee(i, f), f;
};
}
function Ee(e, u) {
const t = Array.isArray(e) ? e : [e];
u ? u.children = t : u = null;
for (let a = 0; a < t.length; a++) {
const r = t[a];
r.parent && r.parent.children !== t && Te(r), u ? (r.prev = t[a - 1] || null, r.next = t[a + 1] || null) : r.prev = r.next = null, r.parent = u;
}
return u;
}
function dn(e, u) {
if (e == null)
return [];
if (typeof e == "string")
return this._parse(e, this.options, !1, null).children.slice(0);
if ("length" in e) {
if (e.length === 1)
return this._makeDomArray(e[0], u);
const t = [];
for (let a = 0; a < e.length; a++) {
const r = e[a];
if (typeof r == "object") {
if (r == null)
continue;
if (!("length" in r)) {
t.push(u ? ve(r, !0) : r);
continue;
}
}
t.push(...this._makeDomArray(r, u));
}
return t;
}
return [u ? ve(e, !0) : e];
}
function B0(e) {
return function(...u) {
const t = this.length - 1;
return y(this, (a, r) => {
if (!M(a))
return;
const n = typeof u[0] == "function" ? u[0].call(a, r, this._render(a.children)) : u, i = this._makeDomArray(n, r < t);
e(i, a.children, a);
});
};
}
function oe(e, u, t, a, r) {
var n, i;
const f = [
u,
t,
...a
], l = u === 0 ? null : e[u - 1], b = u + t >= e.length ? null : e[u + t];
for (let m = 0; m < a.length; ++m) {
const p = a[m], g = p.parent;
if (g) {
const C = g.children.indexOf(p);
C !== -1 && (g.children.splice(C, 1), r === g && u > C && f[0]--);
}
p.parent = r, p.prev && (p.prev.next = (n = p.next) !== null && n !== void 0 ? n : null), p.next && (p.next.prev = (i = p.prev) !== null && i !== void 0 ? i : null), p.prev = m === 0 ? l : a[m - 1], p.next = m === a.length - 1 ? b : a[m + 1];
}
return l && (l.next = a[0]), b && (b.prev = a[a.length - 1]), e.splice(...f);
}
function fn(e) {
return (te(e) ? e : this._make(e)).append(this), this;
}
function ln(e) {
return (te(e) ? e : this._make(e)).prepend(this), this;
}
const hn = B0((e, u, t) => {
oe(u, u.length, 0, e, t);
}), bn = B0((e, u, t) => {
oe(u, 0, 0, e, t);
});
function F0(e) {
return function(u) {
const t = this.length - 1, a = this.parents().last();
for (let r = 0; r < this.length; r++) {
const n = this[r], i = typeof u == "function" ? u.call(n, r, n) : typeof u == "string" && !vu(u) ? a.find(u).clone() : u, [f] = this._makeDomArray(i, r < t);
if (!f || !M(f))
continue;
let l = f, b = 0;
for (; b < l.children.length; ) {
const m = l.children[b];
x(m) ? (l = m, b = 0) : b++;
}
e(n, l, [f]);
}
return this;
};
}
const En = F0((e, u, t) => {
const { parent: a } = e;
if (!a)
return;
const r = a.children, n = r.indexOf(e);
Ee([e], u), oe(r, n, 0, t, a);
}), Tn = F0((e, u, t) => {
M(e) && (Ee(e.children, u), Ee(t, e));
});
function mn(e) {
return this.parent(e).not("body").each((u, t) => {
this._make(t).replaceWith(t.children);
}), this;
}
function An(e) {
const u = this[0];
if (u) {
const t = this._make(typeof e == "function" ? e.call(u, 0, u) : e).insertBefore(u);
let a;
for (let n = 0; n < t.length; n++)
t[n].type === wu && (a = t[n]);
let r = 0;
for (; a && r < a.children.length; ) {
const n = a.children[r];
n.type === wu ? (a = n, r = 0) : r++;
}
a && this._make(a).append(this);
}
return this;
}
function _n(...e) {
const u = this.length - 1;
return y(this, (t, a) => {
if (!M(t) || !t.parent)
return;
const r = t.parent.children, n = r.indexOf(t);
if (n === -1)
return;
const i = typeof e[0] == "function" ? e[0].call(t, a, this._render(t.children)) : e, f = this._makeDomArray(i, a < u);
oe(r, n + 1, 0, f, t.parent);
});
}
function pn(e) {
typeof e == "string" && (e = this._make(e)), this.remove();
const u = [];
for (const t of this._makeDomArray(e)) {
const a = this.clone().toArray(), { parent: r } = t;
if (!r)
continue;
const n = r.children, i = n.indexOf(t);
i !== -1 && (oe(n, i + 1, 0, a, r), u.push(...a));
}
return this._make(u);
}
function gn(...e) {
const u = this.length - 1;
return y(this, (t, a) => {
if (!M(t) || !t.parent)
return;
const r = t.parent.children, n = r.indexOf(t);
if (n === -1)
return;
const i = typeof e[0] == "function" ? e[0].call(t, a, this._render(t.children)) : e, f = this._makeDomArray(i, a < u);
oe(r, n, 0, f, t.parent);
});
}
function Nn(e) {
const u = this._make(e);
this.remove();
const t = [];
return y(u, (a) => {
const r = this.clone().toArray(), { parent: n } = a;
if (!n)
return;
const i = n.children, f = i.indexOf(a);
f !== -1 && (oe(i, f, 0, r, n), t.push(...r));
}), this._make(t);
}
function In(e) {
const u = e ? this.filter(e) : this;
return y(u, (t) => {
Te(t), t.prev = t.next = t.parent = null;
}), this;
}
function Sn(e) {
return y(this, (u, t) => {
const { parent: a } = u;
if (!a)
return;
const r = a.children, n = typeof e == "function" ? e.call(u, t, u) : e, i = this._makeDomArray(n);
Ee(i, null);
const f = r.indexOf(u);
oe(r, f, 1, i, a), i.includes(u) || (u.parent = u.prev = u.next = null);
});
}
function Cn() {
return y(this, (e) => {
if (M(e)) {
for (const u of e.children)
u.next = u.prev = u.parent = null;
e.children.length = 0;
}
});
}
function xn(e) {
if (e === void 0) {
const u = this[0];
return !u || !M(u) ? null : this._render(u.children);
}
return y(this, (u) => {
if (!M(u))
return;
for (const a of u.children)
a.next = a.prev = a.parent = null;
const t = te(e) ? e.toArray() : this._parse(`${e}`, this.options, !1, u).children;
Ee(t, u);
});
}
function On() {
return this._render(this);
}
function Ln(e) {
return e === void 0 ? qe(this) : typeof e == "function" ? y(this, (u, t) => this._make(u).text(e.call(u, t, qe([u])))) : y(this, (u) => {
if (!M(u))
return;
for (const a of u.children)
a.next = a.prev = a.parent = null;
const t = new He(`${e}`);
Ee(t, u);
});
}
function Dn() {
const e = Array.prototype.map.call(this.get(), (t) => ve(t, !0)), u = new be(e);
for (const t of e)
t.parent = u;
return this._make(e);
}
const Rn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
_makeDomArray: dn,
after: _n,
append: hn,
appendTo: fn,
before: gn,
clone: Dn,
empty: Cn,
html: xn,
insertAfter: pn,
insertBefore: Nn,
prepend: bn,
prependTo: ln,
remove: In,
replaceWith: Sn,
text: Ln,
toString: On,
unwrap: mn,
wrap: En,
wrapAll: An,
wrapInner: Tn
}, Symbol.toStringTag, { value: "Module" }));
function Pn(e, u) {
if (e != null && u != null || // When `prop` is a "plain" object
typeof e == "object" && !Array.isArray(e))
return y(this, (t, a) => {
x(t) && w0(t, e, u, a);
});
if (this.length !== 0)
return U0(this[0], e);
}
function w0(e, u, t, a) {
if (typeof u == "string") {
const r = U0(e), n = typeof t == "function" ? t.call(e, a, r[u]) : t;
n === "" ? delete r[u] : n != null && (r[u] = n), e.attribs.style = yn(r);
} else if (typeof u == "object") {
const r = Object.keys(u);
for (let n = 0; n < r.length; n++) {
const i = r[n];
w0(e, i, u[i], n);
}
}
}
function U0(e, u) {
if (!e || !x(e))
return;
const t = Mn(e.attribs.style);
if (typeof u == "string")
return t[u];
if (Array.isArray(u)) {
const a = {};
for (const r of u)
t[r] != null && (a[r] = t[r]);
return a;
}
return t;
}
function yn(e) {
return Object.keys(e).reduce((u, t) => `${u}${u ? " " : ""}${t}: ${e[t]};`, "");
}
function Mn(e) {
if (e = (e || "").trim(), !e)
return {};
const u = {};
let t;
for (const a of e.split(";")) {
const r = a.indexOf(":");
if (r < 1 || r === a.length - 1) {
const n = a.trimEnd();
n.length > 0 && t !== void 0 && (u[t] += `;${n}`);
} else
t = a.slice(0, r).trim(), u[t] = a.slice(r + 1).trim();
}
return u;
}
const kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
css: Pn
}, Symbol.toStringTag, { value: "Module" })), vt = "input,select,textarea,keygen", Bn = /%20/g, qt = /\r?\n/g;
function Fn() {
return this.serializeArray().map((t) => `${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`).join("&").replace(Bn, "+");
}
function wn() {
return this.map((e, u) => {
const t = this._make(u);
return x(u) && u.name === "form" ? t.find(vt).toArray() : t.filter(vt).toArray();
}).filter(
// Verify elements have a name (`attr.name`) and are not disabled (`:enabled`)
'[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))'
).map((e, u) => {
var t;
const a = this._make(u), r = a.attr("name"), n = (t = a.val()) !== null && t !== void 0 ? t : "";
return Array.isArray(n) ? n.map((i) => (
/*
* We trim replace any line endings (e.g. `\r` or `\r\n` with `\r\n`) to guarantee consistency across platforms
* These can occur inside of `<textarea>'s`
*/
{ name: r, value: i.replace(qt, `\r
`) }
)) : { name: r, value: n.replace(qt, `\r
`) };
}).toArray();
}
const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
serialize: Fn,
serializeArray: wn
}, Symbol.toStringTag, { value: "Module" }));
function Hn(e) {
var u;
return typeof e == "string" ? { selector: e, value: "textContent" } : {
selector: e.selector,
value: (u = e.value) !== null && u !== void 0 ? u : "textContent"
};
}
function vn(e) {
const u = {};
for (const t in e) {
const a = e[t], r = Array.isArray(a), { selector: n, value: i } = Hn(r ? a[0] : a), f = typeof i == "function" ? i : typeof i == "string" ? (l) => this._make(l).prop(i) : (l) => this._make(l).extract(i);
if (r)
u[t] = this._findBySelector(n, Number.POSITIVE_INFINITY).map((l, b) => f(b, t, u)).get();
else {
const l = this._findBySelector(n, 1);
u[t] = l.length > 0 ? f(l[0], t, u) : void 0;
}
}
return u;
}
const qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
extract: vn
}, Symbol.toStringTag, { value: "Module" }));
class Ke {
/**
* Instance of cheerio. Methods are specified in the modules. Usage of this
* constructor is not recommended. Please use `$.load` instead.
*
* @private
* @param elements - The new selection.
* @param root - Sets the root node.
* @param options - Options for the instance.
*/
constructor(u, t, a) {
if (this.length = 0, this.options = a, this._root = t, u) {
for (let r = 0; r < u.length; r++)
this[r] = u[r];
this.length = u.length;
}
}
}
Ke.prototype.cheerio = "[cheerio object]";
Ke.prototype.splice = Array.prototype.splice;
Ke.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
Object.assign(Ke.prototype, Qs, cn, Rn, kn, Un, qn);
function Yn(e, u) {
return function t(a, r, n = !0) {
if (a == null)
throw new Error("cheerio.load() expects a string");
const i = Hu(r), f = e(a, i, n, null);
class l extends Ke {
_make(p, g) {
const N = b(p, g);
return N.prevObject = this, N;
}
_parse(p, g, N, C) {
return e(p, g, N, C);
}
_render(p) {
return u(p, this.options);
}
}
function b(m, p, g = f, N) {
if (m && te(m))
return m;
const C = Hu(N, i), B = typeof g == "string" ? [e(g, C, !1, null)] : "length" in g ? g : [g], X = te(B) ? B : new l(B, null, C);
if (X._root = X, !m)
return new l(void 0, X, C);
const Ae = typeof m == "string" && vu(m) ? (
// $(<html>)
e(m, C, !1, null).children
) : Vn(m) ? (
// $(dom)
[m]
) : Array.isArray(m) ? (
// $([dom])
m
) : void 0, _e = new l(Ae, X, C);
if (Ae)
return _e;
if (typeof m != "string")
throw new TypeError("Unexpected type of selector");
let Oe = m;
const Le = p ? (
// If we don't have a context, maybe we have a root, from loading
typeof p == "string" ? vu(p) ? (
// $('li', '<ul>...</ul>')
new l([e(p, C, !1, null)], X, C)
) : (
// $('li', 'ul')
(Oe = `${p} ${Oe}`, X)
) : te(p) ? (
// $('li', $)
p
) : (
// $('li', node), $('li', [nodes])
new l(Array.isArray(p) ? p : [p], X, C)
)
) : X;
return Le ? Le.find(Oe) : _e;
}
return Object.assign(b, Ts, {
load: t,
// `_root` and `_options` are used in static methods.
_root: f,
_options: i,
// Add `fn` for plugins
fn: l.prototype,
// Add the prototype here to maintain `instanceof` behavior.
prototype: l.prototype
}), b;
};
}
function Vn(e) {
return (
// @ts-expect-error: TS doesn't know about the `name` property.
!!e.name || // @ts-expect-error: TS doesn't know about the `type` property.
e.type === zu || // @ts-expect-error: TS doesn't know about the `type` property.
e.type === e0 || // @ts-expect-error: TS doesn't know about the `type` property.
e.type === u0
);
}
const Gn = /* @__PURE__ */ new Set([
65534,
65535,
131070,
131071,
196606,
196607,
262142,
262143,
327678,
327679,
393214,
393215,
458750,
458751,
524286,
524287,
589822,
589823,
655358,
655359,
720894,
720895,
786430,
786431,
851966,
851967,
917502,
917503,
983038,
983039,
1048574,
1048575,
1114110,
1114111
]), P = "�";
var c;
(function(e) {
e[e.EOF = -1] = "EOF", e[e.NULL = 0] = "NULL", e[e.TABULATION = 9] = "TABULATION", e[e.CARRIAGE_RETURN = 13] = "CARRIAGE_RETURN", e[e.LINE_FEED = 10] = "LINE_FEED", e[e.FORM_FEED = 12] = "FORM_FEED", e[e.SPACE = 32] = "SPACE", e[e.EXCLAMATION_MARK = 33] = "EXCLAMATION_MARK", e[e.QUOTATION_MARK = 34] = "QUOTATION_MARK", e[e.AMPERSAND = 38] = "AMPERSAND", e[e.APOSTROPHE = 39] = "APOSTROPHE", e[e.HYPHEN_MINUS = 45] = "HYPHEN_MINUS", e[e.SOLIDUS = 47] = "SOLIDUS", e[e.DIGIT_0 = 48] = "DIGIT_0", e[e.DIGIT_9 = 57] = "DIGIT_9", e[e.SEMICOLON = 59] = "SEMICOLON", e[e.LESS_THAN_SIGN = 60] = "LESS_THAN_SIGN", e[e.EQUALS_SIGN = 61] = "EQUALS_SIGN", e[e.GREATER_THAN_SIGN = 62] = "GREATER_THAN_SIGN", e[e.QUESTION_MARK = 63] = "QUESTION_MARK", e[e.LATIN_CAPITAL_A = 65] = "LATIN_CAPITAL_A", e[e.LATIN_CAPITAL_Z = 90] = "LATIN_CAPITAL_Z", e[e.RIGHT_SQUARE_BRACKET = 93] = "RIGHT_SQUARE_BRACKET", e[e.GRAVE_ACCENT = 96] = "GRAVE_ACCENT", e[e.LATIN_SMALL_A = 97] = "LATIN_SMALL_A", e[e.LATIN_SMALL_Z = 122] = "LATIN_SMALL_Z";
})(c || (c = {}));
const Y = {
DASH_DASH: "--",
CDATA_START: "[CDATA[",
DOCTYPE: "doctype",
SCRIPT: "script",
PUBLIC: "public",
SYSTEM: "system"
};
function H0(e) {
return e >= 55296 && e <= 57343;
}
function Qn(e) {
return e >= 56320 && e <= 57343;
}
function Wn(e, u) {
return (e - 55296) * 1024 + 9216 + u;
}
function v0(e) {
return e !== 32 && e !== 10 && e !== 13 && e !== 9 && e !== 12 && e >= 1 && e <= 31 || e >= 127 && e <= 159;
}
function q0(e) {
return e >= 64976 && e <= 65007 || Gn.has(e);
}
var E;
(function(e) {
e.controlCharacterInInputStream = "control-character-in-input-stream", e.noncharacterInInputStream = "noncharacter-in-input-stream", e.surrogateInInputStream = "surrogate-in-input-stream", e.nonVoidHtmlElementStartTagWithTrailingSolidus = "non-void-html-element-start-tag-with-trailing-solidus", e.endTagWithAttributes = "end-tag-with-attributes", e.endTagWithTrailingSolidus = "end-tag-with-trailing-solidus", e.unexpectedSolidusInTag = "unexpected-solidus-in-tag", e.unexpectedNullCharacter = "unexpected-null-character", e.unexpectedQuestionMarkInsteadOfTagName = "unexpected-question-mark-instead-of-tag-name", e.invalidFirstCharacterOfTagName = "invalid-first-character-of-tag-name", e.unexpectedEqualsSignBeforeAttributeName = "unexpected-equals-sign-before-attribute-name", e.missingEndTagName = "missing-end-tag-name", e.unexpectedCharacterInAttributeName = "unexpected-character-in-attribute-name", e.unknownNamedCharacterReference = "unknown-named-character-reference", e.missingSemicolonAfterCharacterReference = "missing-semicolon-after-character-reference", e.unexpectedCharacterAfterDoctypeSystemIdentifier = "unexpected-character-after-doctype-system-identifier", e.unexpectedCharacterInUnquotedAttributeValue = "unexpected-character-in-unquoted-attribute-value", e.eofBeforeTagName = "eof-before-tag-name", e.eofInTag = "eof-in-tag", e.missingAttributeValue = "missing-attribute-value", e.missingWhitespaceBetweenAttributes = "missing-whitespace-between-attributes", e.missingWhitespaceAfterDoctypePublicKeyword = "missing-whitespace-after-doctype-public-keyword", e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers = "missing-whitespace-between-doctype-public-and-system-identifiers", e.missingWhitespaceAfterDoctypeSystemKeyword = "missing-whitespace-after-doctype-system-keyword", e.missingQuoteBeforeDoctypePublicIdentifier = "missing-quote-before-doctype-public-identifier", e.missingQuoteBeforeDoctypeSystemIdentifier = "missing-quote-before-doctype-system-identifier", e.missingDoctypePublicIdentifier = "missing-doctype-public-identifier", e.missingDoctypeSystemIdentifier = "missing-doctype-system-identifier", e.abruptDoctypePublicIdentifier = "abrupt-doctype-public-identifier", e.abruptDoctypeSystemIdentifier = "abrupt-doctype-system-identifier", e.cdataInHtmlContent = "cdata-in-html-content", e.incorrectlyOpenedComment = "incorrectly-opened-comment", e.eofInScriptHtmlCommentLikeText = "eof-in-script-html-comment-like-text", e.eofInDoctype = "eof-in-doctype", e.nestedComment = "nested-comment", e.abruptClosingOfEmptyComment = "abrupt-closing-of-empty-comment", e.eofInComment = "eof-in-comment", e.incorrectlyClosedComment = "incorrectly-closed-comment", e.eofInCdata = "eof-in-cdata", e.absenceOfDigitsInNumericCharacterReference = "absence-of-digits-in-numeric-character-reference", e.nullCharacterReference = "null-character-reference", e.surrogateCharacterReference = "surrogate-character-reference", e.characterReferenceOutsideUnicodeRange = "character-reference-outside-unicode-range", e.controlCharacterReference = "control-character-reference", e.noncharacterCharacterReference = "noncharacter-character-reference", e.missingWhitespaceBeforeDoctypeName = "missing-whitespace-before-doctype-name", e.missingDoctypeName = "missing-doctype-name", e.invalidCharacterSequenceAfterDoctypeName = "invalid-character-sequence-after-doctype-name", e.duplicateAttribute = "duplicate-attribute", e.nonConformingDoctype = "non-conforming-doctype", e.missingDoctype = "missing-doctype", e.misplacedDoctype = "misplaced-doctype", e.endTagWithoutMatchingOpenElement = "end-tag-without-matching-open-element", e.closingOfElementWithOpenChildElements = "closing-of-element-with-open-child-elements", e.disallowedContentInNoscriptInHead = "disallowed-content-in-noscript-in-head", e.openElementsLeftAfterEof = "open-elements-left-after-eof", e.abandonedHeadElementChild = "abandoned-head-element-child", e.misplacedStartTagForHeadElement = "misplaced-start-tag-for-head-element", e.nestedNoscriptInHead = "nested-noscript-in-head", e.eofInElementThatCanContainOnlyText = "eof-in-element-that-can-contain-only-text";
})(E || (E = {}));
const Xn = 65536;
class Kn {
constructor(u) {
this.handler = u, this.html = "", this.pos = -1, this.lastGapPos = -2, this.gapStack = [], this.skipNextNewLine = !1, this.lastChunkWritten = !1, this.endOfChunkHit = !1, this.bufferWaterline = Xn, this.isEol = !1, this.lineStartPos = 0, this.droppedBufferSize = 0, this.line = 1, this.lastErrOffset = -1;
}
/** The column on the current line. If we just saw a gap (eg. a surrogate pair), return the index before. */
get col() {
return this.pos - this.lineStartPos + +(this.lastGapPos !== this.pos);
}
get offset() {
return this.droppedBufferSize + this.pos;
}
getError(u, t) {
const { line: a, col: r, offset: n } = this, i = r + t, f = n + t;
return {
code: u,
startLine: a,
endLine: a,
startCol: i,
endCol: i,
startOffset: f,
endOffset: f
};
}
_err(u) {
this.handler.onParseError && this.lastErrOffset !== this.offset && (this.lastErrOffset = this.offset, this.handler.onParseError(this.getError(u, 0)));
}
_addGap() {
this.gapStack.push(this.lastGapPos), this.lastGapPos = this.pos;
}
_processSurrogate(u) {
if (this.pos !== this.html.length - 1) {
const t = this.html.charCodeAt(this.pos + 1);
if (Qn(t))
return this.pos++, this._addGap(), Wn(u, t);
} else if (!this.lastChunkWritten)
return this.endOfChunkHit = !0, c.EOF;
return this._err(E.surrogateInInputStream), u;
}
willDropParsedChunk() {
return this.pos > this.bufferWaterline;
}
dropParsedChunk() {
this.willDropParsedChunk() && (this.html = this.html.substring(this.pos), this.lineStartPos -= this.pos, this.droppedBufferSize += this.pos, this.pos = 0, this.lastGapPos = -2, this.gapStack.length = 0);
}
write(u, t) {
this.html.length > 0 ? this.html += u : this.html = u, this.endOfChunkHit = !1, this.lastChunkWritten = t;
}
insertHtmlAtCurrentPos(u) {
this.html = this.html.substring(0, this.pos + 1) + u + this.html.substring(this.pos + 1), this.endOfChunkHit = !1;
}
startsWith(u, t) {
if (this.pos + u.length > this.html.length)
return this.endOfChunkHit = !this.lastChunkWritten, !1;
if (t)
return this.html.startsWith(u, this.pos);
for (let a = 0; a < u.length; a++)
if ((this.html.charCodeAt(this.pos + a) | 32) !== u.charCodeAt(a))
return !1;
return !0;
}
peek(u) {
const t = this.pos + u;
if (t >= this.html.length)
return this.endOfChunkHit = !this.lastChunkWritten, c.EOF;
const a = this.html.charCodeAt(t);
return a === c.CARRIAGE_RETURN ? c.LINE_FEED : a;
}
advance() {
if (this.pos++, this.isEol && (this.isEol = !1, this.line++, this.lineStartPos = this.pos), this.pos >= this.html.length)
return this.endOfChunkHit = !this.lastChunkWritten, c.EOF;
let u = this.html.charCodeAt(this.pos);
return u === c.CARRIAGE_RETURN ? (this.isEol = !0, this.skipNextNewLine = !0, c.LINE_FEED) : u === c.LINE_FEED && (this.isEol = !0, this.skipNextNewLine) ? (this.line--, this.skipNextNewLine = !1, this._addGap(), this.advance()) : (this.skipNextNewLine = !1, H0(u) && (u = this._processSurrogate(u)), this.handler.onParseError === null || u > 31 && u < 127 || u === c.LINE_FEED || u === c.CARRIAGE_RETURN || u > 159 && u < 64976 || this._checkForProblematicCharacters(u), u);
}
_checkForProblematicCharacters(u) {
v0(u) ? this._err(E.controlCharacterInInputStream) : q0(u) && this._err(E.noncharacterInInputStream);
}
retreat(u) {
for (this.pos -= u; this.pos < this.lastGapPos; )
this.lastGapPos = this.gapStack.pop(), this.pos--;
this.isEol = !1;
}
}
var L;
(function(e) {
e[e.CHARACTER = 0] = "CHARACTER", e[e.NULL_CHARACTER = 1] = "NULL_CHARACTER", e[e.WHITESPACE_CHARACTER = 2] = "WHITESPACE_CHARACTER", e[e.START_TAG = 3] = "START_TAG", e[e.END_TAG = 4] = "END_TAG", e[e.COMMENT = 5] = "COMMENT", e[e.DOCTYPE = 6] = "DOCTYPE", e[e.EOF = 7] = "EOF", e[e.HIBERNATION = 8] = "HIBERNATION";
})(L || (L = {}));
function Y0(e, u) {
for (let t = e.attrs.length - 1; t >= 0; t--)
if (e.attrs[t].name === u)
return e.attrs[t].value;
return null;
}
const jn = /* @__PURE__ */ new Uint16Array(
// prettier-ignore
/* @__PURE__ */ 'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((e) => e.charCodeAt(0))
), $n = /* @__PURE__ */ new Map([
[0, 65533],
// C1 Unicode control character reference replacements
[128, 8364],
[130, 8218],
[131, 402],
[132, 8222],
[133, 8230],
[134, 8224],
[135, 8225],
[136, 710],
[137, 8240],
[138, 352],
[139, 8249],
[140, 338],
[142, 381],
[145, 8216],
[146, 8217],
[147, 8220],
[148, 8221],
[149, 8226],
[150, 8211],
[151, 8212],
[152, 732],
[153, 8482],
[154, 353],
[155, 8250],
[156, 339],
[158, 382],
[159, 376]
]);
function zn(e) {
var u;
return e >= 55296 && e <= 57343 || e > 1114111 ? 65533 : (u = $n.get(e)) !== null && u !== void 0 ? u : e;
}
var v;
(function(e) {
e[e.NUM = 35] = "NUM", e[e.SEMI = 59] = "SEMI", e[e.EQUALS = 61] = "EQUALS", e[e.ZERO = 48] = "ZERO", e[e.NINE = 57] = "NINE", e[e.LOWER_A = 97] = "LOWER_A", e[e.LOWER_F = 102] = "LOWER_F", e[e.LOWER_X = 120] = "LOWER_X", e[e.LOWER_Z = 122] = "LOWER_Z", e[e.UPPER_A = 65] = "UPPER_A", e[e.UPPER_F = 70] = "UPPER_F", e[e.UPPER_Z = 90] = "UPPER_Z";
})(v || (v = {}));
const Zn = 32;
var ie;
(function(e) {
e[e.VALUE_LENGTH = 49152] = "VALUE_LENGTH", e[e.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", e[e.JUMP_TABLE = 127] = "JUMP_TABLE";
})(ie || (ie = {}));
function Xu(e) {
return e >= v.ZERO && e <= v.NINE;
}
function Jn(e) {
return e >= v.UPPER_A && e <= v.UPPER_F || e >= v.LOWER_A && e <= v.LOWER_F;
}
function ei(e) {
return e >= v.UPPER_A && e <= v.UPPER_Z || e >= v.LOWER_A && e <= v.LOWER_Z || Xu(e);
}
function ui(e) {
return e === v.EQUALS || ei(e);
}
var U;
(function(e) {
e[e.EntityStart = 0] = "EntityStart", e[e.NumericStart = 1] = "NumericStart", e[e.NumericDecimal = 2] = "NumericDecimal", e[e.NumericHex = 3] = "NumericHex", e[e.NamedEntity = 4] = "NamedEntity";
})(U || (U = {}));
var ue;
(function(e) {
e[e.Legacy = 0] = "Legacy", e[e.Strict = 1] = "Strict", e[e.Attribute = 2] = "Attribute";
})(ue || (ue = {}));
class ti {
constructor(u, t, a) {
this.decodeTree = u, this.emitCodePoint = t, this.errors = a, this.state = U.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = ue.Strict;
}
/** Resets the instance to make it reusable. */
startEntity(u) {
this.decodeMode = u, this.state = U.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
}
/**
* Write an entity to the decoder. This can be called multiple times with partial entities.
* If the entity is incomplete, the decoder will return -1.
*
* Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
* entity is incomplete, and resume when the next string is written.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
write(u, t) {
switch (this.state) {
case U.EntityStart:
return u.charCodeAt(t) === v.NUM ? (this.state = U.NumericStart, this.consumed += 1, this.stateNumericStart(u, t + 1)) : (this.state = U.NamedEntity, this.stateNamedEntity(u, t));
case U.NumericStart:
return this.stateNumericStart(u, t);
case U.NumericDecimal:
return this.stateNumericDecimal(u, t);
case U.NumericHex:
return this.stateNumericHex(u, t);
case U.NamedEntity:
return this.stateNamedEntity(u, t);
}
}
/**
* Switches between the numeric decimal and hexadecimal states.
*
* Equivalent to the `Numeric character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericStart(u, t) {
return t >= u.length ? -1 : (u.charCodeAt(t) | Zn) === v.LOWER_X ? (this.state = U.NumericHex, this.consumed += 1, this.stateNumericHex(u, t + 1)) : (this.state = U.NumericDecimal, this.stateNumericDecimal(u, t));
}
addToNumericResult(u, t, a, r) {
if (t !== a) {
const n = a - t;
this.result = this.result * Math.pow(r, n) + Number.parseInt(u.substr(t, n), r), this.consumed += n;
}
}
/**
* Parses a hexadecimal numeric entity.
*
* Equivalent to the `Hexademical character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericHex(u, t) {
const a = t;
for (; t < u.length; ) {
const r = u.charCodeAt(t);
if (Xu(r) || Jn(r))
t += 1;
else
return this.addToNumericResult(u, a, t, 16), this.emitNumericEntity(r, 3);
}
return this.addToNumericResult(u, a, t, 16), -1;
}
/**
* Parses a decimal numeric entity.
*
* Equivalent to the `Decimal character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNumericDecimal(u, t) {
const a = t;
for (; t < u.length; ) {
const r = u.charCodeAt(t);
if (Xu(r))
t += 1;
else
return this.addToNumericResult(u, a, t, 10), this.emitNumericEntity(r, 2);
}
return this.addToNumericResult(u, a, t, 10), -1;
}
/**
* Validate and emit a numeric entity.
*
* Implements the logic from the `Hexademical character reference start
* state` and `Numeric character reference end state` in the HTML spec.
*
* @param lastCp The last code point of the entity. Used to see if the
* entity was terminated with a semicolon.
* @param expectedLength The minimum number of characters that should be
* consumed. Used to validate that at least one digit
* was consumed.
* @returns The number of characters that were consumed.
*/
emitNumericEntity(u, t) {
var a;
if (this.consumed <= t)
return (a = this.errors) === null || a === void 0 || a.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
if (u === v.SEMI)
this.consumed += 1;
else if (this.decodeMode === ue.Strict)
return 0;
return this.emitCodePoint(zn(this.result), this.consumed), this.errors && (u !== v.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
}
/**
* Parses a named entity.
*
* Equivalent to the `Named character reference state` in the HTML spec.
*
* @param input The string containing the entity (or a continuation of the entity).
* @param offset The current offset.
* @returns The number of characters that were consumed, or -1 if the entity is incomplete.
*/
stateNamedEntity(u, t) {
const { decodeTree: a } = this;
let r = a[this.treeIndex], n = (r & ie.VALUE_LENGTH) >> 14;
for (; t < u.length; t++, this.excess++) {
const i = u.charCodeAt(t);
if (this.treeIndex = ai(a, r, this.treeIndex + Math.max(1, n), i), this.treeIndex < 0)
return this.result === 0 || // If we are parsing an attribute
this.decodeMode === ue.Attribute && // We shouldn't have consumed any characters after the entity,
(n === 0 || // And there should be no invalid characters.
ui(i)) ? 0 : this.emitNotTerminatedNamedEntity();
if (r = a[this.treeIndex], n = (r & ie.VALUE_LENGTH) >> 14, n !== 0) {
if (i === v.SEMI)
return this.emitNamedEntityData(this.treeIndex, n, this.consumed + this.excess);
this.decodeMode !== ue.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
}
}
return -1;
}
/**
* Emit a named entity that was not terminated with a semicolon.
*
* @returns The number of characters consumed.
*/
emitNotTerminatedNamedEntity() {
var u;
const { result: t, decodeTree: a } = this, r = (a[t] & ie.VALUE_LENGTH) >> 14;
return this.emitNamedEntityData(t, r, this.consumed), (u = this.errors) === null || u === void 0 || u.missingSemicolonAfterCharacterReference(), this.consumed;
}
/**
* Emit a named entity.
*
* @param result The index of the entity in the decode tree.
* @param valueLength The number of bytes in the entity.
* @param consumed The number of characters consumed.
*
* @returns The number of characters consumed.
*/
emitNamedEntityData(u, t, a) {
const { decodeTree: r } = this;
return this.emitCodePoint(t === 1 ? r[u] & ~ie.VALUE_LENGTH : r[u + 1], a), t === 3 && this.emitCodePoint(r[u + 2], a), a;
}
/**
* Signal to the parser that the end of the input was reached.
*
* Remaining data will be emitted and relevant errors will be produced.
*
* @returns The number of characters consumed.
*/
end() {
var u;
switch (this.state) {
case U.NamedEntity:
return this.result !== 0 && (this.decodeMode !== ue.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
// Otherwise, emit a numeric entity if we have one.
case U.NumericDecimal:
return this.emitNumericEntity(0, 2);
case U.NumericHex:
return this.emitNumericEntity(0, 3);
case U.NumericStart:
return (u = this.errors) === null || u === void 0 || u.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
case U.EntityStart:
return 0;
}
}
}
function ai(e, u, t, a) {
const r = (u & ie.BRANCH_LENGTH) >> 7, n = u & ie.JUMP_TABLE;
if (r === 0)
return n !== 0 && a === n ? t : -1;
if (n) {
const l = a - n;
return l < 0 || l >= r ? -1 : e[t + l] - 1;
}
let i = t, f = i + r - 1;
for (; i <= f; ) {
const l = i + f >>> 1, b = e[l];
if (b < a)
i = l + 1;
else if (b > a)
f = l - 1;
else
return e[l + r];
}
return -1;
}
var T;
(function(e) {
e.HTML = "http://www.w3.org/1999/xhtml", e.MATHML = "http://www.w3.org/1998/Math/MathML", e.SVG = "http://www.w3.org/2000/svg", e.XLINK = "http://www.w3.org/1999/xlink", e.XML = "http://www.w3.org/XML/1998/namespace", e.XMLNS = "http://www.w3.org/2000/xmlns/";
})(T || (T = {}));
var he;
(function(e) {
e.TYPE = "type", e.ACTION = "action", e.ENCODING = "encoding", e.PROMPT = "prompt", e.NAME = "name", e.COLOR = "color", e.FACE = "face", e.SIZE = "size";
})(he || (he = {}));
var Q;
(function(e) {
e.NO_QUIRKS = "no-quirks", e.QUIRKS = "quirks", e.LIMITED_QUIRKS = "limited-quirks";
})(Q || (Q = {}));
var h;
(function(e) {
e.A = "a", e.ADDRESS = "address", e.ANNOTATION_XML = "annotation-xml", e.APPLET = "applet", e.AREA = "area", e.ARTICLE = "article", e.ASIDE = "aside", e.B = "b", e.BASE = "base", e.BASEFONT = "basefont", e.BGSOUND = "bgsound", e.BIG = "big", e.BLOCKQUOTE = "blockquote", e.BODY = "body", e.BR = "br", e.BUTTON = "button", e.CAPTION = "caption", e.CENTER = "center", e.CODE = "code", e.COL = "col", e.COLGROUP = "colgroup", e.DD = "dd", e.DESC = "desc", e.DETAILS = "details", e.DIALOG = "dialog", e.DIR = "dir", e.DIV = "div", e.DL = "dl", e.DT = "dt", e.EM = "em", e.EMBED = "embed", e.FIELDSET = "fieldset", e.FIGCAPTION = "figcaption", e.FIGURE = "figure", e.FONT = "font", e.FOOTER = "footer", e.FOREIGN_OBJECT = "foreignObject", e.FORM = "form", e.FRAME = "frame", e.FRAMESET = "frameset", e.H1 = "h1", e.H2 = "h2", e.H3 = "h3", e.H4 = "h4", e.H5 = "h5", e.H6 = "h6", e.HEAD = "head", e.HEADER = "header", e.HGROUP = "hgroup", e.HR = "hr", e.HTML = "html", e.I = "i", e.IMG = "img", e.IMAGE = "image", e.INPUT = "input", e.IFRAME = "iframe", e.KEYGEN = "keygen", e.LABEL = "label", e.LI = "li", e.LINK = "link", e.LISTING = "listing", e.MAIN = "main", e.MALIGNMARK = "malignmark", e.MARQUEE = "marquee", e.MATH = "math", e.MENU = "menu", e.META = "meta", e.MGLYPH = "mglyph", e.MI = "mi", e.MO = "mo", e.MN = "mn", e.MS = "ms", e.MTEXT = "mtext", e.NAV = "nav", e.NOBR = "nobr", e.NOFRAMES = "noframes", e.NOEMBED = "noembed", e.NOSCRIPT = "noscript", e.OBJECT = "object", e.OL = "ol", e.OPTGROUP = "optgroup", e.OPTION = "option", e.P = "p", e.PARAM = "param", e.PLAINTEXT = "plaintext", e.PRE = "pre", e.RB = "rb", e.RP = "rp", e.RT = "rt", e.RTC = "rtc", e.RUBY = "ruby", e.S = "s", e.SCRIPT = "script", e.SEARCH = "search", e.SECTION = "section", e.SELECT = "select", e.SOURCE = "source", e.SMALL = "small", e.SPAN = "span", e.STRIKE = "strike", e.STRONG = "strong", e.STYLE = "style", e.SUB = "sub", e.SUMMARY = "summary", e.SUP = "sup", e.TABLE = "table", e.TBODY = "tbody", e.TEMPLATE = "template", e.TEXTAREA = "textarea", e.TFOOT = "tfoot", e.TD = "td", e.TH = "th", e.THEAD = "thead", e.TITLE = "title", e.TR = "tr", e.TRACK = "track", e.TT = "tt", e.U = "u", e.UL = "ul", e.SVG = "svg", e.VAR = "var", e.WBR = "wbr", e.XMP = "xmp";
})(h || (h = {}));
var s;
(function(e) {
e[e.UNKNOWN = 0] = "UNKNOWN", e[e.A = 1] = "A", e[e.ADDRESS = 2] = "ADDRESS", e[e.ANNOTATION_XML = 3] = "ANNOTATION_XML", e[e.APPLET = 4] = "APPLET", e[e.AREA = 5] = "AREA", e[e.ARTICLE = 6] = "ARTICLE", e[e.ASIDE = 7] = "ASIDE", e[e.B = 8] = "B", e[e.BASE = 9] = "BASE", e[e.BASEFONT = 10] = "BASEFONT", e[e.BGSOUND = 11] = "BGSOUND", e[e.BIG = 12] = "BIG", e[e.BLOCKQUOTE = 13] = "BLOCKQUOTE", e[e.BODY = 14] = "BODY", e[e.BR = 15] = "BR", e[e.BUTTON = 16] = "BUTTON", e[e.CAPTION = 17] = "CAPTION", e[e.CENTER = 18] = "CENTER", e[e.CODE = 19] = "CODE", e[e.COL = 20] = "COL", e[e.COLGROUP = 21] = "COLGROUP", e[e.DD = 22] = "DD", e[e.DESC = 23] = "DESC", e[e.DETAILS = 24] = "DETAILS", e[e.DIALOG = 25] = "DIALOG", e[e.DIR = 26] = "DIR", e[e.DIV = 27] = "DIV", e[e.DL = 28] = "DL", e[e.DT = 29] = "DT", e[e.EM = 30] = "EM", e[e.EMBED = 31] = "EMBED", e[e.FIELDSET = 32] = "FIELDSET", e[e.FIGCAPTION = 33] = "FIGCAPTION", e[e.FIGURE = 34] = "FIGURE", e[e.FONT = 35] = "FONT", e[e.FOOTER = 36] = "FOOTER", e[e.FOREIGN_OBJECT = 37] = "FOREIGN_OBJECT", e[e.FORM = 38] = "FORM", e[e.FRAME = 39] = "FRAME", e[e.FRAMESET = 40] = "FRAMESET", e[e.H1 = 41] = "H1", e[e.H2 = 42] = "H2", e[e.H3 = 43] = "H3", e[e.H4 = 44] = "H4", e[e.H5 = 45] = "H5", e[e.H6 = 46] = "H6", e[e.HEAD = 47] = "HEAD", e[e.HEADER = 48] = "HEADER", e[e.HGROUP = 49] = "HGROUP", e[e.HR = 50] = "HR", e[e.HTML = 51] = "HTML", e[e.I = 52] = "I", e[e.IMG = 53] = "IMG", e[e.IMAGE = 54] = "IMAGE", e[e.INPUT = 55] = "INPUT", e[e.IFRAME = 56] = "IFRAME", e[e.KEYGEN = 57] = "KEYGEN", e[e.LABEL = 58] = "LABEL", e[e.LI = 59] = "LI", e[e.LINK = 60] = "LINK", e[e.LISTING = 61] = "LISTING", e[e.MAIN = 62] = "MAIN", e[e.MALIGNMARK = 63] = "MALIGNMARK", e[e.MARQUEE = 64] = "MARQUEE", e[e.MATH = 65] = "MATH", e[e.MENU = 66] = "MENU", e[e.META = 67] = "META", e[e.MGLYPH = 68] = "MGLYPH", e[e.MI = 69] = "MI", e[e.MO = 70] = "MO", e[e.MN = 71] = "MN", e[e.MS = 72] = "MS", e[e.MTEXT = 73] = "MTEXT", e[e.NAV = 74] = "NAV", e[e.NOBR = 75] = "NOBR", e[e.NOFRAMES = 76] = "NOFRAMES", e[e.NOEMBED = 77] = "NOEMBED", e[e.NOSCRIPT = 78] = "NOSCRIPT", e[e.OBJECT = 79] = "OBJECT", e[e.OL = 80] = "OL", e[e.OPTGROUP = 81] = "OPTGROUP", e[e.OPTION = 82] = "OPTION", e[e.P = 83] = "P", e[e.PARAM = 84] = "PARAM", e[e.PLAINTEXT = 85] = "PLAINTEXT", e[e.PRE = 86] = "PRE", e[e.RB = 87] = "RB", e[e.RP = 88] = "RP", e[e.RT = 89] = "RT", e[e.RTC = 90] = "RTC", e[e.RUBY = 91] = "RUBY", e[e.S = 92] = "S", e[e.SCRIPT = 93] = "SCRIPT", e[e.SEARCH = 94] = "SEARCH", e[e.SECTION = 95] = "SECTION", e[e.SELECT = 96] = "SELECT", e[e.SOURCE = 97] = "SOURCE", e[e.SMALL = 98] = "SMALL", e[e.SPAN = 99] = "SPAN", e[e.STRIKE = 100] = "STRIKE", e[e.STRONG = 101] = "STRONG", e[e.STYLE = 102] = "STYLE", e[e.SUB = 103] = "SUB", e[e.SUMMARY = 104] = "SUMMARY", e[e.SUP = 105] = "SUP", e[e.TABLE = 106] = "TABLE", e[e.TBODY = 107] = "TBODY", e[e.TEMPLATE = 108] = "TEMPLATE", e[e.TEXTAREA = 109] = "TEXTAREA", e[e.TFOOT = 110] = "TFOOT", e[e.TD = 111] = "TD", e[e.TH = 112] = "TH", e[e.THEAD = 113] = "THEAD", e[e.TITLE = 114] = "TITLE", e[e.TR = 115] = "TR", e[e.TRACK = 116] = "TRACK", e[e.TT = 117] = "TT", e[e.U = 118] = "U", e[e.UL = 119] = "UL", e[e.SVG = 120] = "SVG", e[e.VAR = 121] = "VAR", e[e.WBR = 122] = "WBR", e[e.XMP = 123] = "XMP";
})(s || (s = {}));
const si = /* @__PURE__ */ new Map([
[h.A, s.A],
[h.ADDRESS, s.ADDRESS],
[h.ANNOTATION_XML, s.ANNOTATION_XML],
[h.APPLET, s.APPLET],
[h.AREA, s.AREA],
[h.ARTICLE, s.ARTICLE],
[h.ASIDE, s.ASIDE],
[h.B, s.B],
[h.BASE, s.BASE],
[h.BASEFONT, s.BASEFONT],
[h.BGSOUND, s.BGSOUND],
[h.BIG, s.BIG],
[h.BLOCKQUOTE, s.BLOCKQUOTE],
[h.BODY, s.BODY],
[h.BR, s.BR],
[h.BUTTON, s.BUTTON],
[h.CAPTION, s.CAPTION],
[h.CENTER, s.CENTER],
[h.CODE, s.CODE],
[h.COL, s.COL],
[h.COLGROUP, s.COLGROUP],
[h.DD, s.DD],
[h.DESC, s.DESC],
[h.DETAILS, s.DETAILS],
[h.DIALOG, s.DIALOG],
[h.DIR, s.DIR],
[h.DIV, s.DIV],
[h.DL, s.DL],
[h.DT, s.DT],
[h.EM, s.EM],
[h.EMBED, s.EMBED],
[h.FIELDSET, s.FIELDSET],
[h.FIGCAPTION, s.FIGCAPTION],
[h.FIGURE, s.FIGURE],
[h.FONT, s.FONT],
[h.FOOTER, s.FOOTER],
[h.FOREIGN_OBJECT, s.FOREIGN_OBJECT],
[h.FORM, s.FORM],
[h.FRAME, s.FRAME],
[h.FRAMESET, s.FRAMESET],
[h.H1, s.H1],
[h.H2, s.H2],
[h.H3, s.H3],
[h.H4, s.H4],
[h.H5, s.H5],
[h.H6, s.H6],
[h.HEAD, s.HEAD],
[h.HEADER, s.HEADER],
[h.HGROUP, s.HGROUP],
[h.HR, s.HR],
[h.HTML, s.HTML],
[h.I, s.I],
[h.IMG, s.IMG],
[h.IMAGE, s.IMAGE],
[h.INPUT, s.INPUT],
[h.IFRAME, s.IFRAME],
[h.KEYGEN, s.KEYGEN],
[h.LABEL, s.LABEL],
[h.LI, s.LI],
[h.LINK, s.LINK],
[h.LISTING, s.LISTING],
[h.MAIN, s.MAIN],
[h.MALIGNMARK, s.MALIGNMARK],
[h.MARQUEE, s.MARQUEE],
[h.MATH, s.MATH],
[h.MENU, s.MENU],
[h.META, s.META],
[h.MGLYPH, s.MGLYPH],
[h.MI, s.MI],
[h.MO, s.MO],
[h.MN, s.MN],
[h.MS, s.MS],
[h.MTEXT, s.MTEXT],
[h.NAV, s.NAV],
[h.NOBR, s.NOBR],
[h.NOFRAMES, s.NOFRAMES],
[h.NOEMBED, s.NOEMBED],
[h.NOSCRIPT, s.NOSCRIPT],
[h.OBJECT, s.OBJECT],
[h.OL, s.OL],
[h.OPTGROUP, s.OPTGROUP],
[h.OPTION, s.OPTION],
[h.P, s.P],
[h.PARAM, s.PARAM],
[h.PLAINTEXT, s.PLAINTEXT],
[h.PRE, s.PRE],
[h.RB, s.RB],
[h.RP, s.RP],
[h.RT, s.RT],
[h.RTC, s.RTC],
[h.RUBY, s.RUBY],
[h.S, s.S],
[h.SCRIPT, s.SCRIPT],
[h.SEARCH, s.SEARCH],
[h.SECTION, s.SECTION],
[h.SELECT, s.SELECT],
[h.SOURCE, s.SOURCE],
[h.SMALL, s.SMALL],
[h.SPAN, s.SPAN],
[h.STRIKE, s.STRIKE],
[h.STRONG, s.STRONG],
[h.STYLE, s.STYLE],
[h.SUB, s.SUB],
[h.SUMMARY, s.SUMMARY],
[h.SUP, s.SUP],
[h.TABLE, s.TABLE],
[h.TBODY, s.TBODY],
[h.TEMPLATE, s.TEMPLATE],
[h.TEXTAREA, s.TEXTAREA],
[h.TFOOT, s.TFOOT],
[h.TD, s.TD],
[h.TH, s.TH],
[h.THEAD, s.THEAD],
[h.TITLE, s.TITLE],
[h.TR, s.TR],
[h.TRACK, s.TRACK],
[h.TT, s.TT],
[h.U, s.U],
[h.UL, s.UL],
[h.SVG, s.SVG],
[h.VAR, s.VAR],
[h.WBR, s.WBR],
[h.XMP, s.XMP]
]);
function pu(e) {
var u;
return (u = si.get(e)) !== null && u !== void 0 ? u : s.UNKNOWN;
}
const _ = s, ri = {
[T.HTML]: /* @__PURE__ */ new Set([
_.ADDRESS,
_.APPLET,
_.AREA,
_.ARTICLE,
_.ASIDE,
_.BASE,
_.BASEFONT,
_.BGSOUND,
_.BLOCKQUOTE,
_.BODY,
_.BR,
_.BUTTON,
_.CAPTION,
_.CENTER,
_.COL,
_.COLGROUP,
_.DD,
_.DETAILS,
_.DIR,
_.DIV,
_.DL,
_.DT,
_.EMBED,
_.FIELDSET,
_.FIGCAPTION,
_.FIGURE,
_.FOOTER,
_.FORM,
_.FRAME,
_.FRAMESET,
_.H1,
_.H2,
_.H3,
_.H4,
_.H5,
_.H6,
_.HEAD,
_.HEADER,
_.HGROUP,
_.HR,
_.HTML,
_.IFRAME,
_.IMG,
_.INPUT,
_.LI,
_.LINK,
_.LISTING,
_.MAIN,
_.MARQUEE,
_.MENU,
_.META,
_.NAV,
_.NOEMBED,
_.NOFRAMES,
_.NOSCRIPT,
_.OBJECT,
_.OL,
_.P,
_.PARAM,
_.PLAINTEXT,
_.PRE,
_.SCRIPT,
_.SECTION,
_.SELECT,
_.SOURCE,
_.STYLE,
_.SUMMARY,
_.TABLE,
_.TBODY,
_.TD,
_.TEMPLATE,
_.TEXTAREA,
_.TFOOT,
_.TH,
_.THEAD,
_.TITLE,
_.TR,
_.TRACK,
_.UL,
_.WBR,
_.XMP
]),
[T.MATHML]: /* @__PURE__ */ new Set([_.MI, _.MO, _.MN, _.MS, _.MTEXT, _.ANNOTATION_XML]),
[T.SVG]: /* @__PURE__ */ new Set([_.TITLE, _.FOREIGN_OBJECT, _.DESC]),
[T.XLINK]: /* @__PURE__ */ new Set(),
[T.XML]: /* @__PURE__ */ new Set(),
[T.XMLNS]: /* @__PURE__ */ new Set()
}, Ku = /* @__PURE__ */ new Set([_.H1, _.H2, _.H3, _.H4, _.H5, _.H6]), ni = /* @__PURE__ */ new Set([
h.STYLE,
h.SCRIPT,
h.XMP,
h.IFRAME,
h.NOEMBED,
h.NOFRAMES,
h.PLAINTEXT
]);
function ii(e, u) {
return ni.has(e) || u && e === h.NOSCRIPT;
}
var o;
(function(e) {
e[e.DATA = 0] = "DATA", e[e.RCDATA = 1] = "RCDATA", e[e.RAWTEXT = 2] = "RAWTEXT", e[e.SCRIPT_DATA = 3] = "SCRIPT_DATA", e[e.PLAINTEXT = 4] = "PLAINTEXT", e[e.TAG_OPEN = 5] = "TAG_OPEN", e[e.END_TAG_OPEN = 6] = "END_TAG_OPEN", e[e.TAG_NAME = 7] = "TAG_NAME", e[e.RCDATA_LESS_THAN_SIGN = 8] = "RCDATA_LESS_THAN_SIGN", e[e.RCDATA_END_TAG_OPEN = 9] = "RCDATA_END_TAG_OPEN", e[e.RCDATA_END_TAG_NAME = 10] = "RCDATA_END_TAG_NAME", e[e.RAWTEXT_LESS_THAN_SIGN = 11] = "RAWTEXT_LESS_THAN_SIGN", e[e.RAWTEXT_END_TAG_OPEN = 12] = "RAWTEXT_END_TAG_OPEN", e[e.RAWTEXT_END_TAG_NAME = 13] = "RAWTEXT_END_TAG_NAME", e[e.SCRIPT_DATA_LESS_THAN_SIGN = 14] = "SCRIPT_DATA_LESS_THAN_SIGN", e[e.SCRIPT_DATA_END_TAG_OPEN = 15] = "SCRIPT_DATA_END_TAG_OPEN", e[e.SCRIPT_DATA_END_TAG_NAME = 16] = "SCRIPT_DATA_END_TAG_NAME", e[e.SCRIPT_DATA_ESCAPE_START = 17] = "SCRIPT_DATA_ESCAPE_START", e[e.SCRIPT_DATA_ESCAPE_START_DASH = 18] = "SCRIPT_DATA_ESCAPE_START_DASH", e[e.SCRIPT_DATA_ESCAPED = 19] = "SCRIPT_DATA_ESCAPED", e[e.SCRIPT_DATA_ESCAPED_DASH = 20] = "SCRIPT_DATA_ESCAPED_DASH", e[e.SCRIPT_DATA_ESCAPED_DASH_DASH = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN", e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START", e[e.SCRIPT_DATA_DOUBLE_ESCAPED = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH", e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN", e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END", e[e.BEFORE_ATTRIBUTE_NAME = 31] = "BEFORE_ATTRIBUTE_NAME", e[e.ATTRIBUTE_NAME = 32] = "ATTRIBUTE_NAME", e[e.AFTER_ATTRIBUTE_NAME = 33] = "AFTER_ATTRIBUTE_NAME", e[e.BEFORE_ATTRIBUTE_VALUE = 34] = "BEFORE_ATTRIBUTE_VALUE", e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED", e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED", e[e.ATTRIBUTE_VALUE_UNQUOTED = 37] = "ATTRIBUTE_VALUE_UNQUOTED", e[e.AFTER_ATTRIBUTE_VALUE_QUOTED = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED", e[e.SELF_CLOSING_START_TAG = 39] = "SELF_CLOSING_START_TAG", e[e.BOGUS_COMMENT = 40] = "BOGUS_COMMENT", e[e.MARKUP_DECLARATION_OPEN = 41] = "MARKUP_DECLARATION_OPEN", e[e.COMMENT_START = 42] = "COMMENT_START", e[e.COMMENT_START_DASH = 43] = "COMMENT_START_DASH", e[e.COMMENT = 44] = "COMMENT", e[e.COMMENT_LESS_THAN_SIGN = 45] = "COMMENT_LESS_THAN_SIGN", e[e.COMMENT_LESS_THAN_SIGN_BANG = 46] = "COMMENT_LESS_THAN_SIGN_BANG", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH", e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH", e[e.COMMENT_END_DASH = 49] = "COMMENT_END_DASH", e[e.COMMENT_END = 50] = "COMMENT_END", e[e.COMMENT_END_BANG = 51] = "COMMENT_END_BANG", e[e.DOCTYPE = 52] = "DOCTYPE", e[e.BEFORE_DOCTYPE_NAME = 53] = "BEFORE_DOCTYPE_NAME", e[e.DOCTYPE_NAME = 54] = "DOCTYPE_NAME", e[e.AFTER_DOCTYPE_NAME = 55] = "AFTER_DOCTYPE_NAME", e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD", e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER", e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER", e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS", e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD", e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER", e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED", e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED", e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER", e[e.BOGUS_DOCTYPE = 67] = "BOGUS_DOCTYPE", e[e.CDATA_SECTION = 68] = "CDATA_SECTION", e[e.CDATA_SECTION_BRACKET = 69] = "CDATA_SECTION_BRACKET", e[e.CDATA_SECTION_END = 70] = "CDATA_SECTION_END", e[e.CHARACTER_REFERENCE = 71] = "CHARACTER_REFERENCE", e[e.AMBIGUOUS_AMPERSAND = 72] = "AMBIGUOUS_AMPERSAND";
})(o || (o = {}));
const G = {
DATA: o.DATA,
RCDATA: o.RCDATA,
RAWTEXT: o.RAWTEXT,
SCRIPT_DATA: o.SCRIPT_DATA,
PLAINTEXT: o.PLAINTEXT,
CDATA_SECTION: o.CDATA_SECTION
};
function ci(e) {
return e >= c.DIGIT_0 && e <= c.DIGIT_9;
}
function ye(e) {
return e >= c.LATIN_CAPITAL_A && e <= c.LATIN_CAPITAL_Z;
}
function oi(e) {
return e >= c.LATIN_SMALL_A && e <= c.LATIN_SMALL_Z;
}
function ae(e) {
return oi(e) || ye(e);
}
function Yt(e) {
return ae(e) || ci(e);
}
function eu(e) {
return e + 32;
}
function V0(e) {
return e === c.SPACE || e === c.LINE_FEED || e === c.TABULATION || e === c.FORM_FEED;
}
function Vt(e) {
return V0(e) || e === c.SOLIDUS || e === c.GREATER_THAN_SIGN;
}
function di(e) {
return e === c.NULL ? E.nullCharacterReference : e > 1114111 ? E.characterReferenceOutsideUnicodeRange : H0(e) ? E.surrogateCharacterReference : q0(e) ? E.noncharacterCharacterReference : v0(e) || e === c.CARRIAGE_RETURN ? E.controlCharacterReference : null;
}
class fi {
constructor(u, t) {
this.options = u, this.handler = t, this.paused = !1, this.inLoop = !1, this.inForeignNode = !1, this.lastStartTagName = "", this.active = !1, this.state = o.DATA, this.returnState = o.DATA, this.entityStartPos = 0, this.consumedAfterSnapshot = -1, this.currentCharacterToken = null, this.currentToken = null, this.currentAttr = { name: "", value: "" }, this.preprocessor = new Kn(t), this.currentLocation = this.getCurrentLocation(-1), this.entityDecoder = new ti(jn, (a, r) => {
this.preprocessor.pos = this.entityStartPos + r - 1, this._flushCodePointConsumedAsCharacterReference(a);
}, t.onParseError ? {
missingSemicolonAfterCharacterReference: () => {
this._err(E.missingSemicolonAfterCharacterReference, 1);
},
absenceOfDigitsInNumericCharacterReference: (a) => {
this._err(E.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + a);
},
validateNumericCharacterReference: (a) => {
const r = di(a);
r && this._err(r, 1);
}
} : void 0);
}
//Errors
_err(u, t = 0) {
var a, r;
(r = (a = this.handler).onParseError) === null || r === void 0 || r.call(a, this.preprocessor.getError(u, t));
}
// NOTE: `offset` may never run across line boundaries.
getCurrentLocation(u) {
return this.options.sourceCodeLocationInfo ? {
startLine: this.preprocessor.line,
startCol: this.preprocessor.col - u,
startOffset: this.preprocessor.offset - u,
endLine: -1,
endCol: -1,
endOffset: -1
} : null;
}
_runParsingLoop() {
if (!this.inLoop) {
for (this.inLoop = !0; this.active && !this.paused; ) {
this.consumedAfterSnapshot = 0;
const u = this._consume();
this._ensureHibernation() || this._callState(u);
}
this.inLoop = !1;
}
}
//API
pause() {
this.paused = !0;
}
resume(u) {
if (!this.paused)
throw new Error("Parser was already resumed");
this.paused = !1, !this.inLoop && (this._runParsingLoop(), this.paused || u?.());
}
write(u, t, a) {
this.active = !0, this.preprocessor.write(u, t), this._runParsingLoop(), this.paused || a?.();
}
insertHtmlAtCurrentPos(u) {
this.active = !0, this.preprocessor.insertHtmlAtCurrentPos(u), this._runParsingLoop();
}
//Hibernation
_ensureHibernation() {
return this.preprocessor.endOfChunkHit ? (this.preprocessor.retreat(this.consumedAfterSnapshot), this.consumedAfterSnapshot = 0, this.active = !1, !0) : !1;
}
//Consumption
_consume() {
return this.consumedAfterSnapshot++, this.preprocessor.advance();
}
_advanceBy(u) {
this.consumedAfterSnapshot += u;
for (let t = 0; t < u; t++)
this.preprocessor.advance();
}
_consumeSequenceIfMatch(u, t) {
return this.preprocessor.startsWith(u, t) ? (this._advanceBy(u.length - 1), !0) : !1;
}
//Token creation
_createStartTagToken() {
this.currentToken = {
type: L.START_TAG,
tagName: "",
tagID: s.UNKNOWN,
selfClosing: !1,
ackSelfClosing: !1,
attrs: [],
location: this.getCurrentLocation(1)
};
}
_createEndTagToken() {
this.currentToken = {
type: L.END_TAG,
tagName: "",
tagID: s.UNKNOWN,
selfClosing: !1,
ackSelfClosing: !1,
attrs: [],
location: this.getCurrentLocation(2)
};
}
_createCommentToken(u) {
this.currentToken = {
type: L.COMMENT,
data: "",
location: this.getCurrentLocation(u)
};
}
_createDoctypeToken(u) {
this.currentToken = {
type: L.DOCTYPE,
name: u,
forceQuirks: !1,
publicId: null,
systemId: null,
location: this.currentLocation
};
}
_createCharacterToken(u, t) {
this.currentCharacterToken = {
type: u,
chars: t,
location: this.currentLocation
};
}
//Tag attributes
_createAttr(u) {
this.currentAttr = {
name: u,
value: ""
}, this.currentLocation = this.getCurrentLocation(0);
}
_leaveAttrName() {
var u, t;
const a = this.currentToken;
if (Y0(a, this.currentAttr.name) === null) {
if (a.attrs.push(this.currentAttr), a.location && this.currentLocation) {
const r = (u = (t = a.location).attrs) !== null && u !== void 0 ? u : t.attrs = /* @__PURE__ */ Object.create(null);
r[this.currentAttr.name] = this.currentLocation, this._leaveAttrValue();
}
} else
this._err(E.duplicateAttribute);
}
_leaveAttrValue() {
this.currentLocation && (this.currentLocation.endLine = this.preprocessor.line, this.currentLocation.endCol = this.preprocessor.col, this.currentLocation.endOffset = this.preprocessor.offset);
}
//Token emission
prepareToken(u) {
this._emitCurrentCharacterToken(u.location), this.currentToken = null, u.location && (u.location.endLine = this.preprocessor.line, u.location.endCol = this.preprocessor.col + 1, u.location.endOffset = this.preprocessor.offset + 1), this.currentLocation = this.getCurrentLocation(-1);
}
emitCurrentTagToken() {
const u = this.currentToken;
this.prepareToken(u), u.tagID = pu(u.tagName), u.type === L.START_TAG ? (this.lastStartTagName = u.tagName, this.handler.onStartTag(u)) : (u.attrs.length > 0 && this._err(E.endTagWithAttributes), u.selfClosing && this._err(E.endTagWithTrailingSolidus), this.handler.onEndTag(u)), this.preprocessor.dropParsedChunk();
}
emitCurrentComment(u) {
this.prepareToken(u), this.handler.onComment(u), this.preprocessor.dropParsedChunk();
}
emitCurrentDoctype(u) {
this.prepareToken(u), this.handler.onDoctype(u), this.preprocessor.dropParsedChunk();
}
_emitCurrentCharacterToken(u) {
if (this.currentCharacterToken) {
switch (u && this.currentCharacterToken.location && (this.currentCharacterToken.location.endLine = u.startLine, this.currentCharacterToken.location.endCol = u.startCol, this.currentCharacterToken.location.endOffset = u.startOffset), this.currentCharacterToken.type) {
case L.CHARACTER: {
this.handler.onCharacter(this.currentCharacterToken);
break;
}
case L.NULL_CHARACTER: {
this.handler.onNullCharacter(this.currentCharacterToken);
break;
}
case L.WHITESPACE_CHARACTER: {
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
break;
}
}
this.currentCharacterToken = null;
}
}
_emitEOFToken() {
const u = this.getCurrentLocation(0);
u && (u.endLine = u.startLine, u.endCol = u.startCol, u.endOffset = u.startOffset), this._emitCurrentCharacterToken(u), this.handler.onEof({ type: L.EOF, location: u }), this.active = !1;
}
//Characters emission
//OPTIMIZATION: The specification uses only one type of character token (one token per character).
//This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters.
//If we have a sequence of characters that belong to the same group, the parser can process it
//as a single solid character token.
//So, there are 3 types of character tokens in parse5:
//1)TokenType.NULL_CHARACTER - \u0000-character sequences (e.g. '\u0000\u0000\u0000')
//2)TokenType.WHITESPACE_CHARACTER - any whitespace/new-line character sequences (e.g. '\n \r\t \f')
//3)TokenType.CHARACTER - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^')
_appendCharToCurrentCharacterToken(u, t) {
if (this.currentCharacterToken)
if (this.currentCharacterToken.type === u) {
this.currentCharacterToken.chars += t;
return;
} else
this.currentLocation = this.getCurrentLocation(0), this._emitCurrentCharacterToken(this.currentLocation), this.preprocessor.dropParsedChunk();
this._createCharacterToken(u, t);
}
_emitCodePoint(u) {
const t = V0(u) ? L.WHITESPACE_CHARACTER : u === c.NULL ? L.NULL_CHARACTER : L.CHARACTER;
this._appendCharToCurrentCharacterToken(t, String.fromCodePoint(u));
}
//NOTE: used when we emit characters explicitly.
//This is always for non-whitespace and non-null characters, which allows us to avoid additional checks.
_emitChars(u) {
this._appendCharToCurrentCharacterToken(L.CHARACTER, u);
}
// Character reference helpers
_startCharacterReference() {
this.returnState = this.state, this.state = o.CHARACTER_REFERENCE, this.entityStartPos = this.preprocessor.pos, this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? ue.Attribute : ue.Legacy);
}
_isCharacterReferenceInAttribute() {
return this.returnState === o.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === o.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === o.ATTRIBUTE_VALUE_UNQUOTED;
}
_flushCodePointConsumedAsCharacterReference(u) {
this._isCharacterReferenceInAttribute() ? this.currentAttr.value += String.fromCodePoint(u) : this._emitCodePoint(u);
}
// Calling states this way turns out to be much faster than any other approach.
_callState(u) {
switch (this.state) {
case o.DATA: {
this._stateData(u);
break;
}
case o.RCDATA: {
this._stateRcdata(u);
break;
}
case o.RAWTEXT: {
this._stateRawtext(u);
break;
}
case o.SCRIPT_DATA: {
this._stateScriptData(u);
break;
}
case o.PLAINTEXT: {
this._statePlaintext(u);
break;
}
case o.TAG_OPEN: {
this._stateTagOpen(u);
break;
}
case o.END_TAG_OPEN: {
this._stateEndTagOpen(u);
break;
}
case o.TAG_NAME: {
this._stateTagName(u);
break;
}
case o.RCDATA_LESS_THAN_SIGN: {
this._stateRcdataLessThanSign(u);
break;
}
case o.RCDATA_END_TAG_OPEN: {
this._stateRcdataEndTagOpen(u);
break;
}
case o.RCDATA_END_TAG_NAME: {
this._stateRcdataEndTagName(u);
break;
}
case o.RAWTEXT_LESS_THAN_SIGN: {
this._stateRawtextLessThanSign(u);
break;
}
case o.RAWTEXT_END_TAG_OPEN: {
this._stateRawtextEndTagOpen(u);
break;
}
case o.RAWTEXT_END_TAG_NAME: {
this._stateRawtextEndTagName(u);
break;
}
case o.SCRIPT_DATA_LESS_THAN_SIGN: {
this._stateScriptDataLessThanSign(u);
break;
}
case o.SCRIPT_DATA_END_TAG_OPEN: {
this._stateScriptDataEndTagOpen(u);
break;
}
case o.SCRIPT_DATA_END_TAG_NAME: {
this._stateScriptDataEndTagName(u);
break;
}
case o.SCRIPT_DATA_ESCAPE_START: {
this._stateScriptDataEscapeStart(u);
break;
}
case o.SCRIPT_DATA_ESCAPE_START_DASH: {
this._stateScriptDataEscapeStartDash(u);
break;
}
case o.SCRIPT_DATA_ESCAPED: {
this._stateScriptDataEscaped(u);
break;
}
case o.SCRIPT_DATA_ESCAPED_DASH: {
this._stateScriptDataEscapedDash(u);
break;
}
case o.SCRIPT_DATA_ESCAPED_DASH_DASH: {
this._stateScriptDataEscapedDashDash(u);
break;
}
case o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
this._stateScriptDataEscapedLessThanSign(u);
break;
}
case o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {
this._stateScriptDataEscapedEndTagOpen(u);
break;
}
case o.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {
this._stateScriptDataEscapedEndTagName(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
this._stateScriptDataDoubleEscapeStart(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPED: {
this._stateScriptDataDoubleEscaped(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
this._stateScriptDataDoubleEscapedDash(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
this._stateScriptDataDoubleEscapedDashDash(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
this._stateScriptDataDoubleEscapedLessThanSign(u);
break;
}
case o.SCRIPT_DATA_DOUBLE_ESCAPE_END: {
this._stateScriptDataDoubleEscapeEnd(u);
break;
}
case o.BEFORE_ATTRIBUTE_NAME: {
this._stateBeforeAttributeName(u);
break;
}
case o.ATTRIBUTE_NAME: {
this._stateAttributeName(u);
break;
}
case o.AFTER_ATTRIBUTE_NAME: {
this._stateAfterAttributeName(u);
break;
}
case o.BEFORE_ATTRIBUTE_VALUE: {
this._stateBeforeAttributeValue(u);
break;
}
case o.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
this._stateAttributeValueDoubleQuoted(u);
break;
}
case o.ATTRIBUTE_VALUE_SINGLE_QUOTED: {
this._stateAttributeValueSingleQuoted(u);
break;
}
case o.ATTRIBUTE_VALUE_UNQUOTED: {
this._stateAttributeValueUnquoted(u);
break;
}
case o.AFTER_ATTRIBUTE_VALUE_QUOTED: {
this._stateAfterAttributeValueQuoted(u);
break;
}
case o.SELF_CLOSING_START_TAG: {
this._stateSelfClosingStartTag(u);
break;
}
case o.BOGUS_COMMENT: {
this._stateBogusComment(u);
break;
}
case o.MARKUP_DECLARATION_OPEN: {
this._stateMarkupDeclarationOpen(u);
break;
}
case o.COMMENT_START: {
this._stateCommentStart(u);
break;
}
case o.COMMENT_START_DASH: {
this._stateCommentStartDash(u);
break;
}
case o.COMMENT: {
this._stateComment(u);
break;
}
case o.COMMENT_LESS_THAN_SIGN: {
this._stateCommentLessThanSign(u);
break;
}
case o.COMMENT_LESS_THAN_SIGN_BANG: {
this._stateCommentLessThanSignBang(u);
break;
}
case o.COMMENT_LESS_THAN_SIGN_BANG_DASH: {
this._stateCommentLessThanSignBangDash(u);
break;
}
case o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {
this._stateCommentLessThanSignBangDashDash(u);
break;
}
case o.COMMENT_END_DASH: {
this._stateCommentEndDash(u);
break;
}
case o.COMMENT_END: {
this._stateCommentEnd(u);
break;
}
case o.COMMENT_END_BANG: {
this._stateCommentEndBang(u);
break;
}
case o.DOCTYPE: {
this._stateDoctype(u);
break;
}
case o.BEFORE_DOCTYPE_NAME: {
this._stateBeforeDoctypeName(u);
break;
}
case o.DOCTYPE_NAME: {
this._stateDoctypeName(u);
break;
}
case o.AFTER_DOCTYPE_NAME: {
this._stateAfterDoctypeName(u);
break;
}
case o.AFTER_DOCTYPE_PUBLIC_KEYWORD: {
this._stateAfterDoctypePublicKeyword(u);
break;
}
case o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
this._stateBeforeDoctypePublicIdentifier(u);
break;
}
case o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
this._stateDoctypePublicIdentifierDoubleQuoted(u);
break;
}
case o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
this._stateDoctypePublicIdentifierSingleQuoted(u);
break;
}
case o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
this._stateAfterDoctypePublicIdentifier(u);
break;
}
case o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
this._stateBetweenDoctypePublicAndSystemIdentifiers(u);
break;
}
case o.AFTER_DOCTYPE_SYSTEM_KEYWORD: {
this._stateAfterDoctypeSystemKeyword(u);
break;
}
case o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
this._stateBeforeDoctypeSystemIdentifier(u);
break;
}
case o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
this._stateDoctypeSystemIdentifierDoubleQuoted(u);
break;
}
case o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
this._stateDoctypeSystemIdentifierSingleQuoted(u);
break;
}
case o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
this._stateAfterDoctypeSystemIdentifier(u);
break;
}
case o.BOGUS_DOCTYPE: {
this._stateBogusDoctype(u);
break;
}
case o.CDATA_SECTION: {
this._stateCdataSection(u);
break;
}
case o.CDATA_SECTION_BRACKET: {
this._stateCdataSectionBracket(u);
break;
}
case o.CDATA_SECTION_END: {
this._stateCdataSectionEnd(u);
break;
}
case o.CHARACTER_REFERENCE: {
this._stateCharacterReference();
break;
}
case o.AMBIGUOUS_AMPERSAND: {
this._stateAmbiguousAmpersand(u);
break;
}
default:
throw new Error("Unknown state");
}
}
// State machine
// Data state
//------------------------------------------------------------------
_stateData(u) {
switch (u) {
case c.LESS_THAN_SIGN: {
this.state = o.TAG_OPEN;
break;
}
case c.AMPERSAND: {
this._startCharacterReference();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitCodePoint(u);
break;
}
case c.EOF: {
this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// RCDATA state
//------------------------------------------------------------------
_stateRcdata(u) {
switch (u) {
case c.AMPERSAND: {
this._startCharacterReference();
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.RCDATA_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// RAWTEXT state
//------------------------------------------------------------------
_stateRawtext(u) {
switch (u) {
case c.LESS_THAN_SIGN: {
this.state = o.RAWTEXT_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// Script data state
//------------------------------------------------------------------
_stateScriptData(u) {
switch (u) {
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// PLAINTEXT state
//------------------------------------------------------------------
_statePlaintext(u) {
switch (u) {
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// Tag open state
//------------------------------------------------------------------
_stateTagOpen(u) {
if (ae(u))
this._createStartTagToken(), this.state = o.TAG_NAME, this._stateTagName(u);
else
switch (u) {
case c.EXCLAMATION_MARK: {
this.state = o.MARKUP_DECLARATION_OPEN;
break;
}
case c.SOLIDUS: {
this.state = o.END_TAG_OPEN;
break;
}
case c.QUESTION_MARK: {
this._err(E.unexpectedQuestionMarkInsteadOfTagName), this._createCommentToken(1), this.state = o.BOGUS_COMMENT, this._stateBogusComment(u);
break;
}
case c.EOF: {
this._err(E.eofBeforeTagName), this._emitChars("<"), this._emitEOFToken();
break;
}
default:
this._err(E.invalidFirstCharacterOfTagName), this._emitChars("<"), this.state = o.DATA, this._stateData(u);
}
}
// End tag open state
//------------------------------------------------------------------
_stateEndTagOpen(u) {
if (ae(u))
this._createEndTagToken(), this.state = o.TAG_NAME, this._stateTagName(u);
else
switch (u) {
case c.GREATER_THAN_SIGN: {
this._err(E.missingEndTagName), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofBeforeTagName), this._emitChars("</"), this._emitEOFToken();
break;
}
default:
this._err(E.invalidFirstCharacterOfTagName), this._createCommentToken(2), this.state = o.BOGUS_COMMENT, this._stateBogusComment(u);
}
}
// Tag name state
//------------------------------------------------------------------
_stateTagName(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.BEFORE_ATTRIBUTE_NAME;
break;
}
case c.SOLIDUS: {
this.state = o.SELF_CLOSING_START_TAG;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentTagToken();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.tagName += P;
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
t.tagName += String.fromCodePoint(ye(u) ? eu(u) : u);
}
}
// RCDATA less-than sign state
//------------------------------------------------------------------
_stateRcdataLessThanSign(u) {
u === c.SOLIDUS ? this.state = o.RCDATA_END_TAG_OPEN : (this._emitChars("<"), this.state = o.RCDATA, this._stateRcdata(u));
}
// RCDATA end tag open state
//------------------------------------------------------------------
_stateRcdataEndTagOpen(u) {
ae(u) ? (this.state = o.RCDATA_END_TAG_NAME, this._stateRcdataEndTagName(u)) : (this._emitChars("</"), this.state = o.RCDATA, this._stateRcdata(u));
}
handleSpecialEndTag(u) {
if (!this.preprocessor.startsWith(this.lastStartTagName, !1))
return !this._ensureHibernation();
this._createEndTagToken();
const t = this.currentToken;
switch (t.tagName = this.lastStartTagName, this.preprocessor.peek(this.lastStartTagName.length)) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
return this._advanceBy(this.lastStartTagName.length), this.state = o.BEFORE_ATTRIBUTE_NAME, !1;
case c.SOLIDUS:
return this._advanceBy(this.lastStartTagName.length), this.state = o.SELF_CLOSING_START_TAG, !1;
case c.GREATER_THAN_SIGN:
return this._advanceBy(this.lastStartTagName.length), this.emitCurrentTagToken(), this.state = o.DATA, !1;
default:
return !this._ensureHibernation();
}
}
// RCDATA end tag name state
//------------------------------------------------------------------
_stateRcdataEndTagName(u) {
this.handleSpecialEndTag(u) && (this._emitChars("</"), this.state = o.RCDATA, this._stateRcdata(u));
}
// RAWTEXT less-than sign state
//------------------------------------------------------------------
_stateRawtextLessThanSign(u) {
u === c.SOLIDUS ? this.state = o.RAWTEXT_END_TAG_OPEN : (this._emitChars("<"), this.state = o.RAWTEXT, this._stateRawtext(u));
}
// RAWTEXT end tag open state
//------------------------------------------------------------------
_stateRawtextEndTagOpen(u) {
ae(u) ? (this.state = o.RAWTEXT_END_TAG_NAME, this._stateRawtextEndTagName(u)) : (this._emitChars("</"), this.state = o.RAWTEXT, this._stateRawtext(u));
}
// RAWTEXT end tag name state
//------------------------------------------------------------------
_stateRawtextEndTagName(u) {
this.handleSpecialEndTag(u) && (this._emitChars("</"), this.state = o.RAWTEXT, this._stateRawtext(u));
}
// Script data less-than sign state
//------------------------------------------------------------------
_stateScriptDataLessThanSign(u) {
switch (u) {
case c.SOLIDUS: {
this.state = o.SCRIPT_DATA_END_TAG_OPEN;
break;
}
case c.EXCLAMATION_MARK: {
this.state = o.SCRIPT_DATA_ESCAPE_START, this._emitChars("<!");
break;
}
default:
this._emitChars("<"), this.state = o.SCRIPT_DATA, this._stateScriptData(u);
}
}
// Script data end tag open state
//------------------------------------------------------------------
_stateScriptDataEndTagOpen(u) {
ae(u) ? (this.state = o.SCRIPT_DATA_END_TAG_NAME, this._stateScriptDataEndTagName(u)) : (this._emitChars("</"), this.state = o.SCRIPT_DATA, this._stateScriptData(u));
}
// Script data end tag name state
//------------------------------------------------------------------
_stateScriptDataEndTagName(u) {
this.handleSpecialEndTag(u) && (this._emitChars("</"), this.state = o.SCRIPT_DATA, this._stateScriptData(u));
}
// Script data escape start state
//------------------------------------------------------------------
_stateScriptDataEscapeStart(u) {
u === c.HYPHEN_MINUS ? (this.state = o.SCRIPT_DATA_ESCAPE_START_DASH, this._emitChars("-")) : (this.state = o.SCRIPT_DATA, this._stateScriptData(u));
}
// Script data escape start dash state
//------------------------------------------------------------------
_stateScriptDataEscapeStartDash(u) {
u === c.HYPHEN_MINUS ? (this.state = o.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-")) : (this.state = o.SCRIPT_DATA, this._stateScriptData(u));
}
// Script data escaped state
//------------------------------------------------------------------
_stateScriptDataEscaped(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.SCRIPT_DATA_ESCAPED_DASH, this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// Script data escaped dash state
//------------------------------------------------------------------
_stateScriptDataEscapedDash(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.SCRIPT_DATA_ESCAPED_DASH_DASH, this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.state = o.SCRIPT_DATA_ESCAPED, this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this.state = o.SCRIPT_DATA_ESCAPED, this._emitCodePoint(u);
}
}
// Script data escaped dash dash state
//------------------------------------------------------------------
_stateScriptDataEscapedDashDash(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.SCRIPT_DATA, this._emitChars(">");
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.state = o.SCRIPT_DATA_ESCAPED, this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this.state = o.SCRIPT_DATA_ESCAPED, this._emitCodePoint(u);
}
}
// Script data escaped less-than sign state
//------------------------------------------------------------------
_stateScriptDataEscapedLessThanSign(u) {
u === c.SOLIDUS ? this.state = o.SCRIPT_DATA_ESCAPED_END_TAG_OPEN : ae(u) ? (this._emitChars("<"), this.state = o.SCRIPT_DATA_DOUBLE_ESCAPE_START, this._stateScriptDataDoubleEscapeStart(u)) : (this._emitChars("<"), this.state = o.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(u));
}
// Script data escaped end tag open state
//------------------------------------------------------------------
_stateScriptDataEscapedEndTagOpen(u) {
ae(u) ? (this.state = o.SCRIPT_DATA_ESCAPED_END_TAG_NAME, this._stateScriptDataEscapedEndTagName(u)) : (this._emitChars("</"), this.state = o.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(u));
}
// Script data escaped end tag name state
//------------------------------------------------------------------
_stateScriptDataEscapedEndTagName(u) {
this.handleSpecialEndTag(u) && (this._emitChars("</"), this.state = o.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(u));
}
// Script data double escape start state
//------------------------------------------------------------------
_stateScriptDataDoubleEscapeStart(u) {
if (this.preprocessor.startsWith(Y.SCRIPT, !1) && Vt(this.preprocessor.peek(Y.SCRIPT.length))) {
this._emitCodePoint(u);
for (let t = 0; t < Y.SCRIPT.length; t++)
this._emitCodePoint(this._consume());
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED;
} else this._ensureHibernation() || (this.state = o.SCRIPT_DATA_ESCAPED, this._stateScriptDataEscaped(u));
}
// Script data double escaped state
//------------------------------------------------------------------
_stateScriptDataDoubleEscaped(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH, this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// Script data double escaped dash state
//------------------------------------------------------------------
_stateScriptDataDoubleEscapedDash(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH, this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(u);
}
}
// Script data double escaped dash dash state
//------------------------------------------------------------------
_stateScriptDataDoubleEscapedDashDash(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this._emitChars("-");
break;
}
case c.LESS_THAN_SIGN: {
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN, this._emitChars("<");
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.SCRIPT_DATA, this._emitChars(">");
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitChars(P);
break;
}
case c.EOF: {
this._err(E.eofInScriptHtmlCommentLikeText), this._emitEOFToken();
break;
}
default:
this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._emitCodePoint(u);
}
}
// Script data double escaped less-than sign state
//------------------------------------------------------------------
_stateScriptDataDoubleEscapedLessThanSign(u) {
u === c.SOLIDUS ? (this.state = o.SCRIPT_DATA_DOUBLE_ESCAPE_END, this._emitChars("/")) : (this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(u));
}
// Script data double escape end state
//------------------------------------------------------------------
_stateScriptDataDoubleEscapeEnd(u) {
if (this.preprocessor.startsWith(Y.SCRIPT, !1) && Vt(this.preprocessor.peek(Y.SCRIPT.length))) {
this._emitCodePoint(u);
for (let t = 0; t < Y.SCRIPT.length; t++)
this._emitCodePoint(this._consume());
this.state = o.SCRIPT_DATA_ESCAPED;
} else this._ensureHibernation() || (this.state = o.SCRIPT_DATA_DOUBLE_ESCAPED, this._stateScriptDataDoubleEscaped(u));
}
// Before attribute name state
//------------------------------------------------------------------
_stateBeforeAttributeName(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.SOLIDUS:
case c.GREATER_THAN_SIGN:
case c.EOF: {
this.state = o.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(u);
break;
}
case c.EQUALS_SIGN: {
this._err(E.unexpectedEqualsSignBeforeAttributeName), this._createAttr("="), this.state = o.ATTRIBUTE_NAME;
break;
}
default:
this._createAttr(""), this.state = o.ATTRIBUTE_NAME, this._stateAttributeName(u);
}
}
// Attribute name state
//------------------------------------------------------------------
_stateAttributeName(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
case c.SOLIDUS:
case c.GREATER_THAN_SIGN:
case c.EOF: {
this._leaveAttrName(), this.state = o.AFTER_ATTRIBUTE_NAME, this._stateAfterAttributeName(u);
break;
}
case c.EQUALS_SIGN: {
this._leaveAttrName(), this.state = o.BEFORE_ATTRIBUTE_VALUE;
break;
}
case c.QUOTATION_MARK:
case c.APOSTROPHE:
case c.LESS_THAN_SIGN: {
this._err(E.unexpectedCharacterInAttributeName), this.currentAttr.name += String.fromCodePoint(u);
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.currentAttr.name += P;
break;
}
default:
this.currentAttr.name += String.fromCodePoint(ye(u) ? eu(u) : u);
}
}
// After attribute name state
//------------------------------------------------------------------
_stateAfterAttributeName(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.SOLIDUS: {
this.state = o.SELF_CLOSING_START_TAG;
break;
}
case c.EQUALS_SIGN: {
this.state = o.BEFORE_ATTRIBUTE_VALUE;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentTagToken();
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this._createAttr(""), this.state = o.ATTRIBUTE_NAME, this._stateAttributeName(u);
}
}
// Before attribute value state
//------------------------------------------------------------------
_stateBeforeAttributeValue(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.QUOTATION_MARK: {
this.state = o.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
this.state = o.ATTRIBUTE_VALUE_SINGLE_QUOTED;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingAttributeValue), this.state = o.DATA, this.emitCurrentTagToken();
break;
}
default:
this.state = o.ATTRIBUTE_VALUE_UNQUOTED, this._stateAttributeValueUnquoted(u);
}
}
// Attribute value (double-quoted) state
//------------------------------------------------------------------
_stateAttributeValueDoubleQuoted(u) {
switch (u) {
case c.QUOTATION_MARK: {
this.state = o.AFTER_ATTRIBUTE_VALUE_QUOTED;
break;
}
case c.AMPERSAND: {
this._startCharacterReference();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.currentAttr.value += P;
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this.currentAttr.value += String.fromCodePoint(u);
}
}
// Attribute value (single-quoted) state
//------------------------------------------------------------------
_stateAttributeValueSingleQuoted(u) {
switch (u) {
case c.APOSTROPHE: {
this.state = o.AFTER_ATTRIBUTE_VALUE_QUOTED;
break;
}
case c.AMPERSAND: {
this._startCharacterReference();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.currentAttr.value += P;
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this.currentAttr.value += String.fromCodePoint(u);
}
}
// Attribute value (unquoted) state
//------------------------------------------------------------------
_stateAttributeValueUnquoted(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this._leaveAttrValue(), this.state = o.BEFORE_ATTRIBUTE_NAME;
break;
}
case c.AMPERSAND: {
this._startCharacterReference();
break;
}
case c.GREATER_THAN_SIGN: {
this._leaveAttrValue(), this.state = o.DATA, this.emitCurrentTagToken();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), this.currentAttr.value += P;
break;
}
case c.QUOTATION_MARK:
case c.APOSTROPHE:
case c.LESS_THAN_SIGN:
case c.EQUALS_SIGN:
case c.GRAVE_ACCENT: {
this._err(E.unexpectedCharacterInUnquotedAttributeValue), this.currentAttr.value += String.fromCodePoint(u);
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this.currentAttr.value += String.fromCodePoint(u);
}
}
// After attribute value (quoted) state
//------------------------------------------------------------------
_stateAfterAttributeValueQuoted(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this._leaveAttrValue(), this.state = o.BEFORE_ATTRIBUTE_NAME;
break;
}
case c.SOLIDUS: {
this._leaveAttrValue(), this.state = o.SELF_CLOSING_START_TAG;
break;
}
case c.GREATER_THAN_SIGN: {
this._leaveAttrValue(), this.state = o.DATA, this.emitCurrentTagToken();
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this._err(E.missingWhitespaceBetweenAttributes), this.state = o.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(u);
}
}
// Self-closing start tag state
//------------------------------------------------------------------
_stateSelfClosingStartTag(u) {
switch (u) {
case c.GREATER_THAN_SIGN: {
const t = this.currentToken;
t.selfClosing = !0, this.state = o.DATA, this.emitCurrentTagToken();
break;
}
case c.EOF: {
this._err(E.eofInTag), this._emitEOFToken();
break;
}
default:
this._err(E.unexpectedSolidusInTag), this.state = o.BEFORE_ATTRIBUTE_NAME, this._stateBeforeAttributeName(u);
}
}
// Bogus comment state
//------------------------------------------------------------------
_stateBogusComment(u) {
const t = this.currentToken;
switch (u) {
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentComment(t);
break;
}
case c.EOF: {
this.emitCurrentComment(t), this._emitEOFToken();
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.data += P;
break;
}
default:
t.data += String.fromCodePoint(u);
}
}
// Markup declaration open state
//------------------------------------------------------------------
_stateMarkupDeclarationOpen(u) {
this._consumeSequenceIfMatch(Y.DASH_DASH, !0) ? (this._createCommentToken(Y.DASH_DASH.length + 1), this.state = o.COMMENT_START) : this._consumeSequenceIfMatch(Y.DOCTYPE, !1) ? (this.currentLocation = this.getCurrentLocation(Y.DOCTYPE.length + 1), this.state = o.DOCTYPE) : this._consumeSequenceIfMatch(Y.CDATA_START, !0) ? this.inForeignNode ? this.state = o.CDATA_SECTION : (this._err(E.cdataInHtmlContent), this._createCommentToken(Y.CDATA_START.length + 1), this.currentToken.data = "[CDATA[", this.state = o.BOGUS_COMMENT) : this._ensureHibernation() || (this._err(E.incorrectlyOpenedComment), this._createCommentToken(2), this.state = o.BOGUS_COMMENT, this._stateBogusComment(u));
}
// Comment start state
//------------------------------------------------------------------
_stateCommentStart(u) {
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.COMMENT_START_DASH;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptClosingOfEmptyComment), this.state = o.DATA;
const t = this.currentToken;
this.emitCurrentComment(t);
break;
}
default:
this.state = o.COMMENT, this._stateComment(u);
}
}
// Comment start dash state
//------------------------------------------------------------------
_stateCommentStartDash(u) {
const t = this.currentToken;
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.COMMENT_END;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptClosingOfEmptyComment), this.state = o.DATA, this.emitCurrentComment(t);
break;
}
case c.EOF: {
this._err(E.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
break;
}
default:
t.data += "-", this.state = o.COMMENT, this._stateComment(u);
}
}
// Comment state
//------------------------------------------------------------------
_stateComment(u) {
const t = this.currentToken;
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.COMMENT_END_DASH;
break;
}
case c.LESS_THAN_SIGN: {
t.data += "<", this.state = o.COMMENT_LESS_THAN_SIGN;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.data += P;
break;
}
case c.EOF: {
this._err(E.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
break;
}
default:
t.data += String.fromCodePoint(u);
}
}
// Comment less-than sign state
//------------------------------------------------------------------
_stateCommentLessThanSign(u) {
const t = this.currentToken;
switch (u) {
case c.EXCLAMATION_MARK: {
t.data += "!", this.state = o.COMMENT_LESS_THAN_SIGN_BANG;
break;
}
case c.LESS_THAN_SIGN: {
t.data += "<";
break;
}
default:
this.state = o.COMMENT, this._stateComment(u);
}
}
// Comment less-than sign bang state
//------------------------------------------------------------------
_stateCommentLessThanSignBang(u) {
u === c.HYPHEN_MINUS ? this.state = o.COMMENT_LESS_THAN_SIGN_BANG_DASH : (this.state = o.COMMENT, this._stateComment(u));
}
// Comment less-than sign bang dash state
//------------------------------------------------------------------
_stateCommentLessThanSignBangDash(u) {
u === c.HYPHEN_MINUS ? this.state = o.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH : (this.state = o.COMMENT_END_DASH, this._stateCommentEndDash(u));
}
// Comment less-than sign bang dash dash state
//------------------------------------------------------------------
_stateCommentLessThanSignBangDashDash(u) {
u !== c.GREATER_THAN_SIGN && u !== c.EOF && this._err(E.nestedComment), this.state = o.COMMENT_END, this._stateCommentEnd(u);
}
// Comment end dash state
//------------------------------------------------------------------
_stateCommentEndDash(u) {
const t = this.currentToken;
switch (u) {
case c.HYPHEN_MINUS: {
this.state = o.COMMENT_END;
break;
}
case c.EOF: {
this._err(E.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
break;
}
default:
t.data += "-", this.state = o.COMMENT, this._stateComment(u);
}
}
// Comment end state
//------------------------------------------------------------------
_stateCommentEnd(u) {
const t = this.currentToken;
switch (u) {
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentComment(t);
break;
}
case c.EXCLAMATION_MARK: {
this.state = o.COMMENT_END_BANG;
break;
}
case c.HYPHEN_MINUS: {
t.data += "-";
break;
}
case c.EOF: {
this._err(E.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
break;
}
default:
t.data += "--", this.state = o.COMMENT, this._stateComment(u);
}
}
// Comment end bang state
//------------------------------------------------------------------
_stateCommentEndBang(u) {
const t = this.currentToken;
switch (u) {
case c.HYPHEN_MINUS: {
t.data += "--!", this.state = o.COMMENT_END_DASH;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.incorrectlyClosedComment), this.state = o.DATA, this.emitCurrentComment(t);
break;
}
case c.EOF: {
this._err(E.eofInComment), this.emitCurrentComment(t), this._emitEOFToken();
break;
}
default:
t.data += "--!", this.state = o.COMMENT, this._stateComment(u);
}
}
// DOCTYPE state
//------------------------------------------------------------------
_stateDoctype(u) {
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.BEFORE_DOCTYPE_NAME;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(u);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), this._createDoctypeToken(null);
const t = this.currentToken;
t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingWhitespaceBeforeDoctypeName), this.state = o.BEFORE_DOCTYPE_NAME, this._stateBeforeDoctypeName(u);
}
}
// Before DOCTYPE name state
//------------------------------------------------------------------
_stateBeforeDoctypeName(u) {
if (ye(u))
this._createDoctypeToken(String.fromCharCode(eu(u))), this.state = o.DOCTYPE_NAME;
else
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.NULL: {
this._err(E.unexpectedNullCharacter), this._createDoctypeToken(P), this.state = o.DOCTYPE_NAME;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingDoctypeName), this._createDoctypeToken(null);
const t = this.currentToken;
t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), this._createDoctypeToken(null);
const t = this.currentToken;
t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._createDoctypeToken(String.fromCodePoint(u)), this.state = o.DOCTYPE_NAME;
}
}
// DOCTYPE name state
//------------------------------------------------------------------
_stateDoctypeName(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.AFTER_DOCTYPE_NAME;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.name += P;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
t.name += String.fromCodePoint(ye(u) ? eu(u) : u);
}
}
// After DOCTYPE name state
//------------------------------------------------------------------
_stateAfterDoctypeName(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._consumeSequenceIfMatch(Y.PUBLIC, !1) ? this.state = o.AFTER_DOCTYPE_PUBLIC_KEYWORD : this._consumeSequenceIfMatch(Y.SYSTEM, !1) ? this.state = o.AFTER_DOCTYPE_SYSTEM_KEYWORD : this._ensureHibernation() || (this._err(E.invalidCharacterSequenceAfterDoctypeName), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u));
}
}
// After DOCTYPE public keyword state
//------------------------------------------------------------------
_stateAfterDoctypePublicKeyword(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case c.QUOTATION_MARK: {
this._err(E.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
this._err(E.missingWhitespaceAfterDoctypePublicKeyword), t.publicId = "", this.state = o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// Before DOCTYPE public identifier state
//------------------------------------------------------------------
_stateBeforeDoctypePublicIdentifier(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.QUOTATION_MARK: {
t.publicId = "", this.state = o.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
t.publicId = "", this.state = o.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingDoctypePublicIdentifier), t.forceQuirks = !0, this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypePublicIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// DOCTYPE public identifier (double-quoted) state
//------------------------------------------------------------------
_stateDoctypePublicIdentifierDoubleQuoted(u) {
const t = this.currentToken;
switch (u) {
case c.QUOTATION_MARK: {
this.state = o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.publicId += P;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
t.publicId += String.fromCodePoint(u);
}
}
// DOCTYPE public identifier (single-quoted) state
//------------------------------------------------------------------
_stateDoctypePublicIdentifierSingleQuoted(u) {
const t = this.currentToken;
switch (u) {
case c.APOSTROPHE: {
this.state = o.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.publicId += P;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptDoctypePublicIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
t.publicId += String.fromCodePoint(u);
}
}
// After DOCTYPE public identifier state
//------------------------------------------------------------------
_stateAfterDoctypePublicIdentifier(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
break;
}
case c.GREATER_THAN_SIGN: {
this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.QUOTATION_MARK: {
this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
this._err(E.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers), t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// Between DOCTYPE public and system identifiers state
//------------------------------------------------------------------
_stateBetweenDoctypePublicAndSystemIdentifiers(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.QUOTATION_MARK: {
t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// After DOCTYPE system keyword state
//------------------------------------------------------------------
_stateAfterDoctypeSystemKeyword(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED: {
this.state = o.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case c.QUOTATION_MARK: {
this._err(E.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
this._err(E.missingWhitespaceAfterDoctypeSystemKeyword), t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// Before DOCTYPE system identifier state
//------------------------------------------------------------------
_stateBeforeDoctypeSystemIdentifier(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.QUOTATION_MARK: {
t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case c.APOSTROPHE: {
t.systemId = "", this.state = o.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.missingDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.DATA, this.emitCurrentDoctype(t);
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.missingQuoteBeforeDoctypeSystemIdentifier), t.forceQuirks = !0, this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// DOCTYPE system identifier (double-quoted) state
//------------------------------------------------------------------
_stateDoctypeSystemIdentifierDoubleQuoted(u) {
const t = this.currentToken;
switch (u) {
case c.QUOTATION_MARK: {
this.state = o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.systemId += P;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
t.systemId += String.fromCodePoint(u);
}
}
// DOCTYPE system identifier (single-quoted) state
//------------------------------------------------------------------
_stateDoctypeSystemIdentifierSingleQuoted(u) {
const t = this.currentToken;
switch (u) {
case c.APOSTROPHE: {
this.state = o.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter), t.systemId += P;
break;
}
case c.GREATER_THAN_SIGN: {
this._err(E.abruptDoctypeSystemIdentifier), t.forceQuirks = !0, this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
t.systemId += String.fromCodePoint(u);
}
}
// After DOCTYPE system identifier state
//------------------------------------------------------------------
_stateAfterDoctypeSystemIdentifier(u) {
const t = this.currentToken;
switch (u) {
case c.SPACE:
case c.LINE_FEED:
case c.TABULATION:
case c.FORM_FEED:
break;
case c.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.EOF: {
this._err(E.eofInDoctype), t.forceQuirks = !0, this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
default:
this._err(E.unexpectedCharacterAfterDoctypeSystemIdentifier), this.state = o.BOGUS_DOCTYPE, this._stateBogusDoctype(u);
}
}
// Bogus DOCTYPE state
//------------------------------------------------------------------
_stateBogusDoctype(u) {
const t = this.currentToken;
switch (u) {
case c.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(t), this.state = o.DATA;
break;
}
case c.NULL: {
this._err(E.unexpectedNullCharacter);
break;
}
case c.EOF: {
this.emitCurrentDoctype(t), this._emitEOFToken();
break;
}
}
}
// CDATA section state
//------------------------------------------------------------------
_stateCdataSection(u) {
switch (u) {
case c.RIGHT_SQUARE_BRACKET: {
this.state = o.CDATA_SECTION_BRACKET;
break;
}
case c.EOF: {
this._err(E.eofInCdata), this._emitEOFToken();
break;
}
default:
this._emitCodePoint(u);
}
}
// CDATA section bracket state
//------------------------------------------------------------------
_stateCdataSectionBracket(u) {
u === c.RIGHT_SQUARE_BRACKET ? this.state = o.CDATA_SECTION_END : (this._emitChars("]"), this.state = o.CDATA_SECTION, this._stateCdataSection(u));
}
// CDATA section end state
//------------------------------------------------------------------
_stateCdataSectionEnd(u) {
switch (u) {
case c.GREATER_THAN_SIGN: {
this.state = o.DATA;
break;
}
case c.RIGHT_SQUARE_BRACKET: {
this._emitChars("]");
break;
}
default:
this._emitChars("]]"), this.state = o.CDATA_SECTION, this._stateCdataSection(u);
}
}
// Character reference state
//------------------------------------------------------------------
_stateCharacterReference() {
let u = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
if (u < 0)
if (this.preprocessor.lastChunkWritten)
u = this.entityDecoder.end();
else {
this.active = !1, this.preprocessor.pos = this.preprocessor.html.length - 1, this.consumedAfterSnapshot = 0, this.preprocessor.endOfChunkHit = !0;
return;
}
u === 0 ? (this.preprocessor.pos = this.entityStartPos, this._flushCodePointConsumedAsCharacterReference(c.AMPERSAND), this.state = !this._isCharacterReferenceInAttribute() && Yt(this.preprocessor.peek(1)) ? o.AMBIGUOUS_AMPERSAND : this.returnState) : this.state = this.returnState;
}
// Ambiguos ampersand state
//------------------------------------------------------------------
_stateAmbiguousAmpersand(u) {
Yt(u) ? this._flushCodePointConsumedAsCharacterReference(u) : (u === c.SEMICOLON && this._err(E.unknownNamedCharacterReference), this.state = this.returnState, this._callState(u));
}
}
const G0 = /* @__PURE__ */ new Set([s.DD, s.DT, s.LI, s.OPTGROUP, s.OPTION, s.P, s.RB, s.RP, s.RT, s.RTC]), Gt = /* @__PURE__ */ new Set([
...G0,
s.CAPTION,
s.COLGROUP,
s.TBODY,
s.TD,
s.TFOOT,
s.TH,
s.THEAD,
s.TR
]), fu = /* @__PURE__ */ new Set([
s.APPLET,
s.CAPTION,
s.HTML,
s.MARQUEE,
s.OBJECT,
s.TABLE,
s.TD,
s.TEMPLATE,
s.TH
]), li = /* @__PURE__ */ new Set([...fu, s.OL, s.UL]), hi = /* @__PURE__ */ new Set([...fu, s.BUTTON]), Qt = /* @__PURE__ */ new Set([s.ANNOTATION_XML, s.MI, s.MN, s.MO, s.MS, s.MTEXT]), Wt = /* @__PURE__ */ new Set([s.DESC, s.FOREIGN_OBJECT, s.TITLE]), bi = /* @__PURE__ */ new Set([s.TR, s.TEMPLATE, s.HTML]), Ei = /* @__PURE__ */ new Set([s.TBODY, s.TFOOT, s.THEAD, s.TEMPLATE, s.HTML]), Ti = /* @__PURE__ */ new Set([s.TABLE, s.TEMPLATE, s.HTML]), mi = /* @__PURE__ */ new Set([s.TD, s.TH]);
class Ai {
get currentTmplContentOrNode() {
return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
}
constructor(u, t, a) {
this.treeAdapter = t, this.handler = a, this.items = [], this.tagIDs = [], this.stackTop = -1, this.tmplCount = 0, this.currentTagId = s.UNKNOWN, this.current = u;
}
//Index of element
_indexOf(u) {
return this.items.lastIndexOf(u, this.stackTop);
}
//Update current element
_isInTemplate() {
return this.currentTagId === s.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === T.HTML;
}
_updateCurrentElement() {
this.current = this.items[this.stackTop], this.currentTagId = this.tagIDs[this.stackTop];
}
//Mutations
push(u, t) {
this.stackTop++, this.items[this.stackTop] = u, this.current = u, this.tagIDs[this.stackTop] = t, this.currentTagId = t, this._isInTemplate() && this.tmplCount++, this.handler.onItemPush(u, t, !0);
}
pop() {
const u = this.current;
this.tmplCount > 0 && this._isInTemplate() && this.tmplCount--, this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(u, !0);
}
replace(u, t) {
const a = this._indexOf(u);
this.items[a] = t, a === this.stackTop && (this.current = t);
}
insertAfter(u, t, a) {
const r = this._indexOf(u) + 1;
this.items.splice(r, 0, t), this.tagIDs.splice(r, 0, a), this.stackTop++, r === this.stackTop && this._updateCurrentElement(), this.current && this.currentTagId !== void 0 && this.handler.onItemPush(this.current, this.currentTagId, r === this.stackTop);
}
popUntilTagNamePopped(u) {
let t = this.stackTop + 1;
do
t = this.tagIDs.lastIndexOf(u, t - 1);
while (t > 0 && this.treeAdapter.getNamespaceURI(this.items[t]) !== T.HTML);
this.shortenToLength(Math.max(t, 0));
}
shortenToLength(u) {
for (; this.stackTop >= u; ) {
const t = this.current;
this.tmplCount > 0 && this._isInTemplate() && (this.tmplCount -= 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(t, this.stackTop < u);
}
}
popUntilElementPopped(u) {
const t = this._indexOf(u);
this.shortenToLength(Math.max(t, 0));
}
popUntilPopped(u, t) {
const a = this._indexOfTagNames(u, t);
this.shortenToLength(Math.max(a, 0));
}
popUntilNumberedHeaderPopped() {
this.popUntilPopped(Ku, T.HTML);
}
popUntilTableCellPopped() {
this.popUntilPopped(mi, T.HTML);
}
popAllUpToHtmlElement() {
this.tmplCount = 0, this.shortenToLength(1);
}
_indexOfTagNames(u, t) {
for (let a = this.stackTop; a >= 0; a--)
if (u.has(this.tagIDs[a]) && this.treeAdapter.getNamespaceURI(this.items[a]) === t)
return a;
return -1;
}
clearBackTo(u, t) {
const a = this._indexOfTagNames(u, t);
this.shortenToLength(a + 1);
}
clearBackToTableContext() {
this.clearBackTo(Ti, T.HTML);
}
clearBackToTableBodyContext() {
this.clearBackTo(Ei, T.HTML);
}
clearBackToTableRowContext() {
this.clearBackTo(bi, T.HTML);
}
remove(u) {
const t = this._indexOf(u);
t >= 0 && (t === this.stackTop ? this.pop() : (this.items.splice(t, 1), this.tagIDs.splice(t, 1), this.stackTop--, this._updateCurrentElement(), this.handler.onItemPop(u, !1)));
}
//Search
tryPeekProperlyNestedBodyElement() {
return this.stackTop >= 1 && this.tagIDs[1] === s.BODY ? this.items[1] : null;
}
contains(u) {
return this._indexOf(u) > -1;
}
getCommonAncestor(u) {
const t = this._indexOf(u) - 1;
return t >= 0 ? this.items[t] : null;
}
isRootHtmlElementCurrent() {
return this.stackTop === 0 && this.tagIDs[0] === s.HTML;
}
//Element in scope
hasInDynamicScope(u, t) {
for (let a = this.stackTop; a >= 0; a--) {
const r = this.tagIDs[a];
switch (this.treeAdapter.getNamespaceURI(this.items[a])) {
case T.HTML: {
if (r === u)
return !0;
if (t.has(r))
return !1;
break;
}
case T.SVG: {
if (Wt.has(r))
return !1;
break;
}
case T.MATHML: {
if (Qt.has(r))
return !1;
break;
}
}
}
return !0;
}
hasInScope(u) {
return this.hasInDynamicScope(u, fu);
}
hasInListItemScope(u) {
return this.hasInDynamicScope(u, li);
}
hasInButtonScope(u) {
return this.hasInDynamicScope(u, hi);
}
hasNumberedHeaderInScope() {
for (let u = this.stackTop; u >= 0; u--) {
const t = this.tagIDs[u];
switch (this.treeAdapter.getNamespaceURI(this.items[u])) {
case T.HTML: {
if (Ku.has(t))
return !0;
if (fu.has(t))
return !1;
break;
}
case T.SVG: {
if (Wt.has(t))
return !1;
break;
}
case T.MATHML: {
if (Qt.has(t))
return !1;
break;
}
}
}
return !0;
}
hasInTableScope(u) {
for (let t = this.stackTop; t >= 0; t--)
if (this.treeAdapter.getNamespaceURI(this.items[t]) === T.HTML)
switch (this.tagIDs[t]) {
case u:
return !0;
case s.TABLE:
case s.HTML:
return !1;
}
return !0;
}
hasTableBodyContextInTableScope() {
for (let u = this.stackTop; u >= 0; u--)
if (this.treeAdapter.getNamespaceURI(this.items[u]) === T.HTML)
switch (this.tagIDs[u]) {
case s.TBODY:
case s.THEAD:
case s.TFOOT:
return !0;
case s.TABLE:
case s.HTML:
return !1;
}
return !0;
}
hasInSelectScope(u) {
for (let t = this.stackTop; t >= 0; t--)
if (this.treeAdapter.getNamespaceURI(this.items[t]) === T.HTML)
switch (this.tagIDs[t]) {
case u:
return !0;
case s.OPTION:
case s.OPTGROUP:
break;
default:
return !1;
}
return !0;
}
//Implied end tags
generateImpliedEndTags() {
for (; this.currentTagId !== void 0 && G0.has(this.currentTagId); )
this.pop();
}
generateImpliedEndTagsThoroughly() {
for (; this.currentTagId !== void 0 && Gt.has(this.currentTagId); )
this.pop();
}
generateImpliedEndTagsWithExclusion(u) {
for (; this.currentTagId !== void 0 && this.currentTagId !== u && Gt.has(this.currentTagId); )
this.pop();
}
}
const Bu = 3;
var j;
(function(e) {
e[e.Marker = 0] = "Marker", e[e.Element = 1] = "Element";
})(j || (j = {}));
const Xt = { type: j.Marker };
class _i {
constructor(u) {
this.treeAdapter = u, this.entries = [], this.bookmark = null;
}
//Noah Ark's condition
//OPTIMIZATION: at first we try to find possible candidates for exclusion using
//lightweight heuristics without thorough attributes check.
_getNoahArkConditionCandidates(u, t) {
const a = [], r = t.length, n = this.treeAdapter.getTagName(u), i = this.treeAdapter.getNamespaceURI(u);
for (let f = 0; f < this.entries.length; f++) {
const l = this.entries[f];
if (l.type === j.Marker)
break;
const { element: b } = l;
if (this.treeAdapter.getTagName(b) === n && this.treeAdapter.getNamespaceURI(b) === i) {
const m = this.treeAdapter.getAttrList(b);
m.length === r && a.push({ idx: f, attrs: m });
}
}
return a;
}
_ensureNoahArkCondition(u) {
if (this.entries.length < Bu)
return;
const t = this.treeAdapter.getAttrList(u), a = this._getNoahArkConditionCandidates(u, t);
if (a.length < Bu)
return;
const r = new Map(t.map((i) => [i.name, i.value]));
let n = 0;
for (let i = 0; i < a.length; i++) {
const f = a[i];
f.attrs.every((l) => r.get(l.name) === l.value) && (n += 1, n >= Bu && this.entries.splice(f.idx, 1));
}
}
//Mutations
insertMarker() {
this.entries.unshift(Xt);
}
pushElement(u, t) {
this._ensureNoahArkCondition(u), this.entries.unshift({
type: j.Element,
element: u,
token: t
});
}
insertElementAfterBookmark(u, t) {
const a = this.entries.indexOf(this.bookmark);
this.entries.splice(a, 0, {
type: j.Element,
element: u,
token: t
});
}
removeEntry(u) {
const t = this.entries.indexOf(u);
t !== -1 && this.entries.splice(t, 1);
}
/**
* Clears the list of formatting elements up to the last marker.
*
* @see https://html.spec.whatwg.org/multipage/parsing.html#clear-the-list-of-active-formatting-elements-up-to-the-last-marker
*/
clearToLastMarker() {
const u = this.entries.indexOf(Xt);
u === -1 ? this.entries.length = 0 : this.entries.splice(0, u + 1);
}
//Search
getElementEntryInScopeWithTagName(u) {
const t = this.entries.find((a) => a.type === j.Marker || this.treeAdapter.getTagName(a.element) === u);
return t && t.type === j.Element ? t : null;
}
getElementEntry(u) {
return this.entries.find((t) => t.type === j.Element && t.element === u);
}
}
const ee = {
//Node construction
createDocument() {
return {
nodeName: "#document",
mode: Q.NO_QUIRKS,
childNodes: []
};
},
createDocumentFragment() {
return {
nodeName: "#document-fragment",
childNodes: []
};
},
createElement(e, u, t) {
return {
nodeName: e,
tagName: e,
attrs: t,
namespaceURI: u,
childNodes: [],
parentNode: null
};
},
createCommentNode(e) {
return {
nodeName: "#comment",
data: e,
parentNode: null
};
},
createTextNode(e) {
return {
nodeName: "#text",
value: e,
parentNode: null
};
},
//Tree mutation
appendChild(e, u) {
e.childNodes.push(u), u.parentNode = e;
},
insertBefore(e, u, t) {
const a = e.childNodes.indexOf(t);
e.childNodes.splice(a, 0, u), u.parentNode = e;
},
setTemplateContent(e, u) {
e.content = u;
},
getTemplateContent(e) {
return e.content;
},
setDocumentType(e, u, t, a) {
const r = e.childNodes.find((n) => n.nodeName === "#documentType");
if (r)
r.name = u, r.publicId = t, r.systemId = a;
else {
const n = {
nodeName: "#documentType",
name: u,
publicId: t,
systemId: a,
parentNode: null
};
ee.appendChild(e, n);
}
},
setDocumentMode(e, u) {
e.mode = u;
},
getDocumentMode(e) {
return e.mode;
},
detachNode(e) {
if (e.parentNode) {
const u = e.parentNode.childNodes.indexOf(e);
e.parentNode.childNodes.splice(u, 1), e.parentNode = null;
}
},
insertText(e, u) {
if (e.childNodes.length > 0) {
const t = e.childNodes[e.childNodes.length - 1];
if (ee.isTextNode(t)) {
t.value += u;
return;
}
}
ee.appendChild(e, ee.createTextNode(u));
},
insertTextBefore(e, u, t) {
const a = e.childNodes[e.childNodes.indexOf(t) - 1];
a && ee.isTextNode(a) ? a.value += u : ee.insertBefore(e, ee.createTextNode(u), t);
},
adoptAttributes(e, u) {
const t = new Set(e.attrs.map((a) => a.name));
for (let a = 0; a < u.length; a++)
t.has(u[a].name) || e.attrs.push(u[a]);
},
//Tree traversing
getFirstChild(e) {
return e.childNodes[0];
},
getChildNodes(e) {
return e.childNodes;
},
getParentNode(e) {
return e.parentNode;
},
getAttrList(e) {
return e.attrs;
},
//Node data
getTagName(e) {
return e.tagName;
},
getNamespaceURI(e) {
return e.namespaceURI;
},
getTextNodeContent(e) {
return e.value;
},
getCommentNodeContent(e) {
return e.data;
},
getDocumentTypeNodeName(e) {
return e.name;
},
getDocumentTypeNodePublicId(e) {
return e.publicId;
},
getDocumentTypeNodeSystemId(e) {
return e.systemId;
},
//Node types
isTextNode(e) {
return e.nodeName === "#text";
},
isCommentNode(e) {
return e.nodeName === "#comment";
},
isDocumentTypeNode(e) {
return e.nodeName === "#documentType";
},
isElementNode(e) {
return Object.prototype.hasOwnProperty.call(e, "tagName");
},
// Source code location
setNodeSourceCodeLocation(e, u) {
e.sourceCodeLocation = u;
},
getNodeSourceCodeLocation(e) {
return e.sourceCodeLocation;
},
updateNodeSourceCodeLocation(e, u) {
e.sourceCodeLocation = { ...e.sourceCodeLocation, ...u };
}
}, Q0 = "html", pi = "about:legacy-compat", gi = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", W0 = [
"+//silmaril//dtd html pro v0r11 19970101//",
"-//as//dtd html 3.0 aswedit + extensions//",
"-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
"-//ietf//dtd html 2.0 level 1//",
"-//ietf//dtd html 2.0 level 2//",
"-//ietf//dtd html 2.0 strict level 1//",
"-//ietf//dtd html 2.0 strict level 2//",
"-//ietf//dtd html 2.0 strict//",
"-//ietf//dtd html 2.0//",
"-//ietf//dtd html 2.1e//",
"-//ietf//dtd html 3.0//",
"-//ietf//dtd html 3.2 final//",
"-//ietf//dtd html 3.2//",
"-//ietf//dtd html 3//",
"-//ietf//dtd html level 0//",
"-//ietf//dtd html level 1//",
"-//ietf//dtd html level 2//",
"-//ietf//dtd html level 3//",
"-//ietf//dtd html strict level 0//",
"-//ietf//dtd html strict level 1//",
"-//ietf//dtd html strict level 2//",
"-//ietf//dtd html strict level 3//",
"-//ietf//dtd html strict//",
"-//ietf//dtd html//",
"-//metrius//dtd metrius presentational//",
"-//microsoft//dtd internet explorer 2.0 html strict//",
"-//microsoft//dtd internet explorer 2.0 html//",
"-//microsoft//dtd internet explorer 2.0 tables//",
"-//microsoft//dtd internet explorer 3.0 html strict//",
"-//microsoft//dtd internet explorer 3.0 html//",
"-//microsoft//dtd internet explorer 3.0 tables//",
"-//netscape comm. corp.//dtd html//",
"-//netscape comm. corp.//dtd strict html//",
"-//o'reilly and associates//dtd html 2.0//",
"-//o'reilly and associates//dtd html extended 1.0//",
"-//o'reilly and associates//dtd html extended relaxed 1.0//",
"-//sq//dtd html 2.0 hotmetal + extensions//",
"-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//",
"-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
"-//spyglass//dtd html 2.0 extended//",
"-//sun microsystems corp.//dtd hotjava html//",
"-//sun microsystems corp.//dtd hotjava strict html//",
"-//w3c//dtd html 3 1995-03-24//",
"-//w3c//dtd html 3.2 draft//",
"-//w3c//dtd html 3.2 final//",
"-//w3c//dtd html 3.2//",
"-//w3c//dtd html 3.2s draft//",
"-//w3c//dtd html 4.0 frameset//",
"-//w3c//dtd html 4.0 transitional//",
"-//w3c//dtd html experimental 19960712//",
"-//w3c//dtd html experimental 970421//",
"-//w3c//dtd w3 html//",
"-//w3o//dtd w3 html 3.0//",
"-//webtechs//dtd mozilla html 2.0//",
"-//webtechs//dtd mozilla html//"
], Ni = [
...W0,
"-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//"
], Ii = /* @__PURE__ */ new Set([
"-//w3o//dtd w3 html strict 3.0//en//",
"-/w3c/dtd html 4.0 transitional/en",
"html"
]), X0 = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"], Si = [
...X0,
"-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//"
];
function Kt(e, u) {
return u.some((t) => e.startsWith(t));
}
function Ci(e) {
return e.name === Q0 && e.publicId === null && (e.systemId === null || e.systemId === pi);
}
function xi(e) {
if (e.name !== Q0)
return Q.QUIRKS;
const { systemId: u } = e;
if (u && u.toLowerCase() === gi)
return Q.QUIRKS;
let { publicId: t } = e;
if (t !== null) {
if (t = t.toLowerCase(), Ii.has(t))
return Q.QUIRKS;
let a = u === null ? Ni : W0;
if (Kt(t, a))
return Q.QUIRKS;
if (a = u === null ? X0 : Si, Kt(t, a))
return Q.LIMITED_QUIRKS;
}
return Q.NO_QUIRKS;
}
const jt = {
TEXT_HTML: "text/html",
APPLICATION_XML: "application/xhtml+xml"
}, Oi = "definitionurl", Li = "definitionURL", Di = new Map([
"attributeName",
"attributeType",
"baseFrequency",
"baseProfile",
"calcMode",
"clipPathUnits",
"diffuseConstant",
"edgeMode",
"filterUnits",
"glyphRef",
"gradientTransform",
"gradientUnits",
"kernelMatrix",
"kernelUnitLength",
"keyPoints",
"keySplines",
"keyTimes",
"lengthAdjust",
"limitingConeAngle",
"markerHeight",
"markerUnits",
"markerWidth",
"maskContentUnits",
"maskUnits",
"numOctaves",
"pathLength",
"patternContentUnits",
"patternTransform",
"patternUnits",
"pointsAtX",
"pointsAtY",
"pointsAtZ",
"preserveAlpha",
"preserveAspectRatio",
"primitiveUnits",
"refX",
"refY",
"repeatCount",
"repeatDur",
"requiredExtensions",
"requiredFeatures",
"specularConstant",
"specularExponent",
"spreadMethod",
"startOffset",
"stdDeviation",
"stitchTiles",
"surfaceScale",
"systemLanguage",
"tableValues",
"targetX",
"targetY",
"textLength",
"viewBox",
"viewTarget",
"xChannelSelector",
"yChannelSelector",
"zoomAndPan"
].map((e) => [e.toLowerCase(), e])), Ri = /* @__PURE__ */ new Map([
["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: T.XLINK }],
["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: T.XLINK }],
["xlink:href", { prefix: "xlink", name: "href", namespace: T.XLINK }],
["xlink:role", { prefix: "xlink", name: "role", namespace: T.XLINK }],
["xlink:show", { prefix: "xlink", name: "show", namespace: T.XLINK }],
["xlink:title", { prefix: "xlink", name: "title", namespace: T.XLINK }],
["xlink:type", { prefix: "xlink", name: "type", namespace: T.XLINK }],
["xml:lang", { prefix: "xml", name: "lang", namespace: T.XML }],
["xml:space", { prefix: "xml", name: "space", namespace: T.XML }],
["xmlns", { prefix: "", name: "xmlns", namespace: T.XMLNS }],
["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: T.XMLNS }]
]), Pi = new Map([
"altGlyph",
"altGlyphDef",
"altGlyphItem",
"animateColor",
"animateMotion",
"animateTransform",
"clipPath",
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence",
"foreignObject",
"glyphRef",
"linearGradient",
"radialGradient",
"textPath"
].map((e) => [e.toLowerCase(), e])), yi = /* @__PURE__ */ new Set([
s.B,
s.BIG,
s.BLOCKQUOTE,
s.BODY,
s.BR,
s.CENTER,
s.CODE,
s.DD,
s.DIV,
s.DL,
s.DT,
s.EM,
s.EMBED,
s.H1,
s.H2,
s.H3,
s.H4,
s.H5,
s.H6,
s.HEAD,
s.HR,
s.I,
s.IMG,
s.LI,
s.LISTING,
s.MENU,
s.META,
s.NOBR,
s.OL,
s.P,
s.PRE,
s.RUBY,
s.S,
s.SMALL,
s.SPAN,
s.STRONG,
s.STRIKE,
s.SUB,
s.SUP,
s.TABLE,
s.TT,
s.U,
s.UL,
s.VAR
]);
function Mi(e) {
const u = e.tagID;
return u === s.FONT && e.attrs.some(({ name: a }) => a === he.COLOR || a === he.SIZE || a === he.FACE) || yi.has(u);
}
function K0(e) {
for (let u = 0; u < e.attrs.length; u++)
if (e.attrs[u].name === Oi) {
e.attrs[u].name = Li;
break;
}
}
function j0(e) {
for (let u = 0; u < e.attrs.length; u++) {
const t = Di.get(e.attrs[u].name);
t != null && (e.attrs[u].name = t);
}
}
function mt(e) {
for (let u = 0; u < e.attrs.length; u++) {
const t = Ri.get(e.attrs[u].name);
t && (e.attrs[u].prefix = t.prefix, e.attrs[u].name = t.name, e.attrs[u].namespace = t.namespace);
}
}
function ki(e) {
const u = Pi.get(e.tagName);
u != null && (e.tagName = u, e.tagID = pu(e.tagName));
}
function Bi(e, u) {
return u === T.MATHML && (e === s.MI || e === s.MO || e === s.MN || e === s.MS || e === s.MTEXT);
}
function Fi(e, u, t) {
if (u === T.MATHML && e === s.ANNOTATION_XML) {
for (let a = 0; a < t.length; a++)
if (t[a].name === he.ENCODING) {
const r = t[a].value.toLowerCase();
return r === jt.TEXT_HTML || r === jt.APPLICATION_XML;
}
}
return u === T.SVG && (e === s.FOREIGN_OBJECT || e === s.DESC || e === s.TITLE);
}
function wi(e, u, t, a) {
return (!a || a === T.HTML) && Fi(e, u, t) || (!a || a === T.MATHML) && Bi(e, u);
}
const Ui = "hidden", Hi = 8, vi = 3;
var d;
(function(e) {
e[e.INITIAL = 0] = "INITIAL", e[e.BEFORE_HTML = 1] = "BEFORE_HTML", e[e.BEFORE_HEAD = 2] = "BEFORE_HEAD", e[e.IN_HEAD = 3] = "IN_HEAD", e[e.IN_HEAD_NO_SCRIPT = 4] = "IN_HEAD_NO_SCRIPT", e[e.AFTER_HEAD = 5] = "AFTER_HEAD", e[e.IN_BODY = 6] = "IN_BODY", e[e.TEXT = 7] = "TEXT", e[e.IN_TABLE = 8] = "IN_TABLE", e[e.IN_TABLE_TEXT = 9] = "IN_TABLE_TEXT", e[e.IN_CAPTION = 10] = "IN_CAPTION", e[e.IN_COLUMN_GROUP = 11] = "IN_COLUMN_GROUP", e[e.IN_TABLE_BODY = 12] = "IN_TABLE_BODY", e[e.IN_ROW = 13] = "IN_ROW", e[e.IN_CELL = 14] = "IN_CELL", e[e.IN_SELECT = 15] = "IN_SELECT", e[e.IN_SELECT_IN_TABLE = 16] = "IN_SELECT_IN_TABLE", e[e.IN_TEMPLATE = 17] = "IN_TEMPLATE", e[e.AFTER_BODY = 18] = "AFTER_BODY", e[e.IN_FRAMESET = 19] = "IN_FRAMESET", e[e.AFTER_FRAMESET = 20] = "AFTER_FRAMESET", e[e.AFTER_AFTER_BODY = 21] = "AFTER_AFTER_BODY", e[e.AFTER_AFTER_FRAMESET = 22] = "AFTER_AFTER_FRAMESET";
})(d || (d = {}));
const qi = {
startLine: -1,
startCol: -1,
startOffset: -1,
endLine: -1,
endCol: -1,
endOffset: -1
}, $0 = /* @__PURE__ */ new Set([s.TABLE, s.TBODY, s.TFOOT, s.THEAD, s.TR]), $t = {
scriptingEnabled: !0,
sourceCodeLocationInfo: !1,
treeAdapter: ee,
onParseError: null
};
class z0 {
constructor(u, t, a = null, r = null) {
this.fragmentContext = a, this.scriptHandler = r, this.currentToken = null, this.stopped = !1, this.insertionMode = d.INITIAL, this.originalInsertionMode = d.INITIAL, this.headElement = null, this.formElement = null, this.currentNotInHTML = !1, this.tmplInsertionModeStack = [], this.pendingCharacterTokens = [], this.hasNonWhitespacePendingCharacterToken = !1, this.framesetOk = !0, this.skipNextNewLine = !1, this.fosterParentingEnabled = !1, this.options = {
...$t,
...u
}, this.treeAdapter = this.options.treeAdapter, this.onParseError = this.options.onParseError, this.onParseError && (this.options.sourceCodeLocationInfo = !0), this.document = t ?? this.treeAdapter.createDocument(), this.tokenizer = new fi(this.options, this), this.activeFormattingElements = new _i(this.treeAdapter), this.fragmentContextID = a ? pu(this.treeAdapter.getTagName(a)) : s.UNKNOWN, this._setContextModes(a ?? this.document, this.fragmentContextID), this.openElements = new Ai(this.document, this.treeAdapter, this);
}
// API
static parse(u, t) {
const a = new this(t);
return a.tokenizer.write(u, !0), a.document;
}
static getFragmentParser(u, t) {
const a = {
...$t,
...t
};
u ?? (u = a.treeAdapter.createElement(h.TEMPLATE, T.HTML, []));
const r = a.treeAdapter.createElement("documentmock", T.HTML, []), n = new this(a, r, u);
return n.fragmentContextID === s.TEMPLATE && n.tmplInsertionModeStack.unshift(d.IN_TEMPLATE), n._initTokenizerForFragmentParsing(), n._insertFakeRootElement(), n._resetInsertionMode(), n._findFormInFragmentContext(), n;
}
getFragment() {
const u = this.treeAdapter.getFirstChild(this.document), t = this.treeAdapter.createDocumentFragment();
return this._adoptNodes(u, t), t;
}
//Errors
/** @internal */
_err(u, t, a) {
var r;
if (!this.onParseError)
return;
const n = (r = u.location) !== null && r !== void 0 ? r : qi, i = {
code: t,
startLine: n.startLine,
startCol: n.startCol,
startOffset: n.startOffset,
endLine: a ? n.startLine : n.endLine,
endCol: a ? n.startCol : n.endCol,
endOffset: a ? n.startOffset : n.endOffset
};
this.onParseError(i);
}
//Stack events
/** @internal */
onItemPush(u, t, a) {
var r, n;
(n = (r = this.treeAdapter).onItemPush) === null || n === void 0 || n.call(r, u), a && this.openElements.stackTop > 0 && this._setContextModes(u, t);
}
/** @internal */
onItemPop(u, t) {
var a, r;
if (this.options.sourceCodeLocationInfo && this._setEndLocation(u, this.currentToken), (r = (a = this.treeAdapter).onItemPop) === null || r === void 0 || r.call(a, u, this.openElements.current), t) {
let n, i;
this.openElements.stackTop === 0 && this.fragmentContext ? (n = this.fragmentContext, i = this.fragmentContextID) : { current: n, currentTagId: i } = this.openElements, this._setContextModes(n, i);
}
}
_setContextModes(u, t) {
const a = u === this.document || u && this.treeAdapter.getNamespaceURI(u) === T.HTML;
this.currentNotInHTML = !a, this.tokenizer.inForeignNode = !a && u !== void 0 && t !== void 0 && !this._isIntegrationPoint(t, u);
}
/** @protected */
_switchToTextParsing(u, t) {
this._insertElement(u, T.HTML), this.tokenizer.state = t, this.originalInsertionMode = this.insertionMode, this.insertionMode = d.TEXT;
}
switchToPlaintextParsing() {
this.insertionMode = d.TEXT, this.originalInsertionMode = d.IN_BODY, this.tokenizer.state = G.PLAINTEXT;
}
//Fragment parsing
/** @protected */
_getAdjustedCurrentElement() {
return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current;
}
/** @protected */
_findFormInFragmentContext() {
let u = this.fragmentContext;
for (; u; ) {
if (this.treeAdapter.getTagName(u) === h.FORM) {
this.formElement = u;
break;
}
u = this.treeAdapter.getParentNode(u);
}
}
_initTokenizerForFragmentParsing() {
if (!(!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== T.HTML))
switch (this.fragmentContextID) {
case s.TITLE:
case s.TEXTAREA: {
this.tokenizer.state = G.RCDATA;
break;
}
case s.STYLE:
case s.XMP:
case s.IFRAME:
case s.NOEMBED:
case s.NOFRAMES:
case s.NOSCRIPT: {
this.tokenizer.state = G.RAWTEXT;
break;
}
case s.SCRIPT: {
this.tokenizer.state = G.SCRIPT_DATA;
break;
}
case s.PLAINTEXT: {
this.tokenizer.state = G.PLAINTEXT;
break;
}
}
}
//Tree mutation
/** @protected */
_setDocumentType(u) {
const t = u.name || "", a = u.publicId || "", r = u.systemId || "";
if (this.treeAdapter.setDocumentType(this.document, t, a, r), u.location) {
const i = this.treeAdapter.getChildNodes(this.document).find((f) => this.treeAdapter.isDocumentTypeNode(f));
i && this.treeAdapter.setNodeSourceCodeLocation(i, u.location);
}
}
/** @protected */
_attachElementToTree(u, t) {
if (this.options.sourceCodeLocationInfo) {
const a = t && {
...t,
startTag: t
};
this.treeAdapter.setNodeSourceCodeLocation(u, a);
}
if (this._shouldFosterParentOnInsertion())
this._fosterParentElement(u);
else {
const a = this.openElements.currentTmplContentOrNode;
this.treeAdapter.appendChild(a ?? this.document, u);
}
}
/**
* For self-closing tags. Add an element to the tree, but skip adding it
* to the stack.
*/
/** @protected */
_appendElement(u, t) {
const a = this.treeAdapter.createElement(u.tagName, t, u.attrs);
this._attachElementToTree(a, u.location);
}
/** @protected */
_insertElement(u, t) {
const a = this.treeAdapter.createElement(u.tagName, t, u.attrs);
this._attachElementToTree(a, u.location), this.openElements.push(a, u.tagID);
}
/** @protected */
_insertFakeElement(u, t) {
const a = this.treeAdapter.createElement(u, T.HTML, []);
this._attachElementToTree(a, null), this.openElements.push(a, t);
}
/** @protected */
_insertTemplate(u) {
const t = this.treeAdapter.createElement(u.tagName, T.HTML, u.attrs), a = this.treeAdapter.createDocumentFragment();
this.treeAdapter.setTemplateContent(t, a), this._attachElementToTree(t, u.location), this.openElements.push(t, u.tagID), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(a, null);
}
/** @protected */
_insertFakeRootElement() {
const u = this.treeAdapter.createElement(h.HTML, T.HTML, []);
this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(u, null), this.treeAdapter.appendChild(this.openElements.current, u), this.openElements.push(u, s.HTML);
}
/** @protected */
_appendCommentNode(u, t) {
const a = this.treeAdapter.createCommentNode(u.data);
this.treeAdapter.appendChild(t, a), this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(a, u.location);
}
/** @protected */
_insertCharacters(u) {
let t, a;
if (this._shouldFosterParentOnInsertion() ? ({ parent: t, beforeElement: a } = this._findFosterParentingLocation(), a ? this.treeAdapter.insertTextBefore(t, u.chars, a) : this.treeAdapter.insertText(t, u.chars)) : (t = this.openElements.currentTmplContentOrNode, this.treeAdapter.insertText(t, u.chars)), !u.location)
return;
const r = this.treeAdapter.getChildNodes(t), n = a ? r.lastIndexOf(a) : r.length, i = r[n - 1];
if (this.treeAdapter.getNodeSourceCodeLocation(i)) {
const { endLine: l, endCol: b, endOffset: m } = u.location;
this.treeAdapter.updateNodeSourceCodeLocation(i, { endLine: l, endCol: b, endOffset: m });
} else this.options.sourceCodeLocationInfo && this.treeAdapter.setNodeSourceCodeLocation(i, u.location);
}
/** @protected */
_adoptNodes(u, t) {
for (let a = this.treeAdapter.getFirstChild(u); a; a = this.treeAdapter.getFirstChild(u))
this.treeAdapter.detachNode(a), this.treeAdapter.appendChild(t, a);
}
/** @protected */
_setEndLocation(u, t) {
if (this.treeAdapter.getNodeSourceCodeLocation(u) && t.location) {
const a = t.location, r = this.treeAdapter.getTagName(u), n = (
// NOTE: For cases like <p> <p> </p> - First 'p' closes without a closing
// tag and for cases like <td> <p> </td> - 'p' closes without a closing tag.
t.type === L.END_TAG && r === t.tagName ? {
endTag: { ...a },
endLine: a.endLine,
endCol: a.endCol,
endOffset: a.endOffset
} : {
endLine: a.startLine,
endCol: a.startCol,
endOffset: a.startOffset
}
);
this.treeAdapter.updateNodeSourceCodeLocation(u, n);
}
}
//Token processing
shouldProcessStartTagTokenInForeignContent(u) {
if (!this.currentNotInHTML)
return !1;
let t, a;
return this.openElements.stackTop === 0 && this.fragmentContext ? (t = this.fragmentContext, a = this.fragmentContextID) : { current: t, currentTagId: a } = this.openElements, u.tagID === s.SVG && this.treeAdapter.getTagName(t) === h.ANNOTATION_XML && this.treeAdapter.getNamespaceURI(t) === T.MATHML ? !1 : (
// Check that `current` is not an integration point for HTML or MathML elements.
this.tokenizer.inForeignNode || // If it _is_ an integration point, then we might have to check that it is not an HTML
// integration point.
(u.tagID === s.MGLYPH || u.tagID === s.MALIGNMARK) && a !== void 0 && !this._isIntegrationPoint(a, t, T.HTML)
);
}
/** @protected */
_processToken(u) {
switch (u.type) {
case L.CHARACTER: {
this.onCharacter(u);
break;
}
case L.NULL_CHARACTER: {
this.onNullCharacter(u);
break;
}
case L.COMMENT: {
this.onComment(u);
break;
}
case L.DOCTYPE: {
this.onDoctype(u);
break;
}
case L.START_TAG: {
this._processStartTag(u);
break;
}
case L.END_TAG: {
this.onEndTag(u);
break;
}
case L.EOF: {
this.onEof(u);
break;
}
case L.WHITESPACE_CHARACTER: {
this.onWhitespaceCharacter(u);
break;
}
}
}
//Integration points
/** @protected */
_isIntegrationPoint(u, t, a) {
const r = this.treeAdapter.getNamespaceURI(t), n = this.treeAdapter.getAttrList(t);
return wi(u, r, n, a);
}
//Active formatting elements reconstruction
/** @protected */
_reconstructActiveFormattingElements() {
const u = this.activeFormattingElements.entries.length;
if (u) {
const t = this.activeFormattingElements.entries.findIndex((r) => r.type === j.Marker || this.openElements.contains(r.element)), a = t === -1 ? u - 1 : t - 1;
for (let r = a; r >= 0; r--) {
const n = this.activeFormattingElements.entries[r];
this._insertElement(n.token, this.treeAdapter.getNamespaceURI(n.element)), n.element = this.openElements.current;
}
}
}
//Close elements
/** @protected */
_closeTableCell() {
this.openElements.generateImpliedEndTags(), this.openElements.popUntilTableCellPopped(), this.activeFormattingElements.clearToLastMarker(), this.insertionMode = d.IN_ROW;
}
/** @protected */
_closePElement() {
this.openElements.generateImpliedEndTagsWithExclusion(s.P), this.openElements.popUntilTagNamePopped(s.P);
}
//Insertion modes
/** @protected */
_resetInsertionMode() {
for (let u = this.openElements.stackTop; u >= 0; u--)
switch (u === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[u]) {
case s.TR: {
this.insertionMode = d.IN_ROW;
return;
}
case s.TBODY:
case s.THEAD:
case s.TFOOT: {
this.insertionMode = d.IN_TABLE_BODY;
return;
}
case s.CAPTION: {
this.insertionMode = d.IN_CAPTION;
return;
}
case s.COLGROUP: {
this.insertionMode = d.IN_COLUMN_GROUP;
return;
}
case s.TABLE: {
this.insertionMode = d.IN_TABLE;
return;
}
case s.BODY: {
this.insertionMode = d.IN_BODY;
return;
}
case s.FRAMESET: {
this.insertionMode = d.IN_FRAMESET;
return;
}
case s.SELECT: {
this._resetInsertionModeForSelect(u);
return;
}
case s.TEMPLATE: {
this.insertionMode = this.tmplInsertionModeStack[0];
return;
}
case s.HTML: {
this.insertionMode = this.headElement ? d.AFTER_HEAD : d.BEFORE_HEAD;
return;
}
case s.TD:
case s.TH: {
if (u > 0) {
this.insertionMode = d.IN_CELL;
return;
}
break;
}
case s.HEAD: {
if (u > 0) {
this.insertionMode = d.IN_HEAD;
return;
}
break;
}
}
this.insertionMode = d.IN_BODY;
}
/** @protected */
_resetInsertionModeForSelect(u) {
if (u > 0)
for (let t = u - 1; t > 0; t--) {
const a = this.openElements.tagIDs[t];
if (a === s.TEMPLATE)
break;
if (a === s.TABLE) {
this.insertionMode = d.IN_SELECT_IN_TABLE;
return;
}
}
this.insertionMode = d.IN_SELECT;
}
//Foster parenting
/** @protected */
_isElementCausesFosterParenting(u) {
return $0.has(u);
}
/** @protected */
_shouldFosterParentOnInsertion() {
return this.fosterParentingEnabled && this.openElements.currentTagId !== void 0 && this._isElementCausesFosterParenting(this.openElements.currentTagId);
}
/** @protected */
_findFosterParentingLocation() {
for (let u = this.openElements.stackTop; u >= 0; u--) {
const t = this.openElements.items[u];
switch (this.openElements.tagIDs[u]) {
case s.TEMPLATE: {
if (this.treeAdapter.getNamespaceURI(t) === T.HTML)
return { parent: this.treeAdapter.getTemplateContent(t), beforeElement: null };
break;
}
case s.TABLE: {
const a = this.treeAdapter.getParentNode(t);
return a ? { parent: a, beforeElement: t } : { parent: this.openElements.items[u - 1], beforeElement: null };
}
}
}
return { parent: this.openElements.items[0], beforeElement: null };
}
/** @protected */
_fosterParentElement(u) {
const t = this._findFosterParentingLocation();
t.beforeElement ? this.treeAdapter.insertBefore(t.parent, u, t.beforeElement) : this.treeAdapter.appendChild(t.parent, u);
}
//Special elements
/** @protected */
_isSpecialElement(u, t) {
const a = this.treeAdapter.getNamespaceURI(u);
return ri[a].has(t);
}
/** @internal */
onCharacter(u) {
if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
Ao(this, u);
return;
}
switch (this.insertionMode) {
case d.INITIAL: {
Re(this, u);
break;
}
case d.BEFORE_HTML: {
ke(this, u);
break;
}
case d.BEFORE_HEAD: {
Be(this, u);
break;
}
case d.IN_HEAD: {
Fe(this, u);
break;
}
case d.IN_HEAD_NO_SCRIPT: {
we(this, u);
break;
}
case d.AFTER_HEAD: {
Ue(this, u);
break;
}
case d.IN_BODY:
case d.IN_CAPTION:
case d.IN_CELL:
case d.IN_TEMPLATE: {
J0(this, u);
break;
}
case d.TEXT:
case d.IN_SELECT:
case d.IN_SELECT_IN_TABLE: {
this._insertCharacters(u);
break;
}
case d.IN_TABLE:
case d.IN_TABLE_BODY:
case d.IN_ROW: {
Fu(this, u);
break;
}
case d.IN_TABLE_TEXT: {
ra(this, u);
break;
}
case d.IN_COLUMN_GROUP: {
lu(this, u);
break;
}
case d.AFTER_BODY: {
hu(this, u);
break;
}
case d.AFTER_AFTER_BODY: {
tu(this, u);
break;
}
}
}
/** @internal */
onNullCharacter(u) {
if (this.skipNextNewLine = !1, this.tokenizer.inForeignNode) {
mo(this, u);
return;
}
switch (this.insertionMode) {
case d.INITIAL: {
Re(this, u);
break;
}
case d.BEFORE_HTML: {
ke(this, u);
break;
}
case d.BEFORE_HEAD: {
Be(this, u);
break;
}
case d.IN_HEAD: {
Fe(this, u);
break;
}
case d.IN_HEAD_NO_SCRIPT: {
we(this, u);
break;
}
case d.AFTER_HEAD: {
Ue(this, u);
break;
}
case d.TEXT: {
this._insertCharacters(u);
break;
}
case d.IN_TABLE:
case d.IN_TABLE_BODY:
case d.IN_ROW: {
Fu(this, u);
break;
}
case d.IN_COLUMN_GROUP: {
lu(this, u);
break;
}
case d.AFTER_BODY: {
hu(this, u);
break;
}
case d.AFTER_AFTER_BODY: {
tu(this, u);
break;
}
}
}
/** @internal */
onComment(u) {
if (this.skipNextNewLine = !1, this.currentNotInHTML) {
ju(this, u);
return;
}
switch (this.insertionMode) {
case d.INITIAL:
case d.BEFORE_HTML:
case d.BEFORE_HEAD:
case d.IN_HEAD:
case d.IN_HEAD_NO_SCRIPT:
case d.AFTER_HEAD:
case d.IN_BODY:
case d.IN_TABLE:
case d.IN_CAPTION:
case d.IN_COLUMN_GROUP:
case d.IN_TABLE_BODY:
case d.IN_ROW:
case d.IN_CELL:
case d.IN_SELECT:
case d.IN_SELECT_IN_TABLE:
case d.IN_TEMPLATE:
case d.IN_FRAMESET:
case d.AFTER_FRAMESET: {
ju(this, u);
break;
}
case d.IN_TABLE_TEXT: {
Pe(this, u);
break;
}
case d.AFTER_BODY: {
Ki(this, u);
break;
}
case d.AFTER_AFTER_BODY:
case d.AFTER_AFTER_FRAMESET: {
ji(this, u);
break;
}
}
}
/** @internal */
onDoctype(u) {
switch (this.skipNextNewLine = !1, this.insertionMode) {
case d.INITIAL: {
$i(this, u);
break;
}
case d.BEFORE_HEAD:
case d.IN_HEAD:
case d.IN_HEAD_NO_SCRIPT:
case d.AFTER_HEAD: {
this._err(u, E.misplacedDoctype);
break;
}
case d.IN_TABLE_TEXT: {
Pe(this, u);
break;
}
}
}
/** @internal */
onStartTag(u) {
this.skipNextNewLine = !1, this.currentToken = u, this._processStartTag(u), u.selfClosing && !u.ackSelfClosing && this._err(u, E.nonVoidHtmlElementStartTagWithTrailingSolidus);
}
/**
* Processes a given start tag.
*
* `onStartTag` checks if a self-closing tag was recognized. When a token
* is moved inbetween multiple insertion modes, this check for self-closing
* could lead to false positives. To avoid this, `_processStartTag` is used
* for nested calls.
*
* @param token The token to process.
* @protected
*/
_processStartTag(u) {
this.shouldProcessStartTagTokenInForeignContent(u) ? _o(this, u) : this._startTagOutsideForeignContent(u);
}
/** @protected */
_startTagOutsideForeignContent(u) {
switch (this.insertionMode) {
case d.INITIAL: {
Re(this, u);
break;
}
case d.BEFORE_HTML: {
zi(this, u);
break;
}
case d.BEFORE_HEAD: {
Ji(this, u);
break;
}
case d.IN_HEAD: {
K(this, u);
break;
}
case d.IN_HEAD_NO_SCRIPT: {
tc(this, u);
break;
}
case d.AFTER_HEAD: {
sc(this, u);
break;
}
case d.IN_BODY: {
q(this, u);
break;
}
case d.IN_TABLE: {
Ie(this, u);
break;
}
case d.IN_TABLE_TEXT: {
Pe(this, u);
break;
}
case d.IN_CAPTION: {
eo(this, u);
break;
}
case d.IN_COLUMN_GROUP: {
pt(this, u);
break;
}
case d.IN_TABLE_BODY: {
Iu(this, u);
break;
}
case d.IN_ROW: {
Su(this, u);
break;
}
case d.IN_CELL: {
ao(this, u);
break;
}
case d.IN_SELECT: {
ca(this, u);
break;
}
case d.IN_SELECT_IN_TABLE: {
ro(this, u);
break;
}
case d.IN_TEMPLATE: {
io(this, u);
break;
}
case d.AFTER_BODY: {
oo(this, u);
break;
}
case d.IN_FRAMESET: {
fo(this, u);
break;
}
case d.AFTER_FRAMESET: {
ho(this, u);
break;
}
case d.AFTER_AFTER_BODY: {
Eo(this, u);
break;
}
case d.AFTER_AFTER_FRAMESET: {
To(this, u);
break;
}
}
}
/** @internal */
onEndTag(u) {
this.skipNextNewLine = !1, this.currentToken = u, this.currentNotInHTML ? po(this, u) : this._endTagOutsideForeignContent(u);
}
/** @protected */
_endTagOutsideForeignContent(u) {
switch (this.insertionMode) {
case d.INITIAL: {
Re(this, u);
break;
}
case d.BEFORE_HTML: {
Zi(this, u);
break;
}
case d.BEFORE_HEAD: {
ec(this, u);
break;
}
case d.IN_HEAD: {
uc(this, u);
break;
}
case d.IN_HEAD_NO_SCRIPT: {
ac(this, u);
break;
}
case d.AFTER_HEAD: {
rc(this, u);
break;
}
case d.IN_BODY: {
Nu(this, u);
break;
}
case d.TEXT: {
Gc(this, u);
break;
}
case d.IN_TABLE: {
Ge(this, u);
break;
}
case d.IN_TABLE_TEXT: {
Pe(this, u);
break;
}
case d.IN_CAPTION: {
uo(this, u);
break;
}
case d.IN_COLUMN_GROUP: {
to(this, u);
break;
}
case d.IN_TABLE_BODY: {
$u(this, u);
break;
}
case d.IN_ROW: {
ia(this, u);
break;
}
case d.IN_CELL: {
so(this, u);
break;
}
case d.IN_SELECT: {
oa(this, u);
break;
}
case d.IN_SELECT_IN_TABLE: {
no(this, u);
break;
}
case d.IN_TEMPLATE: {
co(this, u);
break;
}
case d.AFTER_BODY: {
fa(this, u);
break;
}
case d.IN_FRAMESET: {
lo(this, u);
break;
}
case d.AFTER_FRAMESET: {
bo(this, u);
break;
}
case d.AFTER_AFTER_BODY: {
tu(this, u);
break;
}
}
}
/** @internal */
onEof(u) {
switch (this.insertionMode) {
case d.INITIAL: {
Re(this, u);
break;
}
case d.BEFORE_HTML: {
ke(this, u);
break;
}
case d.BEFORE_HEAD: {
Be(this, u);
break;
}
case d.IN_HEAD: {
Fe(this, u);
break;
}
case d.IN_HEAD_NO_SCRIPT: {
we(this, u);
break;
}
case d.AFTER_HEAD: {
Ue(this, u);
break;
}
case d.IN_BODY:
case d.IN_TABLE:
case d.IN_CAPTION:
case d.IN_COLUMN_GROUP:
case d.IN_TABLE_BODY:
case d.IN_ROW:
case d.IN_CELL:
case d.IN_SELECT:
case d.IN_SELECT_IN_TABLE: {
aa(this, u);
break;
}
case d.TEXT: {
Qc(this, u);
break;
}
case d.IN_TABLE_TEXT: {
Pe(this, u);
break;
}
case d.IN_TEMPLATE: {
da(this, u);
break;
}
case d.AFTER_BODY:
case d.IN_FRAMESET:
case d.AFTER_FRAMESET:
case d.AFTER_AFTER_BODY:
case d.AFTER_AFTER_FRAMESET: {
_t(this, u);
break;
}
}
}
/** @internal */
onWhitespaceCharacter(u) {
if (this.skipNextNewLine && (this.skipNextNewLine = !1, u.chars.charCodeAt(0) === c.LINE_FEED)) {
if (u.chars.length === 1)
return;
u.chars = u.chars.substr(1);
}
if (this.tokenizer.inForeignNode) {
this._insertCharacters(u);
return;
}
switch (this.insertionMode) {
case d.IN_HEAD:
case d.IN_HEAD_NO_SCRIPT:
case d.AFTER_HEAD:
case d.TEXT:
case d.IN_COLUMN_GROUP:
case d.IN_SELECT:
case d.IN_SELECT_IN_TABLE:
case d.IN_FRAMESET:
case d.AFTER_FRAMESET: {
this._insertCharacters(u);
break;
}
case d.IN_BODY:
case d.IN_CAPTION:
case d.IN_CELL:
case d.IN_TEMPLATE:
case d.AFTER_BODY:
case d.AFTER_AFTER_BODY:
case d.AFTER_AFTER_FRAMESET: {
Z0(this, u);
break;
}
case d.IN_TABLE:
case d.IN_TABLE_BODY:
case d.IN_ROW: {
Fu(this, u);
break;
}
case d.IN_TABLE_TEXT: {
sa(this, u);
break;
}
}
}
}
function Yi(e, u) {
let t = e.activeFormattingElements.getElementEntryInScopeWithTagName(u.tagName);
return t ? e.openElements.contains(t.element) ? e.openElements.hasInScope(u.tagID) || (t = null) : (e.activeFormattingElements.removeEntry(t), t = null) : ta(e, u), t;
}
function Vi(e, u) {
let t = null, a = e.openElements.stackTop;
for (; a >= 0; a--) {
const r = e.openElements.items[a];
if (r === u.element)
break;
e._isSpecialElement(r, e.openElements.tagIDs[a]) && (t = r);
}
return t || (e.openElements.shortenToLength(Math.max(a, 0)), e.activeFormattingElements.removeEntry(u)), t;
}
function Gi(e, u, t) {
let a = u, r = e.openElements.getCommonAncestor(u);
for (let n = 0, i = r; i !== t; n++, i = r) {
r = e.openElements.getCommonAncestor(i);
const f = e.activeFormattingElements.getElementEntry(i), l = f && n >= vi;
!f || l ? (l && e.activeFormattingElements.removeEntry(f), e.openElements.remove(i)) : (i = Qi(e, f), a === u && (e.activeFormattingElements.bookmark = f), e.treeAdapter.detachNode(a), e.treeAdapter.appendChild(i, a), a = i);
}
return a;
}
function Qi(e, u) {
const t = e.treeAdapter.getNamespaceURI(u.element), a = e.treeAdapter.createElement(u.token.tagName, t, u.token.attrs);
return e.openElements.replace(u.element, a), u.element = a, a;
}
function Wi(e, u, t) {
const a = e.treeAdapter.getTagName(u), r = pu(a);
if (e._isElementCausesFosterParenting(r))
e._fosterParentElement(t);
else {
const n = e.treeAdapter.getNamespaceURI(u);
r === s.TEMPLATE && n === T.HTML && (u = e.treeAdapter.getTemplateContent(u)), e.treeAdapter.appendChild(u, t);
}
}
function Xi(e, u, t) {
const a = e.treeAdapter.getNamespaceURI(t.element), { token: r } = t, n = e.treeAdapter.createElement(r.tagName, a, r.attrs);
e._adoptNodes(u, n), e.treeAdapter.appendChild(u, n), e.activeFormattingElements.insertElementAfterBookmark(n, r), e.activeFormattingElements.removeEntry(t), e.openElements.remove(t.element), e.openElements.insertAfter(u, n, r.tagID);
}
function At(e, u) {
for (let t = 0; t < Hi; t++) {
const a = Yi(e, u);
if (!a)
break;
const r = Vi(e, a);
if (!r)
break;
e.activeFormattingElements.bookmark = a;
const n = Gi(e, r, a.element), i = e.openElements.getCommonAncestor(a.element);
e.treeAdapter.detachNode(n), i && Wi(e, i, n), Xi(e, r, a);
}
}
function ju(e, u) {
e._appendCommentNode(u, e.openElements.currentTmplContentOrNode);
}
function Ki(e, u) {
e._appendCommentNode(u, e.openElements.items[0]);
}
function ji(e, u) {
e._appendCommentNode(u, e.document);
}
function _t(e, u) {
if (e.stopped = !0, u.location) {
const t = e.fragmentContext ? 0 : 2;
for (let a = e.openElements.stackTop; a >= t; a--)
e._setEndLocation(e.openElements.items[a], u);
if (!e.fragmentContext && e.openElements.stackTop >= 0) {
const a = e.openElements.items[0], r = e.treeAdapter.getNodeSourceCodeLocation(a);
if (r && !r.endTag && (e._setEndLocation(a, u), e.openElements.stackTop >= 1)) {
const n = e.openElements.items[1], i = e.treeAdapter.getNodeSourceCodeLocation(n);
i && !i.endTag && e._setEndLocation(n, u);
}
}
}
}
function $i(e, u) {
e._setDocumentType(u);
const t = u.forceQuirks ? Q.QUIRKS : xi(u);
Ci(u) || e._err(u, E.nonConformingDoctype), e.treeAdapter.setDocumentMode(e.document, t), e.insertionMode = d.BEFORE_HTML;
}
function Re(e, u) {
e._err(u, E.missingDoctype, !0), e.treeAdapter.setDocumentMode(e.document, Q.QUIRKS), e.insertionMode = d.BEFORE_HTML, e._processToken(u);
}
function zi(e, u) {
u.tagID === s.HTML ? (e._insertElement(u, T.HTML), e.insertionMode = d.BEFORE_HEAD) : ke(e, u);
}
function Zi(e, u) {
const t = u.tagID;
(t === s.HTML || t === s.HEAD || t === s.BODY || t === s.BR) && ke(e, u);
}
function ke(e, u) {
e._insertFakeRootElement(), e.insertionMode = d.BEFORE_HEAD, e._processToken(u);
}
function Ji(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.HEAD: {
e._insertElement(u, T.HTML), e.headElement = e.openElements.current, e.insertionMode = d.IN_HEAD;
break;
}
default:
Be(e, u);
}
}
function ec(e, u) {
const t = u.tagID;
t === s.HEAD || t === s.BODY || t === s.HTML || t === s.BR ? Be(e, u) : e._err(u, E.endTagWithoutMatchingOpenElement);
}
function Be(e, u) {
e._insertFakeElement(h.HEAD, s.HEAD), e.headElement = e.openElements.current, e.insertionMode = d.IN_HEAD, e._processToken(u);
}
function K(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.BASE:
case s.BASEFONT:
case s.BGSOUND:
case s.LINK:
case s.META: {
e._appendElement(u, T.HTML), u.ackSelfClosing = !0;
break;
}
case s.TITLE: {
e._switchToTextParsing(u, G.RCDATA);
break;
}
case s.NOSCRIPT: {
e.options.scriptingEnabled ? e._switchToTextParsing(u, G.RAWTEXT) : (e._insertElement(u, T.HTML), e.insertionMode = d.IN_HEAD_NO_SCRIPT);
break;
}
case s.NOFRAMES:
case s.STYLE: {
e._switchToTextParsing(u, G.RAWTEXT);
break;
}
case s.SCRIPT: {
e._switchToTextParsing(u, G.SCRIPT_DATA);
break;
}
case s.TEMPLATE: {
e._insertTemplate(u), e.activeFormattingElements.insertMarker(), e.framesetOk = !1, e.insertionMode = d.IN_TEMPLATE, e.tmplInsertionModeStack.unshift(d.IN_TEMPLATE);
break;
}
case s.HEAD: {
e._err(u, E.misplacedStartTagForHeadElement);
break;
}
default:
Fe(e, u);
}
}
function uc(e, u) {
switch (u.tagID) {
case s.HEAD: {
e.openElements.pop(), e.insertionMode = d.AFTER_HEAD;
break;
}
case s.BODY:
case s.BR:
case s.HTML: {
Fe(e, u);
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
default:
e._err(u, E.endTagWithoutMatchingOpenElement);
}
}
function me(e, u) {
e.openElements.tmplCount > 0 ? (e.openElements.generateImpliedEndTagsThoroughly(), e.openElements.currentTagId !== s.TEMPLATE && e._err(u, E.closingOfElementWithOpenChildElements), e.openElements.popUntilTagNamePopped(s.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode()) : e._err(u, E.endTagWithoutMatchingOpenElement);
}
function Fe(e, u) {
e.openElements.pop(), e.insertionMode = d.AFTER_HEAD, e._processToken(u);
}
function tc(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.BASEFONT:
case s.BGSOUND:
case s.HEAD:
case s.LINK:
case s.META:
case s.NOFRAMES:
case s.STYLE: {
K(e, u);
break;
}
case s.NOSCRIPT: {
e._err(u, E.nestedNoscriptInHead);
break;
}
default:
we(e, u);
}
}
function ac(e, u) {
switch (u.tagID) {
case s.NOSCRIPT: {
e.openElements.pop(), e.insertionMode = d.IN_HEAD;
break;
}
case s.BR: {
we(e, u);
break;
}
default:
e._err(u, E.endTagWithoutMatchingOpenElement);
}
}
function we(e, u) {
const t = u.type === L.EOF ? E.openElementsLeftAfterEof : E.disallowedContentInNoscriptInHead;
e._err(u, t), e.openElements.pop(), e.insertionMode = d.IN_HEAD, e._processToken(u);
}
function sc(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.BODY: {
e._insertElement(u, T.HTML), e.framesetOk = !1, e.insertionMode = d.IN_BODY;
break;
}
case s.FRAMESET: {
e._insertElement(u, T.HTML), e.insertionMode = d.IN_FRAMESET;
break;
}
case s.BASE:
case s.BASEFONT:
case s.BGSOUND:
case s.LINK:
case s.META:
case s.NOFRAMES:
case s.SCRIPT:
case s.STYLE:
case s.TEMPLATE:
case s.TITLE: {
e._err(u, E.abandonedHeadElementChild), e.openElements.push(e.headElement, s.HEAD), K(e, u), e.openElements.remove(e.headElement);
break;
}
case s.HEAD: {
e._err(u, E.misplacedStartTagForHeadElement);
break;
}
default:
Ue(e, u);
}
}
function rc(e, u) {
switch (u.tagID) {
case s.BODY:
case s.HTML:
case s.BR: {
Ue(e, u);
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
default:
e._err(u, E.endTagWithoutMatchingOpenElement);
}
}
function Ue(e, u) {
e._insertFakeElement(h.BODY, s.BODY), e.insertionMode = d.IN_BODY, gu(e, u);
}
function gu(e, u) {
switch (u.type) {
case L.CHARACTER: {
J0(e, u);
break;
}
case L.WHITESPACE_CHARACTER: {
Z0(e, u);
break;
}
case L.COMMENT: {
ju(e, u);
break;
}
case L.START_TAG: {
q(e, u);
break;
}
case L.END_TAG: {
Nu(e, u);
break;
}
case L.EOF: {
aa(e, u);
break;
}
}
}
function Z0(e, u) {
e._reconstructActiveFormattingElements(), e._insertCharacters(u);
}
function J0(e, u) {
e._reconstructActiveFormattingElements(), e._insertCharacters(u), e.framesetOk = !1;
}
function nc(e, u) {
e.openElements.tmplCount === 0 && e.treeAdapter.adoptAttributes(e.openElements.items[0], u.attrs);
}
function ic(e, u) {
const t = e.openElements.tryPeekProperlyNestedBodyElement();
t && e.openElements.tmplCount === 0 && (e.framesetOk = !1, e.treeAdapter.adoptAttributes(t, u.attrs));
}
function cc(e, u) {
const t = e.openElements.tryPeekProperlyNestedBodyElement();
e.framesetOk && t && (e.treeAdapter.detachNode(t), e.openElements.popAllUpToHtmlElement(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_FRAMESET);
}
function oc(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML);
}
function dc(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e.openElements.currentTagId !== void 0 && Ku.has(e.openElements.currentTagId) && e.openElements.pop(), e._insertElement(u, T.HTML);
}
function fc(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML), e.skipNextNewLine = !0, e.framesetOk = !1;
}
function lc(e, u) {
const t = e.openElements.tmplCount > 0;
(!e.formElement || t) && (e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML), t || (e.formElement = e.openElements.current));
}
function hc(e, u) {
e.framesetOk = !1;
const t = u.tagID;
for (let a = e.openElements.stackTop; a >= 0; a--) {
const r = e.openElements.tagIDs[a];
if (t === s.LI && r === s.LI || (t === s.DD || t === s.DT) && (r === s.DD || r === s.DT)) {
e.openElements.generateImpliedEndTagsWithExclusion(r), e.openElements.popUntilTagNamePopped(r);
break;
}
if (r !== s.ADDRESS && r !== s.DIV && r !== s.P && e._isSpecialElement(e.openElements.items[a], r))
break;
}
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML);
}
function bc(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML), e.tokenizer.state = G.PLAINTEXT;
}
function Ec(e, u) {
e.openElements.hasInScope(s.BUTTON) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.BUTTON)), e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML), e.framesetOk = !1;
}
function Tc(e, u) {
const t = e.activeFormattingElements.getElementEntryInScopeWithTagName(h.A);
t && (At(e, u), e.openElements.remove(t.element), e.activeFormattingElements.removeEntry(t)), e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML), e.activeFormattingElements.pushElement(e.openElements.current, u);
}
function mc(e, u) {
e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML), e.activeFormattingElements.pushElement(e.openElements.current, u);
}
function Ac(e, u) {
e._reconstructActiveFormattingElements(), e.openElements.hasInScope(s.NOBR) && (At(e, u), e._reconstructActiveFormattingElements()), e._insertElement(u, T.HTML), e.activeFormattingElements.pushElement(e.openElements.current, u);
}
function _c(e, u) {
e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML), e.activeFormattingElements.insertMarker(), e.framesetOk = !1;
}
function pc(e, u) {
e.treeAdapter.getDocumentMode(e.document) !== Q.QUIRKS && e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._insertElement(u, T.HTML), e.framesetOk = !1, e.insertionMode = d.IN_TABLE;
}
function ea(e, u) {
e._reconstructActiveFormattingElements(), e._appendElement(u, T.HTML), e.framesetOk = !1, u.ackSelfClosing = !0;
}
function ua(e) {
const u = Y0(e, he.TYPE);
return u != null && u.toLowerCase() === Ui;
}
function gc(e, u) {
e._reconstructActiveFormattingElements(), e._appendElement(u, T.HTML), ua(u) || (e.framesetOk = !1), u.ackSelfClosing = !0;
}
function Nc(e, u) {
e._appendElement(u, T.HTML), u.ackSelfClosing = !0;
}
function Ic(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._appendElement(u, T.HTML), e.framesetOk = !1, u.ackSelfClosing = !0;
}
function Sc(e, u) {
u.tagName = h.IMG, u.tagID = s.IMG, ea(e, u);
}
function Cc(e, u) {
e._insertElement(u, T.HTML), e.skipNextNewLine = !0, e.tokenizer.state = G.RCDATA, e.originalInsertionMode = e.insertionMode, e.framesetOk = !1, e.insertionMode = d.TEXT;
}
function xc(e, u) {
e.openElements.hasInButtonScope(s.P) && e._closePElement(), e._reconstructActiveFormattingElements(), e.framesetOk = !1, e._switchToTextParsing(u, G.RAWTEXT);
}
function Oc(e, u) {
e.framesetOk = !1, e._switchToTextParsing(u, G.RAWTEXT);
}
function zt(e, u) {
e._switchToTextParsing(u, G.RAWTEXT);
}
function Lc(e, u) {
e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML), e.framesetOk = !1, e.insertionMode = e.insertionMode === d.IN_TABLE || e.insertionMode === d.IN_CAPTION || e.insertionMode === d.IN_TABLE_BODY || e.insertionMode === d.IN_ROW || e.insertionMode === d.IN_CELL ? d.IN_SELECT_IN_TABLE : d.IN_SELECT;
}
function Dc(e, u) {
e.openElements.currentTagId === s.OPTION && e.openElements.pop(), e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML);
}
function Rc(e, u) {
e.openElements.hasInScope(s.RUBY) && e.openElements.generateImpliedEndTags(), e._insertElement(u, T.HTML);
}
function Pc(e, u) {
e.openElements.hasInScope(s.RUBY) && e.openElements.generateImpliedEndTagsWithExclusion(s.RTC), e._insertElement(u, T.HTML);
}
function yc(e, u) {
e._reconstructActiveFormattingElements(), K0(u), mt(u), u.selfClosing ? e._appendElement(u, T.MATHML) : e._insertElement(u, T.MATHML), u.ackSelfClosing = !0;
}
function Mc(e, u) {
e._reconstructActiveFormattingElements(), j0(u), mt(u), u.selfClosing ? e._appendElement(u, T.SVG) : e._insertElement(u, T.SVG), u.ackSelfClosing = !0;
}
function Zt(e, u) {
e._reconstructActiveFormattingElements(), e._insertElement(u, T.HTML);
}
function q(e, u) {
switch (u.tagID) {
case s.I:
case s.S:
case s.B:
case s.U:
case s.EM:
case s.TT:
case s.BIG:
case s.CODE:
case s.FONT:
case s.SMALL:
case s.STRIKE:
case s.STRONG: {
mc(e, u);
break;
}
case s.A: {
Tc(e, u);
break;
}
case s.H1:
case s.H2:
case s.H3:
case s.H4:
case s.H5:
case s.H6: {
dc(e, u);
break;
}
case s.P:
case s.DL:
case s.OL:
case s.UL:
case s.DIV:
case s.DIR:
case s.NAV:
case s.MAIN:
case s.MENU:
case s.ASIDE:
case s.CENTER:
case s.FIGURE:
case s.FOOTER:
case s.HEADER:
case s.HGROUP:
case s.DIALOG:
case s.DETAILS:
case s.ADDRESS:
case s.ARTICLE:
case s.SEARCH:
case s.SECTION:
case s.SUMMARY:
case s.FIELDSET:
case s.BLOCKQUOTE:
case s.FIGCAPTION: {
oc(e, u);
break;
}
case s.LI:
case s.DD:
case s.DT: {
hc(e, u);
break;
}
case s.BR:
case s.IMG:
case s.WBR:
case s.AREA:
case s.EMBED:
case s.KEYGEN: {
ea(e, u);
break;
}
case s.HR: {
Ic(e, u);
break;
}
case s.RB:
case s.RTC: {
Rc(e, u);
break;
}
case s.RT:
case s.RP: {
Pc(e, u);
break;
}
case s.PRE:
case s.LISTING: {
fc(e, u);
break;
}
case s.XMP: {
xc(e, u);
break;
}
case s.SVG: {
Mc(e, u);
break;
}
case s.HTML: {
nc(e, u);
break;
}
case s.BASE:
case s.LINK:
case s.META:
case s.STYLE:
case s.TITLE:
case s.SCRIPT:
case s.BGSOUND:
case s.BASEFONT:
case s.TEMPLATE: {
K(e, u);
break;
}
case s.BODY: {
ic(e, u);
break;
}
case s.FORM: {
lc(e, u);
break;
}
case s.NOBR: {
Ac(e, u);
break;
}
case s.MATH: {
yc(e, u);
break;
}
case s.TABLE: {
pc(e, u);
break;
}
case s.INPUT: {
gc(e, u);
break;
}
case s.PARAM:
case s.TRACK:
case s.SOURCE: {
Nc(e, u);
break;
}
case s.IMAGE: {
Sc(e, u);
break;
}
case s.BUTTON: {
Ec(e, u);
break;
}
case s.APPLET:
case s.OBJECT:
case s.MARQUEE: {
_c(e, u);
break;
}
case s.IFRAME: {
Oc(e, u);
break;
}
case s.SELECT: {
Lc(e, u);
break;
}
case s.OPTION:
case s.OPTGROUP: {
Dc(e, u);
break;
}
case s.NOEMBED:
case s.NOFRAMES: {
zt(e, u);
break;
}
case s.FRAMESET: {
cc(e, u);
break;
}
case s.TEXTAREA: {
Cc(e, u);
break;
}
case s.NOSCRIPT: {
e.options.scriptingEnabled ? zt(e, u) : Zt(e, u);
break;
}
case s.PLAINTEXT: {
bc(e, u);
break;
}
case s.COL:
case s.TH:
case s.TD:
case s.TR:
case s.HEAD:
case s.FRAME:
case s.TBODY:
case s.TFOOT:
case s.THEAD:
case s.CAPTION:
case s.COLGROUP:
break;
default:
Zt(e, u);
}
}
function kc(e, u) {
if (e.openElements.hasInScope(s.BODY) && (e.insertionMode = d.AFTER_BODY, e.options.sourceCodeLocationInfo)) {
const t = e.openElements.tryPeekProperlyNestedBodyElement();
t && e._setEndLocation(t, u);
}
}
function Bc(e, u) {
e.openElements.hasInScope(s.BODY) && (e.insertionMode = d.AFTER_BODY, fa(e, u));
}
function Fc(e, u) {
const t = u.tagID;
e.openElements.hasInScope(t) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(t));
}
function wc(e) {
const u = e.openElements.tmplCount > 0, { formElement: t } = e;
u || (e.formElement = null), (t || u) && e.openElements.hasInScope(s.FORM) && (e.openElements.generateImpliedEndTags(), u ? e.openElements.popUntilTagNamePopped(s.FORM) : t && e.openElements.remove(t));
}
function Uc(e) {
e.openElements.hasInButtonScope(s.P) || e._insertFakeElement(h.P, s.P), e._closePElement();
}
function Hc(e) {
e.openElements.hasInListItemScope(s.LI) && (e.openElements.generateImpliedEndTagsWithExclusion(s.LI), e.openElements.popUntilTagNamePopped(s.LI));
}
function vc(e, u) {
const t = u.tagID;
e.openElements.hasInScope(t) && (e.openElements.generateImpliedEndTagsWithExclusion(t), e.openElements.popUntilTagNamePopped(t));
}
function qc(e) {
e.openElements.hasNumberedHeaderInScope() && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilNumberedHeaderPopped());
}
function Yc(e, u) {
const t = u.tagID;
e.openElements.hasInScope(t) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(t), e.activeFormattingElements.clearToLastMarker());
}
function Vc(e) {
e._reconstructActiveFormattingElements(), e._insertFakeElement(h.BR, s.BR), e.openElements.pop(), e.framesetOk = !1;
}
function ta(e, u) {
const t = u.tagName, a = u.tagID;
for (let r = e.openElements.stackTop; r > 0; r--) {
const n = e.openElements.items[r], i = e.openElements.tagIDs[r];
if (a === i && (a !== s.UNKNOWN || e.treeAdapter.getTagName(n) === t)) {
e.openElements.generateImpliedEndTagsWithExclusion(a), e.openElements.stackTop >= r && e.openElements.shortenToLength(r);
break;
}
if (e._isSpecialElement(n, i))
break;
}
}
function Nu(e, u) {
switch (u.tagID) {
case s.A:
case s.B:
case s.I:
case s.S:
case s.U:
case s.EM:
case s.TT:
case s.BIG:
case s.CODE:
case s.FONT:
case s.NOBR:
case s.SMALL:
case s.STRIKE:
case s.STRONG: {
At(e, u);
break;
}
case s.P: {
Uc(e);
break;
}
case s.DL:
case s.UL:
case s.OL:
case s.DIR:
case s.DIV:
case s.NAV:
case s.PRE:
case s.MAIN:
case s.MENU:
case s.ASIDE:
case s.BUTTON:
case s.CENTER:
case s.FIGURE:
case s.FOOTER:
case s.HEADER:
case s.HGROUP:
case s.DIALOG:
case s.ADDRESS:
case s.ARTICLE:
case s.DETAILS:
case s.SEARCH:
case s.SECTION:
case s.SUMMARY:
case s.LISTING:
case s.FIELDSET:
case s.BLOCKQUOTE:
case s.FIGCAPTION: {
Fc(e, u);
break;
}
case s.LI: {
Hc(e);
break;
}
case s.DD:
case s.DT: {
vc(e, u);
break;
}
case s.H1:
case s.H2:
case s.H3:
case s.H4:
case s.H5:
case s.H6: {
qc(e);
break;
}
case s.BR: {
Vc(e);
break;
}
case s.BODY: {
kc(e, u);
break;
}
case s.HTML: {
Bc(e, u);
break;
}
case s.FORM: {
wc(e);
break;
}
case s.APPLET:
case s.OBJECT:
case s.MARQUEE: {
Yc(e, u);
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
default:
ta(e, u);
}
}
function aa(e, u) {
e.tmplInsertionModeStack.length > 0 ? da(e, u) : _t(e, u);
}
function Gc(e, u) {
var t;
u.tagID === s.SCRIPT && ((t = e.scriptHandler) === null || t === void 0 || t.call(e, e.openElements.current)), e.openElements.pop(), e.insertionMode = e.originalInsertionMode;
}
function Qc(e, u) {
e._err(u, E.eofInElementThatCanContainOnlyText), e.openElements.pop(), e.insertionMode = e.originalInsertionMode, e.onEof(u);
}
function Fu(e, u) {
if (e.openElements.currentTagId !== void 0 && $0.has(e.openElements.currentTagId))
switch (e.pendingCharacterTokens.length = 0, e.hasNonWhitespacePendingCharacterToken = !1, e.originalInsertionMode = e.insertionMode, e.insertionMode = d.IN_TABLE_TEXT, u.type) {
case L.CHARACTER: {
ra(e, u);
break;
}
case L.WHITESPACE_CHARACTER: {
sa(e, u);
break;
}
}
else
je(e, u);
}
function Wc(e, u) {
e.openElements.clearBackToTableContext(), e.activeFormattingElements.insertMarker(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_CAPTION;
}
function Xc(e, u) {
e.openElements.clearBackToTableContext(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_COLUMN_GROUP;
}
function Kc(e, u) {
e.openElements.clearBackToTableContext(), e._insertFakeElement(h.COLGROUP, s.COLGROUP), e.insertionMode = d.IN_COLUMN_GROUP, pt(e, u);
}
function jc(e, u) {
e.openElements.clearBackToTableContext(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_TABLE_BODY;
}
function $c(e, u) {
e.openElements.clearBackToTableContext(), e._insertFakeElement(h.TBODY, s.TBODY), e.insertionMode = d.IN_TABLE_BODY, Iu(e, u);
}
function zc(e, u) {
e.openElements.hasInTableScope(s.TABLE) && (e.openElements.popUntilTagNamePopped(s.TABLE), e._resetInsertionMode(), e._processStartTag(u));
}
function Zc(e, u) {
ua(u) ? e._appendElement(u, T.HTML) : je(e, u), u.ackSelfClosing = !0;
}
function Jc(e, u) {
!e.formElement && e.openElements.tmplCount === 0 && (e._insertElement(u, T.HTML), e.formElement = e.openElements.current, e.openElements.pop());
}
function Ie(e, u) {
switch (u.tagID) {
case s.TD:
case s.TH:
case s.TR: {
$c(e, u);
break;
}
case s.STYLE:
case s.SCRIPT:
case s.TEMPLATE: {
K(e, u);
break;
}
case s.COL: {
Kc(e, u);
break;
}
case s.FORM: {
Jc(e, u);
break;
}
case s.TABLE: {
zc(e, u);
break;
}
case s.TBODY:
case s.TFOOT:
case s.THEAD: {
jc(e, u);
break;
}
case s.INPUT: {
Zc(e, u);
break;
}
case s.CAPTION: {
Wc(e, u);
break;
}
case s.COLGROUP: {
Xc(e, u);
break;
}
default:
je(e, u);
}
}
function Ge(e, u) {
switch (u.tagID) {
case s.TABLE: {
e.openElements.hasInTableScope(s.TABLE) && (e.openElements.popUntilTagNamePopped(s.TABLE), e._resetInsertionMode());
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
case s.BODY:
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.HTML:
case s.TBODY:
case s.TD:
case s.TFOOT:
case s.TH:
case s.THEAD:
case s.TR:
break;
default:
je(e, u);
}
}
function je(e, u) {
const t = e.fosterParentingEnabled;
e.fosterParentingEnabled = !0, gu(e, u), e.fosterParentingEnabled = t;
}
function sa(e, u) {
e.pendingCharacterTokens.push(u);
}
function ra(e, u) {
e.pendingCharacterTokens.push(u), e.hasNonWhitespacePendingCharacterToken = !0;
}
function Pe(e, u) {
let t = 0;
if (e.hasNonWhitespacePendingCharacterToken)
for (; t < e.pendingCharacterTokens.length; t++)
je(e, e.pendingCharacterTokens[t]);
else
for (; t < e.pendingCharacterTokens.length; t++)
e._insertCharacters(e.pendingCharacterTokens[t]);
e.insertionMode = e.originalInsertionMode, e._processToken(u);
}
const na = /* @__PURE__ */ new Set([s.CAPTION, s.COL, s.COLGROUP, s.TBODY, s.TD, s.TFOOT, s.TH, s.THEAD, s.TR]);
function eo(e, u) {
const t = u.tagID;
na.has(t) ? e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = d.IN_TABLE, Ie(e, u)) : q(e, u);
}
function uo(e, u) {
const t = u.tagID;
switch (t) {
case s.CAPTION:
case s.TABLE: {
e.openElements.hasInTableScope(s.CAPTION) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(s.CAPTION), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = d.IN_TABLE, t === s.TABLE && Ge(e, u));
break;
}
case s.BODY:
case s.COL:
case s.COLGROUP:
case s.HTML:
case s.TBODY:
case s.TD:
case s.TFOOT:
case s.TH:
case s.THEAD:
case s.TR:
break;
default:
Nu(e, u);
}
}
function pt(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.COL: {
e._appendElement(u, T.HTML), u.ackSelfClosing = !0;
break;
}
case s.TEMPLATE: {
K(e, u);
break;
}
default:
lu(e, u);
}
}
function to(e, u) {
switch (u.tagID) {
case s.COLGROUP: {
e.openElements.currentTagId === s.COLGROUP && (e.openElements.pop(), e.insertionMode = d.IN_TABLE);
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
case s.COL:
break;
default:
lu(e, u);
}
}
function lu(e, u) {
e.openElements.currentTagId === s.COLGROUP && (e.openElements.pop(), e.insertionMode = d.IN_TABLE, e._processToken(u));
}
function Iu(e, u) {
switch (u.tagID) {
case s.TR: {
e.openElements.clearBackToTableBodyContext(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_ROW;
break;
}
case s.TH:
case s.TD: {
e.openElements.clearBackToTableBodyContext(), e._insertFakeElement(h.TR, s.TR), e.insertionMode = d.IN_ROW, Su(e, u);
break;
}
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.TBODY:
case s.TFOOT:
case s.THEAD: {
e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE, Ie(e, u));
break;
}
default:
Ie(e, u);
}
}
function $u(e, u) {
const t = u.tagID;
switch (u.tagID) {
case s.TBODY:
case s.TFOOT:
case s.THEAD: {
e.openElements.hasInTableScope(t) && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE);
break;
}
case s.TABLE: {
e.openElements.hasTableBodyContextInTableScope() && (e.openElements.clearBackToTableBodyContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE, Ge(e, u));
break;
}
case s.BODY:
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.HTML:
case s.TD:
case s.TH:
case s.TR:
break;
default:
Ge(e, u);
}
}
function Su(e, u) {
switch (u.tagID) {
case s.TH:
case s.TD: {
e.openElements.clearBackToTableRowContext(), e._insertElement(u, T.HTML), e.insertionMode = d.IN_CELL, e.activeFormattingElements.insertMarker();
break;
}
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.TBODY:
case s.TFOOT:
case s.THEAD:
case s.TR: {
e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE_BODY, Iu(e, u));
break;
}
default:
Ie(e, u);
}
}
function ia(e, u) {
switch (u.tagID) {
case s.TR: {
e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE_BODY);
break;
}
case s.TABLE: {
e.openElements.hasInTableScope(s.TR) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE_BODY, $u(e, u));
break;
}
case s.TBODY:
case s.TFOOT:
case s.THEAD: {
(e.openElements.hasInTableScope(u.tagID) || e.openElements.hasInTableScope(s.TR)) && (e.openElements.clearBackToTableRowContext(), e.openElements.pop(), e.insertionMode = d.IN_TABLE_BODY, $u(e, u));
break;
}
case s.BODY:
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.HTML:
case s.TD:
case s.TH:
break;
default:
Ge(e, u);
}
}
function ao(e, u) {
const t = u.tagID;
na.has(t) ? (e.openElements.hasInTableScope(s.TD) || e.openElements.hasInTableScope(s.TH)) && (e._closeTableCell(), Su(e, u)) : q(e, u);
}
function so(e, u) {
const t = u.tagID;
switch (t) {
case s.TD:
case s.TH: {
e.openElements.hasInTableScope(t) && (e.openElements.generateImpliedEndTags(), e.openElements.popUntilTagNamePopped(t), e.activeFormattingElements.clearToLastMarker(), e.insertionMode = d.IN_ROW);
break;
}
case s.TABLE:
case s.TBODY:
case s.TFOOT:
case s.THEAD:
case s.TR: {
e.openElements.hasInTableScope(t) && (e._closeTableCell(), ia(e, u));
break;
}
case s.BODY:
case s.CAPTION:
case s.COL:
case s.COLGROUP:
case s.HTML:
break;
default:
Nu(e, u);
}
}
function ca(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.OPTION: {
e.openElements.currentTagId === s.OPTION && e.openElements.pop(), e._insertElement(u, T.HTML);
break;
}
case s.OPTGROUP: {
e.openElements.currentTagId === s.OPTION && e.openElements.pop(), e.openElements.currentTagId === s.OPTGROUP && e.openElements.pop(), e._insertElement(u, T.HTML);
break;
}
case s.HR: {
e.openElements.currentTagId === s.OPTION && e.openElements.pop(), e.openElements.currentTagId === s.OPTGROUP && e.openElements.pop(), e._appendElement(u, T.HTML), u.ackSelfClosing = !0;
break;
}
case s.INPUT:
case s.KEYGEN:
case s.TEXTAREA:
case s.SELECT: {
e.openElements.hasInSelectScope(s.SELECT) && (e.openElements.popUntilTagNamePopped(s.SELECT), e._resetInsertionMode(), u.tagID !== s.SELECT && e._processStartTag(u));
break;
}
case s.SCRIPT:
case s.TEMPLATE: {
K(e, u);
break;
}
}
}
function oa(e, u) {
switch (u.tagID) {
case s.OPTGROUP: {
e.openElements.stackTop > 0 && e.openElements.currentTagId === s.OPTION && e.openElements.tagIDs[e.openElements.stackTop - 1] === s.OPTGROUP && e.openElements.pop(), e.openElements.currentTagId === s.OPTGROUP && e.openElements.pop();
break;
}
case s.OPTION: {
e.openElements.currentTagId === s.OPTION && e.openElements.pop();
break;
}
case s.SELECT: {
e.openElements.hasInSelectScope(s.SELECT) && (e.openElements.popUntilTagNamePopped(s.SELECT), e._resetInsertionMode());
break;
}
case s.TEMPLATE: {
me(e, u);
break;
}
}
}
function ro(e, u) {
const t = u.tagID;
t === s.CAPTION || t === s.TABLE || t === s.TBODY || t === s.TFOOT || t === s.THEAD || t === s.TR || t === s.TD || t === s.TH ? (e.openElements.popUntilTagNamePopped(s.SELECT), e._resetInsertionMode(), e._processStartTag(u)) : ca(e, u);
}
function no(e, u) {
const t = u.tagID;
t === s.CAPTION || t === s.TABLE || t === s.TBODY || t === s.TFOOT || t === s.THEAD || t === s.TR || t === s.TD || t === s.TH ? e.openElements.hasInTableScope(t) && (e.openElements.popUntilTagNamePopped(s.SELECT), e._resetInsertionMode(), e.onEndTag(u)) : oa(e, u);
}
function io(e, u) {
switch (u.tagID) {
// First, handle tags that can start without a mode change
case s.BASE:
case s.BASEFONT:
case s.BGSOUND:
case s.LINK:
case s.META:
case s.NOFRAMES:
case s.SCRIPT:
case s.STYLE:
case s.TEMPLATE:
case s.TITLE: {
K(e, u);
break;
}
// Re-process the token in the appropriate mode
case s.CAPTION:
case s.COLGROUP:
case s.TBODY:
case s.TFOOT:
case s.THEAD: {
e.tmplInsertionModeStack[0] = d.IN_TABLE, e.insertionMode = d.IN_TABLE, Ie(e, u);
break;
}
case s.COL: {
e.tmplInsertionModeStack[0] = d.IN_COLUMN_GROUP, e.insertionMode = d.IN_COLUMN_GROUP, pt(e, u);
break;
}
case s.TR: {
e.tmplInsertionModeStack[0] = d.IN_TABLE_BODY, e.insertionMode = d.IN_TABLE_BODY, Iu(e, u);
break;
}
case s.TD:
case s.TH: {
e.tmplInsertionModeStack[0] = d.IN_ROW, e.insertionMode = d.IN_ROW, Su(e, u);
break;
}
default:
e.tmplInsertionModeStack[0] = d.IN_BODY, e.insertionMode = d.IN_BODY, q(e, u);
}
}
function co(e, u) {
u.tagID === s.TEMPLATE && me(e, u);
}
function da(e, u) {
e.openElements.tmplCount > 0 ? (e.openElements.popUntilTagNamePopped(s.TEMPLATE), e.activeFormattingElements.clearToLastMarker(), e.tmplInsertionModeStack.shift(), e._resetInsertionMode(), e.onEof(u)) : _t(e, u);
}
function oo(e, u) {
u.tagID === s.HTML ? q(e, u) : hu(e, u);
}
function fa(e, u) {
var t;
if (u.tagID === s.HTML) {
if (e.fragmentContext || (e.insertionMode = d.AFTER_AFTER_BODY), e.options.sourceCodeLocationInfo && e.openElements.tagIDs[0] === s.HTML) {
e._setEndLocation(e.openElements.items[0], u);
const a = e.openElements.items[1];
a && !(!((t = e.treeAdapter.getNodeSourceCodeLocation(a)) === null || t === void 0) && t.endTag) && e._setEndLocation(a, u);
}
} else
hu(e, u);
}
function hu(e, u) {
e.insertionMode = d.IN_BODY, gu(e, u);
}
function fo(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.FRAMESET: {
e._insertElement(u, T.HTML);
break;
}
case s.FRAME: {
e._appendElement(u, T.HTML), u.ackSelfClosing = !0;
break;
}
case s.NOFRAMES: {
K(e, u);
break;
}
}
}
function lo(e, u) {
u.tagID === s.FRAMESET && !e.openElements.isRootHtmlElementCurrent() && (e.openElements.pop(), !e.fragmentContext && e.openElements.currentTagId !== s.FRAMESET && (e.insertionMode = d.AFTER_FRAMESET));
}
function ho(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.NOFRAMES: {
K(e, u);
break;
}
}
}
function bo(e, u) {
u.tagID === s.HTML && (e.insertionMode = d.AFTER_AFTER_FRAMESET);
}
function Eo(e, u) {
u.tagID === s.HTML ? q(e, u) : tu(e, u);
}
function tu(e, u) {
e.insertionMode = d.IN_BODY, gu(e, u);
}
function To(e, u) {
switch (u.tagID) {
case s.HTML: {
q(e, u);
break;
}
case s.NOFRAMES: {
K(e, u);
break;
}
}
}
function mo(e, u) {
u.chars = P, e._insertCharacters(u);
}
function Ao(e, u) {
e._insertCharacters(u), e.framesetOk = !1;
}
function la(e) {
for (; e.treeAdapter.getNamespaceURI(e.openElements.current) !== T.HTML && e.openElements.currentTagId !== void 0 && !e._isIntegrationPoint(e.openElements.currentTagId, e.openElements.current); )
e.openElements.pop();
}
function _o(e, u) {
if (Mi(u))
la(e), e._startTagOutsideForeignContent(u);
else {
const t = e._getAdjustedCurrentElement(), a = e.treeAdapter.getNamespaceURI(t);
a === T.MATHML ? K0(u) : a === T.SVG && (ki(u), j0(u)), mt(u), u.selfClosing ? e._appendElement(u, a) : e._insertElement(u, a), u.ackSelfClosing = !0;
}
}
function po(e, u) {
if (u.tagID === s.P || u.tagID === s.BR) {
la(e), e._endTagOutsideForeignContent(u);
return;
}
for (let t = e.openElements.stackTop; t > 0; t--) {
const a = e.openElements.items[t];
if (e.treeAdapter.getNamespaceURI(a) === T.HTML) {
e._endTagOutsideForeignContent(u);
break;
}
const r = e.treeAdapter.getTagName(a);
if (r.toLowerCase() === u.tagName) {
u.tagName = r, e.openElements.shortenToLength(t);
break;
}
}
}
function ha(e, u) {
return function(a) {
let r, n = 0, i = "";
for (; r = e.exec(a); )
n !== r.index && (i += a.substring(n, r.index)), i += u.get(r[0].charCodeAt(0)), n = r.index + 1;
return i + a.substring(n);
};
}
const go = /* @__PURE__ */ ha(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, "&quot;"],
[38, "&amp;"],
[160, "&nbsp;"]
])), No = /* @__PURE__ */ ha(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&amp;"],
[60, "&lt;"],
[62, "&gt;"],
[160, "&nbsp;"]
])), Io = /* @__PURE__ */ new Set([
h.AREA,
h.BASE,
h.BASEFONT,
h.BGSOUND,
h.BR,
h.COL,
h.EMBED,
h.FRAME,
h.HR,
h.IMG,
h.INPUT,
h.KEYGEN,
h.LINK,
h.META,
h.PARAM,
h.SOURCE,
h.TRACK,
h.WBR
]);
function So(e, u) {
return u.treeAdapter.isElementNode(e) && u.treeAdapter.getNamespaceURI(e) === T.HTML && Io.has(u.treeAdapter.getTagName(e));
}
const Co = { treeAdapter: ee, scriptingEnabled: !0 };
function xo(e, u) {
const t = { ...Co, ...u };
return ba(e, t);
}
function Oo(e, u) {
let t = "";
const a = u.treeAdapter.isElementNode(e) && u.treeAdapter.getTagName(e) === h.TEMPLATE && u.treeAdapter.getNamespaceURI(e) === T.HTML ? u.treeAdapter.getTemplateContent(e) : e, r = u.treeAdapter.getChildNodes(a);
if (r)
for (const n of r)
t += ba(n, u);
return t;
}
function ba(e, u) {
return u.treeAdapter.isElementNode(e) ? Lo(e, u) : u.treeAdapter.isTextNode(e) ? Ro(e, u) : u.treeAdapter.isCommentNode(e) ? Po(e, u) : u.treeAdapter.isDocumentTypeNode(e) ? yo(e, u) : "";
}
function Lo(e, u) {
const t = u.treeAdapter.getTagName(e);
return `<${t}${Do(e, u)}>${So(e, u) ? "" : `${Oo(e, u)}</${t}>`}`;
}
function Do(e, { treeAdapter: u }) {
let t = "";
for (const a of u.getAttrList(e)) {
if (t += " ", a.namespace)
switch (a.namespace) {
case T.XML: {
t += `xml:${a.name}`;
break;
}
case T.XMLNS: {
a.name !== "xmlns" && (t += "xmlns:"), t += a.name;
break;
}
case T.XLINK: {
t += `xlink:${a.name}`;
break;
}
default:
t += `${a.prefix}:${a.name}`;
}
else
t += a.name;
t += `="${go(a.value)}"`;
}
return t;
}
function Ro(e, u) {
const { treeAdapter: t } = u, a = t.getTextNodeContent(e), r = t.getParentNode(e), n = r && t.isElementNode(r) && t.getTagName(r);
return n && t.getNamespaceURI(r) === T.HTML && ii(n, u.scriptingEnabled) ? a : No(a);
}
function Po(e, { treeAdapter: u }) {
return `<!--${u.getCommentNodeContent(e)}-->`;
}
function yo(e, { treeAdapter: u }) {
return `<!DOCTYPE ${u.getDocumentTypeNodeName(e)}>`;
}
function Mo(e, u) {
return z0.parse(e, u);
}
function ko(e, u, t) {
typeof e == "string" && (t = u, u = e, e = null);
const a = z0.getFragmentParser(e, t);
return a.tokenizer.write(u, !0), a.getFragment();
}
function Jt(e) {
const u = e.includes('"') ? "'" : '"';
return u + e + u;
}
function Bo(e, u, t) {
let a = "!DOCTYPE ";
return e && (a += e), u ? a += ` PUBLIC ${Jt(u)}` : t && (a += " SYSTEM"), t && (a += ` ${Jt(t)}`), a;
}
const se = {
// Re-exports from domhandler
isCommentNode: Eu,
isElementNode: x,
isTextNode: Z,
//Node construction
createDocument() {
const e = new be([]);
return e["x-mode"] = Q.NO_QUIRKS, e;
},
createDocumentFragment() {
return new be([]);
},
createElement(e, u, t) {
const a = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null);
for (let f = 0; f < t.length; f++) {
const l = t[f].name;
a[l] = t[f].value, r[l] = t[f].namespace, n[l] = t[f].prefix;
}
const i = new tt(e, a, []);
return i.namespace = u, i["x-attribsNamespace"] = r, i["x-attribsPrefix"] = n, i;
},
createCommentNode(e) {
return new Ju(e);
},
createTextNode(e) {
return new He(e);
},
//Tree mutation
appendChild(e, u) {
const t = e.children[e.children.length - 1];
t && (t.next = u, u.prev = t), e.children.push(u), u.parent = e;
},
insertBefore(e, u, t) {
const a = e.children.indexOf(t), { prev: r } = t;
r && (r.next = u, u.prev = r), t.prev = u, u.next = t, e.children.splice(a, 0, u), u.parent = e;
},
setTemplateContent(e, u) {
se.appendChild(e, u);
},
getTemplateContent(e) {
return e.children[0];
},
setDocumentType(e, u, t, a) {
const r = Bo(u, t, a);
let n = e.children.find((i) => Uu(i) && i.name === "!doctype");
n ? n.data = r ?? null : (n = new et("!doctype", r), se.appendChild(e, n)), n["x-name"] = u, n["x-publicId"] = t, n["x-systemId"] = a;
},
setDocumentMode(e, u) {
e["x-mode"] = u;
},
getDocumentMode(e) {
return e["x-mode"];
},
detachNode(e) {
if (e.parent) {
const u = e.parent.children.indexOf(e), { prev: t, next: a } = e;
e.prev = null, e.next = null, t && (t.next = a), a && (a.prev = t), e.parent.children.splice(u, 1), e.parent = null;
}
},
insertText(e, u) {
const t = e.children[e.children.length - 1];
t && Z(t) ? t.data += u : se.appendChild(e, se.createTextNode(u));
},
insertTextBefore(e, u, t) {
const a = e.children[e.children.indexOf(t) - 1];
a && Z(a) ? a.data += u : se.insertBefore(e, se.createTextNode(u), t);
},
adoptAttributes(e, u) {
for (let t = 0; t < u.length; t++) {
const a = u[t].name;
e.attribs[a] === void 0 && (e.attribs[a] = u[t].value, e["x-attribsNamespace"][a] = u[t].namespace, e["x-attribsPrefix"][a] = u[t].prefix);
}
},
//Tree traversing
getFirstChild(e) {
return e.children[0];
},
getChildNodes(e) {
return e.children;
},
getParentNode(e) {
return e.parent;
},
getAttrList(e) {
return e.attributes;
},
//Node data
getTagName(e) {
return e.name;
},
getNamespaceURI(e) {
return e.namespace;
},
getTextNodeContent(e) {
return e.data;
},
getCommentNodeContent(e) {
return e.data;
},
getDocumentTypeNodeName(e) {
var u;
return (u = e["x-name"]) !== null && u !== void 0 ? u : "";
},
getDocumentTypeNodePublicId(e) {
var u;
return (u = e["x-publicId"]) !== null && u !== void 0 ? u : "";
},
getDocumentTypeNodeSystemId(e) {
var u;
return (u = e["x-systemId"]) !== null && u !== void 0 ? u : "";
},
//Node types
isDocumentTypeNode(e) {
return Uu(e) && e.name === "!doctype";
},
// Source code location
setNodeSourceCodeLocation(e, u) {
u && (e.startIndex = u.startOffset, e.endIndex = u.endOffset), e.sourceCodeLocation = u;
},
getNodeSourceCodeLocation(e) {
return e.sourceCodeLocation;
},
updateNodeSourceCodeLocation(e, u) {
u.endOffset != null && (e.endIndex = u.endOffset), e.sourceCodeLocation = {
...e.sourceCodeLocation,
...u
};
}
};
function Fo(e, u, t, a) {
var r;
return (r = u.treeAdapter) !== null && r !== void 0 || (u.treeAdapter = se), u.scriptingEnabled !== !1 && (u.scriptingEnabled = !0), t ? Mo(e, u) : ko(a, e, u);
}
const wo = { treeAdapter: se };
function Uo(e) {
const u = "length" in e ? e : [e];
for (let a = 0; a < u.length; a += 1) {
const r = u[a];
ce(r) && Array.prototype.splice.call(u, a, 1, ...r.children);
}
let t = "";
for (let a = 0; a < u.length; a += 1) {
const r = u[a];
t += xo(r, wo);
}
return t;
}
const Ho = on((e, u, t, a) => u._useHtmlParser2 ? Bs(e, u) : Fo(e, u, t, a)), vo = Yn(Ho, (e, u) => u._useHtmlParser2 ? Tu(e, u) : Uo(e)), Go = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
contains: ct,
load: vo,
merge: b0
}, Symbol.toStringTag, { value: "Module" }));
export {
Go as default
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment