`;
const svgStr_unfold = ``;
btn.setAttribute("is_fold", "false");
btn.innerHTML = svgStr_fold;
if (ABCSetting.env.startsWith("obsidian")) {
btn.onclick = () => {
const is_all_fold = btn.getAttribute("is_fold");
if (is_all_fold == "true") {
btn.setAttribute("is_fold", "false");
btn.innerHTML = svgStr_fold;
const btn_subs = table2.querySelectorAll("tr[is_fold='true']>td:first-child");
btn_subs.forEach((btn_sub) => {
btn_sub.click();
});
} else {
btn.setAttribute("is_fold", "true");
btn.innerHTML = svgStr_unfold;
const btn_subs = table2.querySelectorAll("tr[is_fold='false']>td:first-child");
btn_subs.forEach((btn_sub) => {
btn_sub.click();
});
}
};
} else {
btn.setAttribute(
"onclick",
` const btn = this;
const svgStr_fold = \`${svgStr_fold}\`;
const svgStr_unfold = \`${svgStr_unfold}\`;
const table = btn.parentNode?.querySelector("table");
if (!table) return;
const is_all_fold = btn.getAttribute("is_fold")
if (is_all_fold=="true") {
btn.setAttribute("is_fold", "false"); btn.innerHTML = svgStr_fold;
const btn_subs = table.querySelectorAll("tr[is_fold='true']>td:first-child");
btn_subs.forEach((btn_sub) => { btn_sub.click() }) // \u6CE8\u610FsetAttr\u7248\u672C\u65E0\u65AD\u8A00
}
else {
btn.setAttribute("is_fold", "true"); btn.innerHTML = svgStr_unfold;
const btn_subs = table.querySelectorAll("tr[is_fold='false']>td:first-child");
btn_subs.forEach((btn_sub) => { btn_sub.click() }) // \u6CE8\u610FsetAttr\u7248\u672C\u65E0\u65AD\u8A00
}`
);
}
}
return div;
}
};
var _abc_list2lt = ABConvert.factory({
id: "list2lt",
name: "\u5217\u8868\u8F6C\u5217\u8868\u8868\u683C",
match: /list2(md)?lt(T)?/,
default: "list2lt",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/list2(md)?lt(T)?/);
if (!matchs)
return el;
DirProcess.list2lt(content, el, matchs[2] == "T");
return el;
}
});
var _abc_list2dt = ABConvert.factory({
id: "list2dt",
name: "\u5217\u8868\u8F6C\u6811\u72B6\u76EE\u5F55",
match: /list2(md)?dt(T)?/,
default: "list2dt",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/list2(md)?dt(T)?/);
if (!matchs)
return el;
DirProcess.list2dt(content, el, matchs[2] == "T");
return el;
}
});
function listdata2dirdata(list2) {
const is_have_vbar = [];
const newlist = [];
for (let i = 0; i < list2.length; i++) {
const item = list2[i];
let type;
if (item.content.trimEnd().endsWith("/")) {
type = "folder";
} else {
const parts = item.content.split(".");
if (parts.length === 0 || parts[parts.length - 1] === "")
type = "";
else
type = parts[parts.length - 1];
}
let is_last = true;
for (let j = i + 1; j < list2.length; j++) {
if (list2[j].level < item.level) {
is_last = true;
break;
} else if (list2[j].level == item.level) {
is_last = false;
break;
} else {
continue;
}
}
is_have_vbar[item.level] = !is_last;
let pre_as_text = "";
if (item.level > 1) {
for (let i2 = 1; i2 < item.level; i2++) {
if (!is_have_vbar.hasOwnProperty(i2))
pre_as_text += "[e]";
else if (is_have_vbar[i2])
pre_as_text += "| ";
else
pre_as_text += " ";
}
}
newlist.push({
content: item.content,
level: item.level,
type,
is_last,
pre_as_text
});
}
return newlist;
}
var _abc_list2astreeH = ABConvert.factory({
id: "list2astreeH",
name: "\u5217\u8868\u5230sacii\u76EE\u5F55\u6811",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let listdata = ListProcess.list2data(content);
listdata = ListProcess.data2strict(listdata);
const dirlistdata = listdata2dirdata(listdata);
let newContent = "";
for (const item of dirlistdata) {
if (item.level == 0) {
newContent += item.content + "\n";
} else {
newContent += item.pre_as_text + (item.is_last ? "\u2514\u2500 " : "\u251C\u2500 ") + item.content + "\n";
}
}
newContent = newContent.trimEnd();
return newContent;
}
});
// ../../node_modules/.pnpm/dompurify@3.4.3/node_modules/dompurify/dist/purify.es.mjs
function _arrayLikeToArray(r, a) {
(null == a || a > r.length) && (a = r.length);
for (var e = 0, n2 = Array(a); e < a; e++)
n2[e] = r[e];
return n2;
}
function _arrayWithHoles(r) {
if (Array.isArray(r))
return r;
}
function _iterableToArrayLimit(r, l2) {
var t2 = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
if (null != t2) {
var e, n2, i, u, a = [], f = true, o = false;
try {
if (i = (t2 = t2.call(r)).next, 0 === l2)
;
else
for (; !(f = (e = i.call(t2)).done) && (a.push(e.value), a.length !== l2); f = true)
;
} catch (r2) {
o = true, n2 = r2;
} finally {
try {
if (!f && null != t2.return && (u = t2.return(), Object(u) !== u))
return;
} finally {
if (o)
throw n2;
}
}
return a;
}
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(r, e) {
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _unsupportedIterableToArray(r, a) {
if (r) {
if ("string" == typeof r)
return _arrayLikeToArray(r, a);
var t2 = {}.toString.call(r).slice(8, -1);
return "Object" === t2 && r.constructor && (t2 = r.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r, a) : void 0;
}
}
var entries = Object.entries;
var setPrototypeOf = Object.setPrototypeOf;
var isFrozen = Object.isFrozen;
var getPrototypeOf = Object.getPrototypeOf;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var freeze = Object.freeze;
var seal = Object.seal;
var create = Object.create;
var _ref = typeof Reflect !== "undefined" && Reflect;
var apply = _ref.apply;
var construct = _ref.construct;
if (!freeze) {
freeze = function freeze2(x) {
return x;
};
}
if (!seal) {
seal = function seal2(x) {
return x;
};
}
if (!apply) {
apply = function apply2(func, thisArg) {
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
args[_key - 2] = arguments[_key];
}
return func.apply(thisArg, args);
};
}
if (!construct) {
construct = function construct2(Func) {
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
return new Func(...args);
};
}
var arrayForEach = unapply(Array.prototype.forEach);
var arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
var arrayPop = unapply(Array.prototype.pop);
var arrayPush = unapply(Array.prototype.push);
var arraySplice = unapply(Array.prototype.splice);
var arrayIsArray = Array.isArray;
var stringToLowerCase = unapply(String.prototype.toLowerCase);
var stringToString = unapply(String.prototype.toString);
var stringMatch = unapply(String.prototype.match);
var stringReplace = unapply(String.prototype.replace);
var stringIndexOf = unapply(String.prototype.indexOf);
var stringTrim = unapply(String.prototype.trim);
var numberToString = unapply(Number.prototype.toString);
var booleanToString = unapply(Boolean.prototype.toString);
var bigintToString = typeof BigInt === "undefined" ? null : unapply(BigInt.prototype.toString);
var symbolToString = typeof Symbol === "undefined" ? null : unapply(Symbol.prototype.toString);
var objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
var objectToString = unapply(Object.prototype.toString);
var regExpTest = unapply(RegExp.prototype.test);
var typeErrorCreate = unconstruct(TypeError);
function unapply(func) {
return function(thisArg) {
if (thisArg instanceof RegExp) {
thisArg.lastIndex = 0;
}
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = arguments[_key3];
}
return apply(func, thisArg, args);
};
}
function unconstruct(Func) {
return function() {
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
args[_key4] = arguments[_key4];
}
return construct(Func, args);
};
}
function addToSet(set3, array) {
let transformCaseFunc = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : stringToLowerCase;
if (setPrototypeOf) {
setPrototypeOf(set3, null);
}
if (!arrayIsArray(array)) {
return set3;
}
let l2 = array.length;
while (l2--) {
let element = array[l2];
if (typeof element === "string") {
const lcElement = transformCaseFunc(element);
if (lcElement !== element) {
if (!isFrozen(array)) {
array[l2] = lcElement;
}
element = lcElement;
}
}
set3[element] = true;
}
return set3;
}
function cleanArray(array) {
for (let index2 = 0; index2 < array.length; index2++) {
const isPropertyExist = objectHasOwnProperty(array, index2);
if (!isPropertyExist) {
array[index2] = null;
}
}
return array;
}
function clone(object) {
const newObject = create(null);
for (const _ref2 of entries(object)) {
var _ref3 = _slicedToArray(_ref2, 2);
const property = _ref3[0];
const value = _ref3[1];
const isPropertyExist = objectHasOwnProperty(object, property);
if (isPropertyExist) {
if (arrayIsArray(value)) {
newObject[property] = cleanArray(value);
} else if (value && typeof value === "object" && value.constructor === Object) {
newObject[property] = clone(value);
} else {
newObject[property] = value;
}
}
}
return newObject;
}
function stringifyValue(value) {
switch (typeof value) {
case "string": {
return value;
}
case "number": {
return numberToString(value);
}
case "boolean": {
return booleanToString(value);
}
case "bigint": {
return bigintToString ? bigintToString(value) : "0";
}
case "symbol": {
return symbolToString ? symbolToString(value) : "Symbol()";
}
case "undefined": {
return objectToString(value);
}
case "function":
case "object": {
if (value === null) {
return objectToString(value);
}
const valueAsRecord = value;
const valueToString = lookupGetter(valueAsRecord, "toString");
if (typeof valueToString === "function") {
const stringified = valueToString(valueAsRecord);
return typeof stringified === "string" ? stringified : objectToString(stringified);
}
return objectToString(value);
}
default: {
return objectToString(value);
}
}
}
function lookupGetter(object, prop2) {
while (object !== null) {
const desc = getOwnPropertyDescriptor(object, prop2);
if (desc) {
if (desc.get) {
return unapply(desc.get);
}
if (typeof desc.value === "function") {
return unapply(desc.value);
}
}
object = getPrototypeOf(object);
}
function fallbackValue() {
return null;
}
return fallbackValue;
}
function isRegex(value) {
try {
regExpTest(value, "");
return true;
} catch (_unused) {
return false;
}
}
var html$1 = freeze(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]);
var svg$1 = freeze(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]);
var svgFilters = freeze(["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"]);
var svgDisallowed = freeze(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]);
var mathMl$1 = freeze(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]);
var mathMlDisallowed = freeze(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]);
var text = freeze(["#text"]);
var html = freeze(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]);
var svg = freeze(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]);
var mathMl = freeze(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]);
var xml = freeze(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]);
var MUSTACHE_EXPR = seal(/{{[\w\W]*|^[\w\W]*}}/g);
var ERB_EXPR = seal(/<%[\w\W]*|^[\w\W]*%>/g);
var TMPLIT_EXPR = seal(/\${[\w\W]*/g);
var DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/);
var ARIA_ATTR = seal(/^aria-[\-\w]+$/);
var IS_ALLOWED_URI = seal(
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
);
var IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
var ATTR_WHITESPACE = seal(
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
);
var DOCTYPE_NAME = seal(/^html$/i);
var CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
var NODE_TYPE = {
element: 1,
text: 3,
progressingInstruction: 7,
comment: 8,
document: 9
};
var getGlobal = function getGlobal2() {
return typeof window === "undefined" ? null : window;
};
var _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTypes, purifyHostElement) {
if (typeof trustedTypes !== "object" || typeof trustedTypes.createPolicy !== "function") {
return null;
}
let suffix = null;
const ATTR_NAME = "data-tt-policy-suffix";
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
suffix = purifyHostElement.getAttribute(ATTR_NAME);
}
const policyName = "dompurify" + (suffix ? "#" + suffix : "");
try {
return trustedTypes.createPolicy(policyName, {
createHTML(html4) {
return html4;
},
createScriptURL(scriptUrl) {
return scriptUrl;
}
});
} catch (_) {
console.warn("TrustedTypes policy " + policyName + " could not be created.");
return null;
}
};
var _createHooksMap = function _createHooksMap2() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
};
function createDOMPurify() {
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
const DOMPurify = (root3) => createDOMPurify(root3);
DOMPurify.version = "3.4.3";
DOMPurify.removed = [];
if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document || !window2.Element) {
DOMPurify.isSupported = false;
return DOMPurify;
}
let document2 = window2.document;
const originalDocument = document2;
const currentScript = originalDocument.currentScript;
const DocumentFragment = window2.DocumentFragment, HTMLTemplateElement = window2.HTMLTemplateElement, Node3 = window2.Node, Element2 = window2.Element, NodeFilter = window2.NodeFilter, _window$NamedNodeMap = window2.NamedNodeMap, NamedNodeMap = _window$NamedNodeMap === void 0 ? window2.NamedNodeMap || window2.MozNamedAttrMap : _window$NamedNodeMap, HTMLFormElement = window2.HTMLFormElement, DOMParser = window2.DOMParser, trustedTypes = window2.trustedTypes;
const ElementPrototype = Element2.prototype;
const cloneNode2 = lookupGetter(ElementPrototype, "cloneNode");
const remove2 = lookupGetter(ElementPrototype, "remove");
const getNextSibling = lookupGetter(ElementPrototype, "nextSibling");
const getChildNodes = lookupGetter(ElementPrototype, "childNodes");
const getParentNode = lookupGetter(ElementPrototype, "parentNode");
if (typeof HTMLTemplateElement === "function") {
const template = document2.createElement("template");
if (template.content && template.content.ownerDocument) {
document2 = template.content.ownerDocument;
}
}
let trustedTypesPolicy;
let emptyHTML = "";
const _document = document2, implementation = _document.implementation, createNodeIterator = _document.createNodeIterator, createDocumentFragment = _document.createDocumentFragment, getElementsByTagName2 = _document.getElementsByTagName;
const importNode = originalDocument.importNode;
let hooks = _createHooksMap();
DOMPurify.isSupported = typeof entries === "function" && typeof getParentNode === "function" && implementation && implementation.createHTMLDocument !== void 0;
const MUSTACHE_EXPR$1 = MUSTACHE_EXPR, ERB_EXPR$1 = ERB_EXPR, TMPLIT_EXPR$1 = TMPLIT_EXPR, DATA_ATTR$1 = DATA_ATTR, ARIA_ATTR$1 = ARIA_ATTR, IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA, ATTR_WHITESPACE$1 = ATTR_WHITESPACE, CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;
let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;
let ALLOWED_TAGS = null;
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
let ALLOWED_ATTR = null;
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
tagNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
attributeNameCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
allowCustomizedBuiltInElements: {
writable: true,
configurable: false,
enumerable: true,
value: false
}
}));
let FORBID_TAGS = null;
let FORBID_ATTR = null;
const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {
tagCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
},
attributeCheck: {
writable: true,
configurable: false,
enumerable: true,
value: null
}
}));
let ALLOW_ARIA_ATTR = true;
let ALLOW_DATA_ATTR = true;
let ALLOW_UNKNOWN_PROTOCOLS = false;
let ALLOW_SELF_CLOSE_IN_ATTR = true;
let SAFE_FOR_TEMPLATES = false;
let SAFE_FOR_XML = true;
let WHOLE_DOCUMENT = false;
let SET_CONFIG = false;
let FORCE_BODY = false;
let RETURN_DOM = false;
let RETURN_DOM_FRAGMENT = false;
let RETURN_TRUSTED_TYPE = false;
let SANITIZE_DOM = true;
let SANITIZE_NAMED_PROPS = false;
const SANITIZE_NAMED_PROPS_PREFIX = "user-content-";
let KEEP_CONTENT = true;
let IN_PLACE = false;
let USE_PROFILES = {};
let FORBID_CONTENTS = null;
const DEFAULT_FORBID_CONTENTS = addToSet({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
let DATA_URI_TAGS = null;
const DEFAULT_DATA_URI_TAGS = addToSet({}, ["audio", "video", "img", "source", "image", "track"]);
let URI_SAFE_ATTRIBUTES = null;
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]);
const MATHML_NAMESPACE = "http://www.w3.org/1998/Math/MathML";
const SVG_NAMESPACE = "http://www.w3.org/2000/svg";
const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
let NAMESPACE = HTML_NAMESPACE;
let IS_EMPTY_INPUT = false;
let ALLOWED_NAMESPACES = null;
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
let PARSER_MEDIA_TYPE = null;
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
let transformCaseFunc = null;
let CONFIG = null;
const formElement = document2.createElement("form");
const isRegexOrFunction = function isRegexOrFunction2(testValue) {
return testValue instanceof RegExp || testValue instanceof Function;
};
const _parseConfig = function _parseConfig2() {
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (CONFIG && CONFIG === cfg) {
return;
}
if (!cfg || typeof cfg !== "object") {
cfg = {};
}
cfg = clone(cfg);
PARSER_MEDIA_TYPE = SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
transformCaseFunc = PARSER_MEDIA_TYPE === "application/xhtml+xml" ? stringToString : stringToLowerCase;
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") && arrayIsArray(cfg.ALLOWED_TAGS) ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") && arrayIsArray(cfg.ALLOWED_ATTR) ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") && arrayIsArray(cfg.ALLOWED_NAMESPACES) ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR) ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") && arrayIsArray(cfg.ADD_DATA_URI_TAGS) ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS) ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") && arrayIsArray(cfg.FORBID_TAGS) ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") && arrayIsArray(cfg.FORBID_ATTR) ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
USE_PROFILES = objectHasOwnProperty(cfg, "USE_PROFILES") ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === "object" ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false;
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false;
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false;
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false;
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false;
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false;
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false;
RETURN_DOM = cfg.RETURN_DOM || false;
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false;
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false;
FORCE_BODY = cfg.FORCE_BODY || false;
SANITIZE_DOM = cfg.SANITIZE_DOM !== false;
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false;
KEEP_CONTENT = cfg.KEEP_CONTENT !== false;
IN_PLACE = cfg.IN_PLACE || false;
IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI;
NAMESPACE = typeof cfg.NAMESPACE === "string" ? cfg.NAMESPACE : HTML_NAMESPACE;
MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "MATHML_TEXT_INTEGRATION_POINTS") && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === "object" ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, "HTML_INTEGRATION_POINTS") && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === "object" ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, ["annotation-xml"]);
const customElementHandling = objectHasOwnProperty(cfg, "CUSTOM_ELEMENT_HANDLING") && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === "object" ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);
CUSTOM_ELEMENT_HANDLING = create(null);
if (objectHasOwnProperty(customElementHandling, "tagNameCheck") && isRegexOrFunction(customElementHandling.tagNameCheck)) {
CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck;
}
if (objectHasOwnProperty(customElementHandling, "attributeNameCheck") && isRegexOrFunction(customElementHandling.attributeNameCheck)) {
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck;
}
if (objectHasOwnProperty(customElementHandling, "allowCustomizedBuiltInElements") && typeof customElementHandling.allowCustomizedBuiltInElements === "boolean") {
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements;
}
if (SAFE_FOR_TEMPLATES) {
ALLOW_DATA_ATTR = false;
}
if (RETURN_DOM_FRAGMENT) {
RETURN_DOM = true;
}
if (USE_PROFILES) {
ALLOWED_TAGS = addToSet({}, text);
ALLOWED_ATTR = create(null);
if (USE_PROFILES.html === true) {
addToSet(ALLOWED_TAGS, html$1);
addToSet(ALLOWED_ATTR, html);
}
if (USE_PROFILES.svg === true) {
addToSet(ALLOWED_TAGS, svg$1);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.svgFilters === true) {
addToSet(ALLOWED_TAGS, svgFilters);
addToSet(ALLOWED_ATTR, svg);
addToSet(ALLOWED_ATTR, xml);
}
if (USE_PROFILES.mathMl === true) {
addToSet(ALLOWED_TAGS, mathMl$1);
addToSet(ALLOWED_ATTR, mathMl);
addToSet(ALLOWED_ATTR, xml);
}
}
EXTRA_ELEMENT_HANDLING.tagCheck = null;
EXTRA_ELEMENT_HANDLING.attributeCheck = null;
if (objectHasOwnProperty(cfg, "ADD_TAGS")) {
if (typeof cfg.ADD_TAGS === "function") {
EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;
} else if (arrayIsArray(cfg.ADD_TAGS)) {
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
ALLOWED_TAGS = clone(ALLOWED_TAGS);
}
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
}
}
if (objectHasOwnProperty(cfg, "ADD_ATTR")) {
if (typeof cfg.ADD_ATTR === "function") {
EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;
} else if (arrayIsArray(cfg.ADD_ATTR)) {
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
ALLOWED_ATTR = clone(ALLOWED_ATTR);
}
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
}
}
if (objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
}
if (objectHasOwnProperty(cfg, "FORBID_CONTENTS") && arrayIsArray(cfg.FORBID_CONTENTS)) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
}
if (objectHasOwnProperty(cfg, "ADD_FORBID_CONTENTS") && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
FORBID_CONTENTS = clone(FORBID_CONTENTS);
}
addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);
}
if (KEEP_CONTENT) {
ALLOWED_TAGS["#text"] = true;
}
if (WHOLE_DOCUMENT) {
addToSet(ALLOWED_TAGS, ["html", "head", "body"]);
}
if (ALLOWED_TAGS.table) {
addToSet(ALLOWED_TAGS, ["tbody"]);
delete FORBID_TAGS.tbody;
}
if (cfg.TRUSTED_TYPES_POLICY) {
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== "function") {
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
}
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== "function") {
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
}
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
emptyHTML = trustedTypesPolicy.createHTML("");
} else {
if (trustedTypesPolicy === void 0) {
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
}
if (trustedTypesPolicy !== null && typeof emptyHTML === "string") {
emptyHTML = trustedTypesPolicy.createHTML("");
}
}
if (freeze) {
freeze(cfg);
}
CONFIG = cfg;
};
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
const _checkValidNamespace = function _checkValidNamespace2(element) {
let parent2 = getParentNode(element);
if (!parent2 || !parent2.tagName) {
parent2 = {
namespaceURI: NAMESPACE,
tagName: "template"
};
}
const tagName = stringToLowerCase(element.tagName);
const parentTagName = stringToLowerCase(parent2.tagName);
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
return false;
}
if (element.namespaceURI === SVG_NAMESPACE) {
if (parent2.namespaceURI === HTML_NAMESPACE) {
return tagName === "svg";
}
if (parent2.namespaceURI === MATHML_NAMESPACE) {
return tagName === "svg" && (parentTagName === "annotation-xml" || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
}
return Boolean(ALL_SVG_TAGS[tagName]);
}
if (element.namespaceURI === MATHML_NAMESPACE) {
if (parent2.namespaceURI === HTML_NAMESPACE) {
return tagName === "math";
}
if (parent2.namespaceURI === SVG_NAMESPACE) {
return tagName === "math" && HTML_INTEGRATION_POINTS[parentTagName];
}
return Boolean(ALL_MATHML_TAGS[tagName]);
}
if (element.namespaceURI === HTML_NAMESPACE) {
if (parent2.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
return false;
}
if (parent2.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
return false;
}
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
}
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && ALLOWED_NAMESPACES[element.namespaceURI]) {
return true;
}
return false;
};
const _forceRemove = function _forceRemove2(node) {
arrayPush(DOMPurify.removed, {
element: node
});
try {
getParentNode(node).removeChild(node);
} catch (_) {
remove2(node);
}
};
const _removeAttribute = function _removeAttribute2(name2, element) {
try {
arrayPush(DOMPurify.removed, {
attribute: element.getAttributeNode(name2),
from: element
});
} catch (_) {
arrayPush(DOMPurify.removed, {
attribute: null,
from: element
});
}
element.removeAttribute(name2);
if (name2 === "is") {
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
try {
_forceRemove(element);
} catch (_) {
}
} else {
try {
element.setAttribute(name2, "");
} catch (_) {
}
}
}
};
const _initDocument = function _initDocument2(dirty) {
let doc = null;
let leadingWhitespace = null;
if (FORCE_BODY) {
dirty = "" + dirty;
} else {
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
leadingWhitespace = matches && matches[0];
}
if (PARSER_MEDIA_TYPE === "application/xhtml+xml" && NAMESPACE === HTML_NAMESPACE) {
dirty = '' + dirty + "";
}
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
if (NAMESPACE === HTML_NAMESPACE) {
try {
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
} catch (_) {
}
}
if (!doc || !doc.documentElement) {
doc = implementation.createDocument(NAMESPACE, "template", null);
try {
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
} catch (_) {
}
}
const body = doc.body || doc.documentElement;
if (dirty && leadingWhitespace) {
body.insertBefore(document2.createTextNode(leadingWhitespace), body.childNodes[0] || null);
}
if (NAMESPACE === HTML_NAMESPACE) {
return getElementsByTagName2.call(doc, WHOLE_DOCUMENT ? "html" : "body")[0];
}
return WHOLE_DOCUMENT ? doc.documentElement : body;
};
const _createNodeIterator = function _createNodeIterator2(root3) {
return createNodeIterator.call(
root3.ownerDocument || root3,
root3,
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION,
null
);
};
const _isClobbered = function _isClobbered2(element) {
return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
};
const _isNode = function _isNode2(value) {
return typeof Node3 === "function" && value instanceof Node3;
};
function _executeHooks(hooks2, currentNode, data2) {
arrayForEach(hooks2, (hook) => {
hook.call(DOMPurify, currentNode, data2, CONFIG);
});
}
const _sanitizeElements = function _sanitizeElements2(currentNode) {
let content = null;
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
if (_isClobbered(currentNode)) {
_forceRemove(currentNode);
return true;
}
const tagName = transformCaseFunc(currentNode.nodeName);
_executeHooks(hooks.uponSanitizeElement, currentNode, {
tagName,
allowedTags: ALLOWED_TAGS
});
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
_forceRemove(currentNode);
return true;
}
if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === "style" && _isNode(currentNode.firstElementChild)) {
_forceRemove(currentNode);
return true;
}
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
_forceRemove(currentNode);
return true;
}
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
_forceRemove(currentNode);
return true;
}
if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
return false;
}
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
return false;
}
}
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
if (childNodes && parentNode) {
const childCount = childNodes.length;
for (let i = childCount - 1; i >= 0; --i) {
const childClone = cloneNode2(childNodes[i], true);
parentNode.insertBefore(childClone, getNextSibling(currentNode));
}
}
}
_forceRemove(currentNode);
return true;
}
if (currentNode instanceof Element2 && !_checkValidNamespace(currentNode)) {
_forceRemove(currentNode);
return true;
}
if ((tagName === "noscript" || tagName === "noembed" || tagName === "noframes") && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
_forceRemove(currentNode);
return true;
}
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
content = currentNode.textContent;
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], (expr) => {
content = stringReplace(content, expr, " ");
});
if (currentNode.textContent !== content) {
arrayPush(DOMPurify.removed, {
element: currentNode.cloneNode()
});
currentNode.textContent = content;
}
}
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
return false;
};
const _isValidAttribute = function _isValidAttribute2(lcTag, lcName, value) {
if (FORBID_ATTR[lcName]) {
return false;
}
if (SANITIZE_DOM && (lcName === "id" || lcName === "name") && (value in document2 || value in formElement)) {
return false;
}
const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR$1, lcName))
;
else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName))
;
else if (!nameIsPermitted || FORBID_ATTR[lcName]) {
if (_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) || lcName === "is" && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value)))
;
else {
return false;
}
} else if (URI_SAFE_ATTRIBUTES[lcName])
;
else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
;
else if ((lcName === "src" || lcName === "xlink:href" || lcName === "href") && lcTag !== "script" && stringIndexOf(value, "data:") === 0 && DATA_URI_TAGS[lcTag])
;
else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, "")))
;
else if (value) {
return false;
} else
;
return true;
};
const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]);
const _isBasicCustomElement = function _isBasicCustomElement2(tagName) {
return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);
};
const _sanitizeAttributes = function _sanitizeAttributes2(currentNode) {
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
const attributes2 = currentNode.attributes;
if (!attributes2 || _isClobbered(currentNode)) {
return;
}
const hookEvent = {
attrName: "",
attrValue: "",
keepAttr: true,
allowedAttributes: ALLOWED_ATTR,
forceKeepAttr: void 0
};
let l2 = attributes2.length;
while (l2--) {
const attr2 = attributes2[l2];
const name2 = attr2.name, namespaceURI = attr2.namespaceURI, attrValue = attr2.value;
const lcName = transformCaseFunc(name2);
const initValue = attrValue;
let value = name2 === "value" ? initValue : stringTrim(initValue);
hookEvent.attrName = lcName;
hookEvent.attrValue = value;
hookEvent.keepAttr = true;
hookEvent.forceKeepAttr = void 0;
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
value = hookEvent.attrValue;
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name") && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {
_removeAttribute(name2, currentNode);
value = SANITIZE_NAMED_PROPS_PREFIX + value;
}
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {
_removeAttribute(name2, currentNode);
continue;
}
if (lcName === "attributename" && stringMatch(value, "href")) {
_removeAttribute(name2, currentNode);
continue;
}
if (hookEvent.forceKeepAttr) {
continue;
}
if (!hookEvent.keepAttr) {
_removeAttribute(name2, currentNode);
continue;
}
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
_removeAttribute(name2, currentNode);
continue;
}
if (SAFE_FOR_TEMPLATES) {
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], (expr) => {
value = stringReplace(value, expr, " ");
});
}
const lcTag = transformCaseFunc(currentNode.nodeName);
if (!_isValidAttribute(lcTag, lcName, value)) {
_removeAttribute(name2, currentNode);
continue;
}
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
if (namespaceURI)
;
else {
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
case "TrustedHTML": {
value = trustedTypesPolicy.createHTML(value);
break;
}
case "TrustedScriptURL": {
value = trustedTypesPolicy.createScriptURL(value);
break;
}
}
}
}
if (value !== initValue) {
try {
if (namespaceURI) {
currentNode.setAttributeNS(namespaceURI, name2, value);
} else {
currentNode.setAttribute(name2, value);
}
if (_isClobbered(currentNode)) {
_forceRemove(currentNode);
} else {
arrayPop(DOMPurify.removed);
}
} catch (_) {
_removeAttribute(name2, currentNode);
}
}
}
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
};
const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {
let shadowNode = null;
const shadowIterator = _createNodeIterator(fragment);
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
while (shadowNode = shadowIterator.nextNode()) {
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
_sanitizeElements(shadowNode);
_sanitizeAttributes(shadowNode);
if (shadowNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM2(shadowNode.content);
}
}
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
};
const _sanitizeAttachedShadowRoots2 = function _sanitizeAttachedShadowRoots(root3) {
if (root3.nodeType === NODE_TYPE.element && root3.shadowRoot instanceof DocumentFragment) {
const sr = root3.shadowRoot;
_sanitizeAttachedShadowRoots2(sr);
_sanitizeShadowDOM2(sr);
}
const childNodes = root3.childNodes;
if (!childNodes) {
return;
}
const snapshot = [];
arrayForEach(childNodes, (child) => {
arrayPush(snapshot, child);
});
for (const child of snapshot) {
_sanitizeAttachedShadowRoots2(child);
}
};
DOMPurify.sanitize = function(dirty) {
let cfg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
let body = null;
let importedNode = null;
let currentNode = null;
let returnNode = null;
IS_EMPTY_INPUT = !dirty;
if (IS_EMPTY_INPUT) {
dirty = "";
}
if (typeof dirty !== "string" && !_isNode(dirty)) {
dirty = stringifyValue(dirty);
if (typeof dirty !== "string") {
throw typeErrorCreate("dirty is not a string, aborting");
}
}
if (!DOMPurify.isSupported) {
return dirty;
}
if (!SET_CONFIG) {
_parseConfig(cfg);
}
DOMPurify.removed = [];
if (typeof dirty === "string") {
IN_PLACE = false;
}
if (IN_PLACE) {
const nn = dirty.nodeName;
if (typeof nn === "string") {
const tagName = transformCaseFunc(nn);
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place");
}
}
_sanitizeAttachedShadowRoots2(dirty);
} else if (dirty instanceof Node3) {
body = _initDocument("");
importedNode = body.ownerDocument.importNode(dirty, true);
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === "BODY") {
body = importedNode;
} else if (importedNode.nodeName === "HTML") {
body = importedNode;
} else {
body.appendChild(importedNode);
}
_sanitizeAttachedShadowRoots2(importedNode);
} else {
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT && dirty.indexOf("<") === -1) {
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
}
body = _initDocument(dirty);
if (!body) {
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : "";
}
}
if (body && FORCE_BODY) {
_forceRemove(body.firstChild);
}
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
while (currentNode = nodeIterator.nextNode()) {
_sanitizeElements(currentNode);
_sanitizeAttributes(currentNode);
if (currentNode.content instanceof DocumentFragment) {
_sanitizeShadowDOM2(currentNode.content);
}
}
if (IN_PLACE) {
return dirty;
}
if (RETURN_DOM) {
if (SAFE_FOR_TEMPLATES) {
body.normalize();
let html4 = body.innerHTML;
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], (expr) => {
html4 = stringReplace(html4, expr, " ");
});
body.innerHTML = html4;
}
if (RETURN_DOM_FRAGMENT) {
returnNode = createDocumentFragment.call(body.ownerDocument);
while (body.firstChild) {
returnNode.appendChild(body.firstChild);
}
} else {
returnNode = body;
}
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
returnNode = importNode.call(originalDocument, returnNode, true);
}
return returnNode;
}
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
if (WHOLE_DOCUMENT && ALLOWED_TAGS["!doctype"] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
serializedHTML = "\n" + serializedHTML;
}
if (SAFE_FOR_TEMPLATES) {
arrayForEach([MUSTACHE_EXPR$1, ERB_EXPR$1, TMPLIT_EXPR$1], (expr) => {
serializedHTML = stringReplace(serializedHTML, expr, " ");
});
}
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
};
DOMPurify.setConfig = function() {
let cfg = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
_parseConfig(cfg);
SET_CONFIG = true;
};
DOMPurify.clearConfig = function() {
CONFIG = null;
SET_CONFIG = false;
};
DOMPurify.isValidAttribute = function(tag, attr2, value) {
if (!CONFIG) {
_parseConfig({});
}
const lcTag = transformCaseFunc(tag);
const lcName = transformCaseFunc(attr2);
return _isValidAttribute(lcTag, lcName, value);
};
DOMPurify.addHook = function(entryPoint, hookFunction) {
if (typeof hookFunction !== "function") {
return;
}
arrayPush(hooks[entryPoint], hookFunction);
};
DOMPurify.removeHook = function(entryPoint, hookFunction) {
if (hookFunction !== void 0) {
const index2 = arrayLastIndexOf(hooks[entryPoint], hookFunction);
return index2 === -1 ? void 0 : arraySplice(hooks[entryPoint], index2, 1)[0];
}
return arrayPop(hooks[entryPoint]);
};
DOMPurify.removeHooks = function(entryPoint) {
hooks[entryPoint] = [];
};
DOMPurify.removeAllHooks = function() {
hooks = _createHooksMap();
};
return DOMPurify;
}
var purify = createDOMPurify();
// ../ABConverter/converter/abc_deco.ts
var _abc_md = ABConvert.factory({
id: "md",
name: "md",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const subEl = document.createElement("div");
el.appendChild(subEl);
ABConvertManager.getInstance().m_renderMarkdownFn(content, subEl);
return el;
}
});
var _abc_text = ABConvert.factory({
id: "text",
name: "\u7EAF\u6587\u672C",
detail: "\u5176\u5B9E\u4E00\u822C\u4F1A\u66F4\u63A8\u8350\u7528code()\u4EE3\u66FF\uFF0C\u90A3\u4E2A\u66F4\u7CBE\u786E",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
el.innerHTML = purify.sanitize(`${content.replace(/ /g, " ").split("\n").join("
")}
`);
return el;
}
});
var _abc_fold = ABConvert.factory({
id: "fold",
name: "\u6298\u53E0",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
sub_el.remove();
sub_el.setAttribute("is_hide", "true");
sub_el.classList.add("ab-deco-fold-content");
sub_el.style.display = "none";
const mid_el = document.createElement("div");
content.appendChild(mid_el);
mid_el.classList.add("ab-deco-fold");
const sub_button = document.createElement("div");
mid_el.appendChild(sub_button);
sub_button.classList.add("ab-deco-fold-button");
sub_button.textContent = "\u5C55\u5F00";
const fn_fold = () => {
const is_hide = sub_el.getAttribute("is_hide");
if (is_hide && is_hide == "false") {
sub_el.setAttribute("is_hide", "true");
sub_el.style.display = "none";
sub_button.textContent = "\u5C55\u5F00";
} else if (is_hide && is_hide == "true") {
sub_el.setAttribute("is_hide", "false");
sub_el.style.display = "";
sub_button.textContent = "\u6298\u53E0";
}
};
if (ABCSetting.env.startsWith("obsidian")) {
sub_button.onclick = fn_fold;
} else {
sub_button.setAttribute("onclick", `
const sub_button = this;
const sub_el = this.nextElementSibling;
const is_hide = sub_el.getAttribute("is_hide")
if (is_hide && is_hide=="false") {
sub_el.setAttribute("is_hide", "true");
sub_el.style.display = "none"
sub_button.textContent = "\u5C55\u5F00"
}
else if(is_hide && is_hide=="true") {
sub_el.setAttribute("is_hide", "false");
sub_el.style.display = ""
sub_button.textContent = "\u6298\u53E0"
}
`);
}
mid_el.appendChild(sub_button);
mid_el.appendChild(sub_el);
const isListTable = sub_el.classList.contains("ab-list-table-parent");
const listTable_btn = sub_el.querySelector(".ab-table-fold");
if (isListTable && listTable_btn) {
if (ABCSetting.env.startsWith("obsidian")) {
fn_fold();
sub_button.textContent = "\u6298\u53E0/\u5C55\u5F00";
const fn_fold2 = () => {
const clickEvent = new MouseEvent("click", {
view: window,
bubbles: true,
cancelable: true
});
listTable_btn.dispatchEvent(clickEvent);
};
fn_fold2();
sub_button.onclick = fn_fold2;
} else {
}
}
return content;
}
});
var _abc_scroll = ABConvert.factory({
id: "scroll",
name: "\u6EDA\u52A8",
match: /^scroll(X)?(\((\d+)\))?$/,
default: "scroll(460)",
detail: "\u9ED8\u8BA4\u662F\u7EB5\u5411\u6EDA\u52A8\u3002\u53EF\u4EE5\u6307\u5B9A\u6EA2\u51FA\u6EDA\u52A8\u7684\u8303\u56F4\uFF0C\u53EF\u4EE5\u4F7F\u7528scrollX\u8FDB\u884C\u6A2A\u5411\u6EDA\u52A8",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^scroll(X)?(\((\d+)\))?$/);
if (!matchs)
return content;
let arg1 = 0;
if (matchs[2] && matchs[3]) {
arg1 = Number(matchs[3]);
if (isNaN(arg1))
return content;
}
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
sub_el.remove();
const mid_el = document.createElement("div");
content.appendChild(mid_el);
mid_el.classList.add("ab-deco-scroll");
mid_el.appendChild(sub_el);
if (!matchs[1]) {
mid_el.classList.add("ab-deco-scroll-y");
mid_el.setAttribute("style", `max-height: ${arg1 !== 0 ? arg1 + "px" : "460px"}`);
} else {
mid_el.classList.add("ab-deco-scroll-x");
mid_el.setAttribute("style", `max-height: ${arg1 !== 0 ? arg1 + "px" : "100%"}`);
}
return content;
}
});
var _abc_overfold = ABConvert.factory({
id: "overfold",
name: "\u8D85\u51FA\u6298\u53E0",
match: /^overfold(\((\d+)\))?$/,
default: "overfold(380)",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^overfold(\((\d+)\))?$/);
if (!matchs)
return content;
let arg1;
if (!matchs[1])
arg1 = 460;
else {
if (!matchs[2])
return content;
arg1 = Number(matchs[2]);
if (isNaN(arg1))
return content;
}
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
sub_el.remove();
const mid_el = document.createElement("div");
content.appendChild(mid_el);
mid_el.classList.add("ab-deco-overfold");
const sub_button = document.createElement("div");
mid_el.appendChild(sub_button);
sub_button.classList.add("ab-deco-overfold-button");
sub_button.textContent = "\u5C55\u5F00";
sub_el.classList.add("ab-deco-overfold-content");
mid_el.appendChild(sub_el);
mid_el.appendChild(sub_button);
mid_el.setAttribute("style", `max-height: ${arg1}px`);
mid_el.setAttribute("is-fold", "true");
sub_button.onclick = () => {
const is_fold = mid_el.getAttribute("is-fold");
if (!is_fold)
return;
if (is_fold == "true") {
mid_el.setAttribute("style", "");
mid_el.setAttribute("is-fold", "false");
sub_button.textContent = "\u6298\u53E0";
} else {
mid_el.setAttribute("style", `max-height: ${arg1}px`);
mid_el.setAttribute("is-fold", "true");
sub_button.textContent = "\u5C55\u5F00";
}
};
return content;
}
});
var _abc_width = ABConvert.factory({
id: "width",
name: "\u5BBD\u5EA6\u63A7\u5236",
match: /^width\(((?:\d*\.?\d+(?:%|px|rem)?,\s*)*\d*\.?\d+(?:%|px|rem)?)\)$/,
detail: "\u7528\u4E8E\u63A7\u5236\u8868\u683C\u6216\u5206\u680F\u7684\u6BCF\u5217\u7684\u5BBD\u5EA6",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^width\(((?:\d*\.?\d+(?:%|px|rem)?,\s*)*\d*\.?\d+(?:%|px|rem)?)\)$/);
if (!matchs || content.children.length != 1)
return content;
const args = matchs[1].split(",").map(
(arg) => /^\d*\.?\d+$/.test(arg.trim()) ? `${arg.trim()}%` : arg.trim()
);
if (content.children[0].classList.contains("ab-col")) {
const sub_els = content.children[0].children;
if (sub_els.length == 0)
return content;
for (let i = 0; i < Math.min(sub_els.length, args.length); i++) {
const sub_el = sub_els[i];
if (args[i].endsWith("%"))
sub_el.style.flex = `0 1 ${args[i]}`;
else {
sub_el.style.width = args[i];
sub_el.style.flex = `0 0 auto`;
}
}
return content;
}
const table2 = content.querySelector("table");
if (table2 !== null) {
table2.style.tableLayout = "fixed";
table2.style.width = args.some((arg) => arg.endsWith("%")) ? "100%" : "fit-content";
table2.querySelectorAll("tr").forEach((row) => {
for (let i = 0; i < Math.min(row.children.length, args.length); i++) {
const cell = row.children[i];
cell.style.width = cell.style.minWidth = cell.style.maxWidth = args[i];
}
});
return content;
}
return content;
}
});
var _abc_addClass = ABConvert.factory({
id: "addClass",
name: "\u589E\u52A0class",
detail: "\u7ED9\u5F53\u524D\u5757\u589E\u52A0\u4E00\u4E2A\u7C7B\u540D\u3002\u652F\u6301\u6B63\u5E38\u4F7F\u7528\u7A7A\u683C\u6765\u6DFB\u52A0\u591A\u4E2Aclass, \u4E0D\u9700\u8981\u52A0dot\u7B26, \u5C31\u50CF\u5728class=''\u91CC\u5199\u7684\u90A3\u6837",
match: /^addClass\((.*)\)$/,
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^addClass\((.*)\)$/);
if (!matchs || !matchs[1])
return content;
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
const args = matchs[1].split(" ");
for (const arg of args) {
sub_el.classList.add(arg);
}
return content;
}
});
var _abc_addStyle = ABConvert.factory({
id: "addStyle",
name: "\u589E\u52A0style",
detail: "\u7ED9\u5F53\u524D\u5757\u589E\u52A0\u4E00\u4E2A\u6837\u5F0F, \u6CE8\u610F\u6700\u5916\u7684\u62EC\u53F7\u5F80\u5185\u8981\u7559\u4E00\u4E2A\u7A7A\u683C, \u907F\u514Drotate\u8FD9\u79CD\u7528\u62EC\u53F7\u65F6\u51B2\u7A81\u3002\u6DFB\u52A0\u591A\u4E2A\u5219\u6B63\u5E38\u4F7F\u7528\u5206\u53F7",
match: /^addStyle\(\s(.*)\s\)$/,
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^addStyle\(\s(.*)\s\)$/);
if (!matchs || !matchs[1])
return content;
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
sub_el.style.cssText += String(matchs[1]);
return content;
}
});
var _abc_addDiv = ABConvert.factory({
id: "addDiv",
name: "\u589E\u52A0div\u548Cclass",
detail: "\u7ED9\u5F53\u524D\u5757\u589E\u52A0\u4E00\u4E2A\u7236\u7C7B\uFF0C\u9700\u8981\u7ED9\u8FD9\u4E2A\u7236\u7C7B\u4E00\u4E2A\u7C7B\u540D",
match: /^addDiv\((.*)\)$/,
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^addDiv\((.*)\)$/);
if (!matchs || !matchs[1])
return content;
if (content.children.length != 1)
return content;
const sub_el = content.children[0];
sub_el.remove();
const mid_el = document.createElement("div");
content.appendChild(mid_el);
const args = matchs[1].split(" ");
for (const arg of args) {
mid_el.classList.add(arg);
}
mid_el.appendChild(sub_el);
return content;
}
});
var _abc_title = ABConvert.factory({
id: "title",
name: "\u6807\u9898",
match: /^#(.*)/,
detail: "\u82E5\u76F4\u63A5\u5904\u7406\u4EE3\u7801\u6216\u8868\u683C\u5757\uFF0C\u5219\u4F1A\u6709\u7279\u6B8A\u98CE\u683C",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const matchs = header.match(/^#(.*)/);
if (!matchs || !matchs[1])
return content;
const arg1 = matchs[1];
const el_content = document.createElement("div");
while (content.firstChild) {
const item = content.firstChild;
content.removeChild(item);
el_content.appendChild(item);
}
const el_root = document.createElement("div");
content.appendChild(el_root);
el_root.classList.add("ab-deco-title");
const el_title = document.createElement("div");
el_root.appendChild(el_title);
el_title.classList.add("ab-deco-title-title");
const el_title_p = document.createElement("p");
el_title.appendChild(el_title_p);
el_title_p.textContent = arg1;
el_root.appendChild(el_content);
el_content.classList.add("ab-deco-title-content");
let el_content_sub = el_content.childNodes[0];
if (!el_content_sub)
return content;
if (el_content_sub instanceof HTMLDivElement && el_content.childNodes.length == 1 && el_content.childNodes[0].childNodes[0]) {
el_content_sub = el_content.childNodes[0].childNodes[0];
}
let title_type = "none";
if (el_content_sub instanceof HTMLQuoteElement) {
title_type = "quote";
el_root.classList.add("callout");
el_title.classList.add("callout-title");
el_content.classList.add("callout-content");
const el_content_sub_parent = el_content_sub.parentNode;
if (!el_content_sub_parent)
return content;
while (el_content_sub.firstChild) {
el_content_sub_parent.insertBefore(el_content_sub.firstChild, el_content_sub);
}
el_content_sub_parent.removeChild(el_content_sub);
} else if (el_content_sub instanceof HTMLTableElement) {
title_type = "table";
} else if (el_content_sub instanceof HTMLUListElement) {
title_type = "ul";
} else if (el_content_sub instanceof HTMLPreElement) {
title_type = "pre";
}
el_title.setAttribute("title-type", title_type);
return content;
}
});
var _abc_transposition = ABConvert.factory({
id: "transposition",
name: "\u8868\u683C\u8F6C\u7F6E",
match: "transposition",
detail: "\u5C06\u8868\u683C\u8FDB\u884C\u8F6C\u7F6E\uFF0C\u5C31\u50CF\u77E9\u9635\u8F6C\u7F6E\u90A3\u6837\u3002\u8BE5\u7248\u672C\u4E0D\u652F\u6301\u6709\u8DE8\u884C\u8DE8\u5217\u5355\u5143\u683C\u3002\u82E5\u590D\u6742\u8868\u683C\uFF0C\u8BF7\u6362\u7528trs\u7248\u672C",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const origi_table = content.querySelector("table");
if (!origi_table)
return content;
const origi_rows = origi_table.rows;
const origi_rowCount = origi_rows.length;
const origi_colCount = origi_rows[0].cells.length;
const trans_table = document.createElement("table");
origi_table.classList.add("ab-transposition", "ab-table");
origi_table.classList.forEach((className) => {
trans_table.classList.add(className);
});
const trans_body = document.createElement("tbody");
trans_table.appendChild(trans_body);
for (let col = 0; col < origi_colCount; col++) {
const newRow = trans_body.insertRow();
for (let row = 0; row < origi_rowCount; row++) {
const oldCell = origi_rows[row].cells[col];
if (!oldCell)
continue;
const newCell = newRow.insertCell();
newCell.innerHTML = oldCell.innerHTML;
}
}
origi_table.innerHTML = trans_table.innerHTML;
return content;
}
});
var _abc_transpose = ABConvert.factory({
id: "transpose",
name: "\u8868\u683C\u8F6C\u7F6E",
match: "trs",
detail: "\u5C06\u8868\u683C\u8FDB\u884C\u8F6C\u7F6E\uFF0C\u5C31\u50CF\u77E9\u9635\u8F6C\u7F6E\u90A3\u6837\u3002\u8BE5\u7248\u672C\u652F\u6301\u6709\u8DE8\u884C\u8DE8\u5217\u5355\u5143\u683C",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const origi_table = content.querySelector("table");
if (!origi_table)
return content;
let { tableMap, origi_rowCount, origi_colCount } = table2tableMap(origi_table);
const tableMap2 = new Array(origi_colCount).fill(null).map(() => new Array(origi_rowCount).fill(null));
for (let i = 0; i < origi_rowCount; i++) {
for (let j = 0; j < origi_colCount; j++) {
const origi_cell = tableMap[i][j];
if (!origi_cell)
continue;
else if (origi_cell == "<") {
tableMap2[j][i] = "^";
} else if (origi_cell == "^") {
tableMap2[j][i] = "<";
} else {
let content2 = origi_cell.html;
if (content2.innerHTML == "<" || content2.innerHTML == "<")
content2.innerHTML = "^";
else if (content2.innerHTML == "^")
content2.innerHTML = "<";
tableMap2[j][i] = {
html: origi_cell.html,
rowSpan: origi_cell.colSpan || 1,
colSpan: origi_cell.rowSpan || 1,
rowIndex: origi_cell.colIndex,
colIndex: origi_cell.rowIndex
};
}
}
}
const tmp = origi_colCount;
origi_colCount = origi_rowCount;
origi_rowCount = tmp;
const trans_table = tableMap2table(tableMap2, origi_rowCount, origi_colCount);
origi_table.classList.forEach((className) => {
trans_table.classList.add(className);
});
trans_table.classList.add("ab-transposition", "ab-table");
origi_table.innerHTML = trans_table.innerHTML;
return content;
}
});
var _abc_exTable = ABConvert.factory({
id: "exTable",
name: "\u8868\u683C\u6269\u5C55",
match: "exTable",
detail: "\u5C06\u8868\u683C\u5E94\u7528sheet-table\u8BED\u6CD5 (\u4F7F\u7528 `^` \u6807\u6CE8\u5408\u5E76\u5355\u5143\u683C)",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const origi_table = content.querySelector("table");
if (!origi_table)
return content;
let { tableMap, origi_rowCount, origi_colCount } = table2tableMap(origi_table, true);
const map_table2 = tableMap;
const trans_table = tableMap2table(map_table2, origi_rowCount, origi_colCount);
origi_table.classList.forEach((className) => {
trans_table.classList.add(className);
});
trans_table.classList.add("ab-extable", "ab-table");
origi_table.innerHTML = trans_table.innerHTML;
return content;
}
});
var _abc_strictTable = ABConvert.factory({
id: "strictTable",
name: "\u6B63\u89C4\u5316\u8868\u683C",
match: "strictTable",
detail: "\u8865\u5168\u8868\u683C\u7684\u5C3E\u4E22\u5931\u9879\uFF0Clist2table|trs\u65F6\uFF0C\u53EF\u4EE5\u6709\u6548\u907F\u514Dbug",
process_param: "HTMLElement" /* el */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const origi_table = content.querySelector("table");
if (!origi_table)
return content;
let { tableMap, origi_rowCount, origi_colCount } = table2tableMap(origi_table);
for (let i = 0; i < origi_rowCount; i++) {
for (let j = 0; j < origi_colCount; j++) {
const origi_cell = tableMap[i][j];
if (!origi_cell) {
tableMap[i][j] = {
html: document.createElement("td"),
rowSpan: 1,
colSpan: 1,
rowIndex: i,
colIndex: j
};
}
}
}
const trans_table = tableMap2table(tableMap, origi_rowCount, origi_colCount);
origi_table.classList.forEach((className) => {
trans_table.classList.add(className);
});
trans_table.classList.add("ab-extable", "ab-table");
origi_table.innerHTML = trans_table.innerHTML;
return content;
}
});
function table2tableMap(origi_table, useMergeFlag = false) {
const origi_rows = origi_table.rows;
let origi_rowCount = origi_rows.length;
let origi_colCount = 0;
{
let map_colCount = [];
for (let relRow = 0; relRow < origi_rowCount; relRow++) {
for (const cell of origi_rows[relRow].cells) {
const colSpan = cell.colSpan || 1;
const rowSpan = cell.rowSpan || 1;
for (let relRowSpan = relRow; relRowSpan < relRow + rowSpan; relRowSpan++) {
if (!map_colCount[relRowSpan])
map_colCount[relRowSpan] = colSpan;
else
map_colCount[relRowSpan] += colSpan;
}
}
}
origi_rowCount = map_colCount.length;
origi_colCount = Math.max(...map_colCount);
}
const tableMap = new Array(origi_rowCount).fill(null).map(() => new Array(origi_colCount).fill(null));
for (let relRow = 0; relRow < origi_rowCount; relRow++) {
for (let relCol = 0; relCol < origi_rows[relRow].cells.length; relCol++) {
const cell = origi_rows[relRow].cells[relCol];
const rowIndex = relRow;
let colIndex = relCol;
while (true) {
if (colIndex >= tableMap[rowIndex].length) {
console.error(`\u8868\u683C\u89E3\u6790\u9519\u8BEF: colIndex\u8D85\u51FA\u8303\u56F4: [${rowIndex}][${colIndex}] overflow tableMap[${origi_rowCount - 1}][${origi_colCount - 1}]`, tableMap);
throw new Error("\u8868\u683C\u89E3\u6790\u9519\u8BEF: colIndex\u8D85\u51FA\u8303\u56F4");
}
if (!tableMap[rowIndex][colIndex]) {
break;
} else
colIndex++;
}
if (cell.rowSpan > 1) {
for (let i = 1; i < cell.rowSpan; i++) {
if (rowIndex + i >= tableMap.length) {
break;
}
tableMap[rowIndex + i][colIndex] = "^";
}
}
if (cell.colSpan > 1) {
for (let i = 1; i < cell.rowSpan; i++) {
if (colIndex + i >= tableMap[rowIndex].length) {
break;
}
tableMap[rowIndex][colIndex + i] = "<";
}
}
if (useMergeFlag) {
if (cell.rowSpan == 1 && cell.colSpan == 1 && cell.textContent == "^") {
tableMap[rowIndex][colIndex] = "^";
for (let i = rowIndex - 1; i >= 0; i--) {
const item = tableMap[i][colIndex];
if (!item)
break;
if (item == "<")
break;
if (item == "^")
continue;
if (item.html.textContent == "<")
break;
if (item.html.textContent != "^" || i == 0) {
item.rowSpan += 1;
break;
}
}
} else if (cell.rowSpan == 1 && cell.colSpan == 1 && cell.textContent == "<") {
tableMap[rowIndex][colIndex] = "<";
for (let j = colIndex - 1; j >= 0; j--) {
const item = tableMap[rowIndex][j];
if (!item)
break;
if (item == "^")
break;
if (item == "<")
continue;
if (item.html.textContent == "^")
break;
if (item.html.textContent != "<" || j == 0) {
item.colSpan += 1;
break;
}
}
} else {
tableMap[rowIndex][colIndex] = {
html: cell,
rowSpan: cell.rowSpan,
colSpan: cell.colSpan,
rowIndex,
colIndex
};
}
} else {
tableMap[rowIndex][colIndex] = {
html: cell,
rowSpan: cell.rowSpan,
colSpan: cell.colSpan,
rowIndex,
colIndex
};
}
}
}
return {
tableMap,
origi_rowCount,
origi_colCount
};
}
function tableMap2table(tableMap, origi_rowCount, origi_colCount) {
const trans_table = document.createElement("table");
const trans_body = document.createElement("tbody");
trans_table.appendChild(trans_body);
for (let i = 0; i < origi_rowCount; i++) {
const newRow = trans_body.insertRow();
for (let j = 0; j < origi_colCount; j++) {
const cell = tableMap[i][j];
if (!cell)
continue;
if (cell == "<" || cell == "^")
continue;
const newCell = newRow.insertCell();
newCell.innerHTML = cell.html.innerHTML;
newCell.rowSpan = cell.rowSpan;
newCell.colSpan = cell.colSpan;
newCell.setAttribute("rowIndex", String(cell.rowIndex));
newCell.setAttribute("colIndex", String(cell.colIndex));
}
}
return trans_table;
}
// ../ABConverter/converter/abc_ex.ts
var _abc_faq = ABConvert.factory({
id: "faq",
name: "FAQ",
match: "FAQ",
detail: "\u6E32\u67D3\u5E38\u89C1\u95EE\u9898/\u5BF9\u8BDD\u3002\u6BCF\u4E2A\u9879\u9700\u4EE5 `/^([a-zA-Z])(: |\uFF1A)(.*)/` \u5F00\u5934",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const e_faq = document.createElement("div");
el.appendChild(e_faq);
e_faq.classList.add("ab-faq");
const list_content = content.split("\n");
let mode_qa = "";
let last_content = "";
for (let line of list_content) {
const m_line = line.match(/^([\S]+)(:|:)(.*)/);
if (!m_line) {
if (mode_qa) {
last_content = last_content + "\n" + line;
}
continue;
} else {
if (mode_qa) {
const e_faq_line = document.createElement("div");
e_faq.appendChild(e_faq_line);
e_faq_line.classList.add("ab-faq-line", `ab-faq-${mode_qa}`);
const e_faq_bubble = document.createElement("div");
e_faq_line.appendChild(e_faq_bubble);
e_faq_bubble.classList.add("ab-faq-bubble", `ab-faq-${mode_qa}`);
const e_faq_content = document.createElement("div");
e_faq_bubble.appendChild(e_faq_content);
e_faq_content.classList.add("ab-faq-content");
ABConvertManager.getInstance().m_renderMarkdownFn(last_content, e_faq_content);
}
mode_qa = m_line[1];
last_content = m_line[3];
}
}
if (mode_qa) {
const e_faq_line = document.createElement("div");
e_faq.appendChild(e_faq_line);
e_faq_line.classList.add("ab-faq-line", `ab-faq-${mode_qa}`);
const e_faq_bubble = document.createElement("div");
e_faq_line.appendChild(e_faq_bubble);
e_faq_bubble.classList.add("ab-faq-bubble", `ab-faq-${mode_qa}`);
const e_faq_content = document.createElement("div");
e_faq_bubble.appendChild(e_faq_content);
e_faq_content.classList.add("ab-faq-content");
ABConvertManager.getInstance().m_renderMarkdownFn(last_content, e_faq_content);
}
return el;
}
});
var _abc_info_converter = ABConvert.factory({
id: "info_converter",
name: "INFO",
detail: "\u67E5\u770B\u5F53\u524D\u8F6F\u4EF6\u7248\u672C\u4E0B\u7684\u6CE8\u518C\u5904\u7406\u5668\u8868",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const table_p = document.createElement("div");
el.appendChild(table_p);
table_p.classList.add("ab-setting", "md-table-fig1");
const table2 = document.createElement("table");
table_p.appendChild(table2);
table2.classList.add("ab-setting", "md-table-fig2");
{
const thead = document.createElement("thead");
table2.appendChild(thead);
const tr = document.createElement("tr");
thead.appendChild(tr);
let th;
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u5904\u7406\u5668\u540D\nProcessor name";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u4E0B\u62C9\u6846\u9ED8\u8BA4\u9879\nThe default drop-down box";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u7528\u9014\u63CF\u8FF0\nPurpose description";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u8F93\u5165\u7C7B\u578B\nInput type";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u8F93\u51FA\u7C7B\u578B\nOutput type";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u6B63\u5219\nRegExp";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u662F\u5426\u542F\u7528\nIs enable";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u5B9A\u4E49\u6765\u6E90\nSource";
th = document.createElement("th");
tr.appendChild(th);
th.textContent = "\u522B\u540D\u66FF\u6362\nAlias substitution";
}
const tbody = document.createElement("tbody");
table2.appendChild(tbody);
for (let item of ABConvertManager.getInstance().list_abConvert) {
const tr = document.createElement("tr");
tbody.appendChild(tr);
let td;
td = document.createElement("td");
tr.appendChild(td);
td.textContent = item.name;
td = document.createElement("td");
tr.appendChild(td);
td.textContent = String(item.default);
td = document.createElement("td");
tr.appendChild(td);
td.textContent = item.detail;
td.setAttribute("style", "max-width:240px;overflow-x:auto;white-space:nowrap;");
td = document.createElement("td");
tr.appendChild(td);
td.textContent = String(item.process_param);
td = document.createElement("td");
tr.appendChild(td);
td.textContent = String(item.process_return);
td = document.createElement("td");
tr.appendChild(td);
td.textContent = String(item.match);
td = document.createElement("td");
tr.appendChild(td);
td.textContent = item.is_disable ? "No" : "Yes";
td = document.createElement("td");
tr.appendChild(td);
td.textContent = item.register_from;
td = document.createElement("td");
tr.appendChild(td);
td.textContent = item.process_alias;
}
return el;
}
});
var _abc_info_alias = ABConvert.factory({
id: "info_alias",
name: "INFO_Alias",
match: "info_alias",
detail: "\u67E5\u770B\u5F53\u524D\u8F6F\u4EF6\u7248\u672C\u4E0B\u7684\u6CE8\u518C\u522B\u540D\u8868",
process_param: "string" /* text */,
process_return: "json_string" /* json */,
process: (el, header, content) => {
return JSON.stringify(
Array.from(get_ABAlias_iter(), (item) => ({
regex: item.regex.toString(),
replacement: item.replacement
})),
null,
2
);
}
});
// ../ABConverter/converter/abc_mdit_container.ts
function mditTabs2listdata(content, reg) {
const list_line = content.split("\n");
let content_item = "";
const list_c2listItem = [];
for (let line_index = 0; line_index < list_line.length; line_index++) {
const line_content = list_line[line_index];
const line_match = line_content.match(reg);
if (line_match) {
add_current_content();
list_c2listItem.push({
content: line_match[1].trim(),
level: 0
});
continue;
} else {
content_item += line_content + "\n";
}
}
add_current_content();
return list_c2listItem;
function add_current_content() {
if (content_item.trim() == "")
return;
list_c2listItem.push({
content: content_item,
level: 1
});
content_item = "";
}
}
var abc_mditTabs = ABConvert.factory({
id: "mditTabs",
name: "mdit\u6807\u7B7E\u9875",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const c2listdata = mditTabs2listdata(content, /^@tab(.*)$/);
C2ListProcess.c2data2tab(c2listdata, el, false);
return el;
}
});
var _abc_mditDemo = ABConvert.factory({
id: "mditDemo",
name: "mdit\u5C55\u793A\u5BF9\u6BD4",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const newContent = `@tab show
${content}
@tab mdSource
~~~~~md
${content}
~~~~~`;
abc_mditTabs.process(el, header, newContent);
return el;
}
});
var _abc_mditABDemo = ABConvert.factory({
id: "mditABDemo",
name: "AnyBlock\u4E13\u7528\u5C55\u793A\u5BF9\u6BD4",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
if (ABCSetting.env == "markdown-it") {
ABConvertManager.getInstance().m_renderMarkdownFn(`::::: tabs
@tab show
${content}
@tab withoutPlugin
(noPlugin)${content.trimStart()}
@tab mdSource
~~~~~md
${content}
~~~~~
:::::`, el);
return el;
} else {
const newContent = `@tab show
${content}
@tab withoutPlugin
(noPlugin)${content.trimStart()}
@tab mdSource
~~~~~md
${content}
~~~~~`;
abc_mditTabs.process(el, header, newContent);
return el;
}
}
});
var _abc_midt_col = ABConvert.factory({
id: "mditCol",
name: "mdit\u5206\u680F",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
var _a3;
const c2listdata = mditTabs2listdata(content, /^@col(.*)$/);
C2ListProcess.c2data2items(c2listdata, el);
(_a3 = el.querySelector("div")) == null ? void 0 : _a3.classList.add("ab-col");
return el;
}
});
var _abc_midt_card = ABConvert.factory({
id: "mditCard",
name: "mdit\u5361\u7247",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
var _a3, _b;
const c2listdata = mditTabs2listdata(content, /^@card(.*)$/);
C2ListProcess.c2data2items(c2listdata, el);
(_a3 = el.querySelector("div")) == null ? void 0 : _a3.classList.add("ab-card");
(_b = el.querySelector("div")) == null ? void 0 : _b.classList.add("ab-lay-vfall");
return el;
}
});
var _abc_midt_chat = ABConvert.factory({
id: "mditChat",
name: "mdit\u5BF9\u8BDD",
detail: "\u663E\u793A\u6E32\u67D3\u5BF9\u8BDD\uFF0C\u9700\u8981\u914D\u5408 obsidian-view-chat-qq \u63D2\u4EF6\u4F7F\u7528",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
const content_list = content.split("\n");
let newContent = "";
for (let i = 0; i < content_list.length; i++) {
const line = content_list[i];
if (/^@chat(.*)$/.test(line)) {
const match3 = line.match(/^@chat(.*)$/);
if (match3 && match3[1]) {
newContent += "\n" + match3[1] + ":\n";
continue;
}
}
newContent += line + "\n";
}
return newContent;
}
});
// ../../node_modules/.pnpm/luxon@3.7.2/node_modules/luxon/build/es6/luxon.mjs
var LuxonError = class extends Error {
};
var InvalidDateTimeError = class extends LuxonError {
constructor(reason) {
super(`Invalid DateTime: ${reason.toMessage()}`);
}
};
var InvalidIntervalError = class extends LuxonError {
constructor(reason) {
super(`Invalid Interval: ${reason.toMessage()}`);
}
};
var InvalidDurationError = class extends LuxonError {
constructor(reason) {
super(`Invalid Duration: ${reason.toMessage()}`);
}
};
var ConflictingSpecificationError = class extends LuxonError {
};
var InvalidUnitError = class extends LuxonError {
constructor(unit) {
super(`Invalid unit ${unit}`);
}
};
var InvalidArgumentError = class extends LuxonError {
};
var ZoneIsAbstractError = class extends LuxonError {
constructor() {
super("Zone is an abstract class");
}
};
var n = "numeric";
var s = "short";
var l = "long";
var DATE_SHORT = {
year: n,
month: n,
day: n
};
var DATE_MED = {
year: n,
month: s,
day: n
};
var DATE_MED_WITH_WEEKDAY = {
year: n,
month: s,
day: n,
weekday: s
};
var DATE_FULL = {
year: n,
month: l,
day: n
};
var DATE_HUGE = {
year: n,
month: l,
day: n,
weekday: l
};
var TIME_SIMPLE = {
hour: n,
minute: n
};
var TIME_WITH_SECONDS = {
hour: n,
minute: n,
second: n
};
var TIME_WITH_SHORT_OFFSET = {
hour: n,
minute: n,
second: n,
timeZoneName: s
};
var TIME_WITH_LONG_OFFSET = {
hour: n,
minute: n,
second: n,
timeZoneName: l
};
var TIME_24_SIMPLE = {
hour: n,
minute: n,
hourCycle: "h23"
};
var TIME_24_WITH_SECONDS = {
hour: n,
minute: n,
second: n,
hourCycle: "h23"
};
var TIME_24_WITH_SHORT_OFFSET = {
hour: n,
minute: n,
second: n,
hourCycle: "h23",
timeZoneName: s
};
var TIME_24_WITH_LONG_OFFSET = {
hour: n,
minute: n,
second: n,
hourCycle: "h23",
timeZoneName: l
};
var DATETIME_SHORT = {
year: n,
month: n,
day: n,
hour: n,
minute: n
};
var DATETIME_SHORT_WITH_SECONDS = {
year: n,
month: n,
day: n,
hour: n,
minute: n,
second: n
};
var DATETIME_MED = {
year: n,
month: s,
day: n,
hour: n,
minute: n
};
var DATETIME_MED_WITH_SECONDS = {
year: n,
month: s,
day: n,
hour: n,
minute: n,
second: n
};
var DATETIME_MED_WITH_WEEKDAY = {
year: n,
month: s,
day: n,
weekday: s,
hour: n,
minute: n
};
var DATETIME_FULL = {
year: n,
month: l,
day: n,
hour: n,
minute: n,
timeZoneName: s
};
var DATETIME_FULL_WITH_SECONDS = {
year: n,
month: l,
day: n,
hour: n,
minute: n,
second: n,
timeZoneName: s
};
var DATETIME_HUGE = {
year: n,
month: l,
day: n,
weekday: l,
hour: n,
minute: n,
timeZoneName: l
};
var DATETIME_HUGE_WITH_SECONDS = {
year: n,
month: l,
day: n,
weekday: l,
hour: n,
minute: n,
second: n,
timeZoneName: l
};
var Zone = class {
get type() {
throw new ZoneIsAbstractError();
}
get name() {
throw new ZoneIsAbstractError();
}
get ianaName() {
return this.name;
}
get isUniversal() {
throw new ZoneIsAbstractError();
}
offsetName(ts, opts) {
throw new ZoneIsAbstractError();
}
formatOffset(ts, format2) {
throw new ZoneIsAbstractError();
}
offset(ts) {
throw new ZoneIsAbstractError();
}
equals(otherZone) {
throw new ZoneIsAbstractError();
}
get isValid() {
throw new ZoneIsAbstractError();
}
};
var singleton$1 = null;
var SystemZone = class extends Zone {
static get instance() {
if (singleton$1 === null) {
singleton$1 = new SystemZone();
}
return singleton$1;
}
get type() {
return "system";
}
get name() {
return new Intl.DateTimeFormat().resolvedOptions().timeZone;
}
get isUniversal() {
return false;
}
offsetName(ts, { format: format2, locale: locale2 }) {
return parseZoneInfo(ts, format2, locale2);
}
formatOffset(ts, format2) {
return formatOffset(this.offset(ts), format2);
}
offset(ts) {
return -new Date(ts).getTimezoneOffset();
}
equals(otherZone) {
return otherZone.type === "system";
}
get isValid() {
return true;
}
};
var dtfCache = /* @__PURE__ */ new Map();
function makeDTF(zoneName) {
let dtf = dtfCache.get(zoneName);
if (dtf === void 0) {
dtf = new Intl.DateTimeFormat("en-US", {
hour12: false,
timeZone: zoneName,
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
era: "short"
});
dtfCache.set(zoneName, dtf);
}
return dtf;
}
var typeToPos = {
year: 0,
month: 1,
day: 2,
era: 3,
hour: 4,
minute: 5,
second: 6
};
function hackyOffset(dtf, date) {
const formatted = dtf.format(date).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;
return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
}
function partsOffset(dtf, date) {
const formatted = dtf.formatToParts(date);
const filled = [];
for (let i = 0; i < formatted.length; i++) {
const { type, value } = formatted[i];
const pos = typeToPos[type];
if (type === "era") {
filled[pos] = value;
} else if (!isUndefined(pos)) {
filled[pos] = parseInt(value, 10);
}
}
return filled;
}
var ianaZoneCache = /* @__PURE__ */ new Map();
var IANAZone = class extends Zone {
static create(name2) {
let zone = ianaZoneCache.get(name2);
if (zone === void 0) {
ianaZoneCache.set(name2, zone = new IANAZone(name2));
}
return zone;
}
static resetCache() {
ianaZoneCache.clear();
dtfCache.clear();
}
static isValidSpecifier(s2) {
return this.isValidZone(s2);
}
static isValidZone(zone) {
if (!zone) {
return false;
}
try {
new Intl.DateTimeFormat("en-US", { timeZone: zone }).format();
return true;
} catch (e) {
return false;
}
}
constructor(name2) {
super();
this.zoneName = name2;
this.valid = IANAZone.isValidZone(name2);
}
get type() {
return "iana";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return false;
}
offsetName(ts, { format: format2, locale: locale2 }) {
return parseZoneInfo(ts, format2, locale2, this.name);
}
formatOffset(ts, format2) {
return formatOffset(this.offset(ts), format2);
}
offset(ts) {
if (!this.valid)
return NaN;
const date = new Date(ts);
if (isNaN(date))
return NaN;
const dtf = makeDTF(this.name);
let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
if (adOrBc === "BC") {
year = -Math.abs(year) + 1;
}
const adjustedHour = hour === 24 ? 0 : hour;
const asUTC = objToLocalTS({
year,
month,
day,
hour: adjustedHour,
minute,
second,
millisecond: 0
});
let asTS = +date;
const over = asTS % 1e3;
asTS -= over >= 0 ? over : 1e3 + over;
return (asUTC - asTS) / (60 * 1e3);
}
equals(otherZone) {
return otherZone.type === "iana" && otherZone.name === this.name;
}
get isValid() {
return this.valid;
}
};
var intlLFCache = {};
function getCachedLF(locString, opts = {}) {
const key = JSON.stringify([locString, opts]);
let dtf = intlLFCache[key];
if (!dtf) {
dtf = new Intl.ListFormat(locString, opts);
intlLFCache[key] = dtf;
}
return dtf;
}
var intlDTCache = /* @__PURE__ */ new Map();
function getCachedDTF(locString, opts = {}) {
const key = JSON.stringify([locString, opts]);
let dtf = intlDTCache.get(key);
if (dtf === void 0) {
dtf = new Intl.DateTimeFormat(locString, opts);
intlDTCache.set(key, dtf);
}
return dtf;
}
var intlNumCache = /* @__PURE__ */ new Map();
function getCachedINF(locString, opts = {}) {
const key = JSON.stringify([locString, opts]);
let inf = intlNumCache.get(key);
if (inf === void 0) {
inf = new Intl.NumberFormat(locString, opts);
intlNumCache.set(key, inf);
}
return inf;
}
var intlRelCache = /* @__PURE__ */ new Map();
function getCachedRTF(locString, opts = {}) {
const { base: base2, ...cacheKeyOpts } = opts;
const key = JSON.stringify([locString, cacheKeyOpts]);
let inf = intlRelCache.get(key);
if (inf === void 0) {
inf = new Intl.RelativeTimeFormat(locString, opts);
intlRelCache.set(key, inf);
}
return inf;
}
var sysLocaleCache = null;
function systemLocale() {
if (sysLocaleCache) {
return sysLocaleCache;
} else {
sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;
return sysLocaleCache;
}
}
var intlResolvedOptionsCache = /* @__PURE__ */ new Map();
function getCachedIntResolvedOptions(locString) {
let opts = intlResolvedOptionsCache.get(locString);
if (opts === void 0) {
opts = new Intl.DateTimeFormat(locString).resolvedOptions();
intlResolvedOptionsCache.set(locString, opts);
}
return opts;
}
var weekInfoCache = /* @__PURE__ */ new Map();
function getCachedWeekInfo(locString) {
let data2 = weekInfoCache.get(locString);
if (!data2) {
const locale2 = new Intl.Locale(locString);
data2 = "getWeekInfo" in locale2 ? locale2.getWeekInfo() : locale2.weekInfo;
if (!("minimalDays" in data2)) {
data2 = { ...fallbackWeekSettings, ...data2 };
}
weekInfoCache.set(locString, data2);
}
return data2;
}
function parseLocaleString(localeStr) {
const xIndex = localeStr.indexOf("-x-");
if (xIndex !== -1) {
localeStr = localeStr.substring(0, xIndex);
}
const uIndex = localeStr.indexOf("-u-");
if (uIndex === -1) {
return [localeStr];
} else {
let options;
let selectedStr;
try {
options = getCachedDTF(localeStr).resolvedOptions();
selectedStr = localeStr;
} catch (e) {
const smaller = localeStr.substring(0, uIndex);
options = getCachedDTF(smaller).resolvedOptions();
selectedStr = smaller;
}
const { numberingSystem, calendar } = options;
return [selectedStr, numberingSystem, calendar];
}
}
function intlConfigString(localeStr, numberingSystem, outputCalendar) {
if (outputCalendar || numberingSystem) {
if (!localeStr.includes("-u-")) {
localeStr += "-u";
}
if (outputCalendar) {
localeStr += `-ca-${outputCalendar}`;
}
if (numberingSystem) {
localeStr += `-nu-${numberingSystem}`;
}
return localeStr;
} else {
return localeStr;
}
}
function mapMonths(f) {
const ms = [];
for (let i = 1; i <= 12; i++) {
const dt = DateTime.utc(2009, i, 1);
ms.push(f(dt));
}
return ms;
}
function mapWeekdays(f) {
const ms = [];
for (let i = 1; i <= 7; i++) {
const dt = DateTime.utc(2016, 11, 13 + i);
ms.push(f(dt));
}
return ms;
}
function listStuff(loc, length, englishFn, intlFn) {
const mode = loc.listingMode();
if (mode === "error") {
return null;
} else if (mode === "en") {
return englishFn(length);
} else {
return intlFn(length);
}
}
function supportsFastNumbers(loc) {
if (loc.numberingSystem && loc.numberingSystem !== "latn") {
return false;
} else {
return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || getCachedIntResolvedOptions(loc.locale).numberingSystem === "latn";
}
}
var PolyNumberFormatter = class {
constructor(intl, forceSimple, opts) {
this.padTo = opts.padTo || 0;
this.floor = opts.floor || false;
const { padTo, floor: floor2, ...otherOpts } = opts;
if (!forceSimple || Object.keys(otherOpts).length > 0) {
const intlOpts = { useGrouping: false, ...opts };
if (opts.padTo > 0)
intlOpts.minimumIntegerDigits = opts.padTo;
this.inf = getCachedINF(intl, intlOpts);
}
}
format(i) {
if (this.inf) {
const fixed = this.floor ? Math.floor(i) : i;
return this.inf.format(fixed);
} else {
const fixed = this.floor ? Math.floor(i) : roundTo(i, 3);
return padStart(fixed, this.padTo);
}
}
};
var PolyDateFormatter = class {
constructor(dt, intl, opts) {
this.opts = opts;
this.originalZone = void 0;
let z = void 0;
if (this.opts.timeZone) {
this.dt = dt;
} else if (dt.zone.type === "fixed") {
const gmtOffset = -1 * (dt.offset / 60);
const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
z = offsetZ;
this.dt = dt;
} else {
z = "UTC";
this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset });
this.originalZone = dt.zone;
}
} else if (dt.zone.type === "system") {
this.dt = dt;
} else if (dt.zone.type === "iana") {
this.dt = dt;
z = dt.zone.name;
} else {
z = "UTC";
this.dt = dt.setZone("UTC").plus({ minutes: dt.offset });
this.originalZone = dt.zone;
}
const intlOpts = { ...this.opts };
intlOpts.timeZone = intlOpts.timeZone || z;
this.dtf = getCachedDTF(intl, intlOpts);
}
format() {
if (this.originalZone) {
return this.formatToParts().map(({ value }) => value).join("");
}
return this.dtf.format(this.dt.toJSDate());
}
formatToParts() {
const parts = this.dtf.formatToParts(this.dt.toJSDate());
if (this.originalZone) {
return parts.map((part) => {
if (part.type === "timeZoneName") {
const offsetName = this.originalZone.offsetName(this.dt.ts, {
locale: this.dt.locale,
format: this.opts.timeZoneName
});
return {
...part,
value: offsetName
};
} else {
return part;
}
});
}
return parts;
}
resolvedOptions() {
return this.dtf.resolvedOptions();
}
};
var PolyRelFormatter = class {
constructor(intl, isEnglish, opts) {
this.opts = { style: "long", ...opts };
if (!isEnglish && hasRelative()) {
this.rtf = getCachedRTF(intl, opts);
}
}
format(count, unit) {
if (this.rtf) {
return this.rtf.format(count, unit);
} else {
return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long");
}
}
formatToParts(count, unit) {
if (this.rtf) {
return this.rtf.formatToParts(count, unit);
} else {
return [];
}
}
};
var fallbackWeekSettings = {
firstDay: 1,
minimalDays: 4,
weekend: [6, 7]
};
var Locale = class {
static fromOpts(opts) {
return Locale.create(
opts.locale,
opts.numberingSystem,
opts.outputCalendar,
opts.weekSettings,
opts.defaultToEN
);
}
static create(locale2, numberingSystem, outputCalendar, weekSettings, defaultToEN = false) {
const specifiedLocale = locale2 || Settings.defaultLocale;
const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale());
const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;
const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;
const weekSettingsR = validateWeekSettings(weekSettings) || Settings.defaultWeekSettings;
return new Locale(localeR, numberingSystemR, outputCalendarR, weekSettingsR, specifiedLocale);
}
static resetCache() {
sysLocaleCache = null;
intlDTCache.clear();
intlNumCache.clear();
intlRelCache.clear();
intlResolvedOptionsCache.clear();
weekInfoCache.clear();
}
static fromObject({ locale: locale2, numberingSystem, outputCalendar, weekSettings } = {}) {
return Locale.create(locale2, numberingSystem, outputCalendar, weekSettings);
}
constructor(locale2, numbering, outputCalendar, weekSettings, specifiedLocale) {
const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale2);
this.locale = parsedLocale;
this.numberingSystem = numbering || parsedNumberingSystem || null;
this.outputCalendar = outputCalendar || parsedOutputCalendar || null;
this.weekSettings = weekSettings;
this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);
this.weekdaysCache = { format: {}, standalone: {} };
this.monthsCache = { format: {}, standalone: {} };
this.meridiemCache = null;
this.eraCache = {};
this.specifiedLocale = specifiedLocale;
this.fastNumbersCached = null;
}
get fastNumbers() {
if (this.fastNumbersCached == null) {
this.fastNumbersCached = supportsFastNumbers(this);
}
return this.fastNumbersCached;
}
listingMode() {
const isActuallyEn = this.isEnglish();
const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
return isActuallyEn && hasNoWeirdness ? "en" : "intl";
}
clone(alts) {
if (!alts || Object.getOwnPropertyNames(alts).length === 0) {
return this;
} else {
return Locale.create(
alts.locale || this.specifiedLocale,
alts.numberingSystem || this.numberingSystem,
alts.outputCalendar || this.outputCalendar,
validateWeekSettings(alts.weekSettings) || this.weekSettings,
alts.defaultToEN || false
);
}
}
redefaultToEN(alts = {}) {
return this.clone({ ...alts, defaultToEN: true });
}
redefaultToSystem(alts = {}) {
return this.clone({ ...alts, defaultToEN: false });
}
months(length, format2 = false) {
return listStuff(this, length, months, () => {
const monthSpecialCase = this.intl === "ja" || this.intl.startsWith("ja-");
format2 &= !monthSpecialCase;
const intl = format2 ? { month: length, day: "numeric" } : { month: length }, formatStr = format2 ? "format" : "standalone";
if (!this.monthsCache[formatStr][length]) {
const mapper = !monthSpecialCase ? (dt) => this.extract(dt, intl, "month") : (dt) => this.dtFormatter(dt, intl).format();
this.monthsCache[formatStr][length] = mapMonths(mapper);
}
return this.monthsCache[formatStr][length];
});
}
weekdays(length, format2 = false) {
return listStuff(this, length, weekdays, () => {
const intl = format2 ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format2 ? "format" : "standalone";
if (!this.weekdaysCache[formatStr][length]) {
this.weekdaysCache[formatStr][length] = mapWeekdays(
(dt) => this.extract(dt, intl, "weekday")
);
}
return this.weekdaysCache[formatStr][length];
});
}
meridiems() {
return listStuff(
this,
void 0,
() => meridiems,
() => {
if (!this.meridiemCache) {
const intl = { hour: "numeric", hourCycle: "h12" };
this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map(
(dt) => this.extract(dt, intl, "dayperiod")
);
}
return this.meridiemCache;
}
);
}
eras(length) {
return listStuff(this, length, eras, () => {
const intl = { era: length };
if (!this.eraCache[length]) {
this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map(
(dt) => this.extract(dt, intl, "era")
);
}
return this.eraCache[length];
});
}
extract(dt, intlOpts, field) {
const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m) => m.type.toLowerCase() === field);
return matching ? matching.value : null;
}
numberFormatter(opts = {}) {
return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);
}
dtFormatter(dt, intlOpts = {}) {
return new PolyDateFormatter(dt, this.intl, intlOpts);
}
relFormatter(opts = {}) {
return new PolyRelFormatter(this.intl, this.isEnglish(), opts);
}
listFormatter(opts = {}) {
return getCachedLF(this.intl, opts);
}
isEnglish() {
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || getCachedIntResolvedOptions(this.intl).locale.startsWith("en-us");
}
getWeekSettings() {
if (this.weekSettings) {
return this.weekSettings;
} else if (!hasLocaleWeekInfo()) {
return fallbackWeekSettings;
} else {
return getCachedWeekInfo(this.locale);
}
}
getStartOfWeek() {
return this.getWeekSettings().firstDay;
}
getMinDaysInFirstWeek() {
return this.getWeekSettings().minimalDays;
}
getWeekendDays() {
return this.getWeekSettings().weekend;
}
equals(other) {
return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar;
}
toString() {
return `Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`;
}
};
var singleton = null;
var FixedOffsetZone = class extends Zone {
static get utcInstance() {
if (singleton === null) {
singleton = new FixedOffsetZone(0);
}
return singleton;
}
static instance(offset2) {
return offset2 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset2);
}
static parseSpecifier(s2) {
if (s2) {
const r = s2.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
if (r) {
return new FixedOffsetZone(signedOffset(r[1], r[2]));
}
}
return null;
}
constructor(offset2) {
super();
this.fixed = offset2;
}
get type() {
return "fixed";
}
get name() {
return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`;
}
get ianaName() {
if (this.fixed === 0) {
return "Etc/UTC";
} else {
return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`;
}
}
offsetName() {
return this.name;
}
formatOffset(ts, format2) {
return formatOffset(this.fixed, format2);
}
get isUniversal() {
return true;
}
offset() {
return this.fixed;
}
equals(otherZone) {
return otherZone.type === "fixed" && otherZone.fixed === this.fixed;
}
get isValid() {
return true;
}
};
var InvalidZone = class extends Zone {
constructor(zoneName) {
super();
this.zoneName = zoneName;
}
get type() {
return "invalid";
}
get name() {
return this.zoneName;
}
get isUniversal() {
return false;
}
offsetName() {
return null;
}
formatOffset() {
return "";
}
offset() {
return NaN;
}
equals() {
return false;
}
get isValid() {
return false;
}
};
function normalizeZone(input, defaultZone2) {
if (isUndefined(input) || input === null) {
return defaultZone2;
} else if (input instanceof Zone) {
return input;
} else if (isString(input)) {
const lowered = input.toLowerCase();
if (lowered === "default")
return defaultZone2;
else if (lowered === "local" || lowered === "system")
return SystemZone.instance;
else if (lowered === "utc" || lowered === "gmt")
return FixedOffsetZone.utcInstance;
else
return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
} else if (isNumber(input)) {
return FixedOffsetZone.instance(input);
} else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") {
return input;
} else {
return new InvalidZone(input);
}
}
var numberingSystems = {
arab: "[\u0660-\u0669]",
arabext: "[\u06F0-\u06F9]",
bali: "[\u1B50-\u1B59]",
beng: "[\u09E6-\u09EF]",
deva: "[\u0966-\u096F]",
fullwide: "[\uFF10-\uFF19]",
gujr: "[\u0AE6-\u0AEF]",
hanidec: "[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",
khmr: "[\u17E0-\u17E9]",
knda: "[\u0CE6-\u0CEF]",
laoo: "[\u0ED0-\u0ED9]",
limb: "[\u1946-\u194F]",
mlym: "[\u0D66-\u0D6F]",
mong: "[\u1810-\u1819]",
mymr: "[\u1040-\u1049]",
orya: "[\u0B66-\u0B6F]",
tamldec: "[\u0BE6-\u0BEF]",
telu: "[\u0C66-\u0C6F]",
thai: "[\u0E50-\u0E59]",
tibt: "[\u0F20-\u0F29]",
latn: "\\d"
};
var numberingSystemsUTF16 = {
arab: [1632, 1641],
arabext: [1776, 1785],
bali: [6992, 7001],
beng: [2534, 2543],
deva: [2406, 2415],
fullwide: [65296, 65303],
gujr: [2790, 2799],
khmr: [6112, 6121],
knda: [3302, 3311],
laoo: [3792, 3801],
limb: [6470, 6479],
mlym: [3430, 3439],
mong: [6160, 6169],
mymr: [4160, 4169],
orya: [2918, 2927],
tamldec: [3046, 3055],
telu: [3174, 3183],
thai: [3664, 3673],
tibt: [3872, 3881]
};
var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
function parseDigits(str) {
let value = parseInt(str, 10);
if (isNaN(value)) {
value = "";
for (let i = 0; i < str.length; i++) {
const code2 = str.charCodeAt(i);
if (str[i].search(numberingSystems.hanidec) !== -1) {
value += hanidecChars.indexOf(str[i]);
} else {
for (const key in numberingSystemsUTF16) {
const [min, max] = numberingSystemsUTF16[key];
if (code2 >= min && code2 <= max) {
value += code2 - min;
}
}
}
}
return parseInt(value, 10);
} else {
return value;
}
}
var digitRegexCache = /* @__PURE__ */ new Map();
function resetDigitRegexCache() {
digitRegexCache.clear();
}
function digitRegex({ numberingSystem }, append3 = "") {
const ns = numberingSystem || "latn";
let appendCache = digitRegexCache.get(ns);
if (appendCache === void 0) {
appendCache = /* @__PURE__ */ new Map();
digitRegexCache.set(ns, appendCache);
}
let regex = appendCache.get(append3);
if (regex === void 0) {
regex = new RegExp(`${numberingSystems[ns]}${append3}`);
appendCache.set(append3, regex);
}
return regex;
}
var now = () => Date.now();
var defaultZone = "system";
var defaultLocale = null;
var defaultNumberingSystem = null;
var defaultOutputCalendar = null;
var twoDigitCutoffYear = 60;
var throwOnInvalid;
var defaultWeekSettings = null;
var Settings = class {
static get now() {
return now;
}
static set now(n2) {
now = n2;
}
static set defaultZone(zone) {
defaultZone = zone;
}
static get defaultZone() {
return normalizeZone(defaultZone, SystemZone.instance);
}
static get defaultLocale() {
return defaultLocale;
}
static set defaultLocale(locale2) {
defaultLocale = locale2;
}
static get defaultNumberingSystem() {
return defaultNumberingSystem;
}
static set defaultNumberingSystem(numberingSystem) {
defaultNumberingSystem = numberingSystem;
}
static get defaultOutputCalendar() {
return defaultOutputCalendar;
}
static set defaultOutputCalendar(outputCalendar) {
defaultOutputCalendar = outputCalendar;
}
static get defaultWeekSettings() {
return defaultWeekSettings;
}
static set defaultWeekSettings(weekSettings) {
defaultWeekSettings = validateWeekSettings(weekSettings);
}
static get twoDigitCutoffYear() {
return twoDigitCutoffYear;
}
static set twoDigitCutoffYear(cutoffYear) {
twoDigitCutoffYear = cutoffYear % 100;
}
static get throwOnInvalid() {
return throwOnInvalid;
}
static set throwOnInvalid(t2) {
throwOnInvalid = t2;
}
static resetCaches() {
Locale.resetCache();
IANAZone.resetCache();
DateTime.resetCache();
resetDigitRegexCache();
}
};
var Invalid = class {
constructor(reason, explanation) {
this.reason = reason;
this.explanation = explanation;
}
toMessage() {
if (this.explanation) {
return `${this.reason}: ${this.explanation}`;
} else {
return this.reason;
}
}
};
var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
var leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
function unitOutOfRange(unit, value) {
return new Invalid(
"unit out of range",
`you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`
);
}
function dayOfWeek(year, month, day) {
const d = new Date(Date.UTC(year, month - 1, day));
if (year < 100 && year >= 0) {
d.setUTCFullYear(d.getUTCFullYear() - 1900);
}
const js = d.getUTCDay();
return js === 0 ? 7 : js;
}
function computeOrdinal(year, month, day) {
return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];
}
function uncomputeOrdinal(year, ordinal) {
const table2 = isLeapYear(year) ? leapLadder : nonLeapLadder, month0 = table2.findIndex((i) => i < ordinal), day = ordinal - table2[month0];
return { month: month0 + 1, day };
}
function isoWeekdayToLocal(isoWeekday, startOfWeek) {
return (isoWeekday - startOfWeek + 7) % 7 + 1;
}
function gregorianToWeek(gregObj, minDaysInFirstWeek = 4, startOfWeek = 1) {
const { year, month, day } = gregObj, ordinal = computeOrdinal(year, month, day), weekday = isoWeekdayToLocal(dayOfWeek(year, month, day), startOfWeek);
let weekNumber = Math.floor((ordinal - weekday + 14 - minDaysInFirstWeek) / 7), weekYear;
if (weekNumber < 1) {
weekYear = year - 1;
weekNumber = weeksInWeekYear(weekYear, minDaysInFirstWeek, startOfWeek);
} else if (weekNumber > weeksInWeekYear(year, minDaysInFirstWeek, startOfWeek)) {
weekYear = year + 1;
weekNumber = 1;
} else {
weekYear = year;
}
return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };
}
function weekToGregorian(weekData, minDaysInFirstWeek = 4, startOfWeek = 1) {
const { weekYear, weekNumber, weekday } = weekData, weekdayOfJan4 = isoWeekdayToLocal(dayOfWeek(weekYear, 1, minDaysInFirstWeek), startOfWeek), yearInDays = daysInYear(weekYear);
let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 7 + minDaysInFirstWeek, year;
if (ordinal < 1) {
year = weekYear - 1;
ordinal += daysInYear(year);
} else if (ordinal > yearInDays) {
year = weekYear + 1;
ordinal -= daysInYear(weekYear);
} else {
year = weekYear;
}
const { month, day } = uncomputeOrdinal(year, ordinal);
return { year, month, day, ...timeObject(weekData) };
}
function gregorianToOrdinal(gregData) {
const { year, month, day } = gregData;
const ordinal = computeOrdinal(year, month, day);
return { year, ordinal, ...timeObject(gregData) };
}
function ordinalToGregorian(ordinalData) {
const { year, ordinal } = ordinalData;
const { month, day } = uncomputeOrdinal(year, ordinal);
return { year, month, day, ...timeObject(ordinalData) };
}
function usesLocalWeekValues(obj, loc) {
const hasLocaleWeekData = !isUndefined(obj.localWeekday) || !isUndefined(obj.localWeekNumber) || !isUndefined(obj.localWeekYear);
if (hasLocaleWeekData) {
const hasIsoWeekData = !isUndefined(obj.weekday) || !isUndefined(obj.weekNumber) || !isUndefined(obj.weekYear);
if (hasIsoWeekData) {
throw new ConflictingSpecificationError(
"Cannot mix locale-based week fields with ISO-based week fields"
);
}
if (!isUndefined(obj.localWeekday))
obj.weekday = obj.localWeekday;
if (!isUndefined(obj.localWeekNumber))
obj.weekNumber = obj.localWeekNumber;
if (!isUndefined(obj.localWeekYear))
obj.weekYear = obj.localWeekYear;
delete obj.localWeekday;
delete obj.localWeekNumber;
delete obj.localWeekYear;
return {
minDaysInFirstWeek: loc.getMinDaysInFirstWeek(),
startOfWeek: loc.getStartOfWeek()
};
} else {
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
}
}
function hasInvalidWeekData(obj, minDaysInFirstWeek = 4, startOfWeek = 1) {
const validYear = isInteger(obj.weekYear), validWeek = integerBetween(
obj.weekNumber,
1,
weeksInWeekYear(obj.weekYear, minDaysInFirstWeek, startOfWeek)
), validWeekday = integerBetween(obj.weekday, 1, 7);
if (!validYear) {
return unitOutOfRange("weekYear", obj.weekYear);
} else if (!validWeek) {
return unitOutOfRange("week", obj.weekNumber);
} else if (!validWeekday) {
return unitOutOfRange("weekday", obj.weekday);
} else
return false;
}
function hasInvalidOrdinalData(obj) {
const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
if (!validYear) {
return unitOutOfRange("year", obj.year);
} else if (!validOrdinal) {
return unitOutOfRange("ordinal", obj.ordinal);
} else
return false;
}
function hasInvalidGregorianData(obj) {
const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
if (!validYear) {
return unitOutOfRange("year", obj.year);
} else if (!validMonth) {
return unitOutOfRange("month", obj.month);
} else if (!validDay) {
return unitOutOfRange("day", obj.day);
} else
return false;
}
function hasInvalidTimeData(obj) {
const { hour, minute, second, millisecond } = obj;
const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween(minute, 0, 59), validSecond = integerBetween(second, 0, 59), validMillisecond = integerBetween(millisecond, 0, 999);
if (!validHour) {
return unitOutOfRange("hour", hour);
} else if (!validMinute) {
return unitOutOfRange("minute", minute);
} else if (!validSecond) {
return unitOutOfRange("second", second);
} else if (!validMillisecond) {
return unitOutOfRange("millisecond", millisecond);
} else
return false;
}
function isUndefined(o) {
return typeof o === "undefined";
}
function isNumber(o) {
return typeof o === "number";
}
function isInteger(o) {
return typeof o === "number" && o % 1 === 0;
}
function isString(o) {
return typeof o === "string";
}
function isDate(o) {
return Object.prototype.toString.call(o) === "[object Date]";
}
function hasRelative() {
try {
return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat;
} catch (e) {
return false;
}
}
function hasLocaleWeekInfo() {
try {
return typeof Intl !== "undefined" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
} catch (e) {
return false;
}
}
function maybeArray(thing) {
return Array.isArray(thing) ? thing : [thing];
}
function bestBy(arr, by, compare) {
if (arr.length === 0) {
return void 0;
}
return arr.reduce((best, next2) => {
const pair = [by(next2), next2];
if (!best) {
return pair;
} else if (compare(best[0], pair[0]) === best[0]) {
return best;
} else {
return pair;
}
}, null)[1];
}
function pick(obj, keys) {
return keys.reduce((a, k) => {
a[k] = obj[k];
return a;
}, {});
}
function hasOwnProperty(obj, prop2) {
return Object.prototype.hasOwnProperty.call(obj, prop2);
}
function validateWeekSettings(settings) {
if (settings == null) {
return null;
} else if (typeof settings !== "object") {
throw new InvalidArgumentError("Week settings must be an object");
} else {
if (!integerBetween(settings.firstDay, 1, 7) || !integerBetween(settings.minimalDays, 1, 7) || !Array.isArray(settings.weekend) || settings.weekend.some((v) => !integerBetween(v, 1, 7))) {
throw new InvalidArgumentError("Invalid week settings");
}
return {
firstDay: settings.firstDay,
minimalDays: settings.minimalDays,
weekend: Array.from(settings.weekend)
};
}
}
function integerBetween(thing, bottom, top) {
return isInteger(thing) && thing >= bottom && thing <= top;
}
function floorMod(x, n2) {
return x - n2 * Math.floor(x / n2);
}
function padStart(input, n2 = 2) {
const isNeg = input < 0;
let padded;
if (isNeg) {
padded = "-" + ("" + -input).padStart(n2, "0");
} else {
padded = ("" + input).padStart(n2, "0");
}
return padded;
}
function parseInteger(string2) {
if (isUndefined(string2) || string2 === null || string2 === "") {
return void 0;
} else {
return parseInt(string2, 10);
}
}
function parseFloating(string2) {
if (isUndefined(string2) || string2 === null || string2 === "") {
return void 0;
} else {
return parseFloat(string2);
}
}
function parseMillis(fraction) {
if (isUndefined(fraction) || fraction === null || fraction === "") {
return void 0;
} else {
const f = parseFloat("0." + fraction) * 1e3;
return Math.floor(f);
}
}
function roundTo(number, digits, rounding = "round") {
const factor = 10 ** digits;
switch (rounding) {
case "expand":
return number > 0 ? Math.ceil(number * factor) / factor : Math.floor(number * factor) / factor;
case "trunc":
return Math.trunc(number * factor) / factor;
case "round":
return Math.round(number * factor) / factor;
case "floor":
return Math.floor(number * factor) / factor;
case "ceil":
return Math.ceil(number * factor) / factor;
default:
throw new RangeError(`Value rounding ${rounding} is out of range`);
}
}
function isLeapYear(year) {
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}
function daysInYear(year) {
return isLeapYear(year) ? 366 : 365;
}
function daysInMonth(year, month) {
const modMonth = floorMod(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12;
if (modMonth === 2) {
return isLeapYear(modYear) ? 29 : 28;
} else {
return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
}
}
function objToLocalTS(obj) {
let d = Date.UTC(
obj.year,
obj.month - 1,
obj.day,
obj.hour,
obj.minute,
obj.second,
obj.millisecond
);
if (obj.year < 100 && obj.year >= 0) {
d = new Date(d);
d.setUTCFullYear(obj.year, obj.month - 1, obj.day);
}
return +d;
}
function firstWeekOffset(year, minDaysInFirstWeek, startOfWeek) {
const fwdlw = isoWeekdayToLocal(dayOfWeek(year, 1, minDaysInFirstWeek), startOfWeek);
return -fwdlw + minDaysInFirstWeek - 1;
}
function weeksInWeekYear(weekYear, minDaysInFirstWeek = 4, startOfWeek = 1) {
const weekOffset = firstWeekOffset(weekYear, minDaysInFirstWeek, startOfWeek);
const weekOffsetNext = firstWeekOffset(weekYear + 1, minDaysInFirstWeek, startOfWeek);
return (daysInYear(weekYear) - weekOffset + weekOffsetNext) / 7;
}
function untruncateYear(year) {
if (year > 99) {
return year;
} else
return year > Settings.twoDigitCutoffYear ? 1900 + year : 2e3 + year;
}
function parseZoneInfo(ts, offsetFormat, locale2, timeZone = null) {
const date = new Date(ts), intlOpts = {
hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit"
};
if (timeZone) {
intlOpts.timeZone = timeZone;
}
const modified = { timeZoneName: offsetFormat, ...intlOpts };
const parsed = new Intl.DateTimeFormat(locale2, modified).formatToParts(date).find((m) => m.type.toLowerCase() === "timezonename");
return parsed ? parsed.value : null;
}
function signedOffset(offHourStr, offMinuteStr) {
let offHour = parseInt(offHourStr, 10);
if (Number.isNaN(offHour)) {
offHour = 0;
}
const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;
return offHour * 60 + offMinSigned;
}
function asNumber(value) {
const numericValue = Number(value);
if (typeof value === "boolean" || value === "" || !Number.isFinite(numericValue))
throw new InvalidArgumentError(`Invalid unit value ${value}`);
return numericValue;
}
function normalizeObject(obj, normalizer) {
const normalized = {};
for (const u in obj) {
if (hasOwnProperty(obj, u)) {
const v = obj[u];
if (v === void 0 || v === null)
continue;
normalized[normalizer(u)] = asNumber(v);
}
}
return normalized;
}
function formatOffset(offset2, format2) {
const hours = Math.trunc(Math.abs(offset2 / 60)), minutes = Math.trunc(Math.abs(offset2 % 60)), sign = offset2 >= 0 ? "+" : "-";
switch (format2) {
case "short":
return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
case "narrow":
return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
case "techie":
return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
default:
throw new RangeError(`Value format ${format2} is out of range for property format`);
}
}
function timeObject(obj) {
return pick(obj, ["hour", "minute", "second", "millisecond"]);
}
var monthsLong = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
var monthsShort = [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"
];
var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
function months(length) {
switch (length) {
case "narrow":
return [...monthsNarrow];
case "short":
return [...monthsShort];
case "long":
return [...monthsLong];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
case "2-digit":
return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
default:
return null;
}
}
var weekdaysLong = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
];
var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"];
function weekdays(length) {
switch (length) {
case "narrow":
return [...weekdaysNarrow];
case "short":
return [...weekdaysShort];
case "long":
return [...weekdaysLong];
case "numeric":
return ["1", "2", "3", "4", "5", "6", "7"];
default:
return null;
}
}
var meridiems = ["AM", "PM"];
var erasLong = ["Before Christ", "Anno Domini"];
var erasShort = ["BC", "AD"];
var erasNarrow = ["B", "A"];
function eras(length) {
switch (length) {
case "narrow":
return [...erasNarrow];
case "short":
return [...erasShort];
case "long":
return [...erasLong];
default:
return null;
}
}
function meridiemForDateTime(dt) {
return meridiems[dt.hour < 12 ? 0 : 1];
}
function weekdayForDateTime(dt, length) {
return weekdays(length)[dt.weekday - 1];
}
function monthForDateTime(dt, length) {
return months(length)[dt.month - 1];
}
function eraForDateTime(dt, length) {
return eras(length)[dt.year < 0 ? 0 : 1];
}
function formatRelativeTime(unit, count, numeric = "always", narrow = false) {
const units = {
years: ["year", "yr."],
quarters: ["quarter", "qtr."],
months: ["month", "mo."],
weeks: ["week", "wk."],
days: ["day", "day", "days"],
hours: ["hour", "hr."],
minutes: ["minute", "min."],
seconds: ["second", "sec."]
};
const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1;
if (numeric === "auto" && lastable) {
const isDay = unit === "days";
switch (count) {
case 1:
return isDay ? "tomorrow" : `next ${units[unit][0]}`;
case -1:
return isDay ? "yesterday" : `last ${units[unit][0]}`;
case 0:
return isDay ? "today" : `this ${units[unit][0]}`;
}
}
const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit;
return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
}
function stringifyTokens(splits, tokenToString) {
let s2 = "";
for (const token of splits) {
if (token.literal) {
s2 += token.val;
} else {
s2 += tokenToString(token.val);
}
}
return s2;
}
var macroTokenToFormatOpts = {
D: DATE_SHORT,
DD: DATE_MED,
DDD: DATE_FULL,
DDDD: DATE_HUGE,
t: TIME_SIMPLE,
tt: TIME_WITH_SECONDS,
ttt: TIME_WITH_SHORT_OFFSET,
tttt: TIME_WITH_LONG_OFFSET,
T: TIME_24_SIMPLE,
TT: TIME_24_WITH_SECONDS,
TTT: TIME_24_WITH_SHORT_OFFSET,
TTTT: TIME_24_WITH_LONG_OFFSET,
f: DATETIME_SHORT,
ff: DATETIME_MED,
fff: DATETIME_FULL,
ffff: DATETIME_HUGE,
F: DATETIME_SHORT_WITH_SECONDS,
FF: DATETIME_MED_WITH_SECONDS,
FFF: DATETIME_FULL_WITH_SECONDS,
FFFF: DATETIME_HUGE_WITH_SECONDS
};
var Formatter = class {
static create(locale2, opts = {}) {
return new Formatter(locale2, opts);
}
static parseFormat(fmt) {
let current = null, currentFull = "", bracketed = false;
const splits = [];
for (let i = 0; i < fmt.length; i++) {
const c = fmt.charAt(i);
if (c === "'") {
if (currentFull.length > 0 || bracketed) {
splits.push({
literal: bracketed || /^\s+$/.test(currentFull),
val: currentFull === "" ? "'" : currentFull
});
}
current = null;
currentFull = "";
bracketed = !bracketed;
} else if (bracketed) {
currentFull += c;
} else if (c === current) {
currentFull += c;
} else {
if (currentFull.length > 0) {
splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull });
}
currentFull = c;
current = c;
}
}
if (currentFull.length > 0) {
splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull });
}
return splits;
}
static macroTokenToFormatOpts(token) {
return macroTokenToFormatOpts[token];
}
constructor(locale2, formatOpts) {
this.opts = formatOpts;
this.loc = locale2;
this.systemLoc = null;
}
formatWithSystemDefault(dt, opts) {
if (this.systemLoc === null) {
this.systemLoc = this.loc.redefaultToSystem();
}
const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });
return df.format();
}
dtFormatter(dt, opts = {}) {
return this.loc.dtFormatter(dt, { ...this.opts, ...opts });
}
formatDateTime(dt, opts) {
return this.dtFormatter(dt, opts).format();
}
formatDateTimeParts(dt, opts) {
return this.dtFormatter(dt, opts).formatToParts();
}
formatInterval(interval, opts) {
const df = this.dtFormatter(interval.start, opts);
return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate());
}
resolvedOptions(dt, opts) {
return this.dtFormatter(dt, opts).resolvedOptions();
}
num(n2, p = 0, signDisplay = void 0) {
if (this.opts.forceSimple) {
return padStart(n2, p);
}
const opts = { ...this.opts };
if (p > 0) {
opts.padTo = p;
}
if (signDisplay) {
opts.signDisplay = signDisplay;
}
return this.loc.numberFormatter(opts).format(n2);
}
formatDateTimeFromString(dt, fmt) {
const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string2 = (opts, extract) => this.loc.extract(dt, opts, extract), formatOffset2 = (opts) => {
if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {
return "Z";
}
return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : "";
}, meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string2({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string2(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string2(
standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" },
"weekday"
), maybeMacro = (token) => {
const formatOpts = Formatter.macroTokenToFormatOpts(token);
if (formatOpts) {
return this.formatWithSystemDefault(dt, formatOpts);
} else {
return token;
}
}, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string2({ era: length }, "era"), tokenToString = (token) => {
switch (token) {
case "S":
return this.num(dt.millisecond);
case "u":
case "SSS":
return this.num(dt.millisecond, 3);
case "s":
return this.num(dt.second);
case "ss":
return this.num(dt.second, 2);
case "uu":
return this.num(Math.floor(dt.millisecond / 10), 2);
case "uuu":
return this.num(Math.floor(dt.millisecond / 100));
case "m":
return this.num(dt.minute);
case "mm":
return this.num(dt.minute, 2);
case "h":
return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);
case "hh":
return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);
case "H":
return this.num(dt.hour);
case "HH":
return this.num(dt.hour, 2);
case "Z":
return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ });
case "ZZ":
return formatOffset2({ format: "short", allowZ: this.opts.allowZ });
case "ZZZ":
return formatOffset2({ format: "techie", allowZ: this.opts.allowZ });
case "ZZZZ":
return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale });
case "ZZZZZ":
return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale });
case "z":
return dt.zoneName;
case "a":
return meridiem();
case "d":
return useDateTimeFormatter ? string2({ day: "numeric" }, "day") : this.num(dt.day);
case "dd":
return useDateTimeFormatter ? string2({ day: "2-digit" }, "day") : this.num(dt.day, 2);
case "c":
return this.num(dt.weekday);
case "ccc":
return weekday("short", true);
case "cccc":
return weekday("long", true);
case "ccccc":
return weekday("narrow", true);
case "E":
return this.num(dt.weekday);
case "EEE":
return weekday("short", false);
case "EEEE":
return weekday("long", false);
case "EEEEE":
return weekday("narrow", false);
case "L":
return useDateTimeFormatter ? string2({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month);
case "LL":
return useDateTimeFormatter ? string2({ month: "2-digit", day: "numeric" }, "month") : this.num(dt.month, 2);
case "LLL":
return month("short", true);
case "LLLL":
return month("long", true);
case "LLLLL":
return month("narrow", true);
case "M":
return useDateTimeFormatter ? string2({ month: "numeric" }, "month") : this.num(dt.month);
case "MM":
return useDateTimeFormatter ? string2({ month: "2-digit" }, "month") : this.num(dt.month, 2);
case "MMM":
return month("short", false);
case "MMMM":
return month("long", false);
case "MMMMM":
return month("narrow", false);
case "y":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt.year);
case "yy":
return useDateTimeFormatter ? string2({ year: "2-digit" }, "year") : this.num(dt.year.toString().slice(-2), 2);
case "yyyy":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt.year, 4);
case "yyyyyy":
return useDateTimeFormatter ? string2({ year: "numeric" }, "year") : this.num(dt.year, 6);
case "G":
return era("short");
case "GG":
return era("long");
case "GGGGG":
return era("narrow");
case "kk":
return this.num(dt.weekYear.toString().slice(-2), 2);
case "kkkk":
return this.num(dt.weekYear, 4);
case "W":
return this.num(dt.weekNumber);
case "WW":
return this.num(dt.weekNumber, 2);
case "n":
return this.num(dt.localWeekNumber);
case "nn":
return this.num(dt.localWeekNumber, 2);
case "ii":
return this.num(dt.localWeekYear.toString().slice(-2), 2);
case "iiii":
return this.num(dt.localWeekYear, 4);
case "o":
return this.num(dt.ordinal);
case "ooo":
return this.num(dt.ordinal, 3);
case "q":
return this.num(dt.quarter);
case "qq":
return this.num(dt.quarter, 2);
case "X":
return this.num(Math.floor(dt.ts / 1e3));
case "x":
return this.num(dt.ts);
default:
return maybeMacro(token);
}
};
return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
}
formatDurationFromString(dur, fmt) {
const invertLargest = this.opts.signMode === "negativeLargestOnly" ? -1 : 1;
const tokenToField = (token) => {
switch (token[0]) {
case "S":
return "milliseconds";
case "s":
return "seconds";
case "m":
return "minutes";
case "h":
return "hours";
case "d":
return "days";
case "w":
return "weeks";
case "M":
return "months";
case "y":
return "years";
default:
return null;
}
}, tokenToString = (lildur, info) => (token) => {
const mapped = tokenToField(token);
if (mapped) {
const inversionFactor = info.isNegativeDuration && mapped !== info.largestUnit ? invertLargest : 1;
let signDisplay;
if (this.opts.signMode === "negativeLargestOnly" && mapped !== info.largestUnit) {
signDisplay = "never";
} else if (this.opts.signMode === "all") {
signDisplay = "always";
} else {
signDisplay = "auto";
}
return this.num(lildur.get(mapped) * inversionFactor, token.length, signDisplay);
} else {
return token;
}
}, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce(
(found, { literal, val: val2 }) => literal ? found : found.concat(val2),
[]
), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t2) => t2)), durationInfo = {
isNegativeDuration: collapsed < 0,
largestUnit: Object.keys(collapsed.values)[0]
};
return stringifyTokens(tokens, tokenToString(collapsed, durationInfo));
}
};
var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
function combineRegexes(...regexes) {
const full = regexes.reduce((f, r) => f + r.source, "");
return RegExp(`^${full}$`);
}
function combineExtractors(...extractors) {
return (m) => extractors.reduce(
([mergedVals, mergedZone, cursor], ex) => {
const [val2, zone, next2] = ex(m, cursor);
return [{ ...mergedVals, ...val2 }, zone || mergedZone, next2];
},
[{}, null, 1]
).slice(0, 2);
}
function parse(s2, ...patterns) {
if (s2 == null) {
return [null, null];
}
for (const [regex, extractor] of patterns) {
const m = regex.exec(s2);
if (m) {
return extractor(m);
}
}
return [null, null];
}
function simpleParse(...keys) {
return (match3, cursor) => {
const ret = {};
let i;
for (i = 0; i < keys.length; i++) {
ret[keys[i]] = parseInteger(match3[cursor + i]);
}
return [ret, null, cursor + i];
};
}
var offsetRegex = /(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/;
var isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
var isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
var isoTimeExtensionRegex = RegExp(`(?:[Tt]${isoTimeRegex.source})?`);
var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
var isoOrdinalRegex = /(\d{4})-?(\d{3})/;
var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
var extractISOOrdinalData = simpleParse("year", "ordinal");
var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/;
var sqlTimeRegex = RegExp(
`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`
);
var sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
function int(match3, pos, fallback) {
const m = match3[pos];
return isUndefined(m) ? fallback : parseInteger(m);
}
function extractISOYmd(match3, cursor) {
const item = {
year: int(match3, cursor),
month: int(match3, cursor + 1, 1),
day: int(match3, cursor + 2, 1)
};
return [item, null, cursor + 3];
}
function extractISOTime(match3, cursor) {
const item = {
hours: int(match3, cursor, 0),
minutes: int(match3, cursor + 1, 0),
seconds: int(match3, cursor + 2, 0),
milliseconds: parseMillis(match3[cursor + 3])
};
return [item, null, cursor + 4];
}
function extractISOOffset(match3, cursor) {
const local = !match3[cursor] && !match3[cursor + 1], fullOffset = signedOffset(match3[cursor + 1], match3[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset);
return [{}, zone, cursor + 3];
}
function extractIANAZone(match3, cursor) {
const zone = match3[cursor] ? IANAZone.create(match3[cursor]) : null;
return [{}, zone, cursor + 1];
}
var isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);
var isoDuration = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
function extractISODuration(match3) {
const [s2, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match3;
const hasNegativePrefix = s2[0] === "-";
const negativeSeconds = secondStr && secondStr[0] === "-";
const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num;
return [
{
years: maybeNegate(parseFloating(yearStr)),
months: maybeNegate(parseFloating(monthStr)),
weeks: maybeNegate(parseFloating(weekStr)),
days: maybeNegate(parseFloating(dayStr)),
hours: maybeNegate(parseFloating(hourStr)),
minutes: maybeNegate(parseFloating(minuteStr)),
seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
}
];
}
var obsOffsets = {
GMT: 0,
EDT: -4 * 60,
EST: -5 * 60,
CDT: -5 * 60,
CST: -6 * 60,
MDT: -6 * 60,
MST: -7 * 60,
PDT: -7 * 60,
PST: -8 * 60
};
function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
const result = {
year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),
month: monthsShort.indexOf(monthStr) + 1,
day: parseInteger(dayStr),
hour: parseInteger(hourStr),
minute: parseInteger(minuteStr)
};
if (secondStr)
result.second = parseInteger(secondStr);
if (weekdayStr) {
result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1;
}
return result;
}
var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
function extractRFC2822(match3) {
const [
,
weekdayStr,
dayStr,
monthStr,
yearStr,
hourStr,
minuteStr,
secondStr,
obsOffset,
milOffset,
offHourStr,
offMinuteStr
] = match3, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
let offset2;
if (obsOffset) {
offset2 = obsOffsets[obsOffset];
} else if (milOffset) {
offset2 = 0;
} else {
offset2 = signedOffset(offHourStr, offMinuteStr);
}
return [result, new FixedOffsetZone(offset2)];
}
function preprocessRFC2822(s2) {
return s2.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
}
var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/;
var rfc850 = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/;
var ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
function extractRFC1123Or850(match3) {
const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match3, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
return [result, FixedOffsetZone.utcInstance];
}
function extractASCII(match3) {
const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match3, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
return [result, FixedOffsetZone.utcInstance];
}
var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);
var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
var isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
var extractISOYmdTimeAndOffset = combineExtractors(
extractISOYmd,
extractISOTime,
extractISOOffset,
extractIANAZone
);
var extractISOWeekTimeAndOffset = combineExtractors(
extractISOWeekData,
extractISOTime,
extractISOOffset,
extractIANAZone
);
var extractISOOrdinalDateAndTime = combineExtractors(
extractISOOrdinalData,
extractISOTime,
extractISOOffset,
extractIANAZone
);
var extractISOTimeAndOffset = combineExtractors(
extractISOTime,
extractISOOffset,
extractIANAZone
);
function parseISODate(s2) {
return parse(
s2,
[isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
[isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset],
[isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime],
[isoTimeCombinedRegex, extractISOTimeAndOffset]
);
}
function parseRFC2822Date(s2) {
return parse(preprocessRFC2822(s2), [rfc2822, extractRFC2822]);
}
function parseHTTPDate(s2) {
return parse(
s2,
[rfc1123, extractRFC1123Or850],
[rfc850, extractRFC1123Or850],
[ascii, extractASCII]
);
}
function parseISODuration(s2) {
return parse(s2, [isoDuration, extractISODuration]);
}
var extractISOTimeOnly = combineExtractors(extractISOTime);
function parseISOTimeOnly(s2) {
return parse(s2, [isoTimeOnly, extractISOTimeOnly]);
}
var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
var extractISOTimeOffsetAndIANAZone = combineExtractors(
extractISOTime,
extractISOOffset,
extractIANAZone
);
function parseSQL(s2) {
return parse(
s2,
[sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset],
[sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]
);
}
var INVALID$2 = "Invalid Duration";
var lowOrderMatrix = {
weeks: {
days: 7,
hours: 7 * 24,
minutes: 7 * 24 * 60,
seconds: 7 * 24 * 60 * 60,
milliseconds: 7 * 24 * 60 * 60 * 1e3
},
days: {
hours: 24,
minutes: 24 * 60,
seconds: 24 * 60 * 60,
milliseconds: 24 * 60 * 60 * 1e3
},
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
seconds: { milliseconds: 1e3 }
};
var casualMatrix = {
years: {
quarters: 4,
months: 12,
weeks: 52,
days: 365,
hours: 365 * 24,
minutes: 365 * 24 * 60,
seconds: 365 * 24 * 60 * 60,
milliseconds: 365 * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: 13,
days: 91,
hours: 91 * 24,
minutes: 91 * 24 * 60,
seconds: 91 * 24 * 60 * 60,
milliseconds: 91 * 24 * 60 * 60 * 1e3
},
months: {
weeks: 4,
days: 30,
hours: 30 * 24,
minutes: 30 * 24 * 60,
seconds: 30 * 24 * 60 * 60,
milliseconds: 30 * 24 * 60 * 60 * 1e3
},
...lowOrderMatrix
};
var daysInYearAccurate = 146097 / 400;
var daysInMonthAccurate = 146097 / 4800;
var accurateMatrix = {
years: {
quarters: 4,
months: 12,
weeks: daysInYearAccurate / 7,
days: daysInYearAccurate,
hours: daysInYearAccurate * 24,
minutes: daysInYearAccurate * 24 * 60,
seconds: daysInYearAccurate * 24 * 60 * 60,
milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3
},
quarters: {
months: 3,
weeks: daysInYearAccurate / 28,
days: daysInYearAccurate / 4,
hours: daysInYearAccurate * 24 / 4,
minutes: daysInYearAccurate * 24 * 60 / 4,
seconds: daysInYearAccurate * 24 * 60 * 60 / 4,
milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4
},
months: {
weeks: daysInMonthAccurate / 7,
days: daysInMonthAccurate,
hours: daysInMonthAccurate * 24,
minutes: daysInMonthAccurate * 24 * 60,
seconds: daysInMonthAccurate * 24 * 60 * 60,
milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3
},
...lowOrderMatrix
};
var orderedUnits$1 = [
"years",
"quarters",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
];
var reverseUnits = orderedUnits$1.slice(0).reverse();
function clone$1(dur, alts, clear = false) {
const conf = {
values: clear ? alts.values : { ...dur.values, ...alts.values || {} },
loc: dur.loc.clone(alts.loc),
conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy,
matrix: alts.matrix || dur.matrix
};
return new Duration(conf);
}
function durationToMillis(matrix, vals) {
var _a3;
let sum = (_a3 = vals.milliseconds) != null ? _a3 : 0;
for (const unit of reverseUnits.slice(1)) {
if (vals[unit]) {
sum += vals[unit] * matrix[unit]["milliseconds"];
}
}
return sum;
}
function normalizeValues(matrix, vals) {
const factor = durationToMillis(matrix, vals) < 0 ? -1 : 1;
orderedUnits$1.reduceRight((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
const previousVal = vals[previous] * factor;
const conv = matrix[current][previous];
const rollUp = Math.floor(previousVal / conv);
vals[current] += rollUp * factor;
vals[previous] -= rollUp * conv * factor;
}
return current;
} else {
return previous;
}
}, null);
orderedUnits$1.reduce((previous, current) => {
if (!isUndefined(vals[current])) {
if (previous) {
const fraction = vals[previous] % 1;
vals[previous] -= fraction;
vals[current] += fraction * matrix[previous][current];
}
return current;
} else {
return previous;
}
}, null);
}
function removeZeroes(vals) {
const newVals = {};
for (const [key, value] of Object.entries(vals)) {
if (value !== 0) {
newVals[key] = value;
}
}
return newVals;
}
var Duration = class {
constructor(config3) {
const accurate = config3.conversionAccuracy === "longterm" || false;
let matrix = accurate ? accurateMatrix : casualMatrix;
if (config3.matrix) {
matrix = config3.matrix;
}
this.values = config3.values;
this.loc = config3.loc || Locale.create();
this.conversionAccuracy = accurate ? "longterm" : "casual";
this.invalid = config3.invalid || null;
this.matrix = matrix;
this.isLuxonDuration = true;
}
static fromMillis(count, opts) {
return Duration.fromObject({ milliseconds: count }, opts);
}
static fromObject(obj, opts = {}) {
if (obj == null || typeof obj !== "object") {
throw new InvalidArgumentError(
`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`
);
}
return new Duration({
values: normalizeObject(obj, Duration.normalizeUnit),
loc: Locale.fromObject(opts),
conversionAccuracy: opts.conversionAccuracy,
matrix: opts.matrix
});
}
static fromDurationLike(durationLike) {
if (isNumber(durationLike)) {
return Duration.fromMillis(durationLike);
} else if (Duration.isDuration(durationLike)) {
return durationLike;
} else if (typeof durationLike === "object") {
return Duration.fromObject(durationLike);
} else {
throw new InvalidArgumentError(
`Unknown duration argument ${durationLike} of type ${typeof durationLike}`
);
}
}
static fromISO(text5, opts) {
const [parsed] = parseISODuration(text5);
if (parsed) {
return Duration.fromObject(parsed, opts);
} else {
return Duration.invalid("unparsable", `the input "${text5}" can't be parsed as ISO 8601`);
}
}
static fromISOTime(text5, opts) {
const [parsed] = parseISOTimeOnly(text5);
if (parsed) {
return Duration.fromObject(parsed, opts);
} else {
return Duration.invalid("unparsable", `the input "${text5}" can't be parsed as ISO 8601`);
}
}
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidDurationError(invalid);
} else {
return new Duration({ invalid });
}
}
static normalizeUnit(unit) {
const normalized = {
year: "years",
years: "years",
quarter: "quarters",
quarters: "quarters",
month: "months",
months: "months",
week: "weeks",
weeks: "weeks",
day: "days",
days: "days",
hour: "hours",
hours: "hours",
minute: "minutes",
minutes: "minutes",
second: "seconds",
seconds: "seconds",
millisecond: "milliseconds",
milliseconds: "milliseconds"
}[unit ? unit.toLowerCase() : unit];
if (!normalized)
throw new InvalidUnitError(unit);
return normalized;
}
static isDuration(o) {
return o && o.isLuxonDuration || false;
}
get locale() {
return this.isValid ? this.loc.locale : null;
}
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
toFormat(fmt, opts = {}) {
const fmtOpts = {
...opts,
floor: opts.round !== false && opts.floor !== false
};
return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID$2;
}
toHuman(opts = {}) {
if (!this.isValid)
return INVALID$2;
const showZeros = opts.showZeros !== false;
const l2 = orderedUnits$1.map((unit) => {
const val2 = this.values[unit];
if (isUndefined(val2) || val2 === 0 && !showZeros) {
return null;
}
return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }).format(val2);
}).filter((n2) => n2);
return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l2);
}
toObject() {
if (!this.isValid)
return {};
return { ...this.values };
}
toISO() {
if (!this.isValid)
return null;
let s2 = "P";
if (this.years !== 0)
s2 += this.years + "Y";
if (this.months !== 0 || this.quarters !== 0)
s2 += this.months + this.quarters * 3 + "M";
if (this.weeks !== 0)
s2 += this.weeks + "W";
if (this.days !== 0)
s2 += this.days + "D";
if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
s2 += "T";
if (this.hours !== 0)
s2 += this.hours + "H";
if (this.minutes !== 0)
s2 += this.minutes + "M";
if (this.seconds !== 0 || this.milliseconds !== 0)
s2 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S";
if (s2 === "P")
s2 += "T0S";
return s2;
}
toISOTime(opts = {}) {
if (!this.isValid)
return null;
const millis = this.toMillis();
if (millis < 0 || millis >= 864e5)
return null;
opts = {
suppressMilliseconds: false,
suppressSeconds: false,
includePrefix: false,
format: "extended",
...opts,
includeOffset: false
};
const dateTime = DateTime.fromMillis(millis, { zone: "UTC" });
return dateTime.toISOTime(opts);
}
toJSON() {
return this.toISO();
}
toString() {
return this.toISO();
}
[Symbol.for("nodejs.util.inspect.custom")]() {
if (this.isValid) {
return `Duration { values: ${JSON.stringify(this.values)} }`;
} else {
return `Duration { Invalid, reason: ${this.invalidReason} }`;
}
}
toMillis() {
if (!this.isValid)
return NaN;
return durationToMillis(this.matrix, this.values);
}
valueOf() {
return this.toMillis();
}
plus(duration) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration), result = {};
for (const k of orderedUnits$1) {
if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) {
result[k] = dur.get(k) + this.get(k);
}
}
return clone$1(this, { values: result }, true);
}
minus(duration) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration);
return this.plus(dur.negate());
}
mapUnits(fn) {
if (!this.isValid)
return this;
const result = {};
for (const k of Object.keys(this.values)) {
result[k] = asNumber(fn(this.values[k], k));
}
return clone$1(this, { values: result }, true);
}
get(unit) {
return this[Duration.normalizeUnit(unit)];
}
set(values) {
if (!this.isValid)
return this;
const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };
return clone$1(this, { values: mixed });
}
reconfigure({ locale: locale2, numberingSystem, conversionAccuracy, matrix } = {}) {
const loc = this.loc.clone({ locale: locale2, numberingSystem });
const opts = { loc, matrix, conversionAccuracy };
return clone$1(this, opts);
}
as(unit) {
return this.isValid ? this.shiftTo(unit).get(unit) : NaN;
}
normalize() {
if (!this.isValid)
return this;
const vals = this.toObject();
normalizeValues(this.matrix, vals);
return clone$1(this, { values: vals }, true);
}
rescale() {
if (!this.isValid)
return this;
const vals = removeZeroes(this.normalize().shiftToAll().toObject());
return clone$1(this, { values: vals }, true);
}
shiftTo(...units) {
if (!this.isValid)
return this;
if (units.length === 0) {
return this;
}
units = units.map((u) => Duration.normalizeUnit(u));
const built = {}, accumulated = {}, vals = this.toObject();
let lastUnit;
for (const k of orderedUnits$1) {
if (units.indexOf(k) >= 0) {
lastUnit = k;
let own = 0;
for (const ak in accumulated) {
own += this.matrix[ak][k] * accumulated[ak];
accumulated[ak] = 0;
}
if (isNumber(vals[k])) {
own += vals[k];
}
const i = Math.trunc(own);
built[k] = i;
accumulated[k] = (own * 1e3 - i * 1e3) / 1e3;
} else if (isNumber(vals[k])) {
accumulated[k] = vals[k];
}
}
for (const key in accumulated) {
if (accumulated[key] !== 0) {
built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
}
}
normalizeValues(this.matrix, built);
return clone$1(this, { values: built }, true);
}
shiftToAll() {
if (!this.isValid)
return this;
return this.shiftTo(
"years",
"months",
"weeks",
"days",
"hours",
"minutes",
"seconds",
"milliseconds"
);
}
negate() {
if (!this.isValid)
return this;
const negated = {};
for (const k of Object.keys(this.values)) {
negated[k] = this.values[k] === 0 ? 0 : -this.values[k];
}
return clone$1(this, { values: negated }, true);
}
removeZeros() {
if (!this.isValid)
return this;
const vals = removeZeroes(this.values);
return clone$1(this, { values: vals }, true);
}
get years() {
return this.isValid ? this.values.years || 0 : NaN;
}
get quarters() {
return this.isValid ? this.values.quarters || 0 : NaN;
}
get months() {
return this.isValid ? this.values.months || 0 : NaN;
}
get weeks() {
return this.isValid ? this.values.weeks || 0 : NaN;
}
get days() {
return this.isValid ? this.values.days || 0 : NaN;
}
get hours() {
return this.isValid ? this.values.hours || 0 : NaN;
}
get minutes() {
return this.isValid ? this.values.minutes || 0 : NaN;
}
get seconds() {
return this.isValid ? this.values.seconds || 0 : NaN;
}
get milliseconds() {
return this.isValid ? this.values.milliseconds || 0 : NaN;
}
get isValid() {
return this.invalid === null;
}
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
equals(other) {
if (!this.isValid || !other.isValid) {
return false;
}
if (!this.loc.equals(other.loc)) {
return false;
}
function eq2(v1, v2) {
if (v1 === void 0 || v1 === 0)
return v2 === void 0 || v2 === 0;
return v1 === v2;
}
for (const u of orderedUnits$1) {
if (!eq2(this.values[u], other.values[u])) {
return false;
}
}
return true;
}
};
var INVALID$1 = "Invalid Interval";
function validateStartEnd(start, end2) {
if (!start || !start.isValid) {
return Interval.invalid("missing or invalid start");
} else if (!end2 || !end2.isValid) {
return Interval.invalid("missing or invalid end");
} else if (end2 < start) {
return Interval.invalid(
"end before start",
`The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end2.toISO()}`
);
} else {
return null;
}
}
var Interval = class {
constructor(config3) {
this.s = config3.start;
this.e = config3.end;
this.invalid = config3.invalid || null;
this.isLuxonInterval = true;
}
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the Interval is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidIntervalError(invalid);
} else {
return new Interval({ invalid });
}
}
static fromDateTimes(start, end2) {
const builtStart = friendlyDateTime(start), builtEnd = friendlyDateTime(end2);
const validateError = validateStartEnd(builtStart, builtEnd);
if (validateError == null) {
return new Interval({
start: builtStart,
end: builtEnd
});
} else {
return validateError;
}
}
static after(start, duration) {
const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(start);
return Interval.fromDateTimes(dt, dt.plus(dur));
}
static before(end2, duration) {
const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(end2);
return Interval.fromDateTimes(dt.minus(dur), dt);
}
static fromISO(text5, opts) {
const [s2, e] = (text5 || "").split("/", 2);
if (s2 && e) {
let start, startIsValid;
try {
start = DateTime.fromISO(s2, opts);
startIsValid = start.isValid;
} catch (e2) {
startIsValid = false;
}
let end2, endIsValid;
try {
end2 = DateTime.fromISO(e, opts);
endIsValid = end2.isValid;
} catch (e2) {
endIsValid = false;
}
if (startIsValid && endIsValid) {
return Interval.fromDateTimes(start, end2);
}
if (startIsValid) {
const dur = Duration.fromISO(e, opts);
if (dur.isValid) {
return Interval.after(start, dur);
}
} else if (endIsValid) {
const dur = Duration.fromISO(s2, opts);
if (dur.isValid) {
return Interval.before(end2, dur);
}
}
}
return Interval.invalid("unparsable", `the input "${text5}" can't be parsed as ISO 8601`);
}
static isInterval(o) {
return o && o.isLuxonInterval || false;
}
get start() {
return this.isValid ? this.s : null;
}
get end() {
return this.isValid ? this.e : null;
}
get lastDateTime() {
return this.isValid ? this.e ? this.e.minus(1) : null : null;
}
get isValid() {
return this.invalidReason === null;
}
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
length(unit = "milliseconds") {
return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;
}
count(unit = "milliseconds", opts) {
if (!this.isValid)
return NaN;
const start = this.start.startOf(unit, opts);
let end2;
if (opts == null ? void 0 : opts.useLocaleWeeks) {
end2 = this.end.reconfigure({ locale: start.locale });
} else {
end2 = this.end;
}
end2 = end2.startOf(unit, opts);
return Math.floor(end2.diff(start, unit).get(unit)) + (end2.valueOf() !== this.end.valueOf());
}
hasSame(unit) {
return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
}
isEmpty() {
return this.s.valueOf() === this.e.valueOf();
}
isAfter(dateTime) {
if (!this.isValid)
return false;
return this.s > dateTime;
}
isBefore(dateTime) {
if (!this.isValid)
return false;
return this.e <= dateTime;
}
contains(dateTime) {
if (!this.isValid)
return false;
return this.s <= dateTime && this.e > dateTime;
}
set({ start, end: end2 } = {}) {
if (!this.isValid)
return this;
return Interval.fromDateTimes(start || this.s, end2 || this.e);
}
splitAt(...dateTimes) {
if (!this.isValid)
return [];
const sorted = dateTimes.map(friendlyDateTime).filter((d) => this.contains(d)).sort((a, b) => a.toMillis() - b.toMillis()), results = [];
let { s: s2 } = this, i = 0;
while (s2 < this.e) {
const added = sorted[i] || this.e, next2 = +added > +this.e ? this.e : added;
results.push(Interval.fromDateTimes(s2, next2));
s2 = next2;
i += 1;
}
return results;
}
splitBy(duration) {
const dur = Duration.fromDurationLike(duration);
if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
return [];
}
let { s: s2 } = this, idx = 1, next2;
const results = [];
while (s2 < this.e) {
const added = this.start.plus(dur.mapUnits((x) => x * idx));
next2 = +added > +this.e ? this.e : added;
results.push(Interval.fromDateTimes(s2, next2));
s2 = next2;
idx += 1;
}
return results;
}
divideEqually(numberOfParts) {
if (!this.isValid)
return [];
return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);
}
overlaps(other) {
return this.e > other.s && this.s < other.e;
}
abutsStart(other) {
if (!this.isValid)
return false;
return +this.e === +other.s;
}
abutsEnd(other) {
if (!this.isValid)
return false;
return +other.e === +this.s;
}
engulfs(other) {
if (!this.isValid)
return false;
return this.s <= other.s && this.e >= other.e;
}
equals(other) {
if (!this.isValid || !other.isValid) {
return false;
}
return this.s.equals(other.s) && this.e.equals(other.e);
}
intersection(other) {
if (!this.isValid)
return this;
const s2 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e;
if (s2 >= e) {
return null;
} else {
return Interval.fromDateTimes(s2, e);
}
}
union(other) {
if (!this.isValid)
return this;
const s2 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e;
return Interval.fromDateTimes(s2, e);
}
static merge(intervals) {
const [found, final] = intervals.sort((a, b) => a.s - b.s).reduce(
([sofar, current], item) => {
if (!current) {
return [sofar, item];
} else if (current.overlaps(item) || current.abutsStart(item)) {
return [sofar, current.union(item)];
} else {
return [sofar.concat([current]), item];
}
},
[[], null]
);
if (final) {
found.push(final);
}
return found;
}
static xor(intervals) {
let start = null, currentCount = 0;
const results = [], ends = intervals.map((i) => [
{ time: i.s, type: "s" },
{ time: i.e, type: "e" }
]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b) => a.time - b.time);
for (const i of arr) {
currentCount += i.type === "s" ? 1 : -1;
if (currentCount === 1) {
start = i.time;
} else {
if (start && +start !== +i.time) {
results.push(Interval.fromDateTimes(start, i.time));
}
start = null;
}
}
return Interval.merge(results);
}
difference(...intervals) {
return Interval.xor([this].concat(intervals)).map((i) => this.intersection(i)).filter((i) => i && !i.isEmpty());
}
toString() {
if (!this.isValid)
return INVALID$1;
return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;
}
[Symbol.for("nodejs.util.inspect.custom")]() {
if (this.isValid) {
return `Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`;
} else {
return `Interval { Invalid, reason: ${this.invalidReason} }`;
}
}
toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
return this.isValid ? Formatter.create(this.s.loc.clone(opts), formatOpts).formatInterval(this) : INVALID$1;
}
toISO(opts) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;
}
toISODate() {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISODate()}/${this.e.toISODate()}`;
}
toISOTime(opts) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;
}
toFormat(dateFormat, { separator = " \u2013 " } = {}) {
if (!this.isValid)
return INVALID$1;
return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;
}
toDuration(unit, opts) {
if (!this.isValid) {
return Duration.invalid(this.invalidReason);
}
return this.e.diff(this.s, unit, opts);
}
mapEndpoints(mapFn) {
return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));
}
};
var Info = class {
static hasDST(zone = Settings.defaultZone) {
const proto = DateTime.now().setZone(zone).set({ month: 12 });
return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;
}
static isValidIANAZone(zone) {
return IANAZone.isValidZone(zone);
}
static normalizeZone(input) {
return normalizeZone(input, Settings.defaultZone);
}
static getStartOfWeek({ locale: locale2 = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2)).getStartOfWeek();
}
static getMinimumDaysInFirstWeek({ locale: locale2 = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2)).getMinDaysInFirstWeek();
}
static getWeekendWeekdays({ locale: locale2 = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2)).getWeekendDays().slice();
}
static months(length = "long", { locale: locale2 = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, outputCalendar)).months(length);
}
static monthsFormat(length = "long", { locale: locale2 = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, outputCalendar)).months(length, true);
}
static weekdays(length = "long", { locale: locale2 = null, numberingSystem = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, null)).weekdays(length);
}
static weekdaysFormat(length = "long", { locale: locale2 = null, numberingSystem = null, locObj = null } = {}) {
return (locObj || Locale.create(locale2, numberingSystem, null)).weekdays(length, true);
}
static meridiems({ locale: locale2 = null } = {}) {
return Locale.create(locale2).meridiems();
}
static eras(length = "short", { locale: locale2 = null } = {}) {
return Locale.create(locale2, null, "gregory").eras(length);
}
static features() {
return { relative: hasRelative(), localeWeek: hasLocaleWeekInfo() };
}
};
function dayDiff(earlier, later) {
const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier);
return Math.floor(Duration.fromMillis(ms).as("days"));
}
function highOrderDiffs(cursor, later, units) {
const differs = [
["years", (a, b) => b.year - a.year],
["quarters", (a, b) => b.quarter - a.quarter + (b.year - a.year) * 4],
["months", (a, b) => b.month - a.month + (b.year - a.year) * 12],
[
"weeks",
(a, b) => {
const days = dayDiff(a, b);
return (days - days % 7) / 7;
}
],
["days", dayDiff]
];
const results = {};
const earlier = cursor;
let lowestOrder, highWater;
for (const [unit, differ] of differs) {
if (units.indexOf(unit) >= 0) {
lowestOrder = unit;
results[unit] = differ(cursor, later);
highWater = earlier.plus(results);
if (highWater > later) {
results[unit]--;
cursor = earlier.plus(results);
if (cursor > later) {
highWater = cursor;
results[unit]--;
cursor = earlier.plus(results);
}
} else {
cursor = highWater;
}
}
}
return [cursor, results, highWater, lowestOrder];
}
function diff(earlier, later, units, opts) {
let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);
const remainingMillis = later - cursor;
const lowerOrderUnits = units.filter(
(u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0
);
if (lowerOrderUnits.length === 0) {
if (highWater < later) {
highWater = cursor.plus({ [lowestOrder]: 1 });
}
if (highWater !== cursor) {
results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
}
}
const duration = Duration.fromObject(results, opts);
if (lowerOrderUnits.length > 0) {
return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration);
} else {
return duration;
}
}
var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support";
function intUnit(regex, post = (i) => i) {
return { regex, deser: ([s2]) => post(parseDigits(s2)) };
}
var NBSP = String.fromCharCode(160);
var spaceOrNBSP = `[ ${NBSP}]`;
var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
function fixListRegex(s2) {
return s2.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
}
function stripInsensitivities(s2) {
return s2.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase();
}
function oneOf(strings, startIndex) {
if (strings === null) {
return null;
} else {
return {
regex: RegExp(strings.map(fixListRegex).join("|")),
deser: ([s2]) => strings.findIndex((i) => stripInsensitivities(s2) === stripInsensitivities(i)) + startIndex
};
}
}
function offset(regex, groups) {
return { regex, deser: ([, h2, m]) => signedOffset(h2, m), groups };
}
function simple(regex) {
return { regex, deser: ([s2]) => s2 };
}
function escapeToken(value) {
return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
}
function unitForToken(token, loc) {
const one = digitRegex(loc), two = digitRegex(loc, "{2}"), three = digitRegex(loc, "{3}"), four = digitRegex(loc, "{4}"), six = digitRegex(loc, "{6}"), oneOrTwo = digitRegex(loc, "{1,2}"), oneToThree = digitRegex(loc, "{1,3}"), oneToSix = digitRegex(loc, "{1,6}"), oneToNine = digitRegex(loc, "{1,9}"), twoToFour = digitRegex(loc, "{2,4}"), fourToSix = digitRegex(loc, "{4,6}"), literal = (t2) => ({ regex: RegExp(escapeToken(t2.val)), deser: ([s2]) => s2, literal: true }), unitate = (t2) => {
if (token.literal) {
return literal(t2);
}
switch (t2.val) {
case "G":
return oneOf(loc.eras("short"), 0);
case "GG":
return oneOf(loc.eras("long"), 0);
case "y":
return intUnit(oneToSix);
case "yy":
return intUnit(twoToFour, untruncateYear);
case "yyyy":
return intUnit(four);
case "yyyyy":
return intUnit(fourToSix);
case "yyyyyy":
return intUnit(six);
case "M":
return intUnit(oneOrTwo);
case "MM":
return intUnit(two);
case "MMM":
return oneOf(loc.months("short", true), 1);
case "MMMM":
return oneOf(loc.months("long", true), 1);
case "L":
return intUnit(oneOrTwo);
case "LL":
return intUnit(two);
case "LLL":
return oneOf(loc.months("short", false), 1);
case "LLLL":
return oneOf(loc.months("long", false), 1);
case "d":
return intUnit(oneOrTwo);
case "dd":
return intUnit(two);
case "o":
return intUnit(oneToThree);
case "ooo":
return intUnit(three);
case "HH":
return intUnit(two);
case "H":
return intUnit(oneOrTwo);
case "hh":
return intUnit(two);
case "h":
return intUnit(oneOrTwo);
case "mm":
return intUnit(two);
case "m":
return intUnit(oneOrTwo);
case "q":
return intUnit(oneOrTwo);
case "qq":
return intUnit(two);
case "s":
return intUnit(oneOrTwo);
case "ss":
return intUnit(two);
case "S":
return intUnit(oneToThree);
case "SSS":
return intUnit(three);
case "u":
return simple(oneToNine);
case "uu":
return simple(oneOrTwo);
case "uuu":
return intUnit(one);
case "a":
return oneOf(loc.meridiems(), 0);
case "kkkk":
return intUnit(four);
case "kk":
return intUnit(twoToFour, untruncateYear);
case "W":
return intUnit(oneOrTwo);
case "WW":
return intUnit(two);
case "E":
case "c":
return intUnit(one);
case "EEE":
return oneOf(loc.weekdays("short", false), 1);
case "EEEE":
return oneOf(loc.weekdays("long", false), 1);
case "ccc":
return oneOf(loc.weekdays("short", true), 1);
case "cccc":
return oneOf(loc.weekdays("long", true), 1);
case "Z":
case "ZZ":
return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);
case "ZZZ":
return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);
case "z":
return simple(/[a-z_+-/]{1,256}?/i);
case " ":
return simple(/[^\S\n\r]/);
default:
return literal(t2);
}
};
const unit = unitate(token) || {
invalidReason: MISSING_FTP
};
unit.token = token;
return unit;
}
var partTypeStyleToTokenVal = {
year: {
"2-digit": "yy",
numeric: "yyyyy"
},
month: {
numeric: "M",
"2-digit": "MM",
short: "MMM",
long: "MMMM"
},
day: {
numeric: "d",
"2-digit": "dd"
},
weekday: {
short: "EEE",
long: "EEEE"
},
dayperiod: "a",
dayPeriod: "a",
hour12: {
numeric: "h",
"2-digit": "hh"
},
hour24: {
numeric: "H",
"2-digit": "HH"
},
minute: {
numeric: "m",
"2-digit": "mm"
},
second: {
numeric: "s",
"2-digit": "ss"
},
timeZoneName: {
long: "ZZZZZ",
short: "ZZZ"
}
};
function tokenForPart(part, formatOpts, resolvedOpts) {
const { type, value } = part;
if (type === "literal") {
const isSpace2 = /^\s+$/.test(value);
return {
literal: !isSpace2,
val: isSpace2 ? " " : value
};
}
const style = formatOpts[type];
let actualType = type;
if (type === "hour") {
if (formatOpts.hour12 != null) {
actualType = formatOpts.hour12 ? "hour12" : "hour24";
} else if (formatOpts.hourCycle != null) {
if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") {
actualType = "hour12";
} else {
actualType = "hour24";
}
} else {
actualType = resolvedOpts.hour12 ? "hour12" : "hour24";
}
}
let val2 = partTypeStyleToTokenVal[actualType];
if (typeof val2 === "object") {
val2 = val2[style];
}
if (val2) {
return {
literal: false,
val: val2
};
}
return void 0;
}
function buildRegex(units) {
const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, "");
return [`^${re}$`, units];
}
function match(input, regex, handlers) {
const matches = input.match(regex);
if (matches) {
const all = {};
let matchIndex = 1;
for (const i in handlers) {
if (hasOwnProperty(handlers, i)) {
const h2 = handlers[i], groups = h2.groups ? h2.groups + 1 : 1;
if (!h2.literal && h2.token) {
all[h2.token.val[0]] = h2.deser(matches.slice(matchIndex, matchIndex + groups));
}
matchIndex += groups;
}
}
return [matches, all];
} else {
return [matches, {}];
}
}
function dateTimeFromMatches(matches) {
const toField = (token) => {
switch (token) {
case "S":
return "millisecond";
case "s":
return "second";
case "m":
return "minute";
case "h":
case "H":
return "hour";
case "d":
return "day";
case "o":
return "ordinal";
case "L":
case "M":
return "month";
case "y":
return "year";
case "E":
case "c":
return "weekday";
case "W":
return "weekNumber";
case "k":
return "weekYear";
case "q":
return "quarter";
default:
return null;
}
};
let zone = null;
let specificOffset;
if (!isUndefined(matches.z)) {
zone = IANAZone.create(matches.z);
}
if (!isUndefined(matches.Z)) {
if (!zone) {
zone = new FixedOffsetZone(matches.Z);
}
specificOffset = matches.Z;
}
if (!isUndefined(matches.q)) {
matches.M = (matches.q - 1) * 3 + 1;
}
if (!isUndefined(matches.h)) {
if (matches.h < 12 && matches.a === 1) {
matches.h += 12;
} else if (matches.h === 12 && matches.a === 0) {
matches.h = 0;
}
}
if (matches.G === 0 && matches.y) {
matches.y = -matches.y;
}
if (!isUndefined(matches.u)) {
matches.S = parseMillis(matches.u);
}
const vals = Object.keys(matches).reduce((r, k) => {
const f = toField(k);
if (f) {
r[f] = matches[k];
}
return r;
}, {});
return [vals, zone, specificOffset];
}
var dummyDateTimeCache = null;
function getDummyDateTime() {
if (!dummyDateTimeCache) {
dummyDateTimeCache = DateTime.fromMillis(1555555555555);
}
return dummyDateTimeCache;
}
function maybeExpandMacroToken(token, locale2) {
if (token.literal) {
return token;
}
const formatOpts = Formatter.macroTokenToFormatOpts(token.val);
const tokens = formatOptsToTokens(formatOpts, locale2);
if (tokens == null || tokens.includes(void 0)) {
return token;
}
return tokens;
}
function expandMacroTokens(tokens, locale2) {
return Array.prototype.concat(...tokens.map((t2) => maybeExpandMacroToken(t2, locale2)));
}
var TokenParser = class {
constructor(locale2, format2) {
this.locale = locale2;
this.format = format2;
this.tokens = expandMacroTokens(Formatter.parseFormat(format2), locale2);
this.units = this.tokens.map((t2) => unitForToken(t2, locale2));
this.disqualifyingUnit = this.units.find((t2) => t2.invalidReason);
if (!this.disqualifyingUnit) {
const [regexString, handlers] = buildRegex(this.units);
this.regex = RegExp(regexString, "i");
this.handlers = handlers;
}
}
explainFromTokens(input) {
if (!this.isValid) {
return { input, tokens: this.tokens, invalidReason: this.invalidReason };
} else {
const [rawMatches, matches] = match(input, this.regex, this.handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, void 0];
if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
throw new ConflictingSpecificationError(
"Can't include meridiem when specifying 24-hour format"
);
}
return {
input,
tokens: this.tokens,
regex: this.regex,
rawMatches,
matches,
result,
zone,
specificOffset
};
}
}
get isValid() {
return !this.disqualifyingUnit;
}
get invalidReason() {
return this.disqualifyingUnit ? this.disqualifyingUnit.invalidReason : null;
}
};
function explainFromTokens(locale2, input, format2) {
const parser = new TokenParser(locale2, format2);
return parser.explainFromTokens(input);
}
function parseFromTokens(locale2, input, format2) {
const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale2, input, format2);
return [result, zone, specificOffset, invalidReason];
}
function formatOptsToTokens(formatOpts, locale2) {
if (!formatOpts) {
return null;
}
const formatter = Formatter.create(locale2, formatOpts);
const df = formatter.dtFormatter(getDummyDateTime());
const parts = df.formatToParts();
const resolvedOpts = df.resolvedOptions();
return parts.map((p) => tokenForPart(p, formatOpts, resolvedOpts));
}
var INVALID = "Invalid DateTime";
var MAX_DATE = 864e13;
function unsupportedZone(zone) {
return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
}
function possiblyCachedWeekData(dt) {
if (dt.weekData === null) {
dt.weekData = gregorianToWeek(dt.c);
}
return dt.weekData;
}
function possiblyCachedLocalWeekData(dt) {
if (dt.localWeekData === null) {
dt.localWeekData = gregorianToWeek(
dt.c,
dt.loc.getMinDaysInFirstWeek(),
dt.loc.getStartOfWeek()
);
}
return dt.localWeekData;
}
function clone2(inst, alts) {
const current = {
ts: inst.ts,
zone: inst.zone,
c: inst.c,
o: inst.o,
loc: inst.loc,
invalid: inst.invalid
};
return new DateTime({ ...current, ...alts, old: current });
}
function fixOffset(localTS, o, tz) {
let utcGuess = localTS - o * 60 * 1e3;
const o2 = tz.offset(utcGuess);
if (o === o2) {
return [utcGuess, o];
}
utcGuess -= (o2 - o) * 60 * 1e3;
const o3 = tz.offset(utcGuess);
if (o2 === o3) {
return [utcGuess, o2];
}
return [localTS - Math.min(o2, o3) * 60 * 1e3, Math.max(o2, o3)];
}
function tsToObj(ts, offset2) {
ts += offset2 * 60 * 1e3;
const d = new Date(ts);
return {
year: d.getUTCFullYear(),
month: d.getUTCMonth() + 1,
day: d.getUTCDate(),
hour: d.getUTCHours(),
minute: d.getUTCMinutes(),
second: d.getUTCSeconds(),
millisecond: d.getUTCMilliseconds()
};
}
function objToTS(obj, offset2, zone) {
return fixOffset(objToLocalTS(obj), offset2, zone);
}
function adjustTime(inst, dur) {
const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c = {
...inst.c,
year,
month,
day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
}, millisToAdd = Duration.fromObject({
years: dur.years - Math.trunc(dur.years),
quarters: dur.quarters - Math.trunc(dur.quarters),
months: dur.months - Math.trunc(dur.months),
weeks: dur.weeks - Math.trunc(dur.weeks),
days: dur.days - Math.trunc(dur.days),
hours: dur.hours,
minutes: dur.minutes,
seconds: dur.seconds,
milliseconds: dur.milliseconds
}).as("milliseconds"), localTS = objToLocalTS(c);
let [ts, o] = fixOffset(localTS, oPre, inst.zone);
if (millisToAdd !== 0) {
ts += millisToAdd;
o = inst.zone.offset(ts);
}
return { ts, o };
}
function parseDataToDateTime(parsed, parsedZone, opts, format2, text5, specificOffset) {
const { setZone, zone } = opts;
if (parsed && Object.keys(parsed).length !== 0 || parsedZone) {
const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, {
...opts,
zone: interpretationZone,
specificOffset
});
return setZone ? inst : inst.setZone(zone);
} else {
return DateTime.invalid(
new Invalid("unparsable", `the input "${text5}" can't be parsed as ${format2}`)
);
}
}
function toTechFormat(dt, format2, allowZ = true) {
return dt.isValid ? Formatter.create(Locale.create("en-US"), {
allowZ,
forceSimple: true
}).formatDateTimeFromString(dt, format2) : null;
}
function toISODate(o, extended, precision) {
const longFormat = o.c.year > 9999 || o.c.year < 0;
let c = "";
if (longFormat && o.c.year >= 0)
c += "+";
c += padStart(o.c.year, longFormat ? 6 : 4);
if (precision === "year")
return c;
if (extended) {
c += "-";
c += padStart(o.c.month);
if (precision === "month")
return c;
c += "-";
} else {
c += padStart(o.c.month);
if (precision === "month")
return c;
}
c += padStart(o.c.day);
return c;
}
function toISOTime(o, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone, precision) {
let showSeconds = !suppressSeconds || o.c.millisecond !== 0 || o.c.second !== 0, c = "";
switch (precision) {
case "day":
case "month":
case "year":
break;
default:
c += padStart(o.c.hour);
if (precision === "hour")
break;
if (extended) {
c += ":";
c += padStart(o.c.minute);
if (precision === "minute")
break;
if (showSeconds) {
c += ":";
c += padStart(o.c.second);
}
} else {
c += padStart(o.c.minute);
if (precision === "minute")
break;
if (showSeconds) {
c += padStart(o.c.second);
}
}
if (precision === "second")
break;
if (showSeconds && (!suppressMilliseconds || o.c.millisecond !== 0)) {
c += ".";
c += padStart(o.c.millisecond, 3);
}
}
if (includeOffset) {
if (o.isOffsetFixed && o.offset === 0 && !extendedZone) {
c += "Z";
} else if (o.o < 0) {
c += "-";
c += padStart(Math.trunc(-o.o / 60));
c += ":";
c += padStart(Math.trunc(-o.o % 60));
} else {
c += "+";
c += padStart(Math.trunc(o.o / 60));
c += ":";
c += padStart(Math.trunc(o.o % 60));
}
}
if (extendedZone) {
c += "[" + o.zone.ianaName + "]";
}
return c;
}
var defaultUnitValues = {
month: 1,
day: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
};
var defaultWeekUnitValues = {
weekNumber: 1,
weekday: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
};
var defaultOrdinalUnitValues = {
ordinal: 1,
hour: 0,
minute: 0,
second: 0,
millisecond: 0
};
var orderedUnits = ["year", "month", "day", "hour", "minute", "second", "millisecond"];
var orderedWeekUnits = [
"weekYear",
"weekNumber",
"weekday",
"hour",
"minute",
"second",
"millisecond"
];
var orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
function normalizeUnit(unit) {
const normalized = {
year: "year",
years: "year",
month: "month",
months: "month",
day: "day",
days: "day",
hour: "hour",
hours: "hour",
minute: "minute",
minutes: "minute",
quarter: "quarter",
quarters: "quarter",
second: "second",
seconds: "second",
millisecond: "millisecond",
milliseconds: "millisecond",
weekday: "weekday",
weekdays: "weekday",
weeknumber: "weekNumber",
weeksnumber: "weekNumber",
weeknumbers: "weekNumber",
weekyear: "weekYear",
weekyears: "weekYear",
ordinal: "ordinal"
}[unit.toLowerCase()];
if (!normalized)
throw new InvalidUnitError(unit);
return normalized;
}
function normalizeUnitWithLocalWeeks(unit) {
switch (unit.toLowerCase()) {
case "localweekday":
case "localweekdays":
return "localWeekday";
case "localweeknumber":
case "localweeknumbers":
return "localWeekNumber";
case "localweekyear":
case "localweekyears":
return "localWeekYear";
default:
return normalizeUnit(unit);
}
}
function guessOffsetForZone(zone) {
if (zoneOffsetTs === void 0) {
zoneOffsetTs = Settings.now();
}
if (zone.type !== "iana") {
return zone.offset(zoneOffsetTs);
}
const zoneName = zone.name;
let offsetGuess = zoneOffsetGuessCache.get(zoneName);
if (offsetGuess === void 0) {
offsetGuess = zone.offset(zoneOffsetTs);
zoneOffsetGuessCache.set(zoneName, offsetGuess);
}
return offsetGuess;
}
function quickDT(obj, opts) {
const zone = normalizeZone(opts.zone, Settings.defaultZone);
if (!zone.isValid) {
return DateTime.invalid(unsupportedZone(zone));
}
const loc = Locale.fromObject(opts);
let ts, o;
if (!isUndefined(obj.year)) {
for (const u of orderedUnits) {
if (isUndefined(obj[u])) {
obj[u] = defaultUnitValues[u];
}
}
const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
if (invalid) {
return DateTime.invalid(invalid);
}
const offsetProvis = guessOffsetForZone(zone);
[ts, o] = objToTS(obj, offsetProvis, zone);
} else {
ts = Settings.now();
}
return new DateTime({ ts, zone, loc, o });
}
function diffRelative(start, end2, opts) {
const round = isUndefined(opts.round) ? true : opts.round, rounding = isUndefined(opts.rounding) ? "trunc" : opts.rounding, format2 = (c, unit) => {
c = roundTo(c, round || opts.calendary ? 0 : 2, opts.calendary ? "round" : rounding);
const formatter = end2.loc.clone(opts).relFormatter(opts);
return formatter.format(c, unit);
}, differ = (unit) => {
if (opts.calendary) {
if (!end2.hasSame(start, unit)) {
return end2.startOf(unit).diff(start.startOf(unit), unit).get(unit);
} else
return 0;
} else {
return end2.diff(start, unit).get(unit);
}
};
if (opts.unit) {
return format2(differ(opts.unit), opts.unit);
}
for (const unit of opts.units) {
const count = differ(unit);
if (Math.abs(count) >= 1) {
return format2(count, unit);
}
}
return format2(start > end2 ? -0 : 0, opts.units[opts.units.length - 1]);
}
function lastOpts(argList) {
let opts = {}, args;
if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
opts = argList[argList.length - 1];
args = Array.from(argList).slice(0, argList.length - 1);
} else {
args = Array.from(argList);
}
return [opts, args];
}
var zoneOffsetTs;
var zoneOffsetGuessCache = /* @__PURE__ */ new Map();
var DateTime = class {
constructor(config3) {
const zone = config3.zone || Settings.defaultZone;
let invalid = config3.invalid || (Number.isNaN(config3.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null);
this.ts = isUndefined(config3.ts) ? Settings.now() : config3.ts;
let c = null, o = null;
if (!invalid) {
const unchanged = config3.old && config3.old.ts === this.ts && config3.old.zone.equals(zone);
if (unchanged) {
[c, o] = [config3.old.c, config3.old.o];
} else {
const ot = isNumber(config3.o) && !config3.old ? config3.o : zone.offset(this.ts);
c = tsToObj(this.ts, ot);
invalid = Number.isNaN(c.year) ? new Invalid("invalid input") : null;
c = invalid ? null : c;
o = invalid ? null : ot;
}
}
this._zone = zone;
this.loc = config3.loc || Locale.create();
this.invalid = invalid;
this.weekData = null;
this.localWeekData = null;
this.c = c;
this.o = o;
this.isLuxonDateTime = true;
}
static now() {
return new DateTime({});
}
static local() {
const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
}
static utc() {
const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
opts.zone = FixedOffsetZone.utcInstance;
return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
}
static fromJSDate(date, options = {}) {
const ts = isDate(date) ? date.valueOf() : NaN;
if (Number.isNaN(ts)) {
return DateTime.invalid("invalid input");
}
const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);
if (!zoneToUse.isValid) {
return DateTime.invalid(unsupportedZone(zoneToUse));
}
return new DateTime({
ts,
zone: zoneToUse,
loc: Locale.fromObject(options)
});
}
static fromMillis(milliseconds, options = {}) {
if (!isNumber(milliseconds)) {
throw new InvalidArgumentError(
`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`
);
} else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
return DateTime.invalid("Timestamp out of range");
} else {
return new DateTime({
ts: milliseconds,
zone: normalizeZone(options.zone, Settings.defaultZone),
loc: Locale.fromObject(options)
});
}
}
static fromSeconds(seconds, options = {}) {
if (!isNumber(seconds)) {
throw new InvalidArgumentError("fromSeconds requires a numerical input");
} else {
return new DateTime({
ts: seconds * 1e3,
zone: normalizeZone(options.zone, Settings.defaultZone),
loc: Locale.fromObject(options)
});
}
}
static fromObject(obj, opts = {}) {
obj = obj || {};
const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
if (!zoneToUse.isValid) {
return DateTime.invalid(unsupportedZone(zoneToUse));
}
const loc = Locale.fromObject(opts);
const normalized = normalizeObject(obj, normalizeUnitWithLocalWeeks);
const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, loc);
const tsNow = Settings.now(), offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber;
if ((containsGregor || containsOrdinal) && definiteWeekDef) {
throw new ConflictingSpecificationError(
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
);
}
if (containsGregorMD && containsOrdinal) {
throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
}
const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor;
let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis);
if (useWeekData) {
units = orderedWeekUnits;
defaultValues = defaultWeekUnitValues;
objNow = gregorianToWeek(objNow, minDaysInFirstWeek, startOfWeek);
} else if (containsOrdinal) {
units = orderedOrdinalUnits;
defaultValues = defaultOrdinalUnitValues;
objNow = gregorianToOrdinal(objNow);
} else {
units = orderedUnits;
defaultValues = defaultUnitValues;
}
let foundFirst = false;
for (const u of units) {
const v = normalized[u];
if (!isUndefined(v)) {
foundFirst = true;
} else if (foundFirst) {
normalized[u] = defaultValues[u];
} else {
normalized[u] = objNow[u];
}
}
const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized);
if (invalid) {
return DateTime.invalid(invalid);
}
const gregorian = useWeekData ? weekToGregorian(normalized, minDaysInFirstWeek, startOfWeek) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({
ts: tsFinal,
zone: zoneToUse,
o: offsetFinal,
loc
});
if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
return DateTime.invalid(
"mismatched weekday",
`you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`
);
}
if (!inst.isValid) {
return DateTime.invalid(inst.invalid);
}
return inst;
}
static fromISO(text5, opts = {}) {
const [vals, parsedZone] = parseISODate(text5);
return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text5);
}
static fromRFC2822(text5, opts = {}) {
const [vals, parsedZone] = parseRFC2822Date(text5);
return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text5);
}
static fromHTTP(text5, opts = {}) {
const [vals, parsedZone] = parseHTTPDate(text5);
return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
}
static fromFormat(text5, fmt, opts = {}) {
if (isUndefined(text5) || isUndefined(fmt)) {
throw new InvalidArgumentError("fromFormat requires an input string and a format");
}
const { locale: locale2 = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
}), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text5, fmt);
if (invalid) {
return DateTime.invalid(invalid);
} else {
return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text5, specificOffset);
}
}
static fromString(text5, fmt, opts = {}) {
return DateTime.fromFormat(text5, fmt, opts);
}
static fromSQL(text5, opts = {}) {
const [vals, parsedZone] = parseSQL(text5);
return parseDataToDateTime(vals, parsedZone, opts, "SQL", text5);
}
static invalid(reason, explanation = null) {
if (!reason) {
throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");
}
const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
if (Settings.throwOnInvalid) {
throw new InvalidDateTimeError(invalid);
} else {
return new DateTime({ invalid });
}
}
static isDateTime(o) {
return o && o.isLuxonDateTime || false;
}
static parseFormatForOpts(formatOpts, localeOpts = {}) {
const tokenList = formatOptsToTokens(formatOpts, Locale.fromObject(localeOpts));
return !tokenList ? null : tokenList.map((t2) => t2 ? t2.val : null).join("");
}
static expandFormat(fmt, localeOpts = {}) {
const expanded = expandMacroTokens(Formatter.parseFormat(fmt), Locale.fromObject(localeOpts));
return expanded.map((t2) => t2.val).join("");
}
static resetCache() {
zoneOffsetTs = void 0;
zoneOffsetGuessCache.clear();
}
get(unit) {
return this[unit];
}
get isValid() {
return this.invalid === null;
}
get invalidReason() {
return this.invalid ? this.invalid.reason : null;
}
get invalidExplanation() {
return this.invalid ? this.invalid.explanation : null;
}
get locale() {
return this.isValid ? this.loc.locale : null;
}
get numberingSystem() {
return this.isValid ? this.loc.numberingSystem : null;
}
get outputCalendar() {
return this.isValid ? this.loc.outputCalendar : null;
}
get zone() {
return this._zone;
}
get zoneName() {
return this.isValid ? this.zone.name : null;
}
get year() {
return this.isValid ? this.c.year : NaN;
}
get quarter() {
return this.isValid ? Math.ceil(this.c.month / 3) : NaN;
}
get month() {
return this.isValid ? this.c.month : NaN;
}
get day() {
return this.isValid ? this.c.day : NaN;
}
get hour() {
return this.isValid ? this.c.hour : NaN;
}
get minute() {
return this.isValid ? this.c.minute : NaN;
}
get second() {
return this.isValid ? this.c.second : NaN;
}
get millisecond() {
return this.isValid ? this.c.millisecond : NaN;
}
get weekYear() {
return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;
}
get weekNumber() {
return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;
}
get weekday() {
return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;
}
get isWeekend() {
return this.isValid && this.loc.getWeekendDays().includes(this.weekday);
}
get localWeekday() {
return this.isValid ? possiblyCachedLocalWeekData(this).weekday : NaN;
}
get localWeekNumber() {
return this.isValid ? possiblyCachedLocalWeekData(this).weekNumber : NaN;
}
get localWeekYear() {
return this.isValid ? possiblyCachedLocalWeekData(this).weekYear : NaN;
}
get ordinal() {
return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;
}
get monthShort() {
return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null;
}
get monthLong() {
return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null;
}
get weekdayShort() {
return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
}
get weekdayLong() {
return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
}
get offset() {
return this.isValid ? +this.o : NaN;
}
get offsetNameShort() {
if (this.isValid) {
return this.zone.offsetName(this.ts, {
format: "short",
locale: this.locale
});
} else {
return null;
}
}
get offsetNameLong() {
if (this.isValid) {
return this.zone.offsetName(this.ts, {
format: "long",
locale: this.locale
});
} else {
return null;
}
}
get isOffsetFixed() {
return this.isValid ? this.zone.isUniversal : null;
}
get isInDST() {
if (this.isOffsetFixed) {
return false;
} else {
return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset;
}
}
getPossibleOffsets() {
if (!this.isValid || this.isOffsetFixed) {
return [this];
}
const dayMs = 864e5;
const minuteMs = 6e4;
const localTS = objToLocalTS(this.c);
const oEarlier = this.zone.offset(localTS - dayMs);
const oLater = this.zone.offset(localTS + dayMs);
const o1 = this.zone.offset(localTS - oEarlier * minuteMs);
const o2 = this.zone.offset(localTS - oLater * minuteMs);
if (o1 === o2) {
return [this];
}
const ts1 = localTS - o1 * minuteMs;
const ts2 = localTS - o2 * minuteMs;
const c1 = tsToObj(ts1, o1);
const c2 = tsToObj(ts2, o2);
if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) {
return [clone2(this, { ts: ts1 }), clone2(this, { ts: ts2 })];
}
return [this];
}
get isInLeapYear() {
return isLeapYear(this.year);
}
get daysInMonth() {
return daysInMonth(this.year, this.month);
}
get daysInYear() {
return this.isValid ? daysInYear(this.year) : NaN;
}
get weeksInWeekYear() {
return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;
}
get weeksInLocalWeekYear() {
return this.isValid ? weeksInWeekYear(
this.localWeekYear,
this.loc.getMinDaysInFirstWeek(),
this.loc.getStartOfWeek()
) : NaN;
}
resolvedLocaleOptions(opts = {}) {
const { locale: locale2, numberingSystem, calendar } = Formatter.create(
this.loc.clone(opts),
opts
).resolvedOptions(this);
return { locale: locale2, numberingSystem, outputCalendar: calendar };
}
toUTC(offset2 = 0, opts = {}) {
return this.setZone(FixedOffsetZone.instance(offset2), opts);
}
toLocal() {
return this.setZone(Settings.defaultZone);
}
setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {
zone = normalizeZone(zone, Settings.defaultZone);
if (zone.equals(this.zone)) {
return this;
} else if (!zone.isValid) {
return DateTime.invalid(unsupportedZone(zone));
} else {
let newTS = this.ts;
if (keepLocalTime || keepCalendarTime) {
const offsetGuess = zone.offset(this.ts);
const asObj = this.toObject();
[newTS] = objToTS(asObj, offsetGuess, zone);
}
return clone2(this, { ts: newTS, zone });
}
}
reconfigure({ locale: locale2, numberingSystem, outputCalendar } = {}) {
const loc = this.loc.clone({ locale: locale2, numberingSystem, outputCalendar });
return clone2(this, { loc });
}
setLocale(locale2) {
return this.reconfigure({ locale: locale2 });
}
set(values) {
if (!this.isValid)
return this;
const normalized = normalizeObject(values, normalizeUnitWithLocalWeeks);
const { minDaysInFirstWeek, startOfWeek } = usesLocalWeekValues(normalized, this.loc);
const settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber;
if ((containsGregor || containsOrdinal) && definiteWeekDef) {
throw new ConflictingSpecificationError(
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
);
}
if (containsGregorMD && containsOrdinal) {
throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
}
let mixed;
if (settingWeekStuff) {
mixed = weekToGregorian(
{ ...gregorianToWeek(this.c, minDaysInFirstWeek, startOfWeek), ...normalized },
minDaysInFirstWeek,
startOfWeek
);
} else if (!isUndefined(normalized.ordinal)) {
mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });
} else {
mixed = { ...this.toObject(), ...normalized };
if (isUndefined(normalized.day)) {
mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);
}
}
const [ts, o] = objToTS(mixed, this.o, this.zone);
return clone2(this, { ts, o });
}
plus(duration) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration);
return clone2(this, adjustTime(this, dur));
}
minus(duration) {
if (!this.isValid)
return this;
const dur = Duration.fromDurationLike(duration).negate();
return clone2(this, adjustTime(this, dur));
}
startOf(unit, { useLocaleWeeks = false } = {}) {
if (!this.isValid)
return this;
const o = {}, normalizedUnit = Duration.normalizeUnit(unit);
switch (normalizedUnit) {
case "years":
o.month = 1;
case "quarters":
case "months":
o.day = 1;
case "weeks":
case "days":
o.hour = 0;
case "hours":
o.minute = 0;
case "minutes":
o.second = 0;
case "seconds":
o.millisecond = 0;
break;
}
if (normalizedUnit === "weeks") {
if (useLocaleWeeks) {
const startOfWeek = this.loc.getStartOfWeek();
const { weekday } = this;
if (weekday < startOfWeek) {
o.weekNumber = this.weekNumber - 1;
}
o.weekday = startOfWeek;
} else {
o.weekday = 1;
}
}
if (normalizedUnit === "quarters") {
const q = Math.ceil(this.month / 3);
o.month = (q - 1) * 3 + 1;
}
return this.set(o);
}
endOf(unit, opts) {
return this.isValid ? this.plus({ [unit]: 1 }).startOf(unit, opts).minus(1) : this;
}
toFormat(fmt, opts = {}) {
return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID;
}
toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID;
}
toLocaleParts(opts = {}) {
return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : [];
}
toISO({
format: format2 = "extended",
suppressSeconds = false,
suppressMilliseconds = false,
includeOffset = true,
extendedZone = false,
precision = "milliseconds"
} = {}) {
if (!this.isValid) {
return null;
}
precision = normalizeUnit(precision);
const ext = format2 === "extended";
let c = toISODate(this, ext, precision);
if (orderedUnits.indexOf(precision) >= 3)
c += "T";
c += toISOTime(
this,
ext,
suppressSeconds,
suppressMilliseconds,
includeOffset,
extendedZone,
precision
);
return c;
}
toISODate({ format: format2 = "extended", precision = "day" } = {}) {
if (!this.isValid) {
return null;
}
return toISODate(this, format2 === "extended", normalizeUnit(precision));
}
toISOWeekDate() {
return toTechFormat(this, "kkkk-'W'WW-c");
}
toISOTime({
suppressMilliseconds = false,
suppressSeconds = false,
includeOffset = true,
includePrefix = false,
extendedZone = false,
format: format2 = "extended",
precision = "milliseconds"
} = {}) {
if (!this.isValid) {
return null;
}
precision = normalizeUnit(precision);
let c = includePrefix && orderedUnits.indexOf(precision) >= 3 ? "T" : "";
return c + toISOTime(
this,
format2 === "extended",
suppressSeconds,
suppressMilliseconds,
includeOffset,
extendedZone,
precision
);
}
toRFC2822() {
return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false);
}
toHTTP() {
return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
}
toSQLDate() {
if (!this.isValid) {
return null;
}
return toISODate(this, true);
}
toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {
let fmt = "HH:mm:ss.SSS";
if (includeZone || includeOffset) {
if (includeOffsetSpace) {
fmt += " ";
}
if (includeZone) {
fmt += "z";
} else if (includeOffset) {
fmt += "ZZ";
}
}
return toTechFormat(this, fmt, true);
}
toSQL(opts = {}) {
if (!this.isValid) {
return null;
}
return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
}
toString() {
return this.isValid ? this.toISO() : INVALID;
}
[Symbol.for("nodejs.util.inspect.custom")]() {
if (this.isValid) {
return `DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`;
} else {
return `DateTime { Invalid, reason: ${this.invalidReason} }`;
}
}
valueOf() {
return this.toMillis();
}
toMillis() {
return this.isValid ? this.ts : NaN;
}
toSeconds() {
return this.isValid ? this.ts / 1e3 : NaN;
}
toUnixInteger() {
return this.isValid ? Math.floor(this.ts / 1e3) : NaN;
}
toJSON() {
return this.toISO();
}
toBSON() {
return this.toJSDate();
}
toObject(opts = {}) {
if (!this.isValid)
return {};
const base2 = { ...this.c };
if (opts.includeConfig) {
base2.outputCalendar = this.outputCalendar;
base2.numberingSystem = this.loc.numberingSystem;
base2.locale = this.loc.locale;
}
return base2;
}
toJSDate() {
return new Date(this.isValid ? this.ts : NaN);
}
diff(otherDateTime, unit = "milliseconds", opts = {}) {
if (!this.isValid || !otherDateTime.isValid) {
return Duration.invalid("created by diffing an invalid DateTime");
}
const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };
const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff(earlier, later, units, durOpts);
return otherIsLater ? diffed.negate() : diffed;
}
diffNow(unit = "milliseconds", opts = {}) {
return this.diff(DateTime.now(), unit, opts);
}
until(otherDateTime) {
return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
}
hasSame(otherDateTime, unit, opts) {
if (!this.isValid)
return false;
const inputMs = otherDateTime.valueOf();
const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
return adjustedToZone.startOf(unit, opts) <= inputMs && inputMs <= adjustedToZone.endOf(unit, opts);
}
equals(other) {
return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc);
}
toRelative(options = {}) {
if (!this.isValid)
return null;
const base2 = options.base || DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base2 ? -options.padding : options.padding : 0;
let units = ["years", "months", "days", "hours", "minutes", "seconds"];
let unit = options.unit;
if (Array.isArray(options.unit)) {
units = options.unit;
unit = void 0;
}
return diffRelative(base2, this.plus(padding), {
...options,
numeric: "always",
units,
unit
});
}
toRelativeCalendar(options = {}) {
if (!this.isValid)
return null;
return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {
...options,
numeric: "auto",
units: ["years", "months", "days"],
calendary: true
});
}
static min(...dateTimes) {
if (!dateTimes.every(DateTime.isDateTime)) {
throw new InvalidArgumentError("min requires all arguments be DateTimes");
}
return bestBy(dateTimes, (i) => i.valueOf(), Math.min);
}
static max(...dateTimes) {
if (!dateTimes.every(DateTime.isDateTime)) {
throw new InvalidArgumentError("max requires all arguments be DateTimes");
}
return bestBy(dateTimes, (i) => i.valueOf(), Math.max);
}
static fromFormatExplain(text5, fmt, options = {}) {
const { locale: locale2 = null, numberingSystem = null } = options, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
});
return explainFromTokens(localeToUse, text5, fmt);
}
static fromStringExplain(text5, fmt, options = {}) {
return DateTime.fromFormatExplain(text5, fmt, options);
}
static buildFormatParser(fmt, options = {}) {
const { locale: locale2 = null, numberingSystem = null } = options, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
});
return new TokenParser(localeToUse, fmt);
}
static fromFormatParser(text5, formatParser, opts = {}) {
if (isUndefined(text5) || isUndefined(formatParser)) {
throw new InvalidArgumentError(
"fromFormatParser requires an input string and a format parser"
);
}
const { locale: locale2 = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
locale: locale2,
numberingSystem,
defaultToEN: true
});
if (!localeToUse.equals(formatParser.locale)) {
throw new InvalidArgumentError(
`fromFormatParser called with a locale of ${localeToUse}, but the format parser was created for ${formatParser.locale}`
);
}
const { result, zone, specificOffset, invalidReason } = formatParser.explainFromTokens(text5);
if (invalidReason) {
return DateTime.invalid(invalidReason);
} else {
return parseDataToDateTime(
result,
zone,
opts,
`format ${formatParser.format}`,
text5,
specificOffset
);
}
}
static get DATE_SHORT() {
return DATE_SHORT;
}
static get DATE_MED() {
return DATE_MED;
}
static get DATE_MED_WITH_WEEKDAY() {
return DATE_MED_WITH_WEEKDAY;
}
static get DATE_FULL() {
return DATE_FULL;
}
static get DATE_HUGE() {
return DATE_HUGE;
}
static get TIME_SIMPLE() {
return TIME_SIMPLE;
}
static get TIME_WITH_SECONDS() {
return TIME_WITH_SECONDS;
}
static get TIME_WITH_SHORT_OFFSET() {
return TIME_WITH_SHORT_OFFSET;
}
static get TIME_WITH_LONG_OFFSET() {
return TIME_WITH_LONG_OFFSET;
}
static get TIME_24_SIMPLE() {
return TIME_24_SIMPLE;
}
static get TIME_24_WITH_SECONDS() {
return TIME_24_WITH_SECONDS;
}
static get TIME_24_WITH_SHORT_OFFSET() {
return TIME_24_WITH_SHORT_OFFSET;
}
static get TIME_24_WITH_LONG_OFFSET() {
return TIME_24_WITH_LONG_OFFSET;
}
static get DATETIME_SHORT() {
return DATETIME_SHORT;
}
static get DATETIME_SHORT_WITH_SECONDS() {
return DATETIME_SHORT_WITH_SECONDS;
}
static get DATETIME_MED() {
return DATETIME_MED;
}
static get DATETIME_MED_WITH_SECONDS() {
return DATETIME_MED_WITH_SECONDS;
}
static get DATETIME_MED_WITH_WEEKDAY() {
return DATETIME_MED_WITH_WEEKDAY;
}
static get DATETIME_FULL() {
return DATETIME_FULL;
}
static get DATETIME_FULL_WITH_SECONDS() {
return DATETIME_FULL_WITH_SECONDS;
}
static get DATETIME_HUGE() {
return DATETIME_HUGE;
}
static get DATETIME_HUGE_WITH_SECONDS() {
return DATETIME_HUGE_WITH_SECONDS;
}
};
function friendlyDateTime(dateTimeish) {
if (DateTime.isDateTime(dateTimeish)) {
return dateTimeish;
} else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
return DateTime.fromJSDate(dateTimeish);
} else if (dateTimeish && typeof dateTimeish === "object") {
return DateTime.fromObject(dateTimeish);
} else {
throw new InvalidArgumentError(
`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`
);
}
}
// ../ABConverter/converter/abc_echarts.ts
var _abc_list2echarts_tree = ABConvert.factory({
id: "list2echarts_tree",
name: "ECharts\u6811\u56FE",
match: /list2echarts_tree(.*)/,
detail: "\u5C06\u5217\u8868\u8F6C\u6362\u4E3A\u653EECharts\u6811\u56FE\uFF0C\u53EF\u9009\u9644\u52A0\u53C2\u6570: `_tb` \u6216 `_radial` \u6216 `_polyline` \u7B49",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let list_data = ListProcess.list2data(content, false);
list_data = ListProcess.data2strict(list_data);
let radial_array = listdata2radial_array(list_data);
let radial_data = array2data(radial_array);
let attachment = "";
const match3 = header.match(/list2echarts_tree(.*)/);
if (match3) {
if (match3[1].trim().toLowerCase() === "_polyline") {
attachment += `edgeShape: 'polyline',`;
}
if (match3[1].trim().toLowerCase() === "_tb") {
attachment += `orient: 'TB',`;
} else if (match3[1].trim().toLowerCase() === "_lr") {
attachment += `orient: 'LR',`;
} else if (match3[1].trim().toLowerCase() === "_bt") {
attachment += `orient: 'BT',`;
} else if (match3[1].trim().toLowerCase() === "_rl") {
attachment += `orient: 'RL',`;
}
if (match3[1].trim().toLowerCase() === "_radial") {
attachment += `layout: 'radial',
symbol: 'emptyCircle',`;
} else {
attachment += `label: {
position: 'left', // \u5C55\u5F00\u5219\u663E\u793A\u5728\u5DE6\u4FA7
verticalAlign: 'middle',
align: 'right',
},
leaves: {
label: {
position: 'right', // \u6298\u53E0\u540E\u5219\u663E\u793A\u5728\u53F3\u4FA7
verticalAlign: 'middle',
align: 'left'
}
},`;
}
}
const data_str = JSON.stringify(radial_data);
const script_str = `\`\`\`echarts
const option = {
tooltip: {
trigger: 'item',
triggerOn: 'mousemove',
},
series: [
{
type: 'tree',
data: [${data_str}],
${attachment}
top: '10%',
bottom: '10%',
symbolSize: 7,
initialTreeDepth: 3,
animationDurationUpdate: 750,
emphasis: {
focus: 'descendant',
},
},
],
}
// const height = 600
\`\`\``;
return script_str;
}
});
var _abc_list2echarts_sunburst = ABConvert.factory({
id: "list2echarts_sunburst",
name: "ECharts\u65ED\u65E5\u56FE",
match: "list2echarts_sunburst",
detail: "\u5C06\u5217\u8868\u8F6C\u6362\u4E3A\u653EECharts\u65ED\u65E5\u56FE (\u5E73\u5747\u5206\u914D)",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let list_data = ListProcess.list2data(content, false);
list_data = ListProcess.data2strict(list_data);
let radial_array = listdata2radial_array(list_data, true);
const data_str = JSON.stringify(radial_array);
const script_str = `\`\`\`echarts
const option = {
series: [
{
type: 'sunburst',
data: ${data_str},
radius: [0, '90%'],
label: {
rotate: 'radial'
}
},
],
}
\`\`\``;
return script_str;
}
});
var _abc_list2echarts_gantt = ABConvert.factory({
id: "list2echarts_gantt",
name: "ECharts\u7518\u7279\u56FE",
match: "list2echarts_gantt",
detail: "\u5C06\u5217\u8868\u8F6C\u6362\u4E3A\u653EECharts\u7518\u7279\u56FE (ECharts\u7684\u7518\u7279\u56FE\u662F\u7528custom\u6A21\u62DF\u7684)",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let c2list_data = C2ListProcess.list2c2data(content);
const gantt_array = c2listdata2gantt_array(c2list_data);
const script_str = ganttdata_to_script(gantt_array);
return script_str;
}
});
function listdata2radial_array(data2, leafValue = false) {
let nodes = [];
let prev_nodes = [];
for (let index2 = 0; index2 < data2.length; index2++) {
const item = data2[index2];
const current_key = item.content;
const current_value = {
name: current_key,
...leafValue ? { value: 1 } : {}
};
prev_nodes[item.level] = current_value;
if (item.level >= 1 && prev_nodes.hasOwnProperty(item.level - 1)) {
let lastItem = prev_nodes[item.level - 1];
if (typeof lastItem != "object" || Array.isArray(lastItem)) {
console.error(`list\u6570\u636E\u4E0D\u5408\u89C4\uFF0C\u7236\u8282\u70B9\u7684value\u503C\u4E0D\u662F{}\u7C7B\u578B`);
return nodes;
}
if (leafValue) {
delete lastItem.value;
}
if (!lastItem.hasOwnProperty("children")) {
lastItem.children = [current_value];
} else {
lastItem.children.push(current_value);
}
} else if (item.level == 0) {
nodes.push(current_value);
} else {
console.error(`list\u6570\u636E\u4E0D\u5408\u89C4\uFF0C\u6CA1\u6709\u6B63\u89C4\u5316. level:${item.level}, prev_nodes:${prev_nodes}`);
return nodes;
}
}
return nodes;
}
function c2listdata2gantt_array(data2) {
let nodes = [];
let prev_nodes;
let prev_group1 = [];
let min_time;
let max_time;
let time_mode;
for (let index2 = 0; index2 < data2.length; index2++) {
const item = data2[index2];
const content = item.content.trim();
if (item.level == 0) {
const content_array = content.split("/");
const start_time_str = content_array[0].trim();
const end_time_str = content_array[1] ? content_array[1].trim() : "P1D";
if (!time_mode) {
if (/^\d+$/.test(start_time_str)) {
time_mode = "timestamp";
} else if (DateTime.fromISO(start_time_str).isValid) {
time_mode = "ISO8601";
} else {
time_mode = "string";
}
}
const node = {
content: "",
start: 0,
end: 0,
duration: 0,
group1: 0
};
if (time_mode === "ISO8601") {
const startDateTime = DateTime.fromISO(start_time_str);
if (startDateTime.isValid) {
node.start = startDateTime.toMillis();
} else {
console.warn("\u5F00\u59CB\u65F6\u95F4\u89E3\u6790\u5931\u8D251");
prev_nodes = void 0;
continue;
}
const potentialEndDate = DateTime.fromISO(end_time_str);
if (potentialEndDate.isValid) {
node.end = potentialEndDate.toMillis();
} else {
const potentialDuration = Duration.fromISO(end_time_str);
if (potentialDuration.isValid) {
node.end = startDateTime.plus(potentialDuration).toMillis();
} else {
console.warn("\u7ED3\u675F\u65F6\u95F4\u89E3\u6790\u5931\u8D251");
prev_nodes = void 0;
continue;
}
}
} else if (time_mode === "timestamp") {
const startTimestamp = parseInt(start_time_str, 10);
if (!isNaN(startTimestamp))
node.start = startTimestamp;
else {
console.warn("\u5F00\u59CB\u65F6\u95F4\u6233\u89E3\u6790\u5931\u8D252");
prev_nodes = void 0;
continue;
}
const endTimestamp = parseInt(end_time_str, 10);
if (!isNaN(endTimestamp))
node.end = endTimestamp;
else {
console.warn("\u7ED3\u675F\u65F6\u95F4\u6233\u89E3\u6790\u5931\u8D252");
prev_nodes = void 0;
continue;
}
} else {
console.warn("\u6682\u4E0D\u652F\u6301\u975E\u65F6\u95F4\u683C\u5F0F\u7684\u7518\u7279\u56FE\u65F6\u95F4\u89E3\u6790");
prev_nodes = void 0;
continue;
}
min_time = min_time === void 0 ? node.start : Math.min(min_time, node.start);
max_time = max_time === void 0 ? node.end : Math.max(max_time, node.end);
if (prev_group1.length == 0) {
node.group1 = 0;
prev_group1.push(node.end);
} else {
let target_group1;
for (let group1 = 0; group1 < prev_group1.length; group1++) {
if (node.start < prev_group1[group1])
continue;
target_group1 = group1;
node.group1 = group1;
prev_group1[group1] = node.end;
break;
}
if (target_group1 === void 0) {
node.group1 = prev_group1.length;
prev_group1.push(node.end);
}
}
nodes.push(node);
prev_nodes = node;
continue;
} else {
if (!prev_nodes || !time_mode)
continue;
prev_nodes.content = content;
prev_nodes = void 0;
}
}
return {
data: nodes,
time_mode,
max_group1: prev_group1.length,
min_time,
max_time
};
}
function ganttdata_to_script(gantt_data) {
const currentTheme = document.body.classList.contains("theme-dark") ? "dark" : "light";
const { data: ganttNode, max_group1, min_time, max_time } = gantt_data;
let data2 = [];
for (const item of ganttNode) {
data2.push({
value: [
item.content,
item.group1,
item.start,
item.end,
item.end - item.start
]
});
}
const categories = Array.from({ length: max_group1 }, (_, i) => "");
const height_calc = categories.length * 40;
const startTime = min_time != null ? min_time : 0 - 1 * 24 * 60 * 60 * 1e3;
let option = {
tooltip: {
trigger: "item"
},
dataZoom: [
{
type: "slider",
xAxisIndex: 0,
filterMode: "weakFilter",
height: 20,
bottom: 10,
start: 0,
end: 100,
handleIcon: "path://M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4v1.3h1.3v-1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7V23h6.6V24.4z M13.3,19.6H6.7v-1.4h6.6V19.6z",
handleSize: "80%",
showDetail: false
},
{
type: "inside",
xAxisIndex: 0,
filterMode: "weakFilter",
start: 0,
end: 100
}
],
grid: {
height: height_calc,
top: 40,
bottom: 40,
left: 15,
right: 15
},
xAxis: {
position: "top",
min: startTime,
scale: true,
splitNumber: 30,
axisLabel: {
fontSize: 10
}
},
yAxis: {
data: categories,
inverse: true
},
series: [
{
type: "custom",
itemStyle: {
opacity: 0.8
},
encode: {
x: [2, 3],
y: 1
},
data: data2
}
]
};
const script_str = `\`\`\`echarts
height = ${height_calc + 80}
const option = ${JSON.stringify(option, null, 2)}
// \u81EA\u5B9A\u4E49\u6E32\u67D3\u51FD\u6570 - x\u8F74
let lastMonth = -1; // \u7528\u6765\u8BB0\u5F55\u4E0A\u4E00\u4E2A\u523B\u5EA6\u7684\u6708\u4EFD
option.xAxis.axisLabel.formatter = function (val) {
let date = new Date(val);
let currentMonth = date.getMonth();
if (lastMonth !== currentMonth) { // \u5982\u679C\u6708\u4EFD\u4E0E\u4E0A\u4E00\u4E2A\u4E0D\u540C\uFF0C\u6216\u8005\u8FD9\u662F\u7B2C\u4E00\u4E2A\u523B\u5EA6
lastMonth = currentMonth;
return echarts.format.formatTime('yyyy-MM', val) + '\\n' +
echarts.format.formatTime('dd', val);
} else {
return '\\n' + // (\u5934\u90E8\u7A7A\u6362\u884C\u4FDD\u6301\u9AD8\u5EA6\u4E0D\u53D8\uFF0C\u907F\u514D\u7F29\u653E\u65F6\u56FE\u8868\u8DF3\u52A8)
echarts.format.formatTime('dd', val);
}
}
// \u81EA\u5B9A\u4E49\u6E32\u67D3\u51FD\u6570 - tooltip, \u652F\u6301html
option.tooltip.formatter = function (params) {
// let categoryName = categories[params.value[1]];
return echarts.format.formatTime('MM-dd', params.value[2]) +
'/' +
echarts.format.formatTime('MM-dd', params.value[3]) +
'
' +
params.value[0].replaceAll('\\n', '
');
},
// \u81EA\u5B9A\u4E49\u6E32\u67D3\u51FD\u6570 - \u56FE\u8868\u5185\u5BB9
option.series[0].renderItem = function renderItem(params, api) {
var categoryIndex = api.value(1); // \u5206\u7C7B\u7D22\u5F15
var start = api.coord([api.value(2), categoryIndex]);
var end = api.coord([api.value(3), categoryIndex]);
var height = api.size([0, 1])[1] * 1 - 5;
var rectShape = echarts.graphic.clipRectByRect( // \u7ED8\u5236\u77E9\u5F62\uFF0C\u5E76\u88C1\u51CF
{
x: start[0],
y: start[1] - height / 2,
width: end[0] - start[0],
height: height,
},
{
x: params.coordSys.x,
y: params.coordSys.y,
width: params.coordSys.width,
height: params.coordSys.height
}
);
var text_array = api.value(0).split('\\n');
const textColor = myChart.getOption().textStyle.color ?? "black";
return (
rectShape && {
type: 'group', // group \u5143\u7D20\uFF0C\u5305\u542B\u77E9\u5F62\u548C\u6587\u672C
children: [
{
type: 'rect', // \u77E9\u5F62\u5143\u7D20
transition: ['shape'],
shape: {
...rectShape,
r: 5, // \u5706\u89D2\u534A\u5F84
},
style: api.style()
},
{
type: 'text', // \u6587\u672C\u5143\u7D20
transition: ['style'], // \u5BF9\u6837\u5F0F\u5E94\u7528\u8FC7\u6E21\u52A8\u753B
style: {
x: start[0] + 5, // \u5C06\u6587\u672C\u653E\u5728\u77E9\u5F62\u5185\u90E8\uFF0C\u5E76\u5411\u53F3\u504F\u79FB 5px
y: start[1], // \u5782\u76F4\u5C45\u4E2D
text: (text_array.length > 1 ? text_array[0] + '...' : text_array[0]),
fill: textColor, // \u6587\u672C\u989C\u8272
textVerticalAlign: 'middle', // \u6587\u672C\u5782\u76F4\u5BF9\u9F50\u65B9\u5F0F
textAlign: 'left' // \u6587\u672C\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F
}
}
]
}
);
}
\`\`\``;
return script_str;
}
function array2data(array) {
if (array.length == 1) {
return array[0];
} else {
return {
name: "root",
children: array
};
}
}
// ../ABConverter/converter/abc_plantuml.ts
var import_plantuml_encoder = __toESM(require_browser_index());
// ../ABConverter/converter/abc_plantuml_tools.ts
var KEYWORD_IF = "if ";
var KEYWORD_SWITCH = "switch ";
var KEYWORD_SWITCH2 = "match ";
var KEYWORD_WHILE = "while ";
var KEYWORD_GROUP = "group ";
var KEYWORD_PARTITION = "partition ";
var KEYWORD_LANE = "lane ";
var KEYWORD_ELIF = "elif ";
var KEYWORD_ELSEIF = "else if ";
var KEYWORD_ELSE = "else";
var KEYWORD_DEFAULT = "default";
var KEYWORD_DEFAULT2 = "case _";
var KEYWORD_CASE = "case ";
var BLOCK_START = ":";
var INDENT = " ";
var Stat = class {
constructor(content, level) {
this.content = content.trim();
this.level = level;
}
isReservedWord() {
return this.content === "start" || this.content === "stop" || this.content === "kill" || this.content === "detach" || this.content === "break" || this.content === "end" || this.content === "fork" || this.content === "fork again" || this.content === "end fork" || this.content === "end merge";
}
isStatementOfType(...stateType) {
return stateType.some((type) => this.content.startsWith(type)) && this.content.endsWith(BLOCK_START);
}
takeTagOfStat(type) {
const condition = this.content.substring(type.length, this.content.length - BLOCK_START.length).trim();
return condition;
}
};
var statementTypes = {
[KEYWORD_IF]: processIfStatement,
[KEYWORD_SWITCH]: processSwitchStatement,
[KEYWORD_SWITCH2]: processSwitchStatement,
[KEYWORD_WHILE]: processWhileStatement,
[KEYWORD_GROUP]: processGroupStatement,
[KEYWORD_PARTITION]: processPartitionStatement,
[KEYWORD_LANE]: processSwimLane
};
function processBlock(stats, index2, parentLevel) {
let result = "";
let next2 = index2;
while (next2 < stats.length && (parentLevel === -1 || stats[next2].level > parentLevel)) {
const stat = stats[next2];
if (stat.isReservedWord()) {
result += stat.content + "\n";
next2++;
continue;
}
let processed = false;
for (const [statType, processor] of Object.entries(statementTypes)) {
if (stat.isStatementOfType(statType)) {
const { result: processedResult, nextIndex: nextNext } = processor(stats, next2, statType);
result += processedResult;
next2 = nextNext;
processed = true;
break;
}
}
if (processed)
continue;
if (stat.content.length > 0) {
result += `:${stat.content};
`;
}
next2++;
}
return { result, nextIndex: next2 };
}
function processIfStatement(stats, index2) {
let result = KEYWORD_IF;
const stat = stats[index2];
const condition = stat.takeTagOfStat(KEYWORD_IF);
let nextIndex = index2 + 1;
if (nextIndex < stats.length && stats[nextIndex].level > stat.level) {
result += `(${condition}) then (yes)
`;
const { result: result2, nextIndex: nextIndex2 } = processBlock(stats, nextIndex, stat.level);
result += indentContent(result2);
nextIndex = nextIndex2;
}
while (nextIndex < stats.length && stats[nextIndex].level === stat.level && stats[nextIndex].isStatementOfType(KEYWORD_ELIF, KEYWORD_ELSEIF, KEYWORD_ELSE)) {
const branch = stats[nextIndex];
if (branch.isStatementOfType(KEYWORD_ELSEIF)) {
const condition2 = branch.takeTagOfStat(KEYWORD_ELSEIF);
result += `else if(${condition2}) then (yes)
`;
} else if (branch.isStatementOfType(KEYWORD_ELIF)) {
const condition2 = branch.takeTagOfStat(KEYWORD_ELIF);
result += `else if(${condition2}) then (yes)
`;
} else if (branch.isStatementOfType(KEYWORD_ELSE)) {
result += `else (else)
`;
}
const { result: result2, nextIndex: nextIndex2 } = processBlock(stats, nextIndex + 1, stat.level);
result += indentContent(result2);
nextIndex = nextIndex2;
}
result += "endif\n";
return { result, nextIndex };
}
function processSwitchStatement(stats, index2, statType) {
let result = `switch `;
const stat = stats[index2];
const condition = stat.takeTagOfStat(statType);
let nextIndex = index2 + 1;
result += `(${condition})
`;
let hasDefault = false;
while (nextIndex < stats.length && stats[nextIndex].level >= stat.level && stats[nextIndex].isStatementOfType(KEYWORD_CASE, KEYWORD_DEFAULT)) {
const nextStat = stats[nextIndex];
nextIndex++;
if (nextStat.isStatementOfType(KEYWORD_DEFAULT) || nextStat.isStatementOfType(KEYWORD_DEFAULT2)) {
result += `case (default)
`;
hasDefault = true;
const { result: defaultResult, nextIndex: defaultNextIndex } = processBlock(stats, nextIndex, nextStat.level);
result += indentContent(defaultResult);
nextIndex = defaultNextIndex;
} else if (nextStat.isStatementOfType(KEYWORD_CASE)) {
const caseTag = nextStat.takeTagOfStat(KEYWORD_CASE);
result += `case (${caseTag})
`;
const { result: caseResult, nextIndex: caseNextIndex } = processBlock(stats, nextIndex, nextStat.level);
result += indentContent(caseResult);
nextIndex = caseNextIndex;
}
}
if (!hasDefault) {
result += "case (default)\n";
}
result += "endswitch\n";
return { result, nextIndex };
}
function processWhileStatement(stats, index2) {
const stat = stats[index2];
const condition = stat.takeTagOfStat(KEYWORD_WHILE);
let result = `${KEYWORD_WHILE}(${condition}) is (true)
`;
let nextIndex = index2 + 1;
const { result: bodyResult, nextIndex: bodyNextIndex } = processBlock(stats, nextIndex, stat.level);
result += indentContent(bodyResult);
nextIndex = bodyNextIndex;
result += "endwhile\n";
return { result, nextIndex };
}
function processGroupStatement(stats, index2) {
const stat = stats[index2];
const groupName = stat.takeTagOfStat(KEYWORD_GROUP);
let result = `${KEYWORD_GROUP}${groupName}
`;
let nextIndex = index2 + 1;
const { result: bodyResult, nextIndex: bodyNextIndex } = processBlock(stats, nextIndex, stat.level);
result += indentContent(bodyResult);
nextIndex = bodyNextIndex;
result += "endgroup\n";
return { result, nextIndex };
}
function processPartitionStatement(stats, index2) {
const stat = stats[index2];
const partitionName = stat.takeTagOfStat(KEYWORD_PARTITION);
let result = `${KEYWORD_PARTITION}${partitionName} {
`;
let nextIndex = index2 + 1;
const { result: bodyResult, nextIndex: bodyNextIndex } = processBlock(stats, nextIndex, stat.level);
result += indentContent(bodyResult);
nextIndex = bodyNextIndex;
result += "}\n";
return { result, nextIndex };
}
function processSwimLane(stats, index2) {
const stat = stats[index2];
const laneName = stat.takeTagOfStat(KEYWORD_LANE);
return { result: "|" + laneName + "|\n", nextIndex: index2 + 1 };
}
function indentContent(content) {
return content.split("\n").filter((x) => x !== "").map((line) => INDENT + line).join("\n") + "\n";
}
function list2ActivityDiagramText(listdata) {
let result = "@startuml\n";
const stats = listdata.map((item) => new Stat(item.content.trim(), item.level));
const { result: bodyResult } = processBlock(stats, 0, -1);
result += bodyResult;
result += "@enduml";
return result;
}
// ../ABConverter/converter/abc_plantuml.ts
var _abc_list2jsontext = ABConvert.factory({
id: "json2pumlJson",
name: "json\u5230\u53EF\u89C6\u5316",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
content = "@startjson\n" + content + "\n@endjson\n";
render_pumlText(content, el);
return el;
}
});
var _abc_list2pumlWBS = ABConvert.factory({
id: "list2pumlWBS",
name: "\u5217\u8868\u5230puml\u5DE5\u4F5C\u5206\u89E3\u7ED3\u6784",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
let listdata = ListProcess.list2data(content);
listdata = ListProcess.data2strict(listdata);
let newContent = "@startwbs\n";
for (let item of listdata) {
if (item.content.startsWith("< "))
newContent += "*".repeat(item.level + 1) + "< " + item.content.slice(2) + "\n";
else
newContent += "*".repeat(item.level + 1) + " " + item.content + "\n";
}
newContent += "@endwbs";
render_pumlText(newContent, el);
return el;
}
});
var _abc_list2pumlMindmap = ABConvert.factory({
id: "list2pumlMindmap",
name: "\u5217\u8868\u5230puml\u601D\u7EF4\u5BFC\u56FE",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
let listdata = ListProcess.list2data(content);
listdata = ListProcess.data2strict(listdata);
let newContent = "@startmindmap\n";
for (let item of listdata) {
newContent += "*".repeat(item.level + 1) + " " + item.content + "\n";
}
newContent += "@endmindmap";
render_pumlText(newContent, el);
return el;
}
});
var _abc_list2ActivityDiagramText = ABConvert.factory({
id: "list2pumlActivityDiagramText",
name: "\u5217\u8868\u5230puml\u6D3B\u52A8\u56FE\u6587\u672C",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
return list2ActivityDiagramText(ListProcess.data2strict(ListProcess.list2data(content)));
}
});
var _abc_list2ActivityDiagram = ABConvert.factory({
id: "list2pumlActivityDiagram",
name: "\u5217\u8868\u5230puml\u6D3B\u52A8\u56FE",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
const puml = list2ActivityDiagramText(ListProcess.data2strict(ListProcess.list2data(content)));
render_pumlText(puml, el);
return el;
}
});
async function render_pumlText(text5, div) {
var encoded = import_plantuml_encoder.default.encode(text5);
let url = "http://www.plantuml.com/plantuml/img/" + encoded;
div.innerHTML = purify.sanitize(`
`);
return div;
}
// ../ABConverter/converter/abc_mermaid.ts
function getID(length = 16) {
return Number(Math.random().toString().substr(3, length) + Date.now()).toString(36);
}
var _abc_title2mindmap = ABConvert.factory({
id: "title2mindmap",
name: "\u6807\u9898\u5230\u8111\u56FE",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: async (el, header, content) => {
const data2 = ListProcess.title2data(content);
const el2 = await data2mindmap(data2, el);
return el2;
}
});
var _abc_list2mindmap = ABConvert.factory({
id: "list2mindmap",
name: "\u5217\u8868\u8F6Cmermaid\u601D\u7EF4\u5BFC\u56FE",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: async (el, header, content) => {
const data2 = ListProcess.list2data(content);
const el2 = await data2mindmap(data2, el);
return el2;
}
});
var _abc_list2mermaid = ABConvert.factory({
id: "list2mermaid",
name: "\u5217\u8868\u8F6Cmermaid\u6D41\u7A0B\u56FE",
match: /^list2mermaid(\((.*)\))?$/,
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
let matchs = header.match(/^list2mermaid(\((.*)\))?$/);
if (!matchs) {
console.error("no match", matchs);
return el;
}
let mermaid_head = "graph LR";
if (matchs[2])
mermaid_head = matchs[2];
const list_itemInfo = ListProcess.list2data(content);
const mermaidText = mermaid_head + "\n" + data2mermaidText(list_itemInfo);
render_mermaidText(mermaidText, el);
return el;
}
});
var _abc_list2mermaidText = ABConvert.factory({
id: "list2mermaidText",
name: "\u5217\u8868\u8F6Cmermaid\u6587\u672C",
match: /^list2mermaidText(\((.*)\))?$/,
detail: "\u5217\u8868\u8F6Cmermaid\u6587\u672C",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let matchs = header.match(/^list2mermaidText(\((.*)\))?$/);
if (!matchs) {
console.error("no match", matchs);
return "error, no match";
}
let mermaid_head = "graph LR";
if (matchs[2])
mermaid_head = matchs[2];
const list_itemInfo = ListProcess.list2data(content);
const mermaidText = mermaid_head + "\n" + data2mermaidText(list_itemInfo);
return mermaidText;
}
});
var _abc_list2mehrmaid = ABConvert.factory({
id: "list2mehrmaidText",
name: "\u5217\u8868\u8F6Cmehrmaid\u6587\u672C",
match: /^list2mehrmaidText(\((.*)\))?$/,
detail: "\u9700\u8981\u914D\u5408mehrmaid\u63D2\u4EF6\u548Ccode(mehrmaid)\u4F7F\u7528\uFF0C\u6216\u4F7F\u7528\u522B\u540D\u7B80\u5316",
process_param: "string" /* text */,
process_return: "string" /* text */,
process: (el, header, content) => {
let matchs = header.match(/^list2mehrmaidText(\((.*)\))?$/);
if (!matchs) {
console.error("no match", matchs);
return "error, no match";
}
let mermaid_head = "flowchart LR";
if (matchs[2])
mermaid_head = matchs[2];
const list_itemInfo = ListProcess.list2data(content);
const mermaidText = mermaid_head + "\n" + data2mehrmaidText(list_itemInfo);
return mermaidText;
}
});
var _abc_mermaid = ABConvert.factory({
id: "mermaid-with",
name: "\u65B0mermaid",
match: /^mermaid(\((.*)\))?$/,
default: "mermaid(graph TB)",
detail: "\u7531\u4E8E\u9700\u8981\u517C\u5BB9\u8111\u56FE\uFF0C\u8FD9\u91CC\u4F1A\u4F7F\u7528\u63D2\u4EF6\u5185\u7F6E\u7684\u6700\u65B0\u7248mermaid",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: async (el, header, content) => {
let matchs = header.match(/^mermaid(\((.*)\))?$/);
if (!matchs)
return el;
if (matchs[2])
content = matchs[2] + "\n" + content;
const el2 = render_mermaidText(content, el);
return el2;
}
});
function data2mermaidText(list_itemInfo) {
const html_mode = false;
let list_line_content = [];
let prev_line_content = "";
let prev_level = 999;
for (let i = 0; i < list_itemInfo.length; i++) {
if (list_itemInfo[i].level > prev_level) {
prev_line_content = prev_line_content + " --> " + list_itemInfo[i].content;
} else {
list_line_content.push(prev_line_content);
prev_line_content = "";
for (let j = i; j >= 0; j--) {
if (list_itemInfo[j].level < list_itemInfo[i].level) {
prev_line_content = list_itemInfo[j].content;
break;
}
}
if (prev_line_content)
prev_line_content = prev_line_content + " --> ";
prev_line_content = prev_line_content + list_itemInfo[i].content;
}
prev_level = list_itemInfo[i].level;
}
list_line_content.push(prev_line_content);
let text5 = list_line_content.join("\n");
return text5;
}
function data2mehrmaidText(list_itemInfo) {
const mehrmaidMap = [];
for (let i = 0; i < list_itemInfo.length; i++) {
mehrmaidMap[i] = list_itemInfo[i].content;
list_itemInfo[i].content = i.toString();
}
const html_mode = false;
let list_line_content = [];
let prev_line_content = "";
let prev_level = 999;
for (let i = 0; i < list_itemInfo.length; i++) {
if (list_itemInfo[i].level > prev_level) {
prev_line_content = prev_line_content + " --> " + list_itemInfo[i].content;
} else {
list_line_content.push(prev_line_content);
prev_line_content = "";
for (let j = i; j >= 0; j--) {
if (list_itemInfo[j].level < list_itemInfo[i].level) {
prev_line_content = list_itemInfo[j].content;
break;
}
}
if (prev_line_content)
prev_line_content = prev_line_content + " --> ";
prev_line_content = prev_line_content + list_itemInfo[i].content;
}
prev_level = list_itemInfo[i].level;
}
list_line_content.push(prev_line_content);
let text5 = list_line_content.join("\n");
text5 += "\n\n";
for (let i = 0; i < mehrmaidMap.length; i++) {
text5 += `${i}(("${mehrmaidMap[i]}"))
`;
}
return text5;
}
async function data2mindmap(list_itemInfo, div) {
let list_newcontent = [];
for (let item of list_itemInfo) {
let str_indent = "";
for (let i = 0; i < item.level; i++)
str_indent += " ";
list_newcontent.push(str_indent + item.content.replace("\n", "
"));
}
const mermaidText = "mindmap\n" + list_newcontent.join("\n");
return render_mermaidText(mermaidText, div);
}
async function render_mermaidText(mermaidText, div) {
if (ABCSetting.env.startsWith("obsidian") && ABCSetting.obsidian.mermaid) {
ABCSetting.obsidian.mermaid.then(async (mermaid) => {
const { svg: svg2 } = await mermaid.render("ab-mermaid-" + getID(), mermaidText);
const div_mermaid = document.createElement("div");
div.appendChild(div_mermaid);
div_mermaid.classList.add("mermaid");
div_mermaid.innerHTML = svg2;
});
} else {
div.classList.add("ab-raw");
div.innerHTML = purify.sanitize(``);
}
{
}
return div;
}
// ../../node_modules/.pnpm/markmap-common@0.18.9/node_modules/markmap-common/dist/index.mjs
var testPath = "npm2url/dist/index.cjs";
var defaultProviders = {
jsdelivr: (path) => `https://cdn.jsdelivr.net/npm/${path}`,
unpkg: (path) => `https://unpkg.com/${path}`
};
async function checkUrl(url, signal) {
const res = await fetch(url, {
signal
});
if (!res.ok) {
throw res;
}
await res.text();
}
var UrlBuilder = class {
constructor() {
this.providers = { ...defaultProviders };
this.provider = "jsdelivr";
}
async getFastestProvider(timeout = 5e3, path = testPath) {
const controller = new AbortController();
let timer = 0;
try {
return await new Promise((resolve, reject) => {
Promise.all(
Object.entries(this.providers).map(async ([name2, factory]) => {
try {
await checkUrl(factory(path), controller.signal);
resolve(name2);
} catch (e) {
}
})
).then(() => reject(new Error("All providers failed")));
timer = setTimeout(reject, timeout, new Error("Timed out"));
});
} finally {
controller.abort();
clearTimeout(timer);
}
}
async findFastestProvider(timeout, path) {
this.provider = await this.getFastestProvider(timeout, path);
return this.provider;
}
setProvider(name2, factory) {
if (factory) {
this.providers[name2] = factory;
} else {
delete this.providers[name2];
}
}
getFullUrl(path, provider = this.provider) {
if (path.includes("://")) {
return path;
}
const factory = this.providers[provider];
if (!factory) {
throw new Error(`Provider ${provider} not found`);
}
return factory(path);
}
};
var urlBuilder = new UrlBuilder();
var Hook = class {
constructor() {
this.listeners = [];
}
tap(fn) {
this.listeners.push(fn);
return () => this.revoke(fn);
}
revoke(fn) {
const i = this.listeners.indexOf(fn);
if (i >= 0)
this.listeners.splice(i, 1);
}
revokeAll() {
this.listeners.splice(0);
}
call(...args) {
for (const fn of this.listeners) {
fn(...args);
}
}
};
var uniqId = Math.random().toString(36).slice(2, 8);
function noop() {
}
function walkTree(tree, callback) {
const walk = (item, parent2) => callback(
item,
() => {
var _a3;
return (_a3 = item.children) == null ? void 0 : _a3.map((child) => walk(child, item));
},
parent2
);
return walk(tree);
}
function wrapFunction(fn, wrapper) {
return (...args) => wrapper(fn, ...args);
}
function defer() {
const obj = {};
obj.promise = new Promise((resolve, reject) => {
obj.resolve = resolve;
obj.reject = reject;
});
return obj;
}
function memoize(fn) {
const cache = {};
return function memoized(...args) {
const key = `${args[0]}`;
let data2 = cache[key];
if (!data2) {
data2 = {
value: fn(...args)
};
cache[key] = data2;
}
return data2.value;
};
}
var VTYPE_ELEMENT = 1;
var VTYPE_FUNCTION = 2;
var SVG_NS = "http://www.w3.org/2000/svg";
var XLINK_NS = "http://www.w3.org/1999/xlink";
var NS_ATTRS = {
show: XLINK_NS,
actuate: XLINK_NS,
href: XLINK_NS
};
var isLeaf = (c) => typeof c === "string" || typeof c === "number";
var isElement = (c) => (c == null ? void 0 : c.vtype) === VTYPE_ELEMENT;
var isRenderFunction = (c) => (c == null ? void 0 : c.vtype) === VTYPE_FUNCTION;
function h(type, props, ...children2) {
props = Object.assign({}, props, {
children: children2.length === 1 ? children2[0] : children2
});
return jsx(type, props);
}
function jsx(type, props) {
let vtype;
if (typeof type === "string")
vtype = VTYPE_ELEMENT;
else if (typeof type === "function")
vtype = VTYPE_FUNCTION;
else
throw new Error("Invalid VNode type");
return {
vtype,
type,
props
};
}
function Fragment(props) {
return props.children;
}
var DEFAULT_ENV = {
isSvg: false
};
function insertDom(parent2, nodes) {
if (!Array.isArray(nodes))
nodes = [nodes];
nodes = nodes.filter(Boolean);
if (nodes.length)
parent2.append(...nodes);
}
function mountAttributes(domElement, props, env) {
for (const key in props) {
if (key === "key" || key === "children" || key === "ref")
continue;
if (key === "dangerouslySetInnerHTML") {
domElement.innerHTML = props[key].__html;
} else if (key === "innerHTML" || key === "textContent" || key === "innerText" || key === "value" && ["textarea", "select"].includes(domElement.tagName)) {
const value = props[key];
if (value != null)
domElement[key] = value;
} else if (key.startsWith("on")) {
domElement[key.toLowerCase()] = props[key];
} else {
setDOMAttribute(domElement, key, props[key], env.isSvg);
}
}
}
var attrMap = {
className: "class",
labelFor: "for"
};
function setDOMAttribute(el, attr2, value, isSVG) {
attr2 = attrMap[attr2] || attr2;
if (value === true) {
el.setAttribute(attr2, "");
} else if (value === false) {
el.removeAttribute(attr2);
} else {
const namespace = isSVG ? NS_ATTRS[attr2] : void 0;
if (namespace !== void 0) {
el.setAttributeNS(namespace, attr2, value);
} else {
el.setAttribute(attr2, value);
}
}
}
function flatten(arr) {
return arr.reduce((prev2, item) => prev2.concat(item), []);
}
function mountChildren(children2, env) {
return Array.isArray(children2) ? flatten(children2.map((child) => mountChildren(child, env))) : mount(children2, env);
}
function mount(vnode, env = DEFAULT_ENV) {
if (vnode == null || typeof vnode === "boolean") {
return null;
}
if (vnode instanceof Node) {
return vnode;
}
if (isRenderFunction(vnode)) {
const {
type,
props
} = vnode;
if (type === Fragment) {
const node = document.createDocumentFragment();
if (props.children) {
const children2 = mountChildren(props.children, env);
insertDom(node, children2);
}
return node;
}
const childVNode = type(props);
return mount(childVNode, env);
}
if (isLeaf(vnode)) {
return document.createTextNode(`${vnode}`);
}
if (isElement(vnode)) {
let node;
const {
type,
props
} = vnode;
if (!env.isSvg && type === "svg") {
env = Object.assign({}, env, {
isSvg: true
});
}
if (!env.isSvg) {
node = document.createElement(type);
} else {
node = document.createElementNS(SVG_NS, type);
}
mountAttributes(node, props, env);
if (props.children) {
let childEnv = env;
if (env.isSvg && type === "foreignObject") {
childEnv = Object.assign({}, childEnv, {
isSvg: false
});
}
const children2 = mountChildren(props.children, childEnv);
if (children2 != null)
insertDom(node, children2);
}
const {
ref
} = props;
if (typeof ref === "function")
ref(node);
return node;
}
throw new Error("mount: Invalid Vnode!");
}
function mountDom(vnode) {
return mount(vnode);
}
function hm(...args) {
return mountDom(h(...args));
}
var memoizedPreloadJS = memoize((url) => {
document.head.append(
hm("link", {
rel: "preload",
as: "script",
href: url
})
);
});
var jsCache = {};
async function loadJSItem(item, context) {
var _a3;
const src = item.type === "script" && ((_a3 = item.data) == null ? void 0 : _a3.src) || "";
item.loaded || (item.loaded = jsCache[src]);
if (!item.loaded) {
const deferred = defer();
item.loaded = deferred.promise;
if (item.type === "script") {
document.head.append(
hm("script", {
...item.data,
onLoad: () => deferred.resolve(),
onError: deferred.reject
})
);
if (!src) {
deferred.resolve();
} else {
jsCache[src] = item.loaded;
}
}
if (item.type === "iife") {
const { fn, getParams } = item.data;
fn(...(getParams == null ? void 0 : getParams(context)) || []);
deferred.resolve();
}
}
await item.loaded;
}
async function loadJS(items, context) {
items.forEach((item) => {
var _a3;
if (item.type === "script" && ((_a3 = item.data) == null ? void 0 : _a3.src)) {
memoizedPreloadJS(item.data.src);
}
});
context = {
getMarkmap: () => window.markmap,
...context
};
for (const item of items) {
await loadJSItem(item, context);
}
}
function buildJSItem(path) {
return {
type: "script",
data: {
src: path
}
};
}
function buildCSSItem(path) {
return {
type: "stylesheet",
data: {
href: path
}
};
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/options.js
var defaultOpts = {
xml: false,
decodeEntities: true
};
var options_default = defaultOpts;
var xmlModeDefault = {
_useHtmlParser2: true,
xmlMode: true
};
function flatten2(options) {
return (options === null || options === void 0 ? void 0 : options.xml) ? typeof options.xml === "boolean" ? xmlModeDefault : { ...xmlModeDefault, ...options.xml } : options !== null && options !== void 0 ? options : void 0;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/static.js
var static_exports = {};
__export(static_exports, {
contains: () => contains,
html: () => html2,
merge: () => merge,
parseHTML: () => parseHTML,
root: () => root,
text: () => text2,
xml: () => xml2
});
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/index.js
var esm_exports2 = {};
__export(esm_exports2, {
DocumentPosition: () => DocumentPosition,
append: () => append,
appendChild: () => appendChild,
compareDocumentPosition: () => compareDocumentPosition,
existsOne: () => existsOne,
filter: () => filter,
find: () => find,
findAll: () => findAll,
findOne: () => findOne,
findOneChild: () => findOneChild,
getAttributeValue: () => getAttributeValue,
getChildren: () => getChildren,
getElementById: () => getElementById,
getElements: () => getElements,
getElementsByClassName: () => getElementsByClassName,
getElementsByTagName: () => getElementsByTagName,
getElementsByTagType: () => getElementsByTagType,
getFeed: () => getFeed,
getInnerHTML: () => getInnerHTML,
getName: () => getName,
getOuterHTML: () => getOuterHTML,
getParent: () => getParent,
getSiblings: () => getSiblings,
getText: () => getText,
hasAttrib: () => hasAttrib,
hasChildren: () => hasChildren,
innerText: () => innerText,
isCDATA: () => isCDATA,
isComment: () => isComment,
isDocument: () => isDocument,
isTag: () => isTag2,
isText: () => isText,
nextElementSibling: () => nextElementSibling,
prepend: () => prepend,
prependChild: () => prependChild,
prevElementSibling: () => prevElementSibling,
removeElement: () => removeElement,
removeSubsets: () => removeSubsets,
replaceElement: () => replaceElement,
testElement: () => testElement,
textContent: () => textContent,
uniqueSort: () => uniqueSort
});
// ../../node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.js
var esm_exports = {};
__export(esm_exports, {
CDATA: () => CDATA,
Comment: () => Comment,
Directive: () => Directive,
Doctype: () => Doctype,
ElementType: () => ElementType,
Root: () => Root,
Script: () => Script,
Style: () => Style,
Tag: () => Tag,
Text: () => Text,
isTag: () => isTag
});
var ElementType;
(function(ElementType2) {
ElementType2["Root"] = "root";
ElementType2["Text"] = "text";
ElementType2["Directive"] = "directive";
ElementType2["Comment"] = "comment";
ElementType2["Script"] = "script";
ElementType2["Style"] = "style";
ElementType2["Tag"] = "tag";
ElementType2["CDATA"] = "cdata";
ElementType2["Doctype"] = "doctype";
})(ElementType || (ElementType = {}));
function isTag(elem) {
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
}
var Root = ElementType.Root;
var Text = ElementType.Text;
var Directive = ElementType.Directive;
var Comment = ElementType.Comment;
var Script = ElementType.Script;
var Style = ElementType.Style;
var Tag = ElementType.Tag;
var CDATA = ElementType.CDATA;
var Doctype = ElementType.Doctype;
// ../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/node.js
var Node2 = class {
constructor() {
this.parent = null;
this.prev = null;
this.next = null;
this.startIndex = null;
this.endIndex = null;
}
get parentNode() {
return this.parent;
}
set parentNode(parent2) {
this.parent = parent2;
}
get previousSibling() {
return this.prev;
}
set previousSibling(prev2) {
this.prev = prev2;
}
get nextSibling() {
return this.next;
}
set nextSibling(next2) {
this.next = next2;
}
cloneNode(recursive = false) {
return cloneNode(this, recursive);
}
};
var DataNode = class extends Node2 {
constructor(data2) {
super();
this.data = data2;
}
get nodeValue() {
return this.data;
}
set nodeValue(data2) {
this.data = data2;
}
};
var Text2 = class extends DataNode {
constructor() {
super(...arguments);
this.type = ElementType.Text;
}
get nodeType() {
return 3;
}
};
var Comment2 = class extends DataNode {
constructor() {
super(...arguments);
this.type = ElementType.Comment;
}
get nodeType() {
return 8;
}
};
var ProcessingInstruction = class extends DataNode {
constructor(name2, data2) {
super(data2);
this.name = name2;
this.type = ElementType.Directive;
}
get nodeType() {
return 1;
}
};
var NodeWithChildren = class extends Node2 {
constructor(children2) {
super();
this.children = children2;
}
get firstChild() {
var _a3;
return (_a3 = this.children[0]) !== null && _a3 !== void 0 ? _a3 : null;
}
get lastChild() {
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
}
get childNodes() {
return this.children;
}
set childNodes(children2) {
this.children = children2;
}
};
var CDATA2 = class extends NodeWithChildren {
constructor() {
super(...arguments);
this.type = ElementType.CDATA;
}
get nodeType() {
return 4;
}
};
var Document = class extends NodeWithChildren {
constructor() {
super(...arguments);
this.type = ElementType.Root;
}
get nodeType() {
return 9;
}
};
var Element = class extends NodeWithChildren {
constructor(name2, attribs, children2 = [], type = name2 === "script" ? ElementType.Script : name2 === "style" ? ElementType.Style : ElementType.Tag) {
super(children2);
this.name = name2;
this.attribs = attribs;
this.type = type;
}
get nodeType() {
return 1;
}
get tagName() {
return this.name;
}
set tagName(name2) {
this.name = name2;
}
get attributes() {
return Object.keys(this.attribs).map((name2) => {
var _a3, _b;
return {
name: name2,
value: this.attribs[name2],
namespace: (_a3 = this["x-attribsNamespace"]) === null || _a3 === void 0 ? void 0 : _a3[name2],
prefix: (_b = this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name2]
};
});
}
};
function isTag2(node) {
return isTag(node);
}
function isCDATA(node) {
return node.type === ElementType.CDATA;
}
function isText(node) {
return node.type === ElementType.Text;
}
function isComment(node) {
return node.type === ElementType.Comment;
}
function isDirective(node) {
return node.type === ElementType.Directive;
}
function isDocument(node) {
return node.type === ElementType.Root;
}
function hasChildren(node) {
return Object.prototype.hasOwnProperty.call(node, "children");
}
function cloneNode(node, recursive = false) {
let result;
if (isText(node)) {
result = new Text2(node.data);
} else if (isComment(node)) {
result = new Comment2(node.data);
} else if (isTag2(node)) {
const children2 = recursive ? cloneChildren(node.children) : [];
const clone4 = new Element(node.name, { ...node.attribs }, children2);
children2.forEach((child) => child.parent = clone4);
if (node.namespace != null) {
clone4.namespace = node.namespace;
}
if (node["x-attribsNamespace"]) {
clone4["x-attribsNamespace"] = { ...node["x-attribsNamespace"] };
}
if (node["x-attribsPrefix"]) {
clone4["x-attribsPrefix"] = { ...node["x-attribsPrefix"] };
}
result = clone4;
} else if (isCDATA(node)) {
const children2 = recursive ? cloneChildren(node.children) : [];
const clone4 = new CDATA2(children2);
children2.forEach((child) => child.parent = clone4);
result = clone4;
} else if (isDocument(node)) {
const children2 = recursive ? cloneChildren(node.children) : [];
const clone4 = new Document(children2);
children2.forEach((child) => child.parent = clone4);
if (node["x-mode"]) {
clone4["x-mode"] = node["x-mode"];
}
result = clone4;
} else if (isDirective(node)) {
const instruction = new ProcessingInstruction(node.name, node.data);
if (node["x-name"] != null) {
instruction["x-name"] = node["x-name"];
instruction["x-publicId"] = node["x-publicId"];
instruction["x-systemId"] = node["x-systemId"];
}
result = instruction;
} else {
throw new Error(`Not implemented yet: ${node.type}`);
}
result.startIndex = node.startIndex;
result.endIndex = node.endIndex;
if (node.sourceCodeLocation != null) {
result.sourceCodeLocation = node.sourceCodeLocation;
}
return result;
}
function cloneChildren(childs) {
const children2 = childs.map((child) => cloneNode(child, true));
for (let i = 1; i < children2.length; i++) {
children2[i].prev = children2[i - 1];
children2[i - 1].next = children2[i];
}
return children2;
}
// ../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/index.js
var defaultOpts2 = {
withStartIndices: false,
withEndIndices: false,
xmlMode: false
};
var DomHandler = class {
constructor(callback, options, elementCB) {
this.dom = [];
this.root = new Document(this.dom);
this.done = false;
this.tagStack = [this.root];
this.lastNode = null;
this.parser = null;
if (typeof options === "function") {
elementCB = options;
options = defaultOpts2;
}
if (typeof callback === "object") {
options = callback;
callback = void 0;
}
this.callback = callback !== null && callback !== void 0 ? callback : null;
this.options = options !== null && options !== void 0 ? options : defaultOpts2;
this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null;
}
onparserinit(parser) {
this.parser = parser;
}
onreset() {
this.dom = [];
this.root = new Document(this.dom);
this.done = false;
this.tagStack = [this.root];
this.lastNode = null;
this.parser = null;
}
onend() {
if (this.done)
return;
this.done = true;
this.parser = null;
this.handleCallback(null);
}
onerror(error2) {
this.handleCallback(error2);
}
onclosetag() {
this.lastNode = null;
const elem = this.tagStack.pop();
if (this.options.withEndIndices) {
elem.endIndex = this.parser.endIndex;
}
if (this.elementCB)
this.elementCB(elem);
}
onopentag(name2, attribs) {
const type = this.options.xmlMode ? ElementType.Tag : void 0;
const element = new Element(name2, attribs, void 0, type);
this.addNode(element);
this.tagStack.push(element);
}
ontext(data2) {
const { lastNode } = this;
if (lastNode && lastNode.type === ElementType.Text) {
lastNode.data += data2;
if (this.options.withEndIndices) {
lastNode.endIndex = this.parser.endIndex;
}
} else {
const node = new Text2(data2);
this.addNode(node);
this.lastNode = node;
}
}
oncomment(data2) {
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
this.lastNode.data += data2;
return;
}
const node = new Comment2(data2);
this.addNode(node);
this.lastNode = node;
}
oncommentend() {
this.lastNode = null;
}
oncdatastart() {
const text5 = new Text2("");
const node = new CDATA2([text5]);
this.addNode(node);
text5.parent = node;
this.lastNode = text5;
}
oncdataend() {
this.lastNode = null;
}
onprocessinginstruction(name2, data2) {
const node = new ProcessingInstruction(name2, data2);
this.addNode(node);
}
handleCallback(error2) {
if (typeof this.callback === "function") {
this.callback(error2, this.dom);
} else if (error2) {
throw error2;
}
}
addNode(node) {
const parent2 = this.tagStack[this.tagStack.length - 1];
const previousSibling = parent2.children[parent2.children.length - 1];
if (this.options.withStartIndices) {
node.startIndex = this.parser.startIndex;
}
if (this.options.withEndIndices) {
node.endIndex = this.parser.endIndex;
}
parent2.children.push(node);
if (previousSibling) {
node.prev = previousSibling;
previousSibling.next = node;
}
node.parent = parent2;
this.lastNode = null;
}
};
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-html.js
var decode_data_html_default = new Uint16Array(
'\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map((c) => c.charCodeAt(0))
);
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/decode-data-xml.js
var decode_data_xml_default = new Uint16Array(
"\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map((c) => c.charCodeAt(0))
);
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode_codepoint.js
var _a;
var decodeMap = /* @__PURE__ */ new Map([
[0, 65533],
[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]
]);
var fromCodePoint = (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {
let output = "";
if (codePoint > 65535) {
codePoint -= 65536;
output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
codePoint = 56320 | codePoint & 1023;
}
output += String.fromCharCode(codePoint);
return output;
};
function replaceCodePoint(codePoint) {
var _a3;
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
return 65533;
}
return (_a3 = decodeMap.get(codePoint)) !== null && _a3 !== void 0 ? _a3 : codePoint;
}
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/decode.js
var CharCodes;
(function(CharCodes4) {
CharCodes4[CharCodes4["NUM"] = 35] = "NUM";
CharCodes4[CharCodes4["SEMI"] = 59] = "SEMI";
CharCodes4[CharCodes4["EQUALS"] = 61] = "EQUALS";
CharCodes4[CharCodes4["ZERO"] = 48] = "ZERO";
CharCodes4[CharCodes4["NINE"] = 57] = "NINE";
CharCodes4[CharCodes4["LOWER_A"] = 97] = "LOWER_A";
CharCodes4[CharCodes4["LOWER_F"] = 102] = "LOWER_F";
CharCodes4[CharCodes4["LOWER_X"] = 120] = "LOWER_X";
CharCodes4[CharCodes4["LOWER_Z"] = 122] = "LOWER_Z";
CharCodes4[CharCodes4["UPPER_A"] = 65] = "UPPER_A";
CharCodes4[CharCodes4["UPPER_F"] = 70] = "UPPER_F";
CharCodes4[CharCodes4["UPPER_Z"] = 90] = "UPPER_Z";
})(CharCodes || (CharCodes = {}));
var TO_LOWER_BIT = 32;
var BinTrieFlags;
(function(BinTrieFlags3) {
BinTrieFlags3[BinTrieFlags3["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
BinTrieFlags3[BinTrieFlags3["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
BinTrieFlags3[BinTrieFlags3["JUMP_TABLE"] = 127] = "JUMP_TABLE";
})(BinTrieFlags || (BinTrieFlags = {}));
function isNumber2(code2) {
return code2 >= CharCodes.ZERO && code2 <= CharCodes.NINE;
}
function isHexadecimalCharacter(code2) {
return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_F || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_F;
}
function isAsciiAlphaNumeric(code2) {
return code2 >= CharCodes.UPPER_A && code2 <= CharCodes.UPPER_Z || code2 >= CharCodes.LOWER_A && code2 <= CharCodes.LOWER_Z || isNumber2(code2);
}
function isEntityInAttributeInvalidEnd(code2) {
return code2 === CharCodes.EQUALS || isAsciiAlphaNumeric(code2);
}
var EntityDecoderState;
(function(EntityDecoderState3) {
EntityDecoderState3[EntityDecoderState3["EntityStart"] = 0] = "EntityStart";
EntityDecoderState3[EntityDecoderState3["NumericStart"] = 1] = "NumericStart";
EntityDecoderState3[EntityDecoderState3["NumericDecimal"] = 2] = "NumericDecimal";
EntityDecoderState3[EntityDecoderState3["NumericHex"] = 3] = "NumericHex";
EntityDecoderState3[EntityDecoderState3["NamedEntity"] = 4] = "NamedEntity";
})(EntityDecoderState || (EntityDecoderState = {}));
var DecodingMode;
(function(DecodingMode3) {
DecodingMode3[DecodingMode3["Legacy"] = 0] = "Legacy";
DecodingMode3[DecodingMode3["Strict"] = 1] = "Strict";
DecodingMode3[DecodingMode3["Attribute"] = 2] = "Attribute";
})(DecodingMode || (DecodingMode = {}));
var EntityDecoder = class {
constructor(decodeTree, emitCodePoint, errors2) {
this.decodeTree = decodeTree;
this.emitCodePoint = emitCodePoint;
this.errors = errors2;
this.state = EntityDecoderState.EntityStart;
this.consumed = 1;
this.result = 0;
this.treeIndex = 0;
this.excess = 1;
this.decodeMode = DecodingMode.Strict;
}
startEntity(decodeMode) {
this.decodeMode = decodeMode;
this.state = EntityDecoderState.EntityStart;
this.result = 0;
this.treeIndex = 0;
this.excess = 1;
this.consumed = 1;
}
write(str, offset2) {
switch (this.state) {
case EntityDecoderState.EntityStart: {
if (str.charCodeAt(offset2) === CharCodes.NUM) {
this.state = EntityDecoderState.NumericStart;
this.consumed += 1;
return this.stateNumericStart(str, offset2 + 1);
}
this.state = EntityDecoderState.NamedEntity;
return this.stateNamedEntity(str, offset2);
}
case EntityDecoderState.NumericStart: {
return this.stateNumericStart(str, offset2);
}
case EntityDecoderState.NumericDecimal: {
return this.stateNumericDecimal(str, offset2);
}
case EntityDecoderState.NumericHex: {
return this.stateNumericHex(str, offset2);
}
case EntityDecoderState.NamedEntity: {
return this.stateNamedEntity(str, offset2);
}
}
}
stateNumericStart(str, offset2) {
if (offset2 >= str.length) {
return -1;
}
if ((str.charCodeAt(offset2) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
this.state = EntityDecoderState.NumericHex;
this.consumed += 1;
return this.stateNumericHex(str, offset2 + 1);
}
this.state = EntityDecoderState.NumericDecimal;
return this.stateNumericDecimal(str, offset2);
}
addToNumericResult(str, start, end2, base2) {
if (start !== end2) {
const digitCount = end2 - start;
this.result = this.result * Math.pow(base2, digitCount) + parseInt(str.substr(start, digitCount), base2);
this.consumed += digitCount;
}
}
stateNumericHex(str, offset2) {
const startIdx = offset2;
while (offset2 < str.length) {
const char = str.charCodeAt(offset2);
if (isNumber2(char) || isHexadecimalCharacter(char)) {
offset2 += 1;
} else {
this.addToNumericResult(str, startIdx, offset2, 16);
return this.emitNumericEntity(char, 3);
}
}
this.addToNumericResult(str, startIdx, offset2, 16);
return -1;
}
stateNumericDecimal(str, offset2) {
const startIdx = offset2;
while (offset2 < str.length) {
const char = str.charCodeAt(offset2);
if (isNumber2(char)) {
offset2 += 1;
} else {
this.addToNumericResult(str, startIdx, offset2, 10);
return this.emitNumericEntity(char, 2);
}
}
this.addToNumericResult(str, startIdx, offset2, 10);
return -1;
}
emitNumericEntity(lastCp, expectedLength) {
var _a3;
if (this.consumed <= expectedLength) {
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
return 0;
}
if (lastCp === CharCodes.SEMI) {
this.consumed += 1;
} else if (this.decodeMode === DecodingMode.Strict) {
return 0;
}
this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
if (this.errors) {
if (lastCp !== CharCodes.SEMI) {
this.errors.missingSemicolonAfterCharacterReference();
}
this.errors.validateNumericCharacterReference(this.result);
}
return this.consumed;
}
stateNamedEntity(str, offset2) {
const { decodeTree } = this;
let current = decodeTree[this.treeIndex];
let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
for (; offset2 < str.length; offset2++, this.excess++) {
const char = str.charCodeAt(offset2);
this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
if (this.treeIndex < 0) {
return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
}
current = decodeTree[this.treeIndex];
valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
if (valueLength !== 0) {
if (char === CharCodes.SEMI) {
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
}
if (this.decodeMode !== DecodingMode.Strict) {
this.result = this.treeIndex;
this.consumed += this.excess;
this.excess = 0;
}
}
}
return -1;
}
emitNotTerminatedNamedEntity() {
var _a3;
const { result, decodeTree } = this;
const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
this.emitNamedEntityData(result, valueLength, this.consumed);
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.missingSemicolonAfterCharacterReference();
return this.consumed;
}
emitNamedEntityData(result, valueLength, consumed) {
const { decodeTree } = this;
this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed);
if (valueLength === 3) {
this.emitCodePoint(decodeTree[result + 2], consumed);
}
return consumed;
}
end() {
var _a3;
switch (this.state) {
case EntityDecoderState.NamedEntity: {
return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
}
case EntityDecoderState.NumericDecimal: {
return this.emitNumericEntity(0, 2);
}
case EntityDecoderState.NumericHex: {
return this.emitNumericEntity(0, 3);
}
case EntityDecoderState.NumericStart: {
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
return 0;
}
case EntityDecoderState.EntityStart: {
return 0;
}
}
}
};
function getDecoder(decodeTree) {
let ret = "";
const decoder = new EntityDecoder(decodeTree, (str) => ret += fromCodePoint(str));
return function decodeWithTrie(str, decodeMode) {
let lastIndex = 0;
let offset2 = 0;
while ((offset2 = str.indexOf("&", offset2)) >= 0) {
ret += str.slice(lastIndex, offset2);
decoder.startEntity(decodeMode);
const len = decoder.write(
str,
offset2 + 1
);
if (len < 0) {
lastIndex = offset2 + decoder.end();
break;
}
lastIndex = offset2 + len;
offset2 = len === 0 ? lastIndex + 1 : lastIndex;
}
const result = ret + str.slice(lastIndex);
ret = "";
return result;
};
}
function determineBranch(decodeTree, current, nodeIdx, char) {
const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
if (branchCount === 0) {
return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;
}
if (jumpOffset) {
const value = char - jumpOffset;
return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1;
}
let lo = nodeIdx;
let hi = lo + branchCount - 1;
while (lo <= hi) {
const mid = lo + hi >>> 1;
const midVal = decodeTree[mid];
if (midVal < char) {
lo = mid + 1;
} else if (midVal > char) {
hi = mid - 1;
} else {
return decodeTree[mid + branchCount];
}
}
return -1;
}
var htmlDecoder = getDecoder(decode_data_html_default);
var xmlDecoder = getDecoder(decode_data_xml_default);
function decodeHTML(str, mode = DecodingMode.Legacy) {
return htmlDecoder(str, mode);
}
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/generated/encode-html.js
function restoreDiff(arr) {
for (let i = 1; i < arr.length; i++) {
arr[i][0] += arr[i - 1][0] + 1;
}
return arr;
}
var encode_html_default = new Map(/* @__PURE__ */ restoreDiff([[9, "	"], [0, "
"], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, ""], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, ""], [0, ""], [0, ""], [0, ""], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map(/* @__PURE__ */ restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "〈"], [0, "〉"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map(/* @__PURE__ */ restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]]));
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/escape.js
var xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
var xmlCodeMap = /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[39, "'"],
[60, "<"],
[62, ">"]
]);
var getCodePoint = String.prototype.codePointAt != null ? (str, index2) => str.codePointAt(index2) : (c, index2) => (c.charCodeAt(index2) & 64512) === 55296 ? (c.charCodeAt(index2) - 55296) * 1024 + c.charCodeAt(index2 + 1) - 56320 + 65536 : c.charCodeAt(index2);
function encodeXML(str) {
let ret = "";
let lastIdx = 0;
let match3;
while ((match3 = xmlReplacer.exec(str)) !== null) {
const i = match3.index;
const char = str.charCodeAt(i);
const next2 = xmlCodeMap.get(char);
if (next2 !== void 0) {
ret += str.substring(lastIdx, i) + next2;
lastIdx = i + 1;
} else {
ret += `${str.substring(lastIdx, i)}${getCodePoint(str, i).toString(16)};`;
lastIdx = xmlReplacer.lastIndex += Number((char & 64512) === 55296);
}
}
return ret + str.substr(lastIdx);
}
function getEscaper(regex, map4) {
return function escape3(data2) {
let match3;
let lastIdx = 0;
let result = "";
while (match3 = regex.exec(data2)) {
if (lastIdx !== match3.index) {
result += data2.substring(lastIdx, match3.index);
}
result += map4.get(match3[0].charCodeAt(0));
lastIdx = match3.index + 1;
}
return result + data2.substring(lastIdx);
};
}
var escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
var escapeAttribute = getEscaper(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[160, " "]
]));
var escapeText = getEscaper(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&"],
[60, "<"],
[62, ">"],
[160, " "]
]));
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/index.js
var EntityLevel;
(function(EntityLevel2) {
EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
})(EntityLevel || (EntityLevel = {}));
var EncodingMode;
(function(EncodingMode2) {
EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
})(EncodingMode || (EncodingMode = {}));
// ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/foreignNames.js
var elementNames = 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((val2) => [val2.toLowerCase(), val2]));
var attributeNames = 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((val2) => [val2.toLowerCase(), val2]));
// ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.js
var unencodedElements = /* @__PURE__ */ new Set([
"style",
"script",
"xmp",
"iframe",
"noembed",
"noframes",
"plaintext",
"noscript"
]);
function replaceQuotes(value) {
return value.replace(/"/g, """);
}
function formatAttributes(attributes2, opts) {
var _a3;
if (!attributes2)
return;
const encode3 = ((_a3 = opts.encodeEntities) !== null && _a3 !== void 0 ? _a3 : opts.decodeEntities) === false ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute;
return Object.keys(attributes2).map((key) => {
var _a4, _b;
const value = (_a4 = attributes2[key]) !== null && _a4 !== void 0 ? _a4 : "";
if (opts.xmlMode === "foreign") {
key = (_b = attributeNames.get(key)) !== null && _b !== void 0 ? _b : key;
}
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
return key;
}
return `${key}="${encode3(value)}"`;
}).join(" ");
}
var singleTag = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]);
function render(node, options = {}) {
const nodes = "length" in node ? node : [node];
let output = "";
for (let i = 0; i < nodes.length; i++) {
output += renderNode(nodes[i], options);
}
return output;
}
var esm_default = render;
function renderNode(node, options) {
switch (node.type) {
case Root:
return render(node.children, options);
case Doctype:
case Directive:
return renderDirective(node);
case Comment:
return renderComment(node);
case CDATA:
return renderCdata(node);
case Script:
case Style:
case Tag:
return renderTag(node, options);
case Text:
return renderText(node, options);
}
}
var foreignModeIntegrationPoints = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignObject",
"desc",
"title"
]);
var foreignElements = /* @__PURE__ */ new Set(["svg", "math"]);
function renderTag(elem, opts) {
var _a3;
if (opts.xmlMode === "foreign") {
elem.name = (_a3 = elementNames.get(elem.name)) !== null && _a3 !== void 0 ? _a3 : elem.name;
if (elem.parent && foreignModeIntegrationPoints.has(elem.parent.name)) {
opts = { ...opts, xmlMode: false };
}
}
if (!opts.xmlMode && foreignElements.has(elem.name)) {
opts = { ...opts, xmlMode: "foreign" };
}
let tag = `<${elem.name}`;
const attribs = formatAttributes(elem.attribs, opts);
if (attribs) {
tag += ` ${attribs}`;
}
if (elem.children.length === 0 && (opts.xmlMode ? opts.selfClosingTags !== false : opts.selfClosingTags && singleTag.has(elem.name))) {
if (!opts.xmlMode)
tag += " ";
tag += "/>";
} else {
tag += ">";
if (elem.children.length > 0) {
tag += render(elem.children, opts);
}
if (opts.xmlMode || !singleTag.has(elem.name)) {
tag += `${elem.name}>`;
}
}
return tag;
}
function renderDirective(elem) {
return `<${elem.data}>`;
}
function renderText(elem, opts) {
var _a3;
let data2 = elem.data || "";
if (((_a3 = opts.encodeEntities) !== null && _a3 !== void 0 ? _a3 : opts.decodeEntities) !== false && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name))) {
data2 = opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML(data2) : escapeText(data2);
}
return data2;
}
function renderCdata(elem) {
return ``;
}
function renderComment(elem) {
return ``;
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/stringify.js
function getOuterHTML(node, options) {
return esm_default(node, options);
}
function getInnerHTML(node, options) {
return hasChildren(node) ? node.children.map((node2) => getOuterHTML(node2, options)).join("") : "";
}
function getText(node) {
if (Array.isArray(node))
return node.map(getText).join("");
if (isTag2(node))
return node.name === "br" ? "\n" : getText(node.children);
if (isCDATA(node))
return getText(node.children);
if (isText(node))
return node.data;
return "";
}
function textContent(node) {
if (Array.isArray(node))
return node.map(textContent).join("");
if (hasChildren(node) && !isComment(node)) {
return textContent(node.children);
}
if (isText(node))
return node.data;
return "";
}
function innerText(node) {
if (Array.isArray(node))
return node.map(innerText).join("");
if (hasChildren(node) && (node.type === ElementType.Tag || isCDATA(node))) {
return innerText(node.children);
}
if (isText(node))
return node.data;
return "";
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/traversal.js
function getChildren(elem) {
return hasChildren(elem) ? elem.children : [];
}
function getParent(elem) {
return elem.parent || null;
}
function getSiblings(elem) {
const parent2 = getParent(elem);
if (parent2 != null)
return getChildren(parent2);
const siblings2 = [elem];
let { prev: prev2, next: next2 } = elem;
while (prev2 != null) {
siblings2.unshift(prev2);
({ prev: prev2 } = prev2);
}
while (next2 != null) {
siblings2.push(next2);
({ next: next2 } = next2);
}
return siblings2;
}
function getAttributeValue(elem, name2) {
var _a3;
return (_a3 = elem.attribs) === null || _a3 === void 0 ? void 0 : _a3[name2];
}
function hasAttrib(elem, name2) {
return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name2) && elem.attribs[name2] != null;
}
function getName(elem) {
return elem.name;
}
function nextElementSibling(elem) {
let { next: next2 } = elem;
while (next2 !== null && !isTag2(next2))
({ next: next2 } = next2);
return next2;
}
function prevElementSibling(elem) {
let { prev: prev2 } = elem;
while (prev2 !== null && !isTag2(prev2))
({ prev: prev2 } = prev2);
return prev2;
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/manipulation.js
function removeElement(elem) {
if (elem.prev)
elem.prev.next = elem.next;
if (elem.next)
elem.next.prev = elem.prev;
if (elem.parent) {
const childs = elem.parent.children;
const childsIndex = childs.lastIndexOf(elem);
if (childsIndex >= 0) {
childs.splice(childsIndex, 1);
}
}
elem.next = null;
elem.prev = null;
elem.parent = null;
}
function replaceElement(elem, replacement) {
const prev2 = replacement.prev = elem.prev;
if (prev2) {
prev2.next = replacement;
}
const next2 = replacement.next = elem.next;
if (next2) {
next2.prev = replacement;
}
const parent2 = replacement.parent = elem.parent;
if (parent2) {
const childs = parent2.children;
childs[childs.lastIndexOf(elem)] = replacement;
elem.parent = null;
}
}
function appendChild(parent2, child) {
removeElement(child);
child.next = null;
child.parent = parent2;
if (parent2.children.push(child) > 1) {
const sibling = parent2.children[parent2.children.length - 2];
sibling.next = child;
child.prev = sibling;
} else {
child.prev = null;
}
}
function append(elem, next2) {
removeElement(next2);
const { parent: parent2 } = elem;
const currNext = elem.next;
next2.next = currNext;
next2.prev = elem;
elem.next = next2;
next2.parent = parent2;
if (currNext) {
currNext.prev = next2;
if (parent2) {
const childs = parent2.children;
childs.splice(childs.lastIndexOf(currNext), 0, next2);
}
} else if (parent2) {
parent2.children.push(next2);
}
}
function prependChild(parent2, child) {
removeElement(child);
child.parent = parent2;
child.prev = null;
if (parent2.children.unshift(child) !== 1) {
const sibling = parent2.children[1];
sibling.prev = child;
child.next = sibling;
} else {
child.next = null;
}
}
function prepend(elem, prev2) {
removeElement(prev2);
const { parent: parent2 } = elem;
if (parent2) {
const childs = parent2.children;
childs.splice(childs.indexOf(elem), 0, prev2);
}
if (elem.prev) {
elem.prev.next = prev2;
}
prev2.parent = parent2;
prev2.prev = elem.prev;
prev2.next = elem;
elem.prev = prev2;
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/querying.js
function filter(test2, node, recurse = true, limit = Infinity) {
return find(test2, Array.isArray(node) ? node : [node], recurse, limit);
}
function find(test2, nodes, recurse, limit) {
const result = [];
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
const indexStack = [0];
for (; ; ) {
if (indexStack[0] >= nodeStack[0].length) {
if (indexStack.length === 1) {
return result;
}
nodeStack.shift();
indexStack.shift();
continue;
}
const elem = nodeStack[0][indexStack[0]++];
if (test2(elem)) {
result.push(elem);
if (--limit <= 0)
return result;
}
if (recurse && hasChildren(elem) && elem.children.length > 0) {
indexStack.unshift(0);
nodeStack.unshift(elem.children);
}
}
}
function findOneChild(test2, nodes) {
return nodes.find(test2);
}
function findOne(test2, nodes, recurse = true) {
const searchedNodes = Array.isArray(nodes) ? nodes : [nodes];
for (let i = 0; i < searchedNodes.length; i++) {
const node = searchedNodes[i];
if (isTag2(node) && test2(node)) {
return node;
}
if (recurse && hasChildren(node) && node.children.length > 0) {
const found = findOne(test2, node.children, true);
if (found)
return found;
}
}
return null;
}
function existsOne(test2, nodes) {
return (Array.isArray(nodes) ? nodes : [nodes]).some((node) => isTag2(node) && test2(node) || hasChildren(node) && existsOne(test2, node.children));
}
function findAll(test2, nodes) {
const result = [];
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
const indexStack = [0];
for (; ; ) {
if (indexStack[0] >= nodeStack[0].length) {
if (nodeStack.length === 1) {
return result;
}
nodeStack.shift();
indexStack.shift();
continue;
}
const elem = nodeStack[0][indexStack[0]++];
if (isTag2(elem) && test2(elem))
result.push(elem);
if (hasChildren(elem) && elem.children.length > 0) {
indexStack.unshift(0);
nodeStack.unshift(elem.children);
}
}
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/legacy.js
var Checks = {
tag_name(name2) {
if (typeof name2 === "function") {
return (elem) => isTag2(elem) && name2(elem.name);
} else if (name2 === "*") {
return isTag2;
}
return (elem) => isTag2(elem) && elem.name === name2;
},
tag_type(type) {
if (typeof type === "function") {
return (elem) => type(elem.type);
}
return (elem) => elem.type === type;
},
tag_contains(data2) {
if (typeof data2 === "function") {
return (elem) => isText(elem) && data2(elem.data);
}
return (elem) => isText(elem) && elem.data === data2;
}
};
function getAttribCheck(attrib, value) {
if (typeof value === "function") {
return (elem) => isTag2(elem) && value(elem.attribs[attrib]);
}
return (elem) => isTag2(elem) && elem.attribs[attrib] === value;
}
function combineFuncs(a, b) {
return (elem) => a(elem) || b(elem);
}
function compileTest(options) {
const funcs = Object.keys(options).map((key) => {
const value = options[key];
return Object.prototype.hasOwnProperty.call(Checks, key) ? Checks[key](value) : getAttribCheck(key, value);
});
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
}
function testElement(options, node) {
const test2 = compileTest(options);
return test2 ? test2(node) : true;
}
function getElements(options, nodes, recurse, limit = Infinity) {
const test2 = compileTest(options);
return test2 ? filter(test2, nodes, recurse, limit) : [];
}
function getElementById(id, nodes, recurse = true) {
if (!Array.isArray(nodes))
nodes = [nodes];
return findOne(getAttribCheck("id", id), nodes, recurse);
}
function getElementsByTagName(tagName, nodes, recurse = true, limit = Infinity) {
return filter(Checks["tag_name"](tagName), nodes, recurse, limit);
}
function getElementsByClassName(className, nodes, recurse = true, limit = Infinity) {
return filter(getAttribCheck("class", className), nodes, recurse, limit);
}
function getElementsByTagType(type, nodes, recurse = true, limit = Infinity) {
return filter(Checks["tag_type"](type), nodes, recurse, limit);
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/helpers.js
function removeSubsets(nodes) {
let idx = nodes.length;
while (--idx >= 0) {
const node = nodes[idx];
if (idx > 0 && nodes.lastIndexOf(node, idx - 1) >= 0) {
nodes.splice(idx, 1);
continue;
}
for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
if (nodes.includes(ancestor)) {
nodes.splice(idx, 1);
break;
}
}
}
return nodes;
}
var DocumentPosition;
(function(DocumentPosition2) {
DocumentPosition2[DocumentPosition2["DISCONNECTED"] = 1] = "DISCONNECTED";
DocumentPosition2[DocumentPosition2["PRECEDING"] = 2] = "PRECEDING";
DocumentPosition2[DocumentPosition2["FOLLOWING"] = 4] = "FOLLOWING";
DocumentPosition2[DocumentPosition2["CONTAINS"] = 8] = "CONTAINS";
DocumentPosition2[DocumentPosition2["CONTAINED_BY"] = 16] = "CONTAINED_BY";
})(DocumentPosition || (DocumentPosition = {}));
function compareDocumentPosition(nodeA, nodeB) {
const aParents = [];
const bParents = [];
if (nodeA === nodeB) {
return 0;
}
let current = hasChildren(nodeA) ? nodeA : nodeA.parent;
while (current) {
aParents.unshift(current);
current = current.parent;
}
current = hasChildren(nodeB) ? nodeB : nodeB.parent;
while (current) {
bParents.unshift(current);
current = current.parent;
}
const maxIdx = Math.min(aParents.length, bParents.length);
let idx = 0;
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
idx++;
}
if (idx === 0) {
return DocumentPosition.DISCONNECTED;
}
const sharedParent = aParents[idx - 1];
const siblings2 = sharedParent.children;
const aSibling = aParents[idx];
const bSibling = bParents[idx];
if (siblings2.indexOf(aSibling) > siblings2.indexOf(bSibling)) {
if (sharedParent === nodeB) {
return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;
}
return DocumentPosition.FOLLOWING;
}
if (sharedParent === nodeA) {
return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;
}
return DocumentPosition.PRECEDING;
}
function uniqueSort(nodes) {
nodes = nodes.filter((node, i, arr) => !arr.includes(node, i + 1));
nodes.sort((a, b) => {
const relative = compareDocumentPosition(a, b);
if (relative & DocumentPosition.PRECEDING) {
return -1;
} else if (relative & DocumentPosition.FOLLOWING) {
return 1;
}
return 0;
});
return nodes;
}
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/feeds.js
function getFeed(doc) {
const feedRoot = getOneElement(isValidFeed, doc);
return !feedRoot ? null : feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot);
}
function getAtomFeed(feedRoot) {
var _a3;
const childs = feedRoot.children;
const feed = {
type: "atom",
items: getElementsByTagName("entry", childs).map((item) => {
var _a4;
const { children: children2 } = item;
const entry = { media: getMediaElements(children2) };
addConditionally(entry, "id", "id", children2);
addConditionally(entry, "title", "title", children2);
const href2 = (_a4 = getOneElement("link", children2)) === null || _a4 === void 0 ? void 0 : _a4.attribs["href"];
if (href2) {
entry.link = href2;
}
const description = fetch2("summary", children2) || fetch2("content", children2);
if (description) {
entry.description = description;
}
const pubDate = fetch2("updated", children2);
if (pubDate) {
entry.pubDate = new Date(pubDate);
}
return entry;
})
};
addConditionally(feed, "id", "id", childs);
addConditionally(feed, "title", "title", childs);
const href = (_a3 = getOneElement("link", childs)) === null || _a3 === void 0 ? void 0 : _a3.attribs["href"];
if (href) {
feed.link = href;
}
addConditionally(feed, "description", "subtitle", childs);
const updated = fetch2("updated", childs);
if (updated) {
feed.updated = new Date(updated);
}
addConditionally(feed, "author", "email", childs, true);
return feed;
}
function getRssFeed(feedRoot) {
var _a3, _b;
const childs = (_b = (_a3 = getOneElement("channel", feedRoot.children)) === null || _a3 === void 0 ? void 0 : _a3.children) !== null && _b !== void 0 ? _b : [];
const feed = {
type: feedRoot.name.substr(0, 3),
id: "",
items: getElementsByTagName("item", feedRoot.children).map((item) => {
const { children: children2 } = item;
const entry = { media: getMediaElements(children2) };
addConditionally(entry, "id", "guid", children2);
addConditionally(entry, "title", "title", children2);
addConditionally(entry, "link", "link", children2);
addConditionally(entry, "description", "description", children2);
const pubDate = fetch2("pubDate", children2) || fetch2("dc:date", children2);
if (pubDate)
entry.pubDate = new Date(pubDate);
return entry;
})
};
addConditionally(feed, "title", "title", childs);
addConditionally(feed, "link", "link", childs);
addConditionally(feed, "description", "description", childs);
const updated = fetch2("lastBuildDate", childs);
if (updated) {
feed.updated = new Date(updated);
}
addConditionally(feed, "author", "managingEditor", childs, true);
return feed;
}
var MEDIA_KEYS_STRING = ["url", "type", "lang"];
var MEDIA_KEYS_INT = [
"fileSize",
"bitrate",
"framerate",
"samplingrate",
"channels",
"duration",
"height",
"width"
];
function getMediaElements(where) {
return getElementsByTagName("media:content", where).map((elem) => {
const { attribs } = elem;
const media = {
medium: attribs["medium"],
isDefault: !!attribs["isDefault"]
};
for (const attrib of MEDIA_KEYS_STRING) {
if (attribs[attrib]) {
media[attrib] = attribs[attrib];
}
}
for (const attrib of MEDIA_KEYS_INT) {
if (attribs[attrib]) {
media[attrib] = parseInt(attribs[attrib], 10);
}
}
if (attribs["expression"]) {
media.expression = attribs["expression"];
}
return media;
});
}
function getOneElement(tagName, node) {
return getElementsByTagName(tagName, node, true, 1)[0];
}
function fetch2(tagName, where, recurse = false) {
return textContent(getElementsByTagName(tagName, where, recurse, 1)).trim();
}
function addConditionally(obj, prop2, tagName, where, recurse = false) {
const val2 = fetch2(tagName, where, recurse);
if (val2)
obj[prop2] = val2;
}
function isValidFeed(value) {
return value === "rss" || value === "feed" || value === "rdf:RDF";
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/static.js
function render2(that, dom, options) {
if (!that)
return "";
return that(dom !== null && dom !== void 0 ? dom : that._root.children, null, void 0, options).toString();
}
function isOptions(dom, options) {
return !options && typeof dom === "object" && dom != null && !("length" in dom) && !("type" in dom);
}
function html2(dom, options) {
const toRender = isOptions(dom) ? (options = dom, void 0) : dom;
const opts = {
...options_default,
...this === null || this === void 0 ? void 0 : this._options,
...flatten2(options !== null && options !== void 0 ? options : {})
};
return render2(this, toRender, opts);
}
function xml2(dom) {
const options = { ...this._options, xmlMode: true };
return render2(this, dom, options);
}
function text2(elements) {
const elems = elements ? elements : this ? this.root() : [];
let ret = "";
for (let i = 0; i < elems.length; i++) {
ret += textContent(elems[i]);
}
return ret;
}
function parseHTML(data2, context, keepScripts = typeof context === "boolean" ? context : false) {
if (!data2 || typeof data2 !== "string") {
return null;
}
if (typeof context === "boolean") {
keepScripts = context;
}
const parsed = this.load(data2, options_default, false);
if (!keepScripts) {
parsed("script").remove();
}
return parsed.root()[0].children.slice();
}
function root() {
return this(this._root);
}
function contains(container, contained) {
if (contained === container) {
return false;
}
let next2 = contained;
while (next2 && next2 !== next2.parent) {
next2 = next2.parent;
if (next2 === container) {
return true;
}
}
return false;
}
function merge(arr1, arr2) {
if (!isArrayLike(arr1) || !isArrayLike(arr2)) {
return;
}
let newLength = arr1.length;
const len = +arr2.length;
for (let i = 0; i < len; i++) {
arr1[newLength++] = arr2[i];
}
arr1.length = newLength;
return arr1;
}
function isArrayLike(item) {
if (Array.isArray(item)) {
return true;
}
if (typeof item !== "object" || !Object.prototype.hasOwnProperty.call(item, "length") || typeof item.length !== "number" || item.length < 0) {
return false;
}
for (let i = 0; i < item.length; i++) {
if (!(i in item)) {
return false;
}
}
return true;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/attributes.js
var attributes_exports = {};
__export(attributes_exports, {
addClass: () => addClass,
attr: () => attr,
data: () => data,
hasClass: () => hasClass,
prop: () => prop,
removeAttr: () => removeAttr,
removeClass: () => removeClass,
toggleClass: () => toggleClass,
val: () => val
});
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/utils.js
function isCheerio(maybeCheerio) {
return maybeCheerio.cheerio != null;
}
function camelCase(str) {
return str.replace(/[_.-](\w|$)/g, (_, x) => x.toUpperCase());
}
function cssCase(str) {
return str.replace(/[A-Z]/g, "-$&").toLowerCase();
}
function domEach(array, fn) {
const len = array.length;
for (let i = 0; i < len; i++)
fn(array[i], i);
return array;
}
function cloneDom(dom) {
const clone4 = "length" in dom ? Array.prototype.map.call(dom, (el) => cloneNode(el, true)) : [cloneNode(dom, true)];
const root3 = new Document(clone4);
clone4.forEach((node) => {
node.parent = root3;
});
return clone4;
}
var CharacterCodes;
(function(CharacterCodes2) {
CharacterCodes2[CharacterCodes2["LowerA"] = 97] = "LowerA";
CharacterCodes2[CharacterCodes2["LowerZ"] = 122] = "LowerZ";
CharacterCodes2[CharacterCodes2["UpperA"] = 65] = "UpperA";
CharacterCodes2[CharacterCodes2["UpperZ"] = 90] = "UpperZ";
CharacterCodes2[CharacterCodes2["Exclamation"] = 33] = "Exclamation";
})(CharacterCodes || (CharacterCodes = {}));
function isHtml(str) {
const tagStart = str.indexOf("<");
if (tagStart < 0 || tagStart > str.length - 3)
return false;
const tagChar = str.charCodeAt(tagStart + 1);
return (tagChar >= CharacterCodes.LowerA && tagChar <= CharacterCodes.LowerZ || tagChar >= CharacterCodes.UpperA && tagChar <= CharacterCodes.UpperZ || tagChar === CharacterCodes.Exclamation) && str.includes(">", tagStart + 2);
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/attributes.js
var hasOwn = Object.prototype.hasOwnProperty;
var rspace = /\s+/;
var dataAttrPrefix = "data-";
var primitives = {
null: null,
true: true,
false: false
};
var rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i;
var rbrace = /^{[^]*}$|^\[[^]*]$/;
function getAttr(elem, name2, xmlMode) {
var _a3;
if (!elem || !isTag2(elem))
return void 0;
(_a3 = elem.attribs) !== null && _a3 !== void 0 ? _a3 : elem.attribs = {};
if (!name2) {
return elem.attribs;
}
if (hasOwn.call(elem.attribs, name2)) {
return !xmlMode && rboolean.test(name2) ? name2 : elem.attribs[name2];
}
if (elem.name === "option" && name2 === "value") {
return text2(elem.children);
}
if (elem.name === "input" && (elem.attribs["type"] === "radio" || elem.attribs["type"] === "checkbox") && name2 === "value") {
return "on";
}
return void 0;
}
function setAttr(el, name2, value) {
if (value === null) {
removeAttribute(el, name2);
} else {
el.attribs[name2] = `${value}`;
}
}
function attr(name2, value) {
if (typeof name2 === "object" || value !== void 0) {
if (typeof value === "function") {
if (typeof name2 !== "string") {
{
throw new Error("Bad combination of arguments.");
}
}
return domEach(this, (el, i) => {
if (isTag2(el))
setAttr(el, name2, value.call(el, i, el.attribs[name2]));
});
}
return domEach(this, (el) => {
if (!isTag2(el))
return;
if (typeof name2 === "object") {
Object.keys(name2).forEach((objName) => {
const objValue = name2[objName];
setAttr(el, objName, objValue);
});
} else {
setAttr(el, name2, value);
}
});
}
return arguments.length > 1 ? this : getAttr(this[0], name2, this.options.xmlMode);
}
function getProp(el, name2, xmlMode) {
return name2 in el ? el[name2] : !xmlMode && rboolean.test(name2) ? getAttr(el, name2, false) !== void 0 : getAttr(el, name2, xmlMode);
}
function setProp(el, name2, value, xmlMode) {
if (name2 in el) {
el[name2] = value;
} else {
setAttr(el, name2, !xmlMode && rboolean.test(name2) ? value ? "" : null : `${value}`);
}
}
function prop(name2, value) {
var _a3;
if (typeof name2 === "string" && value === void 0) {
const el = this[0];
if (!el || !isTag2(el))
return void 0;
switch (name2) {
case "style": {
const property = this.css();
const keys = Object.keys(property);
keys.forEach((p, i) => {
property[i] = p;
});
property.length = keys.length;
return property;
}
case "tagName":
case "nodeName": {
return el.name.toUpperCase();
}
case "href":
case "src": {
const prop2 = (_a3 = el.attribs) === null || _a3 === void 0 ? void 0 : _a3[name2];
if (typeof URL !== "undefined" && (name2 === "href" && (el.tagName === "a" || el.name === "link") || name2 === "src" && (el.tagName === "img" || el.tagName === "iframe" || el.tagName === "audio" || el.tagName === "video" || el.tagName === "source")) && prop2 !== void 0 && this.options.baseURI) {
return new URL(prop2, this.options.baseURI).href;
}
return prop2;
}
case "innerText": {
return innerText(el);
}
case "textContent": {
return textContent(el);
}
case "outerHTML":
return this.clone().wrap("").parent().html();
case "innerHTML":
return this.html();
default:
return getProp(el, name2, this.options.xmlMode);
}
}
if (typeof name2 === "object" || value !== void 0) {
if (typeof value === "function") {
if (typeof name2 === "object") {
throw new Error("Bad combination of arguments.");
}
return domEach(this, (el, i) => {
if (isTag2(el)) {
setProp(el, name2, value.call(el, i, getProp(el, name2, this.options.xmlMode)), this.options.xmlMode);
}
});
}
return domEach(this, (el) => {
if (!isTag2(el))
return;
if (typeof name2 === "object") {
Object.keys(name2).forEach((key) => {
const val2 = name2[key];
setProp(el, key, val2, this.options.xmlMode);
});
} else {
setProp(el, name2, value, this.options.xmlMode);
}
});
}
return void 0;
}
function setData(el, name2, value) {
var _a3;
const elem = el;
(_a3 = elem.data) !== null && _a3 !== void 0 ? _a3 : elem.data = {};
if (typeof name2 === "object")
Object.assign(elem.data, name2);
else if (typeof name2 === "string" && value !== void 0) {
elem.data[name2] = value;
}
}
function readData(el, name2) {
let domNames;
let jsNames;
let value;
if (name2 == null) {
domNames = Object.keys(el.attribs).filter((attrName) => attrName.startsWith(dataAttrPrefix));
jsNames = domNames.map((domName) => camelCase(domName.slice(dataAttrPrefix.length)));
} else {
domNames = [dataAttrPrefix + cssCase(name2)];
jsNames = [name2];
}
for (let idx = 0; idx < domNames.length; ++idx) {
const domName = domNames[idx];
const jsName = jsNames[idx];
if (hasOwn.call(el.attribs, domName) && !hasOwn.call(el.data, jsName)) {
value = el.attribs[domName];
if (hasOwn.call(primitives, value)) {
value = primitives[value];
} else if (value === String(Number(value))) {
value = Number(value);
} else if (rbrace.test(value)) {
try {
value = JSON.parse(value);
} catch (e) {
}
}
el.data[jsName] = value;
}
}
return name2 == null ? el.data : value;
}
function data(name2, value) {
var _a3;
const elem = this[0];
if (!elem || !isTag2(elem))
return;
const dataEl = elem;
(_a3 = dataEl.data) !== null && _a3 !== void 0 ? _a3 : dataEl.data = {};
if (!name2) {
return readData(dataEl);
}
if (typeof name2 === "object" || value !== void 0) {
domEach(this, (el) => {
if (isTag2(el)) {
if (typeof name2 === "object")
setData(el, name2);
else
setData(el, name2, value);
}
});
return this;
}
if (hasOwn.call(dataEl.data, name2)) {
return dataEl.data[name2];
}
return readData(dataEl, name2);
}
function val(value) {
const querying = arguments.length === 0;
const element = this[0];
if (!element || !isTag2(element))
return querying ? void 0 : this;
switch (element.name) {
case "textarea":
return this.text(value);
case "select": {
const option = this.find("option:selected");
if (!querying) {
if (this.attr("multiple") == null && typeof value === "object") {
return this;
}
this.find("option").removeAttr("selected");
const values = typeof value !== "object" ? [value] : value;
for (let i = 0; i < values.length; i++) {
this.find(`option[value="${values[i]}"]`).attr("selected", "");
}
return this;
}
return this.attr("multiple") ? option.toArray().map((el) => text2(el.children)) : option.attr("value");
}
case "input":
case "option":
return querying ? this.attr("value") : this.attr("value", value);
}
return void 0;
}
function removeAttribute(elem, name2) {
if (!elem.attribs || !hasOwn.call(elem.attribs, name2))
return;
delete elem.attribs[name2];
}
function splitNames(names) {
return names ? names.trim().split(rspace) : [];
}
function removeAttr(name2) {
const attrNames = splitNames(name2);
for (let i = 0; i < attrNames.length; i++) {
domEach(this, (elem) => {
if (isTag2(elem))
removeAttribute(elem, attrNames[i]);
});
}
return this;
}
function hasClass(className) {
return this.toArray().some((elem) => {
const clazz = isTag2(elem) && elem.attribs["class"];
let idx = -1;
if (clazz && className.length) {
while ((idx = clazz.indexOf(className, idx + 1)) > -1) {
const end2 = idx + className.length;
if ((idx === 0 || rspace.test(clazz[idx - 1])) && (end2 === clazz.length || rspace.test(clazz[end2]))) {
return true;
}
}
}
return false;
});
}
function addClass(value) {
if (typeof value === "function") {
return domEach(this, (el, i) => {
if (isTag2(el)) {
const className = el.attribs["class"] || "";
addClass.call([el], value.call(el, i, className));
}
});
}
if (!value || typeof value !== "string")
return this;
const classNames = value.split(rspace);
const numElements = this.length;
for (let i = 0; i < numElements; i++) {
const el = this[i];
if (!isTag2(el))
continue;
const className = getAttr(el, "class", false);
if (!className) {
setAttr(el, "class", classNames.join(" ").trim());
} else {
let setClass = ` ${className} `;
for (let j = 0; j < classNames.length; j++) {
const appendClass = `${classNames[j]} `;
if (!setClass.includes(` ${appendClass}`))
setClass += appendClass;
}
setAttr(el, "class", setClass.trim());
}
}
return this;
}
function removeClass(name2) {
if (typeof name2 === "function") {
return domEach(this, (el, i) => {
if (isTag2(el)) {
removeClass.call([el], name2.call(el, i, el.attribs["class"] || ""));
}
});
}
const classes = splitNames(name2);
const numClasses = classes.length;
const removeAll = arguments.length === 0;
return domEach(this, (el) => {
if (!isTag2(el))
return;
if (removeAll) {
el.attribs["class"] = "";
} else {
const elClasses = splitNames(el.attribs["class"]);
let changed = false;
for (let j = 0; j < numClasses; j++) {
const index2 = elClasses.indexOf(classes[j]);
if (index2 >= 0) {
elClasses.splice(index2, 1);
changed = true;
j--;
}
}
if (changed) {
el.attribs["class"] = elClasses.join(" ");
}
}
});
}
function toggleClass(value, stateVal) {
if (typeof value === "function") {
return domEach(this, (el, i) => {
if (isTag2(el)) {
toggleClass.call([el], value.call(el, i, el.attribs["class"] || "", stateVal), stateVal);
}
});
}
if (!value || typeof value !== "string")
return this;
const classNames = value.split(rspace);
const numClasses = classNames.length;
const state = typeof stateVal === "boolean" ? stateVal ? 1 : -1 : 0;
const numElements = this.length;
for (let i = 0; i < numElements; i++) {
const el = this[i];
if (!isTag2(el))
continue;
const elementClasses = splitNames(el.attribs["class"]);
for (let j = 0; j < numClasses; j++) {
const index2 = elementClasses.indexOf(classNames[j]);
if (state >= 0 && index2 < 0) {
elementClasses.push(classNames[j]);
} else if (state <= 0 && index2 >= 0) {
elementClasses.splice(index2, 1);
}
}
el.attribs["class"] = elementClasses.join(" ");
}
return this;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/traversing.js
var traversing_exports = {};
__export(traversing_exports, {
add: () => add,
addBack: () => addBack,
children: () => children,
closest: () => closest,
contents: () => contents,
each: () => each,
end: () => end,
eq: () => eq,
filter: () => filter3,
filterArray: () => filterArray,
find: () => find3,
first: () => first,
get: () => get,
has: () => has,
index: () => index,
is: () => is3,
last: () => last,
map: () => map,
next: () => next,
nextAll: () => nextAll,
nextUntil: () => nextUntil,
not: () => not,
parent: () => parent,
parents: () => parents,
parentsUntil: () => parentsUntil,
prev: () => prev,
prevAll: () => prevAll,
prevUntil: () => prevUntil,
siblings: () => siblings,
slice: () => slice,
toArray: () => toArray
});
// ../../node_modules/.pnpm/css-what@6.1.0/node_modules/css-what/lib/es/types.js
var SelectorType;
(function(SelectorType2) {
SelectorType2["Attribute"] = "attribute";
SelectorType2["Pseudo"] = "pseudo";
SelectorType2["PseudoElement"] = "pseudo-element";
SelectorType2["Tag"] = "tag";
SelectorType2["Universal"] = "universal";
SelectorType2["Adjacent"] = "adjacent";
SelectorType2["Child"] = "child";
SelectorType2["Descendant"] = "descendant";
SelectorType2["Parent"] = "parent";
SelectorType2["Sibling"] = "sibling";
SelectorType2["ColumnCombinator"] = "column-combinator";
})(SelectorType || (SelectorType = {}));
var AttributeAction;
(function(AttributeAction2) {
AttributeAction2["Any"] = "any";
AttributeAction2["Element"] = "element";
AttributeAction2["End"] = "end";
AttributeAction2["Equals"] = "equals";
AttributeAction2["Exists"] = "exists";
AttributeAction2["Hyphen"] = "hyphen";
AttributeAction2["Not"] = "not";
AttributeAction2["Start"] = "start";
})(AttributeAction || (AttributeAction = {}));
// ../../node_modules/.pnpm/css-what@6.1.0/node_modules/css-what/lib/es/parse.js
var reName = /^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/;
var reEscape = /\\([\da-f]{1,6}\s?|(\s)|.)/gi;
var actionTypes = /* @__PURE__ */ new Map([
[126, AttributeAction.Element],
[94, AttributeAction.Start],
[36, AttributeAction.End],
[42, AttributeAction.Any],
[33, AttributeAction.Not],
[124, AttributeAction.Hyphen]
]);
var unpackPseudos = /* @__PURE__ */ new Set([
"has",
"not",
"matches",
"is",
"where",
"host",
"host-context"
]);
function isTraversal(selector) {
switch (selector.type) {
case SelectorType.Adjacent:
case SelectorType.Child:
case SelectorType.Descendant:
case SelectorType.Parent:
case SelectorType.Sibling:
case SelectorType.ColumnCombinator:
return true;
default:
return false;
}
}
var stripQuotesFromPseudos = /* @__PURE__ */ new Set(["contains", "icontains"]);
function funescape(_, escaped, escapedWhitespace) {
const high = parseInt(escaped, 16) - 65536;
return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
}
function unescapeCSS(str) {
return str.replace(reEscape, funescape);
}
function isQuote(c) {
return c === 39 || c === 34;
}
function isWhitespace(c) {
return c === 32 || c === 9 || c === 10 || c === 12 || c === 13;
}
function parse2(selector) {
const subselects2 = [];
const endIndex = parseSelector(subselects2, `${selector}`, 0);
if (endIndex < selector.length) {
throw new Error(`Unmatched selector: ${selector.slice(endIndex)}`);
}
return subselects2;
}
function parseSelector(subselects2, selector, selectorIndex) {
let tokens = [];
function getName2(offset2) {
const match3 = selector.slice(selectorIndex + offset2).match(reName);
if (!match3) {
throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
}
const [name2] = match3;
selectorIndex += offset2 + name2.length;
return unescapeCSS(name2);
}
function stripWhitespace(offset2) {
selectorIndex += offset2;
while (selectorIndex < selector.length && isWhitespace(selector.charCodeAt(selectorIndex))) {
selectorIndex++;
}
}
function readValueWithParenthesis() {
selectorIndex += 1;
const start = selectorIndex;
let counter = 1;
for (; counter > 0 && selectorIndex < selector.length; selectorIndex++) {
if (selector.charCodeAt(selectorIndex) === 40 && !isEscaped(selectorIndex)) {
counter++;
} else if (selector.charCodeAt(selectorIndex) === 41 && !isEscaped(selectorIndex)) {
counter--;
}
}
if (counter) {
throw new Error("Parenthesis not matched");
}
return unescapeCSS(selector.slice(start, selectorIndex - 1));
}
function isEscaped(pos) {
let slashCount = 0;
while (selector.charCodeAt(--pos) === 92)
slashCount++;
return (slashCount & 1) === 1;
}
function ensureNotTraversal() {
if (tokens.length > 0 && isTraversal(tokens[tokens.length - 1])) {
throw new Error("Did not expect successive traversals.");
}
}
function addTraversal(type) {
if (tokens.length > 0 && tokens[tokens.length - 1].type === SelectorType.Descendant) {
tokens[tokens.length - 1].type = type;
return;
}
ensureNotTraversal();
tokens.push({ type });
}
function addSpecialAttribute(name2, action) {
tokens.push({
type: SelectorType.Attribute,
name: name2,
action,
value: getName2(1),
namespace: null,
ignoreCase: "quirks"
});
}
function finalizeSubselector() {
if (tokens.length && tokens[tokens.length - 1].type === SelectorType.Descendant) {
tokens.pop();
}
if (tokens.length === 0) {
throw new Error("Empty sub-selector");
}
subselects2.push(tokens);
}
stripWhitespace(0);
if (selector.length === selectorIndex) {
return selectorIndex;
}
loop:
while (selectorIndex < selector.length) {
const firstChar = selector.charCodeAt(selectorIndex);
switch (firstChar) {
case 32:
case 9:
case 10:
case 12:
case 13: {
if (tokens.length === 0 || tokens[0].type !== SelectorType.Descendant) {
ensureNotTraversal();
tokens.push({ type: SelectorType.Descendant });
}
stripWhitespace(1);
break;
}
case 62: {
addTraversal(SelectorType.Child);
stripWhitespace(1);
break;
}
case 60: {
addTraversal(SelectorType.Parent);
stripWhitespace(1);
break;
}
case 126: {
addTraversal(SelectorType.Sibling);
stripWhitespace(1);
break;
}
case 43: {
addTraversal(SelectorType.Adjacent);
stripWhitespace(1);
break;
}
case 46: {
addSpecialAttribute("class", AttributeAction.Element);
break;
}
case 35: {
addSpecialAttribute("id", AttributeAction.Equals);
break;
}
case 91: {
stripWhitespace(1);
let name2;
let namespace = null;
if (selector.charCodeAt(selectorIndex) === 124) {
name2 = getName2(1);
} else if (selector.startsWith("*|", selectorIndex)) {
namespace = "*";
name2 = getName2(2);
} else {
name2 = getName2(0);
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 61) {
namespace = name2;
name2 = getName2(1);
}
}
stripWhitespace(0);
let action = AttributeAction.Exists;
const possibleAction = actionTypes.get(selector.charCodeAt(selectorIndex));
if (possibleAction) {
action = possibleAction;
if (selector.charCodeAt(selectorIndex + 1) !== 61) {
throw new Error("Expected `=`");
}
stripWhitespace(2);
} else if (selector.charCodeAt(selectorIndex) === 61) {
action = AttributeAction.Equals;
stripWhitespace(1);
}
let value = "";
let ignoreCase = null;
if (action !== "exists") {
if (isQuote(selector.charCodeAt(selectorIndex))) {
const quote = selector.charCodeAt(selectorIndex);
let sectionEnd = selectorIndex + 1;
while (sectionEnd < selector.length && (selector.charCodeAt(sectionEnd) !== quote || isEscaped(sectionEnd))) {
sectionEnd += 1;
}
if (selector.charCodeAt(sectionEnd) !== quote) {
throw new Error("Attribute value didn't end");
}
value = unescapeCSS(selector.slice(selectorIndex + 1, sectionEnd));
selectorIndex = sectionEnd + 1;
} else {
const valueStart = selectorIndex;
while (selectorIndex < selector.length && (!isWhitespace(selector.charCodeAt(selectorIndex)) && selector.charCodeAt(selectorIndex) !== 93 || isEscaped(selectorIndex))) {
selectorIndex += 1;
}
value = unescapeCSS(selector.slice(valueStart, selectorIndex));
}
stripWhitespace(0);
const forceIgnore = selector.charCodeAt(selectorIndex) | 32;
if (forceIgnore === 115) {
ignoreCase = false;
stripWhitespace(1);
} else if (forceIgnore === 105) {
ignoreCase = true;
stripWhitespace(1);
}
}
if (selector.charCodeAt(selectorIndex) !== 93) {
throw new Error("Attribute selector didn't terminate");
}
selectorIndex += 1;
const attributeSelector = {
type: SelectorType.Attribute,
name: name2,
action,
value,
namespace,
ignoreCase
};
tokens.push(attributeSelector);
break;
}
case 58: {
if (selector.charCodeAt(selectorIndex + 1) === 58) {
tokens.push({
type: SelectorType.PseudoElement,
name: getName2(2).toLowerCase(),
data: selector.charCodeAt(selectorIndex) === 40 ? readValueWithParenthesis() : null
});
continue;
}
const name2 = getName2(1).toLowerCase();
let data2 = null;
if (selector.charCodeAt(selectorIndex) === 40) {
if (unpackPseudos.has(name2)) {
if (isQuote(selector.charCodeAt(selectorIndex + 1))) {
throw new Error(`Pseudo-selector ${name2} cannot be quoted`);
}
data2 = [];
selectorIndex = parseSelector(data2, selector, selectorIndex + 1);
if (selector.charCodeAt(selectorIndex) !== 41) {
throw new Error(`Missing closing parenthesis in :${name2} (${selector})`);
}
selectorIndex += 1;
} else {
data2 = readValueWithParenthesis();
if (stripQuotesFromPseudos.has(name2)) {
const quot = data2.charCodeAt(0);
if (quot === data2.charCodeAt(data2.length - 1) && isQuote(quot)) {
data2 = data2.slice(1, -1);
}
}
data2 = unescapeCSS(data2);
}
}
tokens.push({ type: SelectorType.Pseudo, name: name2, data: data2 });
break;
}
case 44: {
finalizeSubselector();
tokens = [];
stripWhitespace(1);
break;
}
default: {
if (selector.startsWith("/*", selectorIndex)) {
const endIndex = selector.indexOf("*/", selectorIndex + 2);
if (endIndex < 0) {
throw new Error("Comment was not terminated");
}
selectorIndex = endIndex + 2;
if (tokens.length === 0) {
stripWhitespace(0);
}
break;
}
let namespace = null;
let name2;
if (firstChar === 42) {
selectorIndex += 1;
name2 = "*";
} else if (firstChar === 124) {
name2 = "";
if (selector.charCodeAt(selectorIndex + 1) === 124) {
addTraversal(SelectorType.ColumnCombinator);
stripWhitespace(2);
break;
}
} else if (reName.test(selector.slice(selectorIndex))) {
name2 = getName2(0);
} else {
break loop;
}
if (selector.charCodeAt(selectorIndex) === 124 && selector.charCodeAt(selectorIndex + 1) !== 124) {
namespace = name2;
if (selector.charCodeAt(selectorIndex + 1) === 42) {
name2 = "*";
selectorIndex += 2;
} else {
name2 = getName2(1);
}
}
tokens.push(name2 === "*" ? { type: SelectorType.Universal, namespace } : { type: SelectorType.Tag, name: name2, namespace });
}
}
}
finalizeSubselector();
return selectorIndex;
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/index.js
var import_boolbase6 = __toESM(require_boolbase(), 1);
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/compile.js
var import_boolbase5 = __toESM(require_boolbase(), 1);
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/sort.js
var procedure = /* @__PURE__ */ new Map([
[SelectorType.Universal, 50],
[SelectorType.Tag, 30],
[SelectorType.Attribute, 1],
[SelectorType.Pseudo, 0]
]);
function isTraversal2(token) {
return !procedure.has(token.type);
}
var attributes = /* @__PURE__ */ new Map([
[AttributeAction.Exists, 10],
[AttributeAction.Equals, 8],
[AttributeAction.Not, 7],
[AttributeAction.Start, 6],
[AttributeAction.End, 6],
[AttributeAction.Any, 5]
]);
function sortByProcedure(arr) {
const procs = arr.map(getProcedure);
for (let i = 1; i < arr.length; i++) {
const procNew = procs[i];
if (procNew < 0)
continue;
for (let j = i - 1; j >= 0 && procNew < procs[j]; j--) {
const token = arr[j + 1];
arr[j + 1] = arr[j];
arr[j] = token;
procs[j + 1] = procs[j];
procs[j] = procNew;
}
}
}
function getProcedure(token) {
var _a3, _b;
let proc = (_a3 = procedure.get(token.type)) !== null && _a3 !== void 0 ? _a3 : -1;
if (token.type === SelectorType.Attribute) {
proc = (_b = attributes.get(token.action)) !== null && _b !== void 0 ? _b : 4;
if (token.action === AttributeAction.Equals && token.name === "id") {
proc = 9;
}
if (token.ignoreCase) {
proc >>= 1;
}
} else if (token.type === SelectorType.Pseudo) {
if (!token.data) {
proc = 3;
} else if (token.name === "has" || token.name === "contains") {
proc = 0;
} else if (Array.isArray(token.data)) {
proc = Math.min(...token.data.map((d) => Math.min(...d.map(getProcedure))));
if (proc < 0) {
proc = 0;
}
} else {
proc = 2;
}
}
return proc;
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/attributes.js
var import_boolbase = __toESM(require_boolbase(), 1);
var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
function escapeRegex(value) {
return value.replace(reChars, "\\$&");
}
var caseInsensitiveAttributes = /* @__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 shouldIgnoreCase(selector, options) {
return typeof selector.ignoreCase === "boolean" ? selector.ignoreCase : selector.ignoreCase === "quirks" ? !!options.quirksMode : !options.xmlMode && caseInsensitiveAttributes.has(selector.name);
}
var attributeRules = {
equals(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2 } = data2;
let { value } = data2;
if (shouldIgnoreCase(data2, options)) {
value = value.toLowerCase();
return (elem) => {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && attr2.length === value.length && attr2.toLowerCase() === value && next2(elem);
};
}
return (elem) => adapter2.getAttributeValue(elem, name2) === value && next2(elem);
},
hyphen(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2 } = data2;
let { value } = data2;
const len = value.length;
if (shouldIgnoreCase(data2, options)) {
value = value.toLowerCase();
return function hyphenIC(elem) {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && (attr2.length === len || attr2.charAt(len) === "-") && attr2.substr(0, len).toLowerCase() === value && next2(elem);
};
}
return function hyphen(elem) {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && (attr2.length === len || attr2.charAt(len) === "-") && attr2.substr(0, len) === value && next2(elem);
};
},
element(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2, value } = data2;
if (/\s/.test(value)) {
return import_boolbase.default.falseFunc;
}
const regex = new RegExp(`(?:^|\\s)${escapeRegex(value)}(?:$|\\s)`, shouldIgnoreCase(data2, options) ? "i" : "");
return function element(elem) {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && attr2.length >= value.length && regex.test(attr2) && next2(elem);
};
},
exists(next2, { name: name2 }, { adapter: adapter2 }) {
return (elem) => adapter2.hasAttrib(elem, name2) && next2(elem);
},
start(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2 } = data2;
let { value } = data2;
const len = value.length;
if (len === 0) {
return import_boolbase.default.falseFunc;
}
if (shouldIgnoreCase(data2, options)) {
value = value.toLowerCase();
return (elem) => {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && attr2.length >= len && attr2.substr(0, len).toLowerCase() === value && next2(elem);
};
}
return (elem) => {
var _a3;
return !!((_a3 = adapter2.getAttributeValue(elem, name2)) === null || _a3 === void 0 ? void 0 : _a3.startsWith(value)) && next2(elem);
};
},
end(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2 } = data2;
let { value } = data2;
const len = -value.length;
if (len === 0) {
return import_boolbase.default.falseFunc;
}
if (shouldIgnoreCase(data2, options)) {
value = value.toLowerCase();
return (elem) => {
var _a3;
return ((_a3 = adapter2.getAttributeValue(elem, name2)) === null || _a3 === void 0 ? void 0 : _a3.substr(len).toLowerCase()) === value && next2(elem);
};
}
return (elem) => {
var _a3;
return !!((_a3 = adapter2.getAttributeValue(elem, name2)) === null || _a3 === void 0 ? void 0 : _a3.endsWith(value)) && next2(elem);
};
},
any(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2, value } = data2;
if (value === "") {
return import_boolbase.default.falseFunc;
}
if (shouldIgnoreCase(data2, options)) {
const regex = new RegExp(escapeRegex(value), "i");
return function anyIC(elem) {
const attr2 = adapter2.getAttributeValue(elem, name2);
return attr2 != null && attr2.length >= value.length && regex.test(attr2) && next2(elem);
};
}
return (elem) => {
var _a3;
return !!((_a3 = adapter2.getAttributeValue(elem, name2)) === null || _a3 === void 0 ? void 0 : _a3.includes(value)) && next2(elem);
};
},
not(next2, data2, options) {
const { adapter: adapter2 } = options;
const { name: name2 } = data2;
let { value } = data2;
if (value === "") {
return (elem) => !!adapter2.getAttributeValue(elem, name2) && next2(elem);
} else if (shouldIgnoreCase(data2, options)) {
value = value.toLowerCase();
return (elem) => {
const attr2 = adapter2.getAttributeValue(elem, name2);
return (attr2 == null || attr2.length !== value.length || attr2.toLowerCase() !== value) && next2(elem);
};
}
return (elem) => adapter2.getAttributeValue(elem, name2) !== value && next2(elem);
}
};
// ../../node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/parse.js
var whitespace = /* @__PURE__ */ new Set([9, 10, 12, 13, 32]);
var ZERO = "0".charCodeAt(0);
var NINE = "9".charCodeAt(0);
function parse3(formula) {
formula = formula.trim().toLowerCase();
if (formula === "even") {
return [2, 0];
} else if (formula === "odd") {
return [2, 1];
}
let idx = 0;
let a = 0;
let sign = readSign();
let number = readNumber();
if (idx < formula.length && formula.charAt(idx) === "n") {
idx++;
a = sign * (number !== null && number !== void 0 ? number : 1);
skipWhitespace();
if (idx < formula.length) {
sign = readSign();
skipWhitespace();
number = readNumber();
} else {
sign = number = 0;
}
}
if (number === null || idx < formula.length) {
throw new Error(`n-th rule couldn't be parsed ('${formula}')`);
}
return [a, sign * number];
function readSign() {
if (formula.charAt(idx) === "-") {
idx++;
return -1;
}
if (formula.charAt(idx) === "+") {
idx++;
}
return 1;
}
function readNumber() {
const start = idx;
let value = 0;
while (idx < formula.length && formula.charCodeAt(idx) >= ZERO && formula.charCodeAt(idx) <= NINE) {
value = value * 10 + (formula.charCodeAt(idx) - ZERO);
idx++;
}
return idx === start ? null : value;
}
function skipWhitespace() {
while (idx < formula.length && whitespace.has(formula.charCodeAt(idx))) {
idx++;
}
}
}
// ../../node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/compile.js
var import_boolbase2 = __toESM(require_boolbase(), 1);
function compile(parsed) {
const a = parsed[0];
const b = parsed[1] - 1;
if (b < 0 && a <= 0)
return import_boolbase2.default.falseFunc;
if (a === -1)
return (index2) => index2 <= b;
if (a === 0)
return (index2) => index2 === b;
if (a === 1)
return b < 0 ? import_boolbase2.default.trueFunc : (index2) => index2 >= b;
const absA = Math.abs(a);
const bMod = (b % absA + absA) % absA;
return a > 1 ? (index2) => index2 >= b && index2 % absA === bMod : (index2) => index2 <= b && index2 % absA === bMod;
}
// ../../node_modules/.pnpm/nth-check@2.1.1/node_modules/nth-check/lib/esm/index.js
function nthCheck(formula) {
return compile(parse3(formula));
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/pseudo-selectors/filters.js
var import_boolbase3 = __toESM(require_boolbase(), 1);
function getChildFunc(next2, adapter2) {
return (elem) => {
const parent2 = adapter2.getParent(elem);
return parent2 != null && adapter2.isTag(parent2) && next2(elem);
};
}
var filters = {
contains(next2, text5, { adapter: adapter2 }) {
return function contains3(elem) {
return next2(elem) && adapter2.getText(elem).includes(text5);
};
},
icontains(next2, text5, { adapter: adapter2 }) {
const itext = text5.toLowerCase();
return function icontains(elem) {
return next2(elem) && adapter2.getText(elem).toLowerCase().includes(itext);
};
},
"nth-child"(next2, rule, { adapter: adapter2, equals }) {
const func = nthCheck(rule);
if (func === import_boolbase3.default.falseFunc)
return import_boolbase3.default.falseFunc;
if (func === import_boolbase3.default.trueFunc)
return getChildFunc(next2, adapter2);
return function nthChild(elem) {
const siblings2 = adapter2.getSiblings(elem);
let pos = 0;
for (let i = 0; i < siblings2.length; i++) {
if (equals(elem, siblings2[i]))
break;
if (adapter2.isTag(siblings2[i])) {
pos++;
}
}
return func(pos) && next2(elem);
};
},
"nth-last-child"(next2, rule, { adapter: adapter2, equals }) {
const func = nthCheck(rule);
if (func === import_boolbase3.default.falseFunc)
return import_boolbase3.default.falseFunc;
if (func === import_boolbase3.default.trueFunc)
return getChildFunc(next2, adapter2);
return function nthLastChild(elem) {
const siblings2 = adapter2.getSiblings(elem);
let pos = 0;
for (let i = siblings2.length - 1; i >= 0; i--) {
if (equals(elem, siblings2[i]))
break;
if (adapter2.isTag(siblings2[i])) {
pos++;
}
}
return func(pos) && next2(elem);
};
},
"nth-of-type"(next2, rule, { adapter: adapter2, equals }) {
const func = nthCheck(rule);
if (func === import_boolbase3.default.falseFunc)
return import_boolbase3.default.falseFunc;
if (func === import_boolbase3.default.trueFunc)
return getChildFunc(next2, adapter2);
return function nthOfType(elem) {
const siblings2 = adapter2.getSiblings(elem);
let pos = 0;
for (let i = 0; i < siblings2.length; i++) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
break;
if (adapter2.isTag(currentSibling) && adapter2.getName(currentSibling) === adapter2.getName(elem)) {
pos++;
}
}
return func(pos) && next2(elem);
};
},
"nth-last-of-type"(next2, rule, { adapter: adapter2, equals }) {
const func = nthCheck(rule);
if (func === import_boolbase3.default.falseFunc)
return import_boolbase3.default.falseFunc;
if (func === import_boolbase3.default.trueFunc)
return getChildFunc(next2, adapter2);
return function nthLastOfType(elem) {
const siblings2 = adapter2.getSiblings(elem);
let pos = 0;
for (let i = siblings2.length - 1; i >= 0; i--) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
break;
if (adapter2.isTag(currentSibling) && adapter2.getName(currentSibling) === adapter2.getName(elem)) {
pos++;
}
}
return func(pos) && next2(elem);
};
},
root(next2, _rule, { adapter: adapter2 }) {
return (elem) => {
const parent2 = adapter2.getParent(elem);
return (parent2 == null || !adapter2.isTag(parent2)) && next2(elem);
};
},
scope(next2, rule, options, context) {
const { equals } = options;
if (!context || context.length === 0) {
return filters["root"](next2, rule, options);
}
if (context.length === 1) {
return (elem) => equals(context[0], elem) && next2(elem);
}
return (elem) => context.includes(elem) && next2(elem);
},
hover: dynamicStatePseudo("isHovered"),
visited: dynamicStatePseudo("isVisited"),
active: dynamicStatePseudo("isActive")
};
function dynamicStatePseudo(name2) {
return function dynamicPseudo(next2, _rule, { adapter: adapter2 }) {
const func = adapter2[name2];
if (typeof func !== "function") {
return import_boolbase3.default.falseFunc;
}
return function active(elem) {
return func(elem) && next2(elem);
};
};
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/pseudo-selectors/pseudos.js
var pseudos = {
empty(elem, { adapter: adapter2 }) {
return !adapter2.getChildren(elem).some((elem2) => adapter2.isTag(elem2) || adapter2.getText(elem2) !== "");
},
"first-child"(elem, { adapter: adapter2, equals }) {
if (adapter2.prevElementSibling) {
return adapter2.prevElementSibling(elem) == null;
}
const firstChild = adapter2.getSiblings(elem).find((elem2) => adapter2.isTag(elem2));
return firstChild != null && equals(elem, firstChild);
},
"last-child"(elem, { adapter: adapter2, equals }) {
const siblings2 = adapter2.getSiblings(elem);
for (let i = siblings2.length - 1; i >= 0; i--) {
if (equals(elem, siblings2[i]))
return true;
if (adapter2.isTag(siblings2[i]))
break;
}
return false;
},
"first-of-type"(elem, { adapter: adapter2, equals }) {
const siblings2 = adapter2.getSiblings(elem);
const elemName = adapter2.getName(elem);
for (let i = 0; i < siblings2.length; i++) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
return true;
if (adapter2.isTag(currentSibling) && adapter2.getName(currentSibling) === elemName) {
break;
}
}
return false;
},
"last-of-type"(elem, { adapter: adapter2, equals }) {
const siblings2 = adapter2.getSiblings(elem);
const elemName = adapter2.getName(elem);
for (let i = siblings2.length - 1; i >= 0; i--) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
return true;
if (adapter2.isTag(currentSibling) && adapter2.getName(currentSibling) === elemName) {
break;
}
}
return false;
},
"only-of-type"(elem, { adapter: adapter2, equals }) {
const elemName = adapter2.getName(elem);
return adapter2.getSiblings(elem).every((sibling) => equals(elem, sibling) || !adapter2.isTag(sibling) || adapter2.getName(sibling) !== elemName);
},
"only-child"(elem, { adapter: adapter2, equals }) {
return adapter2.getSiblings(elem).every((sibling) => equals(elem, sibling) || !adapter2.isTag(sibling));
}
};
function verifyPseudoArgs(func, name2, subselect, argIndex) {
if (subselect === null) {
if (func.length > argIndex) {
throw new Error(`Pseudo-class :${name2} requires an argument`);
}
} else if (func.length === argIndex) {
throw new Error(`Pseudo-class :${name2} doesn't have any arguments`);
}
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/pseudo-selectors/aliases.js
var aliases = {
"any-link": ":is(a, area, link)[href]",
link: ":any-link:not(:visited)",
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])",
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])"
};
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/pseudo-selectors/subselects.js
var import_boolbase4 = __toESM(require_boolbase(), 1);
var PLACEHOLDER_ELEMENT = {};
function ensureIsTag(next2, adapter2) {
if (next2 === import_boolbase4.default.falseFunc)
return import_boolbase4.default.falseFunc;
return (elem) => adapter2.isTag(elem) && next2(elem);
}
function getNextSiblings(elem, adapter2) {
const siblings2 = adapter2.getSiblings(elem);
if (siblings2.length <= 1)
return [];
const elemIndex = siblings2.indexOf(elem);
if (elemIndex < 0 || elemIndex === siblings2.length - 1)
return [];
return siblings2.slice(elemIndex + 1).filter(adapter2.isTag);
}
function copyOptions(options) {
return {
xmlMode: !!options.xmlMode,
lowerCaseAttributeNames: !!options.lowerCaseAttributeNames,
lowerCaseTags: !!options.lowerCaseTags,
quirksMode: !!options.quirksMode,
cacheResults: !!options.cacheResults,
pseudos: options.pseudos,
adapter: options.adapter,
equals: options.equals
};
}
var is = (next2, token, options, context, compileToken2) => {
const func = compileToken2(token, copyOptions(options), context);
return func === import_boolbase4.default.trueFunc ? next2 : func === import_boolbase4.default.falseFunc ? import_boolbase4.default.falseFunc : (elem) => func(elem) && next2(elem);
};
var subselects = {
is,
matches: is,
where: is,
not(next2, token, options, context, compileToken2) {
const func = compileToken2(token, copyOptions(options), context);
return func === import_boolbase4.default.falseFunc ? next2 : func === import_boolbase4.default.trueFunc ? import_boolbase4.default.falseFunc : (elem) => !func(elem) && next2(elem);
},
has(next2, subselect, options, _context, compileToken2) {
const { adapter: adapter2 } = options;
const opts = copyOptions(options);
opts.relativeSelector = true;
const context = subselect.some((s2) => s2.some(isTraversal2)) ? [PLACEHOLDER_ELEMENT] : void 0;
const compiled = compileToken2(subselect, opts, context);
if (compiled === import_boolbase4.default.falseFunc)
return import_boolbase4.default.falseFunc;
const hasElement = ensureIsTag(compiled, adapter2);
if (context && compiled !== import_boolbase4.default.trueFunc) {
const { shouldTestNextSiblings = false } = compiled;
return (elem) => {
if (!next2(elem))
return false;
context[0] = elem;
const childs = adapter2.getChildren(elem);
const nextElements = shouldTestNextSiblings ? [...childs, ...getNextSiblings(elem, adapter2)] : childs;
return adapter2.existsOne(hasElement, nextElements);
};
}
return (elem) => next2(elem) && adapter2.existsOne(hasElement, adapter2.getChildren(elem));
}
};
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/pseudo-selectors/index.js
function compilePseudoSelector(next2, selector, options, context, compileToken2) {
var _a3;
const { name: name2, data: data2 } = selector;
if (Array.isArray(data2)) {
if (!(name2 in subselects)) {
throw new Error(`Unknown pseudo-class :${name2}(${data2})`);
}
return subselects[name2](next2, data2, options, context, compileToken2);
}
const userPseudo = (_a3 = options.pseudos) === null || _a3 === void 0 ? void 0 : _a3[name2];
const stringPseudo = typeof userPseudo === "string" ? userPseudo : aliases[name2];
if (typeof stringPseudo === "string") {
if (data2 != null) {
throw new Error(`Pseudo ${name2} doesn't have any arguments`);
}
const alias = parse2(stringPseudo);
return subselects["is"](next2, alias, options, context, compileToken2);
}
if (typeof userPseudo === "function") {
verifyPseudoArgs(userPseudo, name2, data2, 1);
return (elem) => userPseudo(elem, data2) && next2(elem);
}
if (name2 in filters) {
return filters[name2](next2, data2, options, context);
}
if (name2 in pseudos) {
const pseudo = pseudos[name2];
verifyPseudoArgs(pseudo, name2, data2, 2);
return (elem) => pseudo(elem, options, data2) && next2(elem);
}
throw new Error(`Unknown pseudo-class :${name2}`);
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/general.js
function getElementParent(node, adapter2) {
const parent2 = adapter2.getParent(node);
if (parent2 && adapter2.isTag(parent2)) {
return parent2;
}
return null;
}
function compileGeneralSelector(next2, selector, options, context, compileToken2) {
const { adapter: adapter2, equals } = options;
switch (selector.type) {
case SelectorType.PseudoElement: {
throw new Error("Pseudo-elements are not supported by css-select");
}
case SelectorType.ColumnCombinator: {
throw new Error("Column combinators are not yet supported by css-select");
}
case SelectorType.Attribute: {
if (selector.namespace != null) {
throw new Error("Namespaced attributes are not yet supported by css-select");
}
if (!options.xmlMode || options.lowerCaseAttributeNames) {
selector.name = selector.name.toLowerCase();
}
return attributeRules[selector.action](next2, selector, options);
}
case SelectorType.Pseudo: {
return compilePseudoSelector(next2, selector, options, context, compileToken2);
}
case SelectorType.Tag: {
if (selector.namespace != null) {
throw new Error("Namespaced tag names are not yet supported by css-select");
}
let { name: name2 } = selector;
if (!options.xmlMode || options.lowerCaseTags) {
name2 = name2.toLowerCase();
}
return function tag(elem) {
return adapter2.getName(elem) === name2 && next2(elem);
};
}
case SelectorType.Descendant: {
if (options.cacheResults === false || typeof WeakSet === "undefined") {
return function descendant(elem) {
let current = elem;
while (current = getElementParent(current, adapter2)) {
if (next2(current)) {
return true;
}
}
return false;
};
}
const isFalseCache = /* @__PURE__ */ new WeakSet();
return function cachedDescendant(elem) {
let current = elem;
while (current = getElementParent(current, adapter2)) {
if (!isFalseCache.has(current)) {
if (adapter2.isTag(current) && next2(current)) {
return true;
}
isFalseCache.add(current);
}
}
return false;
};
}
case "_flexibleDescendant": {
return function flexibleDescendant(elem) {
let current = elem;
do {
if (next2(current))
return true;
} while (current = getElementParent(current, adapter2));
return false;
};
}
case SelectorType.Parent: {
return function parent2(elem) {
return adapter2.getChildren(elem).some((elem2) => adapter2.isTag(elem2) && next2(elem2));
};
}
case SelectorType.Child: {
return function child(elem) {
const parent2 = adapter2.getParent(elem);
return parent2 != null && adapter2.isTag(parent2) && next2(parent2);
};
}
case SelectorType.Sibling: {
return function sibling(elem) {
const siblings2 = adapter2.getSiblings(elem);
for (let i = 0; i < siblings2.length; i++) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
break;
if (adapter2.isTag(currentSibling) && next2(currentSibling)) {
return true;
}
}
return false;
};
}
case SelectorType.Adjacent: {
if (adapter2.prevElementSibling) {
return function adjacent(elem) {
const previous = adapter2.prevElementSibling(elem);
return previous != null && next2(previous);
};
}
return function adjacent(elem) {
const siblings2 = adapter2.getSiblings(elem);
let lastElement;
for (let i = 0; i < siblings2.length; i++) {
const currentSibling = siblings2[i];
if (equals(elem, currentSibling))
break;
if (adapter2.isTag(currentSibling)) {
lastElement = currentSibling;
}
}
return !!lastElement && next2(lastElement);
};
}
case SelectorType.Universal: {
if (selector.namespace != null && selector.namespace !== "*") {
throw new Error("Namespaced universal selectors are not yet supported by css-select");
}
return next2;
}
}
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/compile.js
function compile2(selector, options, context) {
const next2 = compileUnsafe(selector, options, context);
return ensureIsTag(next2, options.adapter);
}
function compileUnsafe(selector, options, context) {
const token = typeof selector === "string" ? parse2(selector) : selector;
return compileToken(token, options, context);
}
function includesScopePseudo(t2) {
return t2.type === SelectorType.Pseudo && (t2.name === "scope" || Array.isArray(t2.data) && t2.data.some((data2) => data2.some(includesScopePseudo)));
}
var DESCENDANT_TOKEN = { type: SelectorType.Descendant };
var FLEXIBLE_DESCENDANT_TOKEN = {
type: "_flexibleDescendant"
};
var SCOPE_TOKEN = {
type: SelectorType.Pseudo,
name: "scope",
data: null
};
function absolutize(token, { adapter: adapter2 }, context) {
const hasContext = !!(context === null || context === void 0 ? void 0 : context.every((e) => {
const parent2 = adapter2.isTag(e) && adapter2.getParent(e);
return e === PLACEHOLDER_ELEMENT || parent2 && adapter2.isTag(parent2);
}));
for (const t2 of token) {
if (t2.length > 0 && isTraversal2(t2[0]) && t2[0].type !== SelectorType.Descendant) {
} else if (hasContext && !t2.some(includesScopePseudo)) {
t2.unshift(DESCENDANT_TOKEN);
} else {
continue;
}
t2.unshift(SCOPE_TOKEN);
}
}
function compileToken(token, options, context) {
var _a3;
token.forEach(sortByProcedure);
context = (_a3 = options.context) !== null && _a3 !== void 0 ? _a3 : context;
const isArrayContext = Array.isArray(context);
const finalContext = context && (Array.isArray(context) ? context : [context]);
if (options.relativeSelector !== false) {
absolutize(token, options, finalContext);
} else if (token.some((t2) => t2.length > 0 && isTraversal2(t2[0]))) {
throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");
}
let shouldTestNextSiblings = false;
const query = token.map((rules) => {
if (rules.length >= 2) {
const [first2, second] = rules;
if (first2.type !== SelectorType.Pseudo || first2.name !== "scope") {
} else if (isArrayContext && second.type === SelectorType.Descendant) {
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
} else if (second.type === SelectorType.Adjacent || second.type === SelectorType.Sibling) {
shouldTestNextSiblings = true;
}
}
return compileRules(rules, options, finalContext);
}).reduce(reduceRules, import_boolbase5.default.falseFunc);
query.shouldTestNextSiblings = shouldTestNextSiblings;
return query;
}
function compileRules(rules, options, context) {
var _a3;
return rules.reduce((previous, rule) => previous === import_boolbase5.default.falseFunc ? import_boolbase5.default.falseFunc : compileGeneralSelector(previous, rule, options, context, compileToken), (_a3 = options.rootFunc) !== null && _a3 !== void 0 ? _a3 : import_boolbase5.default.trueFunc);
}
function reduceRules(a, b) {
if (b === import_boolbase5.default.falseFunc || a === import_boolbase5.default.trueFunc) {
return a;
}
if (a === import_boolbase5.default.falseFunc || b === import_boolbase5.default.trueFunc) {
return b;
}
return function combine(elem) {
return a(elem) || b(elem);
};
}
// ../../node_modules/.pnpm/css-select@5.1.0/node_modules/css-select/lib/esm/index.js
var defaultEquals = (a, b) => a === b;
var defaultOptions = {
adapter: esm_exports2,
equals: defaultEquals
};
function convertOptionFormats(options) {
var _a3, _b, _c, _d;
const opts = options !== null && options !== void 0 ? options : defaultOptions;
(_a3 = opts.adapter) !== null && _a3 !== void 0 ? _a3 : opts.adapter = esm_exports2;
(_b = opts.equals) !== null && _b !== void 0 ? _b : opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals;
return opts;
}
function wrapCompile(func) {
return function addAdapter(selector, options, context) {
const opts = convertOptionFormats(options);
return func(selector, opts, context);
};
}
var compile3 = wrapCompile(compile2);
var _compileUnsafe = wrapCompile(compileUnsafe);
var _compileToken = wrapCompile(compileToken);
function getSelectorFunc(searchFunc) {
return function select2(query, elements, options) {
const opts = convertOptionFormats(options);
if (typeof query !== "function") {
query = compileUnsafe(query, opts, elements);
}
const filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings);
return searchFunc(query, filteredElements, opts);
};
}
function prepareContext(elems, adapter2, shouldTestNextSiblings = false) {
if (shouldTestNextSiblings) {
elems = appendNextSiblings(elems, adapter2);
}
return Array.isArray(elems) ? adapter2.removeSubsets(elems) : adapter2.getChildren(elems);
}
function appendNextSiblings(elem, adapter2) {
const elems = Array.isArray(elem) ? elem.slice(0) : [elem];
const elemsLength = elems.length;
for (let i = 0; i < elemsLength; i++) {
const nextSiblings = getNextSiblings(elems[i], adapter2);
elems.push(...nextSiblings);
}
return elems;
}
var selectAll = getSelectorFunc((query, elems, options) => query === import_boolbase6.default.falseFunc || !elems || elems.length === 0 ? [] : options.adapter.findAll(query, elems));
var selectOne = getSelectorFunc((query, elems, options) => query === import_boolbase6.default.falseFunc || !elems || elems.length === 0 ? null : options.adapter.findOne(query, elems));
// ../../node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/index.js
var boolbase7 = __toESM(require_boolbase(), 1);
// ../../node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/positionals.js
var filterNames = /* @__PURE__ */ new Set([
"first",
"last",
"eq",
"gt",
"nth",
"lt",
"even",
"odd"
]);
function isFilter(s2) {
if (s2.type !== "pseudo")
return false;
if (filterNames.has(s2.name))
return true;
if (s2.name === "not" && Array.isArray(s2.data)) {
return s2.data.some((s3) => s3.some(isFilter));
}
return false;
}
function getLimit(filter4, data2, partLimit) {
const num = data2 != null ? parseInt(data2, 10) : NaN;
switch (filter4) {
case "first":
return 1;
case "nth":
case "eq":
return isFinite(num) ? num >= 0 ? num + 1 : Infinity : 0;
case "lt":
return isFinite(num) ? num >= 0 ? Math.min(num, partLimit) : Infinity : 0;
case "gt":
return isFinite(num) ? Infinity : 0;
case "odd":
return 2 * partLimit;
case "even":
return 2 * partLimit - 1;
case "last":
case "not":
return Infinity;
}
}
// ../../node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/helpers.js
function getDocumentRoot(node) {
while (node.parent)
node = node.parent;
return node;
}
function groupSelectors(selectors) {
const filteredSelectors = [];
const plainSelectors = [];
for (const selector of selectors) {
if (selector.some(isFilter)) {
filteredSelectors.push(selector);
} else {
plainSelectors.push(selector);
}
}
return [plainSelectors, filteredSelectors];
}
// ../../node_modules/.pnpm/cheerio-select@2.1.0/node_modules/cheerio-select/lib/esm/index.js
var UNIVERSAL_SELECTOR = {
type: SelectorType.Universal,
namespace: null
};
var SCOPE_PSEUDO = {
type: SelectorType.Pseudo,
name: "scope",
data: null
};
function is2(element, selector, options = {}) {
return some([element], selector, options);
}
function some(elements, selector, options = {}) {
if (typeof selector === "function")
return elements.some(selector);
const [plain, filtered] = groupSelectors(parse2(selector));
return plain.length > 0 && elements.some(_compileToken(plain, options)) || filtered.some((sel) => filterBySelector(sel, elements, options).length > 0);
}
function filterByPosition(filter4, elems, data2, options) {
const num = typeof data2 === "string" ? parseInt(data2, 10) : NaN;
switch (filter4) {
case "first":
case "lt":
return elems;
case "last":
return elems.length > 0 ? [elems[elems.length - 1]] : elems;
case "nth":
case "eq":
return isFinite(num) && Math.abs(num) < elems.length ? [num < 0 ? elems[elems.length + num] : elems[num]] : [];
case "gt":
return isFinite(num) ? elems.slice(num + 1) : [];
case "even":
return elems.filter((_, i) => i % 2 === 0);
case "odd":
return elems.filter((_, i) => i % 2 === 1);
case "not": {
const filtered = new Set(filterParsed(data2, elems, options));
return elems.filter((e) => !filtered.has(e));
}
}
}
function filter2(selector, elements, options = {}) {
return filterParsed(parse2(selector), elements, options);
}
function filterParsed(selector, elements, options) {
if (elements.length === 0)
return [];
const [plainSelectors, filteredSelectors] = groupSelectors(selector);
let found;
if (plainSelectors.length) {
const filtered = filterElements(elements, plainSelectors, options);
if (filteredSelectors.length === 0) {
return filtered;
}
if (filtered.length) {
found = new Set(filtered);
}
}
for (let i = 0; i < filteredSelectors.length && (found === null || found === void 0 ? void 0 : found.size) !== elements.length; i++) {
const filteredSelector = filteredSelectors[i];
const missing = found ? elements.filter((e) => isTag2(e) && !found.has(e)) : elements;
if (missing.length === 0)
break;
const filtered = filterBySelector(filteredSelector, elements, options);
if (filtered.length) {
if (!found) {
if (i === filteredSelectors.length - 1) {
return filtered;
}
found = new Set(filtered);
} else {
filtered.forEach((el) => found.add(el));
}
}
}
return typeof found !== "undefined" ? found.size === elements.length ? elements : elements.filter((el) => found.has(el)) : [];
}
function filterBySelector(selector, elements, options) {
var _a3;
if (selector.some(isTraversal)) {
const root3 = (_a3 = options.root) !== null && _a3 !== void 0 ? _a3 : getDocumentRoot(elements[0]);
const opts = { ...options, context: elements, relativeSelector: false };
selector.push(SCOPE_PSEUDO);
return findFilterElements(root3, selector, opts, true, elements.length);
}
return findFilterElements(elements, selector, options, false, elements.length);
}
function select(selector, root3, options = {}, limit = Infinity) {
if (typeof selector === "function") {
return find2(root3, selector);
}
const [plain, filtered] = groupSelectors(parse2(selector));
const results = filtered.map((sel) => findFilterElements(root3, sel, options, true, limit));
if (plain.length) {
results.push(findElements(root3, plain, options, limit));
}
if (results.length === 0) {
return [];
}
if (results.length === 1) {
return results[0];
}
return uniqueSort(results.reduce((a, b) => [...a, ...b]));
}
function findFilterElements(root3, selector, options, queryForSelector, totalLimit) {
const filterIndex = selector.findIndex(isFilter);
const sub = selector.slice(0, filterIndex);
const filter4 = selector[filterIndex];
const partLimit = selector.length - 1 === filterIndex ? totalLimit : Infinity;
const limit = getLimit(filter4.name, filter4.data, partLimit);
if (limit === 0)
return [];
const elemsNoLimit = sub.length === 0 && !Array.isArray(root3) ? getChildren(root3).filter(isTag2) : sub.length === 0 ? (Array.isArray(root3) ? root3 : [root3]).filter(isTag2) : queryForSelector || sub.some(isTraversal) ? findElements(root3, [sub], options, limit) : filterElements(root3, [sub], options);
const elems = elemsNoLimit.slice(0, limit);
let result = filterByPosition(filter4.name, elems, filter4.data, options);
if (result.length === 0 || selector.length === filterIndex + 1) {
return result;
}
const remainingSelector = selector.slice(filterIndex + 1);
const remainingHasTraversal = remainingSelector.some(isTraversal);
if (remainingHasTraversal) {
if (isTraversal(remainingSelector[0])) {
const { type } = remainingSelector[0];
if (type === SelectorType.Sibling || type === SelectorType.Adjacent) {
result = prepareContext(result, esm_exports2, true);
}
remainingSelector.unshift(UNIVERSAL_SELECTOR);
}
options = {
...options,
relativeSelector: false,
rootFunc: (el) => result.includes(el)
};
} else if (options.rootFunc && options.rootFunc !== boolbase7.trueFunc) {
options = { ...options, rootFunc: boolbase7.trueFunc };
}
return remainingSelector.some(isFilter) ? findFilterElements(result, remainingSelector, options, false, totalLimit) : remainingHasTraversal ? findElements(result, [remainingSelector], options, totalLimit) : filterElements(result, [remainingSelector], options);
}
function findElements(root3, sel, options, limit) {
const query = _compileToken(sel, options, root3);
return find2(root3, query, limit);
}
function find2(root3, query, limit = Infinity) {
const elems = prepareContext(root3, esm_exports2, query.shouldTestNextSiblings);
return find((node) => isTag2(node) && query(node), elems, true, limit);
}
function filterElements(elements, sel, options) {
const els = (Array.isArray(elements) ? elements : [elements]).filter(isTag2);
if (els.length === 0)
return els;
const query = _compileToken(sel, options);
return query === boolbase7.trueFunc ? els : els.filter(query);
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/traversing.js
var reSiblingSelector = /^\s*[~+]/;
function find3(selectorOrHaystack) {
var _a3;
if (!selectorOrHaystack) {
return this._make([]);
}
const context = this.toArray();
if (typeof selectorOrHaystack !== "string") {
const haystack = isCheerio(selectorOrHaystack) ? selectorOrHaystack.toArray() : [selectorOrHaystack];
return this._make(haystack.filter((elem) => context.some((node) => contains(node, elem))));
}
const elems = reSiblingSelector.test(selectorOrHaystack) ? context : this.children().toArray();
const options = {
context,
root: (_a3 = this._root) === null || _a3 === void 0 ? void 0 : _a3[0],
xmlMode: this.options.xmlMode,
lowerCaseTags: this.options.lowerCaseTags,
lowerCaseAttributeNames: this.options.lowerCaseAttributeNames,
pseudos: this.options.pseudos,
quirksMode: this.options.quirksMode
};
return this._make(select(selectorOrHaystack, elems, options));
}
function _getMatcher(matchMap) {
return function(fn, ...postFns) {
return function(selector) {
var _a3;
let matched = matchMap(fn, this);
if (selector) {
matched = filterArray(matched, selector, this.options.xmlMode, (_a3 = this._root) === null || _a3 === void 0 ? void 0 : _a3[0]);
}
return this._make(
this.length > 1 && matched.length > 1 ? postFns.reduce((elems, fn2) => fn2(elems), matched) : matched
);
};
};
}
var _matcher = _getMatcher((fn, elems) => {
const ret = [];
for (let i = 0; i < elems.length; i++) {
const value = fn(elems[i]);
ret.push(value);
}
return new Array().concat(...ret);
});
var _singleMatcher = _getMatcher((fn, elems) => {
const ret = [];
for (let i = 0; i < elems.length; i++) {
const value = fn(elems[i]);
if (value !== null) {
ret.push(value);
}
}
return ret;
});
function _matchUntil(nextElem, ...postFns) {
let matches = null;
const innerMatcher = _getMatcher((nextElem2, elems) => {
const matched = [];
domEach(elems, (elem) => {
for (let next2; next2 = nextElem2(elem); elem = next2) {
if (matches === null || matches === void 0 ? void 0 : matches(next2, matched.length))
break;
matched.push(next2);
}
});
return matched;
})(nextElem, ...postFns);
return function(selector, filterSelector) {
matches = typeof selector === "string" ? (elem) => is2(elem, selector, this.options) : selector ? getFilterFn(selector) : null;
const ret = innerMatcher.call(this, filterSelector);
matches = null;
return ret;
};
}
function _removeDuplicates(elems) {
return Array.from(new Set(elems));
}
var parent = _singleMatcher(({ parent: parent2 }) => parent2 && !isDocument(parent2) ? parent2 : null, _removeDuplicates);
var parents = _matcher((elem) => {
const matched = [];
while (elem.parent && !isDocument(elem.parent)) {
matched.push(elem.parent);
elem = elem.parent;
}
return matched;
}, uniqueSort, (elems) => elems.reverse());
var parentsUntil = _matchUntil(({ parent: parent2 }) => parent2 && !isDocument(parent2) ? parent2 : null, uniqueSort, (elems) => elems.reverse());
function closest(selector) {
var _a3;
const set3 = [];
if (!selector) {
return this._make(set3);
}
const selectOpts = {
xmlMode: this.options.xmlMode,
root: (_a3 = this._root) === null || _a3 === void 0 ? void 0 : _a3[0]
};
const selectFn = typeof selector === "string" ? (elem) => is2(elem, selector, selectOpts) : getFilterFn(selector);
domEach(this, (elem) => {
while (elem && isTag2(elem)) {
if (selectFn(elem, 0)) {
if (!set3.includes(elem)) {
set3.push(elem);
}
break;
}
elem = elem.parent;
}
});
return this._make(set3);
}
var next = _singleMatcher((elem) => nextElementSibling(elem));
var nextAll = _matcher((elem) => {
const matched = [];
while (elem.next) {
elem = elem.next;
if (isTag2(elem))
matched.push(elem);
}
return matched;
}, _removeDuplicates);
var nextUntil = _matchUntil((el) => nextElementSibling(el), _removeDuplicates);
var prev = _singleMatcher((elem) => prevElementSibling(elem));
var prevAll = _matcher((elem) => {
const matched = [];
while (elem.prev) {
elem = elem.prev;
if (isTag2(elem))
matched.push(elem);
}
return matched;
}, _removeDuplicates);
var prevUntil = _matchUntil((el) => prevElementSibling(el), _removeDuplicates);
var siblings = _matcher((elem) => getSiblings(elem).filter((el) => isTag2(el) && el !== elem), uniqueSort);
var children = _matcher((elem) => getChildren(elem).filter(isTag2), _removeDuplicates);
function contents() {
const elems = this.toArray().reduce((newElems, elem) => hasChildren(elem) ? newElems.concat(elem.children) : newElems, []);
return this._make(elems);
}
function each(fn) {
let i = 0;
const len = this.length;
while (i < len && fn.call(this[i], i, this[i]) !== false)
++i;
return this;
}
function map(fn) {
let elems = [];
for (let i = 0; i < this.length; i++) {
const el = this[i];
const val2 = fn.call(el, i, el);
if (val2 != null) {
elems = elems.concat(val2);
}
}
return this._make(elems);
}
function getFilterFn(match3) {
if (typeof match3 === "function") {
return (el, i) => match3.call(el, i, el);
}
if (isCheerio(match3)) {
return (el) => Array.prototype.includes.call(match3, el);
}
return function(el) {
return match3 === el;
};
}
function filter3(match3) {
var _a3;
return this._make(filterArray(this.toArray(), match3, this.options.xmlMode, (_a3 = this._root) === null || _a3 === void 0 ? void 0 : _a3[0]));
}
function filterArray(nodes, match3, xmlMode, root3) {
return typeof match3 === "string" ? filter2(match3, nodes, { xmlMode, root: root3 }) : nodes.filter(getFilterFn(match3));
}
function is3(selector) {
const nodes = this.toArray();
return typeof selector === "string" ? some(nodes.filter(isTag2), selector, this.options) : selector ? nodes.some(getFilterFn(selector)) : false;
}
function not(match3) {
let nodes = this.toArray();
if (typeof match3 === "string") {
const matches = new Set(filter2(match3, nodes, this.options));
nodes = nodes.filter((el) => !matches.has(el));
} else {
const filterFn = getFilterFn(match3);
nodes = nodes.filter((el, i) => !filterFn(el, i));
}
return this._make(nodes);
}
function has(selectorOrHaystack) {
return this.filter(typeof selectorOrHaystack === "string" ? `:has(${selectorOrHaystack})` : (_, el) => this._make(el).find(selectorOrHaystack).length > 0);
}
function first() {
return this.length > 1 ? this._make(this[0]) : this;
}
function last() {
return this.length > 0 ? this._make(this[this.length - 1]) : this;
}
function eq(i) {
var _a3;
i = +i;
if (i === 0 && this.length <= 1)
return this;
if (i < 0)
i = this.length + i;
return this._make((_a3 = this[i]) !== null && _a3 !== void 0 ? _a3 : []);
}
function get(i) {
if (i == null) {
return this.toArray();
}
return this[i < 0 ? this.length + i : i];
}
function toArray() {
return Array.prototype.slice.call(this);
}
function index(selectorOrNeedle) {
let $haystack;
let needle;
if (selectorOrNeedle == null) {
$haystack = this.parent().children();
needle = this[0];
} else if (typeof selectorOrNeedle === "string") {
$haystack = this._make(selectorOrNeedle);
needle = this[0];
} else {
$haystack = this;
needle = isCheerio(selectorOrNeedle) ? selectorOrNeedle[0] : selectorOrNeedle;
}
return Array.prototype.indexOf.call($haystack, needle);
}
function slice(start, end2) {
return this._make(Array.prototype.slice.call(this, start, end2));
}
function end() {
var _a3;
return (_a3 = this.prevObject) !== null && _a3 !== void 0 ? _a3 : this._make([]);
}
function add(other, context) {
const selection = this._make(other, context);
const contents2 = uniqueSort([...this.get(), ...selection.get()]);
return this._make(contents2);
}
function addBack(selector) {
return this.prevObject ? this.add(selector ? this.prevObject.filter(selector) : this.prevObject) : this;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/manipulation.js
var manipulation_exports = {};
__export(manipulation_exports, {
_makeDomArray: () => _makeDomArray,
after: () => after,
append: () => append2,
appendTo: () => appendTo,
before: () => before,
clone: () => clone3,
empty: () => empty,
html: () => html3,
insertAfter: () => insertAfter,
insertBefore: () => insertBefore,
prepend: () => prepend2,
prependTo: () => prependTo,
remove: () => remove,
replaceWith: () => replaceWith,
text: () => text3,
toString: () => toString,
unwrap: () => unwrap,
wrap: () => wrap,
wrapAll: () => wrapAll,
wrapInner: () => wrapInner
});
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/parse.js
function getParse(parser) {
return function parse8(content, options, isDocument3, context) {
if (typeof Buffer !== "undefined" && Buffer.isBuffer(content)) {
content = content.toString();
}
if (typeof content === "string") {
return parser(content, options, isDocument3, context);
}
const doc = content;
if (!Array.isArray(doc) && isDocument(doc)) {
return doc;
}
const root3 = new Document([]);
update(doc, root3);
return root3;
};
}
function update(newChilds, parent2) {
const arr = Array.isArray(newChilds) ? newChilds : [newChilds];
if (parent2) {
parent2.children = arr;
} else {
parent2 = null;
}
for (let i = 0; i < arr.length; i++) {
const node = arr[i];
if (node.parent && node.parent.children !== arr) {
removeElement(node);
}
if (parent2) {
node.prev = arr[i - 1] || null;
node.next = arr[i + 1] || null;
} else {
node.prev = node.next = null;
}
node.parent = parent2;
}
return parent2;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/manipulation.js
function _makeDomArray(elem, clone4) {
if (elem == null) {
return [];
}
if (isCheerio(elem)) {
return clone4 ? cloneDom(elem.get()) : elem.get();
}
if (Array.isArray(elem)) {
return elem.reduce((newElems, el) => newElems.concat(this._makeDomArray(el, clone4)), []);
}
if (typeof elem === "string") {
return this._parse(elem, this.options, false, null).children;
}
return clone4 ? cloneDom([elem]) : [elem];
}
function _insert(concatenator) {
return function(...elems) {
const lastIdx = this.length - 1;
return domEach(this, (el, i) => {
if (!hasChildren(el))
return;
const domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, this._render(el.children)) : elems;
const dom = this._makeDomArray(domSrc, i < lastIdx);
concatenator(dom, el.children, el);
});
};
}
function uniqueSplice(array, spliceIdx, spliceCount, newElems, parent2) {
var _a3, _b;
const spliceArgs = [
spliceIdx,
spliceCount,
...newElems
];
const prev2 = spliceIdx === 0 ? null : array[spliceIdx - 1];
const next2 = spliceIdx + spliceCount >= array.length ? null : array[spliceIdx + spliceCount];
for (let idx = 0; idx < newElems.length; ++idx) {
const node = newElems[idx];
const oldParent = node.parent;
if (oldParent) {
const oldSiblings = oldParent.children;
const prevIdx = oldSiblings.indexOf(node);
if (prevIdx > -1) {
oldParent.children.splice(prevIdx, 1);
if (parent2 === oldParent && spliceIdx > prevIdx) {
spliceArgs[0]--;
}
}
}
node.parent = parent2;
if (node.prev) {
node.prev.next = (_a3 = node.next) !== null && _a3 !== void 0 ? _a3 : null;
}
if (node.next) {
node.next.prev = (_b = node.prev) !== null && _b !== void 0 ? _b : null;
}
node.prev = idx === 0 ? prev2 : newElems[idx - 1];
node.next = idx === newElems.length - 1 ? next2 : newElems[idx + 1];
}
if (prev2) {
prev2.next = newElems[0];
}
if (next2) {
next2.prev = newElems[newElems.length - 1];
}
return array.splice(...spliceArgs);
}
function appendTo(target) {
const appendTarget = isCheerio(target) ? target : this._make(target);
appendTarget.append(this);
return this;
}
function prependTo(target) {
const prependTarget = isCheerio(target) ? target : this._make(target);
prependTarget.prepend(this);
return this;
}
var append2 = _insert((dom, children2, parent2) => {
uniqueSplice(children2, children2.length, 0, dom, parent2);
});
var prepend2 = _insert((dom, children2, parent2) => {
uniqueSplice(children2, 0, 0, dom, parent2);
});
function _wrap(insert) {
return function(wrapper) {
const lastIdx = this.length - 1;
const lastParent = this.parents().last();
for (let i = 0; i < this.length; i++) {
const el = this[i];
const wrap2 = typeof wrapper === "function" ? wrapper.call(el, i, el) : typeof wrapper === "string" && !isHtml(wrapper) ? lastParent.find(wrapper).clone() : wrapper;
const [wrapperDom] = this._makeDomArray(wrap2, i < lastIdx);
if (!wrapperDom || !hasChildren(wrapperDom))
continue;
let elInsertLocation = wrapperDom;
let j = 0;
while (j < elInsertLocation.children.length) {
const child = elInsertLocation.children[j];
if (isTag2(child)) {
elInsertLocation = child;
j = 0;
} else {
j++;
}
}
insert(el, elInsertLocation, [wrapperDom]);
}
return this;
};
}
var wrap = _wrap((el, elInsertLocation, wrapperDom) => {
const { parent: parent2 } = el;
if (!parent2)
return;
const siblings2 = parent2.children;
const index2 = siblings2.indexOf(el);
update([el], elInsertLocation);
uniqueSplice(siblings2, index2, 0, wrapperDom, parent2);
});
var wrapInner = _wrap((el, elInsertLocation, wrapperDom) => {
if (!hasChildren(el))
return;
update(el.children, elInsertLocation);
update(wrapperDom, el);
});
function unwrap(selector) {
this.parent(selector).not("body").each((_, el) => {
this._make(el).replaceWith(el.children);
});
return this;
}
function wrapAll(wrapper) {
const el = this[0];
if (el) {
const wrap2 = this._make(typeof wrapper === "function" ? wrapper.call(el, 0, el) : wrapper).insertBefore(el);
let elInsertLocation;
for (let i = 0; i < wrap2.length; i++) {
if (wrap2[i].type === "tag")
elInsertLocation = wrap2[i];
}
let j = 0;
while (elInsertLocation && j < elInsertLocation.children.length) {
const child = elInsertLocation.children[j];
if (child.type === "tag") {
elInsertLocation = child;
j = 0;
} else {
j++;
}
}
if (elInsertLocation)
this._make(elInsertLocation).append(this);
}
return this;
}
function after(...elems) {
const lastIdx = this.length - 1;
return domEach(this, (el, i) => {
const { parent: parent2 } = el;
if (!hasChildren(el) || !parent2) {
return;
}
const siblings2 = parent2.children;
const index2 = siblings2.indexOf(el);
if (index2 < 0)
return;
const domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, this._render(el.children)) : elems;
const dom = this._makeDomArray(domSrc, i < lastIdx);
uniqueSplice(siblings2, index2 + 1, 0, dom, parent2);
});
}
function insertAfter(target) {
if (typeof target === "string") {
target = this._make(target);
}
this.remove();
const clones = [];
this._makeDomArray(target).forEach((el) => {
const clonedSelf = this.clone().toArray();
const { parent: parent2 } = el;
if (!parent2) {
return;
}
const siblings2 = parent2.children;
const index2 = siblings2.indexOf(el);
if (index2 < 0)
return;
uniqueSplice(siblings2, index2 + 1, 0, clonedSelf, parent2);
clones.push(...clonedSelf);
});
return this._make(clones);
}
function before(...elems) {
const lastIdx = this.length - 1;
return domEach(this, (el, i) => {
const { parent: parent2 } = el;
if (!hasChildren(el) || !parent2) {
return;
}
const siblings2 = parent2.children;
const index2 = siblings2.indexOf(el);
if (index2 < 0)
return;
const domSrc = typeof elems[0] === "function" ? elems[0].call(el, i, this._render(el.children)) : elems;
const dom = this._makeDomArray(domSrc, i < lastIdx);
uniqueSplice(siblings2, index2, 0, dom, parent2);
});
}
function insertBefore(target) {
const targetArr = this._make(target);
this.remove();
const clones = [];
domEach(targetArr, (el) => {
const clonedSelf = this.clone().toArray();
const { parent: parent2 } = el;
if (!parent2) {
return;
}
const siblings2 = parent2.children;
const index2 = siblings2.indexOf(el);
if (index2 < 0)
return;
uniqueSplice(siblings2, index2, 0, clonedSelf, parent2);
clones.push(...clonedSelf);
});
return this._make(clones);
}
function remove(selector) {
const elems = selector ? this.filter(selector) : this;
domEach(elems, (el) => {
removeElement(el);
el.prev = el.next = el.parent = null;
});
return this;
}
function replaceWith(content) {
return domEach(this, (el, i) => {
const { parent: parent2 } = el;
if (!parent2) {
return;
}
const siblings2 = parent2.children;
const cont = typeof content === "function" ? content.call(el, i, el) : content;
const dom = this._makeDomArray(cont);
update(dom, null);
const index2 = siblings2.indexOf(el);
uniqueSplice(siblings2, index2, 1, dom, parent2);
if (!dom.includes(el)) {
el.parent = el.prev = el.next = null;
}
});
}
function empty() {
return domEach(this, (el) => {
if (!hasChildren(el))
return;
el.children.forEach((child) => {
child.next = child.prev = child.parent = null;
});
el.children.length = 0;
});
}
function html3(str) {
if (str === void 0) {
const el = this[0];
if (!el || !hasChildren(el))
return null;
return this._render(el.children);
}
return domEach(this, (el) => {
if (!hasChildren(el))
return;
el.children.forEach((child) => {
child.next = child.prev = child.parent = null;
});
const content = isCheerio(str) ? str.toArray() : this._parse(`${str}`, this.options, false, el).children;
update(content, el);
});
}
function toString() {
return this._render(this);
}
function text3(str) {
if (str === void 0) {
return text2(this);
}
if (typeof str === "function") {
return domEach(this, (el, i) => this._make(el).text(str.call(el, i, text2([el]))));
}
return domEach(this, (el) => {
if (!hasChildren(el))
return;
el.children.forEach((child) => {
child.next = child.prev = child.parent = null;
});
const textNode = new Text2(`${str}`);
update(textNode, el);
});
}
function clone3() {
return this._make(cloneDom(this.get()));
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/css.js
var css_exports = {};
__export(css_exports, {
css: () => css
});
function css(prop2, val2) {
if (prop2 != null && val2 != null || typeof prop2 === "object" && !Array.isArray(prop2)) {
return domEach(this, (el, i) => {
if (isTag2(el)) {
setCss(el, prop2, val2, i);
}
});
}
if (this.length === 0) {
return void 0;
}
return getCss(this[0], prop2);
}
function setCss(el, prop2, value, idx) {
if (typeof prop2 === "string") {
const styles2 = getCss(el);
const val2 = typeof value === "function" ? value.call(el, idx, styles2[prop2]) : value;
if (val2 === "") {
delete styles2[prop2];
} else if (val2 != null) {
styles2[prop2] = val2;
}
el.attribs["style"] = stringify(styles2);
} else if (typeof prop2 === "object") {
Object.keys(prop2).forEach((k, i) => {
setCss(el, k, prop2[k], i);
});
}
}
function getCss(el, prop2) {
if (!el || !isTag2(el))
return;
const styles2 = parse4(el.attribs["style"]);
if (typeof prop2 === "string") {
return styles2[prop2];
}
if (Array.isArray(prop2)) {
const newStyles = {};
prop2.forEach((item) => {
if (styles2[item] != null) {
newStyles[item] = styles2[item];
}
});
return newStyles;
}
return styles2;
}
function stringify(obj) {
return Object.keys(obj).reduce((str, prop2) => `${str}${str ? " " : ""}${prop2}: ${obj[prop2]};`, "");
}
function parse4(styles2) {
styles2 = (styles2 || "").trim();
if (!styles2)
return {};
const obj = {};
let key;
for (const str of styles2.split(";")) {
const n2 = str.indexOf(":");
if (n2 < 1 || n2 === str.length - 1) {
const trimmed = str.trimEnd();
if (trimmed.length > 0 && key !== void 0) {
obj[key] += `;${trimmed}`;
}
} else {
key = str.slice(0, n2).trim();
obj[key] = str.slice(n2 + 1).trim();
}
}
return obj;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/api/forms.js
var forms_exports = {};
__export(forms_exports, {
serialize: () => serialize,
serializeArray: () => serializeArray
});
var submittableSelector = "input,select,textarea,keygen";
var r20 = /%20/g;
var rCRLF = /\r?\n/g;
function serialize() {
const arr = this.serializeArray();
const retArr = arr.map((data2) => `${encodeURIComponent(data2.name)}=${encodeURIComponent(data2.value)}`);
return retArr.join("&").replace(r20, "+");
}
function serializeArray() {
return this.map((_, elem) => {
const $elem = this._make(elem);
if (isTag2(elem) && elem.name === "form") {
return $elem.find(submittableSelector).toArray();
}
return $elem.filter(submittableSelector).toArray();
}).filter(
'[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))'
).map((_, elem) => {
var _a3;
const $elem = this._make(elem);
const name2 = $elem.attr("name");
const value = (_a3 = $elem.val()) !== null && _a3 !== void 0 ? _a3 : "";
if (Array.isArray(value)) {
return value.map((val2) => ({ name: name2, value: val2.replace(rCRLF, "\r\n") }));
}
return { name: name2, value: value.replace(rCRLF, "\r\n") };
}).toArray();
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/cheerio.js
var Cheerio = class {
constructor(elements, root3, options) {
this.length = 0;
this.options = options;
this._root = root3;
if (elements) {
for (let idx = 0; idx < elements.length; idx++) {
this[idx] = elements[idx];
}
this.length = elements.length;
}
}
};
Cheerio.prototype.cheerio = "[cheerio object]";
Cheerio.prototype.splice = Array.prototype.splice;
Cheerio.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];
Object.assign(Cheerio.prototype, attributes_exports, traversing_exports, manipulation_exports, css_exports, forms_exports);
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/load.js
function getLoad(parse8, render3) {
return function load2(content, options, isDocument3 = true) {
if (content == null) {
throw new Error("cheerio.load() expects a string");
}
const internalOpts = { ...options_default, ...flatten2(options) };
const initialRoot = parse8(content, internalOpts, isDocument3, null);
class LoadedCheerio extends Cheerio {
_make(selector, context) {
const cheerio = initialize(selector, context);
cheerio.prevObject = this;
return cheerio;
}
_parse(content2, options2, isDocument4, context) {
return parse8(content2, options2, isDocument4, context);
}
_render(dom) {
return render3(dom, this.options);
}
}
function initialize(selector, context, root3 = initialRoot, opts) {
if (selector && isCheerio(selector))
return selector;
const options2 = {
...internalOpts,
...flatten2(opts)
};
const r = typeof root3 === "string" ? [parse8(root3, options2, false, null)] : "length" in root3 ? root3 : [root3];
const rootInstance = isCheerio(r) ? r : new LoadedCheerio(r, null, options2);
rootInstance._root = rootInstance;
if (!selector) {
return new LoadedCheerio(void 0, rootInstance, options2);
}
const elements = typeof selector === "string" && isHtml(selector) ? parse8(selector, options2, false, null).children : isNode(selector) ? [selector] : Array.isArray(selector) ? selector : void 0;
const instance = new LoadedCheerio(elements, rootInstance, options2);
if (elements) {
return instance;
}
if (typeof selector !== "string") {
throw new Error("Unexpected type of selector");
}
let search = selector;
const searchContext = !context ? rootInstance : typeof context === "string" ? isHtml(context) ? new LoadedCheerio([parse8(context, options2, false, null)], rootInstance, options2) : (search = `${context} ${search}`, rootInstance) : isCheerio(context) ? context : new LoadedCheerio(Array.isArray(context) ? context : [context], rootInstance, options2);
if (!searchContext)
return instance;
return searchContext.find(search);
}
Object.assign(initialize, static_exports, {
load: load2,
_root: initialRoot,
_options: internalOpts,
fn: LoadedCheerio.prototype,
prototype: LoadedCheerio.prototype
});
return initialize;
};
}
function isNode(obj) {
return !!obj.name || obj.type === "root" || obj.type === "text" || obj.type === "comment";
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/unicode.js
var UNDEFINED_CODE_POINTS = /* @__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
]);
var REPLACEMENT_CHARACTER = "\uFFFD";
var CODE_POINTS;
(function(CODE_POINTS2) {
CODE_POINTS2[CODE_POINTS2["EOF"] = -1] = "EOF";
CODE_POINTS2[CODE_POINTS2["NULL"] = 0] = "NULL";
CODE_POINTS2[CODE_POINTS2["TABULATION"] = 9] = "TABULATION";
CODE_POINTS2[CODE_POINTS2["CARRIAGE_RETURN"] = 13] = "CARRIAGE_RETURN";
CODE_POINTS2[CODE_POINTS2["LINE_FEED"] = 10] = "LINE_FEED";
CODE_POINTS2[CODE_POINTS2["FORM_FEED"] = 12] = "FORM_FEED";
CODE_POINTS2[CODE_POINTS2["SPACE"] = 32] = "SPACE";
CODE_POINTS2[CODE_POINTS2["EXCLAMATION_MARK"] = 33] = "EXCLAMATION_MARK";
CODE_POINTS2[CODE_POINTS2["QUOTATION_MARK"] = 34] = "QUOTATION_MARK";
CODE_POINTS2[CODE_POINTS2["AMPERSAND"] = 38] = "AMPERSAND";
CODE_POINTS2[CODE_POINTS2["APOSTROPHE"] = 39] = "APOSTROPHE";
CODE_POINTS2[CODE_POINTS2["HYPHEN_MINUS"] = 45] = "HYPHEN_MINUS";
CODE_POINTS2[CODE_POINTS2["SOLIDUS"] = 47] = "SOLIDUS";
CODE_POINTS2[CODE_POINTS2["DIGIT_0"] = 48] = "DIGIT_0";
CODE_POINTS2[CODE_POINTS2["DIGIT_9"] = 57] = "DIGIT_9";
CODE_POINTS2[CODE_POINTS2["SEMICOLON"] = 59] = "SEMICOLON";
CODE_POINTS2[CODE_POINTS2["LESS_THAN_SIGN"] = 60] = "LESS_THAN_SIGN";
CODE_POINTS2[CODE_POINTS2["EQUALS_SIGN"] = 61] = "EQUALS_SIGN";
CODE_POINTS2[CODE_POINTS2["GREATER_THAN_SIGN"] = 62] = "GREATER_THAN_SIGN";
CODE_POINTS2[CODE_POINTS2["QUESTION_MARK"] = 63] = "QUESTION_MARK";
CODE_POINTS2[CODE_POINTS2["LATIN_CAPITAL_A"] = 65] = "LATIN_CAPITAL_A";
CODE_POINTS2[CODE_POINTS2["LATIN_CAPITAL_Z"] = 90] = "LATIN_CAPITAL_Z";
CODE_POINTS2[CODE_POINTS2["RIGHT_SQUARE_BRACKET"] = 93] = "RIGHT_SQUARE_BRACKET";
CODE_POINTS2[CODE_POINTS2["GRAVE_ACCENT"] = 96] = "GRAVE_ACCENT";
CODE_POINTS2[CODE_POINTS2["LATIN_SMALL_A"] = 97] = "LATIN_SMALL_A";
CODE_POINTS2[CODE_POINTS2["LATIN_SMALL_Z"] = 122] = "LATIN_SMALL_Z";
})(CODE_POINTS || (CODE_POINTS = {}));
var SEQUENCES = {
DASH_DASH: "--",
CDATA_START: "[CDATA[",
DOCTYPE: "doctype",
SCRIPT: "script",
PUBLIC: "public",
SYSTEM: "system"
};
function isSurrogate(cp) {
return cp >= 55296 && cp <= 57343;
}
function isSurrogatePair(cp) {
return cp >= 56320 && cp <= 57343;
}
function getSurrogatePairCodePoint(cp1, cp2) {
return (cp1 - 55296) * 1024 + 9216 + cp2;
}
function isControlCodePoint(cp) {
return cp !== 32 && cp !== 10 && cp !== 13 && cp !== 9 && cp !== 12 && cp >= 1 && cp <= 31 || cp >= 127 && cp <= 159;
}
function isUndefinedCodePoint(cp) {
return cp >= 64976 && cp <= 65007 || UNDEFINED_CODE_POINTS.has(cp);
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/error-codes.js
var ERR;
(function(ERR2) {
ERR2["controlCharacterInInputStream"] = "control-character-in-input-stream";
ERR2["noncharacterInInputStream"] = "noncharacter-in-input-stream";
ERR2["surrogateInInputStream"] = "surrogate-in-input-stream";
ERR2["nonVoidHtmlElementStartTagWithTrailingSolidus"] = "non-void-html-element-start-tag-with-trailing-solidus";
ERR2["endTagWithAttributes"] = "end-tag-with-attributes";
ERR2["endTagWithTrailingSolidus"] = "end-tag-with-trailing-solidus";
ERR2["unexpectedSolidusInTag"] = "unexpected-solidus-in-tag";
ERR2["unexpectedNullCharacter"] = "unexpected-null-character";
ERR2["unexpectedQuestionMarkInsteadOfTagName"] = "unexpected-question-mark-instead-of-tag-name";
ERR2["invalidFirstCharacterOfTagName"] = "invalid-first-character-of-tag-name";
ERR2["unexpectedEqualsSignBeforeAttributeName"] = "unexpected-equals-sign-before-attribute-name";
ERR2["missingEndTagName"] = "missing-end-tag-name";
ERR2["unexpectedCharacterInAttributeName"] = "unexpected-character-in-attribute-name";
ERR2["unknownNamedCharacterReference"] = "unknown-named-character-reference";
ERR2["missingSemicolonAfterCharacterReference"] = "missing-semicolon-after-character-reference";
ERR2["unexpectedCharacterAfterDoctypeSystemIdentifier"] = "unexpected-character-after-doctype-system-identifier";
ERR2["unexpectedCharacterInUnquotedAttributeValue"] = "unexpected-character-in-unquoted-attribute-value";
ERR2["eofBeforeTagName"] = "eof-before-tag-name";
ERR2["eofInTag"] = "eof-in-tag";
ERR2["missingAttributeValue"] = "missing-attribute-value";
ERR2["missingWhitespaceBetweenAttributes"] = "missing-whitespace-between-attributes";
ERR2["missingWhitespaceAfterDoctypePublicKeyword"] = "missing-whitespace-after-doctype-public-keyword";
ERR2["missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers"] = "missing-whitespace-between-doctype-public-and-system-identifiers";
ERR2["missingWhitespaceAfterDoctypeSystemKeyword"] = "missing-whitespace-after-doctype-system-keyword";
ERR2["missingQuoteBeforeDoctypePublicIdentifier"] = "missing-quote-before-doctype-public-identifier";
ERR2["missingQuoteBeforeDoctypeSystemIdentifier"] = "missing-quote-before-doctype-system-identifier";
ERR2["missingDoctypePublicIdentifier"] = "missing-doctype-public-identifier";
ERR2["missingDoctypeSystemIdentifier"] = "missing-doctype-system-identifier";
ERR2["abruptDoctypePublicIdentifier"] = "abrupt-doctype-public-identifier";
ERR2["abruptDoctypeSystemIdentifier"] = "abrupt-doctype-system-identifier";
ERR2["cdataInHtmlContent"] = "cdata-in-html-content";
ERR2["incorrectlyOpenedComment"] = "incorrectly-opened-comment";
ERR2["eofInScriptHtmlCommentLikeText"] = "eof-in-script-html-comment-like-text";
ERR2["eofInDoctype"] = "eof-in-doctype";
ERR2["nestedComment"] = "nested-comment";
ERR2["abruptClosingOfEmptyComment"] = "abrupt-closing-of-empty-comment";
ERR2["eofInComment"] = "eof-in-comment";
ERR2["incorrectlyClosedComment"] = "incorrectly-closed-comment";
ERR2["eofInCdata"] = "eof-in-cdata";
ERR2["absenceOfDigitsInNumericCharacterReference"] = "absence-of-digits-in-numeric-character-reference";
ERR2["nullCharacterReference"] = "null-character-reference";
ERR2["surrogateCharacterReference"] = "surrogate-character-reference";
ERR2["characterReferenceOutsideUnicodeRange"] = "character-reference-outside-unicode-range";
ERR2["controlCharacterReference"] = "control-character-reference";
ERR2["noncharacterCharacterReference"] = "noncharacter-character-reference";
ERR2["missingWhitespaceBeforeDoctypeName"] = "missing-whitespace-before-doctype-name";
ERR2["missingDoctypeName"] = "missing-doctype-name";
ERR2["invalidCharacterSequenceAfterDoctypeName"] = "invalid-character-sequence-after-doctype-name";
ERR2["duplicateAttribute"] = "duplicate-attribute";
ERR2["nonConformingDoctype"] = "non-conforming-doctype";
ERR2["missingDoctype"] = "missing-doctype";
ERR2["misplacedDoctype"] = "misplaced-doctype";
ERR2["endTagWithoutMatchingOpenElement"] = "end-tag-without-matching-open-element";
ERR2["closingOfElementWithOpenChildElements"] = "closing-of-element-with-open-child-elements";
ERR2["disallowedContentInNoscriptInHead"] = "disallowed-content-in-noscript-in-head";
ERR2["openElementsLeftAfterEof"] = "open-elements-left-after-eof";
ERR2["abandonedHeadElementChild"] = "abandoned-head-element-child";
ERR2["misplacedStartTagForHeadElement"] = "misplaced-start-tag-for-head-element";
ERR2["nestedNoscriptInHead"] = "nested-noscript-in-head";
ERR2["eofInElementThatCanContainOnlyText"] = "eof-in-element-that-can-contain-only-text";
})(ERR || (ERR = {}));
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/preprocessor.js
var DEFAULT_BUFFER_WATERLINE = 1 << 16;
var Preprocessor = class {
constructor(handler) {
this.handler = handler;
this.html = "";
this.pos = -1;
this.lastGapPos = -2;
this.gapStack = [];
this.skipNextNewLine = false;
this.lastChunkWritten = false;
this.endOfChunkHit = false;
this.bufferWaterline = DEFAULT_BUFFER_WATERLINE;
this.isEol = false;
this.lineStartPos = 0;
this.droppedBufferSize = 0;
this.line = 1;
this.lastErrOffset = -1;
}
get col() {
return this.pos - this.lineStartPos + Number(this.lastGapPos !== this.pos);
}
get offset() {
return this.droppedBufferSize + this.pos;
}
getError(code2, cpOffset) {
const { line, col, offset: offset2 } = this;
const startCol = col + cpOffset;
const startOffset = offset2 + cpOffset;
return {
code: code2,
startLine: line,
endLine: line,
startCol,
endCol: startCol,
startOffset,
endOffset: startOffset
};
}
_err(code2) {
if (this.handler.onParseError && this.lastErrOffset !== this.offset) {
this.lastErrOffset = this.offset;
this.handler.onParseError(this.getError(code2, 0));
}
}
_addGap() {
this.gapStack.push(this.lastGapPos);
this.lastGapPos = this.pos;
}
_processSurrogate(cp) {
if (this.pos !== this.html.length - 1) {
const nextCp = this.html.charCodeAt(this.pos + 1);
if (isSurrogatePair(nextCp)) {
this.pos++;
this._addGap();
return getSurrogatePairCodePoint(cp, nextCp);
}
} else if (!this.lastChunkWritten) {
this.endOfChunkHit = true;
return CODE_POINTS.EOF;
}
this._err(ERR.surrogateInInputStream);
return cp;
}
willDropParsedChunk() {
return this.pos > this.bufferWaterline;
}
dropParsedChunk() {
if (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(chunk, isLastChunk) {
if (this.html.length > 0) {
this.html += chunk;
} else {
this.html = chunk;
}
this.endOfChunkHit = false;
this.lastChunkWritten = isLastChunk;
}
insertHtmlAtCurrentPos(chunk) {
this.html = this.html.substring(0, this.pos + 1) + chunk + this.html.substring(this.pos + 1);
this.endOfChunkHit = false;
}
startsWith(pattern, caseSensitive) {
if (this.pos + pattern.length > this.html.length) {
this.endOfChunkHit = !this.lastChunkWritten;
return false;
}
if (caseSensitive) {
return this.html.startsWith(pattern, this.pos);
}
for (let i = 0; i < pattern.length; i++) {
const cp = this.html.charCodeAt(this.pos + i) | 32;
if (cp !== pattern.charCodeAt(i)) {
return false;
}
}
return true;
}
peek(offset2) {
const pos = this.pos + offset2;
if (pos >= this.html.length) {
this.endOfChunkHit = !this.lastChunkWritten;
return CODE_POINTS.EOF;
}
const code2 = this.html.charCodeAt(pos);
return code2 === CODE_POINTS.CARRIAGE_RETURN ? CODE_POINTS.LINE_FEED : code2;
}
advance() {
this.pos++;
if (this.isEol) {
this.isEol = false;
this.line++;
this.lineStartPos = this.pos;
}
if (this.pos >= this.html.length) {
this.endOfChunkHit = !this.lastChunkWritten;
return CODE_POINTS.EOF;
}
let cp = this.html.charCodeAt(this.pos);
if (cp === CODE_POINTS.CARRIAGE_RETURN) {
this.isEol = true;
this.skipNextNewLine = true;
return CODE_POINTS.LINE_FEED;
}
if (cp === CODE_POINTS.LINE_FEED) {
this.isEol = true;
if (this.skipNextNewLine) {
this.line--;
this.skipNextNewLine = false;
this._addGap();
return this.advance();
}
}
this.skipNextNewLine = false;
if (isSurrogate(cp)) {
cp = this._processSurrogate(cp);
}
const isCommonValidRange = this.handler.onParseError === null || cp > 31 && cp < 127 || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.CARRIAGE_RETURN || cp > 159 && cp < 64976;
if (!isCommonValidRange) {
this._checkForProblematicCharacters(cp);
}
return cp;
}
_checkForProblematicCharacters(cp) {
if (isControlCodePoint(cp)) {
this._err(ERR.controlCharacterInInputStream);
} else if (isUndefinedCodePoint(cp)) {
this._err(ERR.noncharacterInInputStream);
}
}
retreat(count) {
this.pos -= count;
while (this.pos < this.lastGapPos) {
this.lastGapPos = this.gapStack.pop();
this.pos--;
}
this.isEol = false;
}
};
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/token.js
var token_exports = {};
__export(token_exports, {
TokenType: () => TokenType,
getTokenAttr: () => getTokenAttr
});
var TokenType;
(function(TokenType2) {
TokenType2[TokenType2["CHARACTER"] = 0] = "CHARACTER";
TokenType2[TokenType2["NULL_CHARACTER"] = 1] = "NULL_CHARACTER";
TokenType2[TokenType2["WHITESPACE_CHARACTER"] = 2] = "WHITESPACE_CHARACTER";
TokenType2[TokenType2["START_TAG"] = 3] = "START_TAG";
TokenType2[TokenType2["END_TAG"] = 4] = "END_TAG";
TokenType2[TokenType2["COMMENT"] = 5] = "COMMENT";
TokenType2[TokenType2["DOCTYPE"] = 6] = "DOCTYPE";
TokenType2[TokenType2["EOF"] = 7] = "EOF";
TokenType2[TokenType2["HIBERNATION"] = 8] = "HIBERNATION";
})(TokenType || (TokenType = {}));
function getTokenAttr(token, attrName) {
for (let i = token.attrs.length - 1; i >= 0; i--) {
if (token.attrs[i].name === attrName) {
return token.attrs[i].value;
}
}
return null;
}
// ../../node_modules/.pnpm/entities@6.0.0/node_modules/entities/dist/esm/generated/decode-data-html.js
var htmlDecodeTree = /* @__PURE__ */ new Uint16Array(
/* @__PURE__ */ '\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map((c) => c.charCodeAt(0))
);
// ../../node_modules/.pnpm/entities@6.0.0/node_modules/entities/dist/esm/decode-codepoint.js
var _a2;
var decodeMap2 = /* @__PURE__ */ new Map([
[0, 65533],
[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]
]);
var fromCodePoint2 = (_a2 = String.fromCodePoint) !== null && _a2 !== void 0 ? _a2 : function(codePoint) {
let output = "";
if (codePoint > 65535) {
codePoint -= 65536;
output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);
codePoint = 56320 | codePoint & 1023;
}
output += String.fromCharCode(codePoint);
return output;
};
function replaceCodePoint2(codePoint) {
var _a3;
if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {
return 65533;
}
return (_a3 = decodeMap2.get(codePoint)) !== null && _a3 !== void 0 ? _a3 : codePoint;
}
// ../../node_modules/.pnpm/entities@6.0.0/node_modules/entities/dist/esm/decode.js
var CharCodes2;
(function(CharCodes4) {
CharCodes4[CharCodes4["NUM"] = 35] = "NUM";
CharCodes4[CharCodes4["SEMI"] = 59] = "SEMI";
CharCodes4[CharCodes4["EQUALS"] = 61] = "EQUALS";
CharCodes4[CharCodes4["ZERO"] = 48] = "ZERO";
CharCodes4[CharCodes4["NINE"] = 57] = "NINE";
CharCodes4[CharCodes4["LOWER_A"] = 97] = "LOWER_A";
CharCodes4[CharCodes4["LOWER_F"] = 102] = "LOWER_F";
CharCodes4[CharCodes4["LOWER_X"] = 120] = "LOWER_X";
CharCodes4[CharCodes4["LOWER_Z"] = 122] = "LOWER_Z";
CharCodes4[CharCodes4["UPPER_A"] = 65] = "UPPER_A";
CharCodes4[CharCodes4["UPPER_F"] = 70] = "UPPER_F";
CharCodes4[CharCodes4["UPPER_Z"] = 90] = "UPPER_Z";
})(CharCodes2 || (CharCodes2 = {}));
var TO_LOWER_BIT2 = 32;
var BinTrieFlags2;
(function(BinTrieFlags3) {
BinTrieFlags3[BinTrieFlags3["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
BinTrieFlags3[BinTrieFlags3["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH";
BinTrieFlags3[BinTrieFlags3["JUMP_TABLE"] = 127] = "JUMP_TABLE";
})(BinTrieFlags2 || (BinTrieFlags2 = {}));
function isNumber3(code2) {
return code2 >= CharCodes2.ZERO && code2 <= CharCodes2.NINE;
}
function isHexadecimalCharacter2(code2) {
return code2 >= CharCodes2.UPPER_A && code2 <= CharCodes2.UPPER_F || code2 >= CharCodes2.LOWER_A && code2 <= CharCodes2.LOWER_F;
}
function isAsciiAlphaNumeric2(code2) {
return code2 >= CharCodes2.UPPER_A && code2 <= CharCodes2.UPPER_Z || code2 >= CharCodes2.LOWER_A && code2 <= CharCodes2.LOWER_Z || isNumber3(code2);
}
function isEntityInAttributeInvalidEnd2(code2) {
return code2 === CharCodes2.EQUALS || isAsciiAlphaNumeric2(code2);
}
var EntityDecoderState2;
(function(EntityDecoderState3) {
EntityDecoderState3[EntityDecoderState3["EntityStart"] = 0] = "EntityStart";
EntityDecoderState3[EntityDecoderState3["NumericStart"] = 1] = "NumericStart";
EntityDecoderState3[EntityDecoderState3["NumericDecimal"] = 2] = "NumericDecimal";
EntityDecoderState3[EntityDecoderState3["NumericHex"] = 3] = "NumericHex";
EntityDecoderState3[EntityDecoderState3["NamedEntity"] = 4] = "NamedEntity";
})(EntityDecoderState2 || (EntityDecoderState2 = {}));
var DecodingMode2;
(function(DecodingMode3) {
DecodingMode3[DecodingMode3["Legacy"] = 0] = "Legacy";
DecodingMode3[DecodingMode3["Strict"] = 1] = "Strict";
DecodingMode3[DecodingMode3["Attribute"] = 2] = "Attribute";
})(DecodingMode2 || (DecodingMode2 = {}));
var EntityDecoder2 = class {
constructor(decodeTree, emitCodePoint, errors2) {
this.decodeTree = decodeTree;
this.emitCodePoint = emitCodePoint;
this.errors = errors2;
this.state = EntityDecoderState2.EntityStart;
this.consumed = 1;
this.result = 0;
this.treeIndex = 0;
this.excess = 1;
this.decodeMode = DecodingMode2.Strict;
}
startEntity(decodeMode) {
this.decodeMode = decodeMode;
this.state = EntityDecoderState2.EntityStart;
this.result = 0;
this.treeIndex = 0;
this.excess = 1;
this.consumed = 1;
}
write(input, offset2) {
switch (this.state) {
case EntityDecoderState2.EntityStart: {
if (input.charCodeAt(offset2) === CharCodes2.NUM) {
this.state = EntityDecoderState2.NumericStart;
this.consumed += 1;
return this.stateNumericStart(input, offset2 + 1);
}
this.state = EntityDecoderState2.NamedEntity;
return this.stateNamedEntity(input, offset2);
}
case EntityDecoderState2.NumericStart: {
return this.stateNumericStart(input, offset2);
}
case EntityDecoderState2.NumericDecimal: {
return this.stateNumericDecimal(input, offset2);
}
case EntityDecoderState2.NumericHex: {
return this.stateNumericHex(input, offset2);
}
case EntityDecoderState2.NamedEntity: {
return this.stateNamedEntity(input, offset2);
}
}
}
stateNumericStart(input, offset2) {
if (offset2 >= input.length) {
return -1;
}
if ((input.charCodeAt(offset2) | TO_LOWER_BIT2) === CharCodes2.LOWER_X) {
this.state = EntityDecoderState2.NumericHex;
this.consumed += 1;
return this.stateNumericHex(input, offset2 + 1);
}
this.state = EntityDecoderState2.NumericDecimal;
return this.stateNumericDecimal(input, offset2);
}
addToNumericResult(input, start, end2, base2) {
if (start !== end2) {
const digitCount = end2 - start;
this.result = this.result * Math.pow(base2, digitCount) + Number.parseInt(input.substr(start, digitCount), base2);
this.consumed += digitCount;
}
}
stateNumericHex(input, offset2) {
const startIndex = offset2;
while (offset2 < input.length) {
const char = input.charCodeAt(offset2);
if (isNumber3(char) || isHexadecimalCharacter2(char)) {
offset2 += 1;
} else {
this.addToNumericResult(input, startIndex, offset2, 16);
return this.emitNumericEntity(char, 3);
}
}
this.addToNumericResult(input, startIndex, offset2, 16);
return -1;
}
stateNumericDecimal(input, offset2) {
const startIndex = offset2;
while (offset2 < input.length) {
const char = input.charCodeAt(offset2);
if (isNumber3(char)) {
offset2 += 1;
} else {
this.addToNumericResult(input, startIndex, offset2, 10);
return this.emitNumericEntity(char, 2);
}
}
this.addToNumericResult(input, startIndex, offset2, 10);
return -1;
}
emitNumericEntity(lastCp, expectedLength) {
var _a3;
if (this.consumed <= expectedLength) {
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
return 0;
}
if (lastCp === CharCodes2.SEMI) {
this.consumed += 1;
} else if (this.decodeMode === DecodingMode2.Strict) {
return 0;
}
this.emitCodePoint(replaceCodePoint2(this.result), this.consumed);
if (this.errors) {
if (lastCp !== CharCodes2.SEMI) {
this.errors.missingSemicolonAfterCharacterReference();
}
this.errors.validateNumericCharacterReference(this.result);
}
return this.consumed;
}
stateNamedEntity(input, offset2) {
const { decodeTree } = this;
let current = decodeTree[this.treeIndex];
let valueLength = (current & BinTrieFlags2.VALUE_LENGTH) >> 14;
for (; offset2 < input.length; offset2++, this.excess++) {
const char = input.charCodeAt(offset2);
this.treeIndex = determineBranch2(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
if (this.treeIndex < 0) {
return this.result === 0 || this.decodeMode === DecodingMode2.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd2(char)) ? 0 : this.emitNotTerminatedNamedEntity();
}
current = decodeTree[this.treeIndex];
valueLength = (current & BinTrieFlags2.VALUE_LENGTH) >> 14;
if (valueLength !== 0) {
if (char === CharCodes2.SEMI) {
return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
}
if (this.decodeMode !== DecodingMode2.Strict) {
this.result = this.treeIndex;
this.consumed += this.excess;
this.excess = 0;
}
}
}
return -1;
}
emitNotTerminatedNamedEntity() {
var _a3;
const { result, decodeTree } = this;
const valueLength = (decodeTree[result] & BinTrieFlags2.VALUE_LENGTH) >> 14;
this.emitNamedEntityData(result, valueLength, this.consumed);
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.missingSemicolonAfterCharacterReference();
return this.consumed;
}
emitNamedEntityData(result, valueLength, consumed) {
const { decodeTree } = this;
this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags2.VALUE_LENGTH : decodeTree[result + 1], consumed);
if (valueLength === 3) {
this.emitCodePoint(decodeTree[result + 2], consumed);
}
return consumed;
}
end() {
var _a3;
switch (this.state) {
case EntityDecoderState2.NamedEntity: {
return this.result !== 0 && (this.decodeMode !== DecodingMode2.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
}
case EntityDecoderState2.NumericDecimal: {
return this.emitNumericEntity(0, 2);
}
case EntityDecoderState2.NumericHex: {
return this.emitNumericEntity(0, 3);
}
case EntityDecoderState2.NumericStart: {
(_a3 = this.errors) === null || _a3 === void 0 ? void 0 : _a3.absenceOfDigitsInNumericCharacterReference(this.consumed);
return 0;
}
case EntityDecoderState2.EntityStart: {
return 0;
}
}
}
};
function determineBranch2(decodeTree, current, nodeIndex, char) {
const branchCount = (current & BinTrieFlags2.BRANCH_LENGTH) >> 7;
const jumpOffset = current & BinTrieFlags2.JUMP_TABLE;
if (branchCount === 0) {
return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
}
if (jumpOffset) {
const value = char - jumpOffset;
return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIndex + value] - 1;
}
let lo = nodeIndex;
let hi = lo + branchCount - 1;
while (lo <= hi) {
const mid = lo + hi >>> 1;
const midValue = decodeTree[mid];
if (midValue < char) {
lo = mid + 1;
} else if (midValue > char) {
hi = mid - 1;
} else {
return decodeTree[mid + branchCount];
}
}
return -1;
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/html.js
var html_exports = {};
__export(html_exports, {
ATTRS: () => ATTRS,
DOCUMENT_MODE: () => DOCUMENT_MODE,
NS: () => NS,
NUMBERED_HEADERS: () => NUMBERED_HEADERS,
SPECIAL_ELEMENTS: () => SPECIAL_ELEMENTS,
TAG_ID: () => TAG_ID,
TAG_NAMES: () => TAG_NAMES,
getTagID: () => getTagID,
hasUnescapedText: () => hasUnescapedText
});
var NS;
(function(NS2) {
NS2["HTML"] = "http://www.w3.org/1999/xhtml";
NS2["MATHML"] = "http://www.w3.org/1998/Math/MathML";
NS2["SVG"] = "http://www.w3.org/2000/svg";
NS2["XLINK"] = "http://www.w3.org/1999/xlink";
NS2["XML"] = "http://www.w3.org/XML/1998/namespace";
NS2["XMLNS"] = "http://www.w3.org/2000/xmlns/";
})(NS || (NS = {}));
var ATTRS;
(function(ATTRS2) {
ATTRS2["TYPE"] = "type";
ATTRS2["ACTION"] = "action";
ATTRS2["ENCODING"] = "encoding";
ATTRS2["PROMPT"] = "prompt";
ATTRS2["NAME"] = "name";
ATTRS2["COLOR"] = "color";
ATTRS2["FACE"] = "face";
ATTRS2["SIZE"] = "size";
})(ATTRS || (ATTRS = {}));
var DOCUMENT_MODE;
(function(DOCUMENT_MODE2) {
DOCUMENT_MODE2["NO_QUIRKS"] = "no-quirks";
DOCUMENT_MODE2["QUIRKS"] = "quirks";
DOCUMENT_MODE2["LIMITED_QUIRKS"] = "limited-quirks";
})(DOCUMENT_MODE || (DOCUMENT_MODE = {}));
var TAG_NAMES;
(function(TAG_NAMES2) {
TAG_NAMES2["A"] = "a";
TAG_NAMES2["ADDRESS"] = "address";
TAG_NAMES2["ANNOTATION_XML"] = "annotation-xml";
TAG_NAMES2["APPLET"] = "applet";
TAG_NAMES2["AREA"] = "area";
TAG_NAMES2["ARTICLE"] = "article";
TAG_NAMES2["ASIDE"] = "aside";
TAG_NAMES2["B"] = "b";
TAG_NAMES2["BASE"] = "base";
TAG_NAMES2["BASEFONT"] = "basefont";
TAG_NAMES2["BGSOUND"] = "bgsound";
TAG_NAMES2["BIG"] = "big";
TAG_NAMES2["BLOCKQUOTE"] = "blockquote";
TAG_NAMES2["BODY"] = "body";
TAG_NAMES2["BR"] = "br";
TAG_NAMES2["BUTTON"] = "button";
TAG_NAMES2["CAPTION"] = "caption";
TAG_NAMES2["CENTER"] = "center";
TAG_NAMES2["CODE"] = "code";
TAG_NAMES2["COL"] = "col";
TAG_NAMES2["COLGROUP"] = "colgroup";
TAG_NAMES2["DD"] = "dd";
TAG_NAMES2["DESC"] = "desc";
TAG_NAMES2["DETAILS"] = "details";
TAG_NAMES2["DIALOG"] = "dialog";
TAG_NAMES2["DIR"] = "dir";
TAG_NAMES2["DIV"] = "div";
TAG_NAMES2["DL"] = "dl";
TAG_NAMES2["DT"] = "dt";
TAG_NAMES2["EM"] = "em";
TAG_NAMES2["EMBED"] = "embed";
TAG_NAMES2["FIELDSET"] = "fieldset";
TAG_NAMES2["FIGCAPTION"] = "figcaption";
TAG_NAMES2["FIGURE"] = "figure";
TAG_NAMES2["FONT"] = "font";
TAG_NAMES2["FOOTER"] = "footer";
TAG_NAMES2["FOREIGN_OBJECT"] = "foreignObject";
TAG_NAMES2["FORM"] = "form";
TAG_NAMES2["FRAME"] = "frame";
TAG_NAMES2["FRAMESET"] = "frameset";
TAG_NAMES2["H1"] = "h1";
TAG_NAMES2["H2"] = "h2";
TAG_NAMES2["H3"] = "h3";
TAG_NAMES2["H4"] = "h4";
TAG_NAMES2["H5"] = "h5";
TAG_NAMES2["H6"] = "h6";
TAG_NAMES2["HEAD"] = "head";
TAG_NAMES2["HEADER"] = "header";
TAG_NAMES2["HGROUP"] = "hgroup";
TAG_NAMES2["HR"] = "hr";
TAG_NAMES2["HTML"] = "html";
TAG_NAMES2["I"] = "i";
TAG_NAMES2["IMG"] = "img";
TAG_NAMES2["IMAGE"] = "image";
TAG_NAMES2["INPUT"] = "input";
TAG_NAMES2["IFRAME"] = "iframe";
TAG_NAMES2["KEYGEN"] = "keygen";
TAG_NAMES2["LABEL"] = "label";
TAG_NAMES2["LI"] = "li";
TAG_NAMES2["LINK"] = "link";
TAG_NAMES2["LISTING"] = "listing";
TAG_NAMES2["MAIN"] = "main";
TAG_NAMES2["MALIGNMARK"] = "malignmark";
TAG_NAMES2["MARQUEE"] = "marquee";
TAG_NAMES2["MATH"] = "math";
TAG_NAMES2["MENU"] = "menu";
TAG_NAMES2["META"] = "meta";
TAG_NAMES2["MGLYPH"] = "mglyph";
TAG_NAMES2["MI"] = "mi";
TAG_NAMES2["MO"] = "mo";
TAG_NAMES2["MN"] = "mn";
TAG_NAMES2["MS"] = "ms";
TAG_NAMES2["MTEXT"] = "mtext";
TAG_NAMES2["NAV"] = "nav";
TAG_NAMES2["NOBR"] = "nobr";
TAG_NAMES2["NOFRAMES"] = "noframes";
TAG_NAMES2["NOEMBED"] = "noembed";
TAG_NAMES2["NOSCRIPT"] = "noscript";
TAG_NAMES2["OBJECT"] = "object";
TAG_NAMES2["OL"] = "ol";
TAG_NAMES2["OPTGROUP"] = "optgroup";
TAG_NAMES2["OPTION"] = "option";
TAG_NAMES2["P"] = "p";
TAG_NAMES2["PARAM"] = "param";
TAG_NAMES2["PLAINTEXT"] = "plaintext";
TAG_NAMES2["PRE"] = "pre";
TAG_NAMES2["RB"] = "rb";
TAG_NAMES2["RP"] = "rp";
TAG_NAMES2["RT"] = "rt";
TAG_NAMES2["RTC"] = "rtc";
TAG_NAMES2["RUBY"] = "ruby";
TAG_NAMES2["S"] = "s";
TAG_NAMES2["SCRIPT"] = "script";
TAG_NAMES2["SEARCH"] = "search";
TAG_NAMES2["SECTION"] = "section";
TAG_NAMES2["SELECT"] = "select";
TAG_NAMES2["SOURCE"] = "source";
TAG_NAMES2["SMALL"] = "small";
TAG_NAMES2["SPAN"] = "span";
TAG_NAMES2["STRIKE"] = "strike";
TAG_NAMES2["STRONG"] = "strong";
TAG_NAMES2["STYLE"] = "style";
TAG_NAMES2["SUB"] = "sub";
TAG_NAMES2["SUMMARY"] = "summary";
TAG_NAMES2["SUP"] = "sup";
TAG_NAMES2["TABLE"] = "table";
TAG_NAMES2["TBODY"] = "tbody";
TAG_NAMES2["TEMPLATE"] = "template";
TAG_NAMES2["TEXTAREA"] = "textarea";
TAG_NAMES2["TFOOT"] = "tfoot";
TAG_NAMES2["TD"] = "td";
TAG_NAMES2["TH"] = "th";
TAG_NAMES2["THEAD"] = "thead";
TAG_NAMES2["TITLE"] = "title";
TAG_NAMES2["TR"] = "tr";
TAG_NAMES2["TRACK"] = "track";
TAG_NAMES2["TT"] = "tt";
TAG_NAMES2["U"] = "u";
TAG_NAMES2["UL"] = "ul";
TAG_NAMES2["SVG"] = "svg";
TAG_NAMES2["VAR"] = "var";
TAG_NAMES2["WBR"] = "wbr";
TAG_NAMES2["XMP"] = "xmp";
})(TAG_NAMES || (TAG_NAMES = {}));
var TAG_ID;
(function(TAG_ID2) {
TAG_ID2[TAG_ID2["UNKNOWN"] = 0] = "UNKNOWN";
TAG_ID2[TAG_ID2["A"] = 1] = "A";
TAG_ID2[TAG_ID2["ADDRESS"] = 2] = "ADDRESS";
TAG_ID2[TAG_ID2["ANNOTATION_XML"] = 3] = "ANNOTATION_XML";
TAG_ID2[TAG_ID2["APPLET"] = 4] = "APPLET";
TAG_ID2[TAG_ID2["AREA"] = 5] = "AREA";
TAG_ID2[TAG_ID2["ARTICLE"] = 6] = "ARTICLE";
TAG_ID2[TAG_ID2["ASIDE"] = 7] = "ASIDE";
TAG_ID2[TAG_ID2["B"] = 8] = "B";
TAG_ID2[TAG_ID2["BASE"] = 9] = "BASE";
TAG_ID2[TAG_ID2["BASEFONT"] = 10] = "BASEFONT";
TAG_ID2[TAG_ID2["BGSOUND"] = 11] = "BGSOUND";
TAG_ID2[TAG_ID2["BIG"] = 12] = "BIG";
TAG_ID2[TAG_ID2["BLOCKQUOTE"] = 13] = "BLOCKQUOTE";
TAG_ID2[TAG_ID2["BODY"] = 14] = "BODY";
TAG_ID2[TAG_ID2["BR"] = 15] = "BR";
TAG_ID2[TAG_ID2["BUTTON"] = 16] = "BUTTON";
TAG_ID2[TAG_ID2["CAPTION"] = 17] = "CAPTION";
TAG_ID2[TAG_ID2["CENTER"] = 18] = "CENTER";
TAG_ID2[TAG_ID2["CODE"] = 19] = "CODE";
TAG_ID2[TAG_ID2["COL"] = 20] = "COL";
TAG_ID2[TAG_ID2["COLGROUP"] = 21] = "COLGROUP";
TAG_ID2[TAG_ID2["DD"] = 22] = "DD";
TAG_ID2[TAG_ID2["DESC"] = 23] = "DESC";
TAG_ID2[TAG_ID2["DETAILS"] = 24] = "DETAILS";
TAG_ID2[TAG_ID2["DIALOG"] = 25] = "DIALOG";
TAG_ID2[TAG_ID2["DIR"] = 26] = "DIR";
TAG_ID2[TAG_ID2["DIV"] = 27] = "DIV";
TAG_ID2[TAG_ID2["DL"] = 28] = "DL";
TAG_ID2[TAG_ID2["DT"] = 29] = "DT";
TAG_ID2[TAG_ID2["EM"] = 30] = "EM";
TAG_ID2[TAG_ID2["EMBED"] = 31] = "EMBED";
TAG_ID2[TAG_ID2["FIELDSET"] = 32] = "FIELDSET";
TAG_ID2[TAG_ID2["FIGCAPTION"] = 33] = "FIGCAPTION";
TAG_ID2[TAG_ID2["FIGURE"] = 34] = "FIGURE";
TAG_ID2[TAG_ID2["FONT"] = 35] = "FONT";
TAG_ID2[TAG_ID2["FOOTER"] = 36] = "FOOTER";
TAG_ID2[TAG_ID2["FOREIGN_OBJECT"] = 37] = "FOREIGN_OBJECT";
TAG_ID2[TAG_ID2["FORM"] = 38] = "FORM";
TAG_ID2[TAG_ID2["FRAME"] = 39] = "FRAME";
TAG_ID2[TAG_ID2["FRAMESET"] = 40] = "FRAMESET";
TAG_ID2[TAG_ID2["H1"] = 41] = "H1";
TAG_ID2[TAG_ID2["H2"] = 42] = "H2";
TAG_ID2[TAG_ID2["H3"] = 43] = "H3";
TAG_ID2[TAG_ID2["H4"] = 44] = "H4";
TAG_ID2[TAG_ID2["H5"] = 45] = "H5";
TAG_ID2[TAG_ID2["H6"] = 46] = "H6";
TAG_ID2[TAG_ID2["HEAD"] = 47] = "HEAD";
TAG_ID2[TAG_ID2["HEADER"] = 48] = "HEADER";
TAG_ID2[TAG_ID2["HGROUP"] = 49] = "HGROUP";
TAG_ID2[TAG_ID2["HR"] = 50] = "HR";
TAG_ID2[TAG_ID2["HTML"] = 51] = "HTML";
TAG_ID2[TAG_ID2["I"] = 52] = "I";
TAG_ID2[TAG_ID2["IMG"] = 53] = "IMG";
TAG_ID2[TAG_ID2["IMAGE"] = 54] = "IMAGE";
TAG_ID2[TAG_ID2["INPUT"] = 55] = "INPUT";
TAG_ID2[TAG_ID2["IFRAME"] = 56] = "IFRAME";
TAG_ID2[TAG_ID2["KEYGEN"] = 57] = "KEYGEN";
TAG_ID2[TAG_ID2["LABEL"] = 58] = "LABEL";
TAG_ID2[TAG_ID2["LI"] = 59] = "LI";
TAG_ID2[TAG_ID2["LINK"] = 60] = "LINK";
TAG_ID2[TAG_ID2["LISTING"] = 61] = "LISTING";
TAG_ID2[TAG_ID2["MAIN"] = 62] = "MAIN";
TAG_ID2[TAG_ID2["MALIGNMARK"] = 63] = "MALIGNMARK";
TAG_ID2[TAG_ID2["MARQUEE"] = 64] = "MARQUEE";
TAG_ID2[TAG_ID2["MATH"] = 65] = "MATH";
TAG_ID2[TAG_ID2["MENU"] = 66] = "MENU";
TAG_ID2[TAG_ID2["META"] = 67] = "META";
TAG_ID2[TAG_ID2["MGLYPH"] = 68] = "MGLYPH";
TAG_ID2[TAG_ID2["MI"] = 69] = "MI";
TAG_ID2[TAG_ID2["MO"] = 70] = "MO";
TAG_ID2[TAG_ID2["MN"] = 71] = "MN";
TAG_ID2[TAG_ID2["MS"] = 72] = "MS";
TAG_ID2[TAG_ID2["MTEXT"] = 73] = "MTEXT";
TAG_ID2[TAG_ID2["NAV"] = 74] = "NAV";
TAG_ID2[TAG_ID2["NOBR"] = 75] = "NOBR";
TAG_ID2[TAG_ID2["NOFRAMES"] = 76] = "NOFRAMES";
TAG_ID2[TAG_ID2["NOEMBED"] = 77] = "NOEMBED";
TAG_ID2[TAG_ID2["NOSCRIPT"] = 78] = "NOSCRIPT";
TAG_ID2[TAG_ID2["OBJECT"] = 79] = "OBJECT";
TAG_ID2[TAG_ID2["OL"] = 80] = "OL";
TAG_ID2[TAG_ID2["OPTGROUP"] = 81] = "OPTGROUP";
TAG_ID2[TAG_ID2["OPTION"] = 82] = "OPTION";
TAG_ID2[TAG_ID2["P"] = 83] = "P";
TAG_ID2[TAG_ID2["PARAM"] = 84] = "PARAM";
TAG_ID2[TAG_ID2["PLAINTEXT"] = 85] = "PLAINTEXT";
TAG_ID2[TAG_ID2["PRE"] = 86] = "PRE";
TAG_ID2[TAG_ID2["RB"] = 87] = "RB";
TAG_ID2[TAG_ID2["RP"] = 88] = "RP";
TAG_ID2[TAG_ID2["RT"] = 89] = "RT";
TAG_ID2[TAG_ID2["RTC"] = 90] = "RTC";
TAG_ID2[TAG_ID2["RUBY"] = 91] = "RUBY";
TAG_ID2[TAG_ID2["S"] = 92] = "S";
TAG_ID2[TAG_ID2["SCRIPT"] = 93] = "SCRIPT";
TAG_ID2[TAG_ID2["SEARCH"] = 94] = "SEARCH";
TAG_ID2[TAG_ID2["SECTION"] = 95] = "SECTION";
TAG_ID2[TAG_ID2["SELECT"] = 96] = "SELECT";
TAG_ID2[TAG_ID2["SOURCE"] = 97] = "SOURCE";
TAG_ID2[TAG_ID2["SMALL"] = 98] = "SMALL";
TAG_ID2[TAG_ID2["SPAN"] = 99] = "SPAN";
TAG_ID2[TAG_ID2["STRIKE"] = 100] = "STRIKE";
TAG_ID2[TAG_ID2["STRONG"] = 101] = "STRONG";
TAG_ID2[TAG_ID2["STYLE"] = 102] = "STYLE";
TAG_ID2[TAG_ID2["SUB"] = 103] = "SUB";
TAG_ID2[TAG_ID2["SUMMARY"] = 104] = "SUMMARY";
TAG_ID2[TAG_ID2["SUP"] = 105] = "SUP";
TAG_ID2[TAG_ID2["TABLE"] = 106] = "TABLE";
TAG_ID2[TAG_ID2["TBODY"] = 107] = "TBODY";
TAG_ID2[TAG_ID2["TEMPLATE"] = 108] = "TEMPLATE";
TAG_ID2[TAG_ID2["TEXTAREA"] = 109] = "TEXTAREA";
TAG_ID2[TAG_ID2["TFOOT"] = 110] = "TFOOT";
TAG_ID2[TAG_ID2["TD"] = 111] = "TD";
TAG_ID2[TAG_ID2["TH"] = 112] = "TH";
TAG_ID2[TAG_ID2["THEAD"] = 113] = "THEAD";
TAG_ID2[TAG_ID2["TITLE"] = 114] = "TITLE";
TAG_ID2[TAG_ID2["TR"] = 115] = "TR";
TAG_ID2[TAG_ID2["TRACK"] = 116] = "TRACK";
TAG_ID2[TAG_ID2["TT"] = 117] = "TT";
TAG_ID2[TAG_ID2["U"] = 118] = "U";
TAG_ID2[TAG_ID2["UL"] = 119] = "UL";
TAG_ID2[TAG_ID2["SVG"] = 120] = "SVG";
TAG_ID2[TAG_ID2["VAR"] = 121] = "VAR";
TAG_ID2[TAG_ID2["WBR"] = 122] = "WBR";
TAG_ID2[TAG_ID2["XMP"] = 123] = "XMP";
})(TAG_ID || (TAG_ID = {}));
var TAG_NAME_TO_ID = /* @__PURE__ */ new Map([
[TAG_NAMES.A, TAG_ID.A],
[TAG_NAMES.ADDRESS, TAG_ID.ADDRESS],
[TAG_NAMES.ANNOTATION_XML, TAG_ID.ANNOTATION_XML],
[TAG_NAMES.APPLET, TAG_ID.APPLET],
[TAG_NAMES.AREA, TAG_ID.AREA],
[TAG_NAMES.ARTICLE, TAG_ID.ARTICLE],
[TAG_NAMES.ASIDE, TAG_ID.ASIDE],
[TAG_NAMES.B, TAG_ID.B],
[TAG_NAMES.BASE, TAG_ID.BASE],
[TAG_NAMES.BASEFONT, TAG_ID.BASEFONT],
[TAG_NAMES.BGSOUND, TAG_ID.BGSOUND],
[TAG_NAMES.BIG, TAG_ID.BIG],
[TAG_NAMES.BLOCKQUOTE, TAG_ID.BLOCKQUOTE],
[TAG_NAMES.BODY, TAG_ID.BODY],
[TAG_NAMES.BR, TAG_ID.BR],
[TAG_NAMES.BUTTON, TAG_ID.BUTTON],
[TAG_NAMES.CAPTION, TAG_ID.CAPTION],
[TAG_NAMES.CENTER, TAG_ID.CENTER],
[TAG_NAMES.CODE, TAG_ID.CODE],
[TAG_NAMES.COL, TAG_ID.COL],
[TAG_NAMES.COLGROUP, TAG_ID.COLGROUP],
[TAG_NAMES.DD, TAG_ID.DD],
[TAG_NAMES.DESC, TAG_ID.DESC],
[TAG_NAMES.DETAILS, TAG_ID.DETAILS],
[TAG_NAMES.DIALOG, TAG_ID.DIALOG],
[TAG_NAMES.DIR, TAG_ID.DIR],
[TAG_NAMES.DIV, TAG_ID.DIV],
[TAG_NAMES.DL, TAG_ID.DL],
[TAG_NAMES.DT, TAG_ID.DT],
[TAG_NAMES.EM, TAG_ID.EM],
[TAG_NAMES.EMBED, TAG_ID.EMBED],
[TAG_NAMES.FIELDSET, TAG_ID.FIELDSET],
[TAG_NAMES.FIGCAPTION, TAG_ID.FIGCAPTION],
[TAG_NAMES.FIGURE, TAG_ID.FIGURE],
[TAG_NAMES.FONT, TAG_ID.FONT],
[TAG_NAMES.FOOTER, TAG_ID.FOOTER],
[TAG_NAMES.FOREIGN_OBJECT, TAG_ID.FOREIGN_OBJECT],
[TAG_NAMES.FORM, TAG_ID.FORM],
[TAG_NAMES.FRAME, TAG_ID.FRAME],
[TAG_NAMES.FRAMESET, TAG_ID.FRAMESET],
[TAG_NAMES.H1, TAG_ID.H1],
[TAG_NAMES.H2, TAG_ID.H2],
[TAG_NAMES.H3, TAG_ID.H3],
[TAG_NAMES.H4, TAG_ID.H4],
[TAG_NAMES.H5, TAG_ID.H5],
[TAG_NAMES.H6, TAG_ID.H6],
[TAG_NAMES.HEAD, TAG_ID.HEAD],
[TAG_NAMES.HEADER, TAG_ID.HEADER],
[TAG_NAMES.HGROUP, TAG_ID.HGROUP],
[TAG_NAMES.HR, TAG_ID.HR],
[TAG_NAMES.HTML, TAG_ID.HTML],
[TAG_NAMES.I, TAG_ID.I],
[TAG_NAMES.IMG, TAG_ID.IMG],
[TAG_NAMES.IMAGE, TAG_ID.IMAGE],
[TAG_NAMES.INPUT, TAG_ID.INPUT],
[TAG_NAMES.IFRAME, TAG_ID.IFRAME],
[TAG_NAMES.KEYGEN, TAG_ID.KEYGEN],
[TAG_NAMES.LABEL, TAG_ID.LABEL],
[TAG_NAMES.LI, TAG_ID.LI],
[TAG_NAMES.LINK, TAG_ID.LINK],
[TAG_NAMES.LISTING, TAG_ID.LISTING],
[TAG_NAMES.MAIN, TAG_ID.MAIN],
[TAG_NAMES.MALIGNMARK, TAG_ID.MALIGNMARK],
[TAG_NAMES.MARQUEE, TAG_ID.MARQUEE],
[TAG_NAMES.MATH, TAG_ID.MATH],
[TAG_NAMES.MENU, TAG_ID.MENU],
[TAG_NAMES.META, TAG_ID.META],
[TAG_NAMES.MGLYPH, TAG_ID.MGLYPH],
[TAG_NAMES.MI, TAG_ID.MI],
[TAG_NAMES.MO, TAG_ID.MO],
[TAG_NAMES.MN, TAG_ID.MN],
[TAG_NAMES.MS, TAG_ID.MS],
[TAG_NAMES.MTEXT, TAG_ID.MTEXT],
[TAG_NAMES.NAV, TAG_ID.NAV],
[TAG_NAMES.NOBR, TAG_ID.NOBR],
[TAG_NAMES.NOFRAMES, TAG_ID.NOFRAMES],
[TAG_NAMES.NOEMBED, TAG_ID.NOEMBED],
[TAG_NAMES.NOSCRIPT, TAG_ID.NOSCRIPT],
[TAG_NAMES.OBJECT, TAG_ID.OBJECT],
[TAG_NAMES.OL, TAG_ID.OL],
[TAG_NAMES.OPTGROUP, TAG_ID.OPTGROUP],
[TAG_NAMES.OPTION, TAG_ID.OPTION],
[TAG_NAMES.P, TAG_ID.P],
[TAG_NAMES.PARAM, TAG_ID.PARAM],
[TAG_NAMES.PLAINTEXT, TAG_ID.PLAINTEXT],
[TAG_NAMES.PRE, TAG_ID.PRE],
[TAG_NAMES.RB, TAG_ID.RB],
[TAG_NAMES.RP, TAG_ID.RP],
[TAG_NAMES.RT, TAG_ID.RT],
[TAG_NAMES.RTC, TAG_ID.RTC],
[TAG_NAMES.RUBY, TAG_ID.RUBY],
[TAG_NAMES.S, TAG_ID.S],
[TAG_NAMES.SCRIPT, TAG_ID.SCRIPT],
[TAG_NAMES.SEARCH, TAG_ID.SEARCH],
[TAG_NAMES.SECTION, TAG_ID.SECTION],
[TAG_NAMES.SELECT, TAG_ID.SELECT],
[TAG_NAMES.SOURCE, TAG_ID.SOURCE],
[TAG_NAMES.SMALL, TAG_ID.SMALL],
[TAG_NAMES.SPAN, TAG_ID.SPAN],
[TAG_NAMES.STRIKE, TAG_ID.STRIKE],
[TAG_NAMES.STRONG, TAG_ID.STRONG],
[TAG_NAMES.STYLE, TAG_ID.STYLE],
[TAG_NAMES.SUB, TAG_ID.SUB],
[TAG_NAMES.SUMMARY, TAG_ID.SUMMARY],
[TAG_NAMES.SUP, TAG_ID.SUP],
[TAG_NAMES.TABLE, TAG_ID.TABLE],
[TAG_NAMES.TBODY, TAG_ID.TBODY],
[TAG_NAMES.TEMPLATE, TAG_ID.TEMPLATE],
[TAG_NAMES.TEXTAREA, TAG_ID.TEXTAREA],
[TAG_NAMES.TFOOT, TAG_ID.TFOOT],
[TAG_NAMES.TD, TAG_ID.TD],
[TAG_NAMES.TH, TAG_ID.TH],
[TAG_NAMES.THEAD, TAG_ID.THEAD],
[TAG_NAMES.TITLE, TAG_ID.TITLE],
[TAG_NAMES.TR, TAG_ID.TR],
[TAG_NAMES.TRACK, TAG_ID.TRACK],
[TAG_NAMES.TT, TAG_ID.TT],
[TAG_NAMES.U, TAG_ID.U],
[TAG_NAMES.UL, TAG_ID.UL],
[TAG_NAMES.SVG, TAG_ID.SVG],
[TAG_NAMES.VAR, TAG_ID.VAR],
[TAG_NAMES.WBR, TAG_ID.WBR],
[TAG_NAMES.XMP, TAG_ID.XMP]
]);
function getTagID(tagName) {
var _a3;
return (_a3 = TAG_NAME_TO_ID.get(tagName)) !== null && _a3 !== void 0 ? _a3 : TAG_ID.UNKNOWN;
}
var $ = TAG_ID;
var SPECIAL_ELEMENTS = {
[NS.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
]),
[NS.MATHML]: /* @__PURE__ */ new Set([$.MI, $.MO, $.MN, $.MS, $.MTEXT, $.ANNOTATION_XML]),
[NS.SVG]: /* @__PURE__ */ new Set([$.TITLE, $.FOREIGN_OBJECT, $.DESC]),
[NS.XLINK]: /* @__PURE__ */ new Set(),
[NS.XML]: /* @__PURE__ */ new Set(),
[NS.XMLNS]: /* @__PURE__ */ new Set()
};
var NUMBERED_HEADERS = /* @__PURE__ */ new Set([$.H1, $.H2, $.H3, $.H4, $.H5, $.H6]);
var UNESCAPED_TEXT = /* @__PURE__ */ new Set([
TAG_NAMES.STYLE,
TAG_NAMES.SCRIPT,
TAG_NAMES.XMP,
TAG_NAMES.IFRAME,
TAG_NAMES.NOEMBED,
TAG_NAMES.NOFRAMES,
TAG_NAMES.PLAINTEXT
]);
function hasUnescapedText(tn, scriptingEnabled) {
return UNESCAPED_TEXT.has(tn) || scriptingEnabled && tn === TAG_NAMES.NOSCRIPT;
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tokenizer/index.js
var State;
(function(State3) {
State3[State3["DATA"] = 0] = "DATA";
State3[State3["RCDATA"] = 1] = "RCDATA";
State3[State3["RAWTEXT"] = 2] = "RAWTEXT";
State3[State3["SCRIPT_DATA"] = 3] = "SCRIPT_DATA";
State3[State3["PLAINTEXT"] = 4] = "PLAINTEXT";
State3[State3["TAG_OPEN"] = 5] = "TAG_OPEN";
State3[State3["END_TAG_OPEN"] = 6] = "END_TAG_OPEN";
State3[State3["TAG_NAME"] = 7] = "TAG_NAME";
State3[State3["RCDATA_LESS_THAN_SIGN"] = 8] = "RCDATA_LESS_THAN_SIGN";
State3[State3["RCDATA_END_TAG_OPEN"] = 9] = "RCDATA_END_TAG_OPEN";
State3[State3["RCDATA_END_TAG_NAME"] = 10] = "RCDATA_END_TAG_NAME";
State3[State3["RAWTEXT_LESS_THAN_SIGN"] = 11] = "RAWTEXT_LESS_THAN_SIGN";
State3[State3["RAWTEXT_END_TAG_OPEN"] = 12] = "RAWTEXT_END_TAG_OPEN";
State3[State3["RAWTEXT_END_TAG_NAME"] = 13] = "RAWTEXT_END_TAG_NAME";
State3[State3["SCRIPT_DATA_LESS_THAN_SIGN"] = 14] = "SCRIPT_DATA_LESS_THAN_SIGN";
State3[State3["SCRIPT_DATA_END_TAG_OPEN"] = 15] = "SCRIPT_DATA_END_TAG_OPEN";
State3[State3["SCRIPT_DATA_END_TAG_NAME"] = 16] = "SCRIPT_DATA_END_TAG_NAME";
State3[State3["SCRIPT_DATA_ESCAPE_START"] = 17] = "SCRIPT_DATA_ESCAPE_START";
State3[State3["SCRIPT_DATA_ESCAPE_START_DASH"] = 18] = "SCRIPT_DATA_ESCAPE_START_DASH";
State3[State3["SCRIPT_DATA_ESCAPED"] = 19] = "SCRIPT_DATA_ESCAPED";
State3[State3["SCRIPT_DATA_ESCAPED_DASH"] = 20] = "SCRIPT_DATA_ESCAPED_DASH";
State3[State3["SCRIPT_DATA_ESCAPED_DASH_DASH"] = 21] = "SCRIPT_DATA_ESCAPED_DASH_DASH";
State3[State3["SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN"] = 22] = "SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN";
State3[State3["SCRIPT_DATA_ESCAPED_END_TAG_OPEN"] = 23] = "SCRIPT_DATA_ESCAPED_END_TAG_OPEN";
State3[State3["SCRIPT_DATA_ESCAPED_END_TAG_NAME"] = 24] = "SCRIPT_DATA_ESCAPED_END_TAG_NAME";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPE_START"] = 25] = "SCRIPT_DATA_DOUBLE_ESCAPE_START";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPED"] = 26] = "SCRIPT_DATA_DOUBLE_ESCAPED";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPED_DASH"] = 27] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH"] = 28] = "SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN"] = 29] = "SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN";
State3[State3["SCRIPT_DATA_DOUBLE_ESCAPE_END"] = 30] = "SCRIPT_DATA_DOUBLE_ESCAPE_END";
State3[State3["BEFORE_ATTRIBUTE_NAME"] = 31] = "BEFORE_ATTRIBUTE_NAME";
State3[State3["ATTRIBUTE_NAME"] = 32] = "ATTRIBUTE_NAME";
State3[State3["AFTER_ATTRIBUTE_NAME"] = 33] = "AFTER_ATTRIBUTE_NAME";
State3[State3["BEFORE_ATTRIBUTE_VALUE"] = 34] = "BEFORE_ATTRIBUTE_VALUE";
State3[State3["ATTRIBUTE_VALUE_DOUBLE_QUOTED"] = 35] = "ATTRIBUTE_VALUE_DOUBLE_QUOTED";
State3[State3["ATTRIBUTE_VALUE_SINGLE_QUOTED"] = 36] = "ATTRIBUTE_VALUE_SINGLE_QUOTED";
State3[State3["ATTRIBUTE_VALUE_UNQUOTED"] = 37] = "ATTRIBUTE_VALUE_UNQUOTED";
State3[State3["AFTER_ATTRIBUTE_VALUE_QUOTED"] = 38] = "AFTER_ATTRIBUTE_VALUE_QUOTED";
State3[State3["SELF_CLOSING_START_TAG"] = 39] = "SELF_CLOSING_START_TAG";
State3[State3["BOGUS_COMMENT"] = 40] = "BOGUS_COMMENT";
State3[State3["MARKUP_DECLARATION_OPEN"] = 41] = "MARKUP_DECLARATION_OPEN";
State3[State3["COMMENT_START"] = 42] = "COMMENT_START";
State3[State3["COMMENT_START_DASH"] = 43] = "COMMENT_START_DASH";
State3[State3["COMMENT"] = 44] = "COMMENT";
State3[State3["COMMENT_LESS_THAN_SIGN"] = 45] = "COMMENT_LESS_THAN_SIGN";
State3[State3["COMMENT_LESS_THAN_SIGN_BANG"] = 46] = "COMMENT_LESS_THAN_SIGN_BANG";
State3[State3["COMMENT_LESS_THAN_SIGN_BANG_DASH"] = 47] = "COMMENT_LESS_THAN_SIGN_BANG_DASH";
State3[State3["COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH"] = 48] = "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH";
State3[State3["COMMENT_END_DASH"] = 49] = "COMMENT_END_DASH";
State3[State3["COMMENT_END"] = 50] = "COMMENT_END";
State3[State3["COMMENT_END_BANG"] = 51] = "COMMENT_END_BANG";
State3[State3["DOCTYPE"] = 52] = "DOCTYPE";
State3[State3["BEFORE_DOCTYPE_NAME"] = 53] = "BEFORE_DOCTYPE_NAME";
State3[State3["DOCTYPE_NAME"] = 54] = "DOCTYPE_NAME";
State3[State3["AFTER_DOCTYPE_NAME"] = 55] = "AFTER_DOCTYPE_NAME";
State3[State3["AFTER_DOCTYPE_PUBLIC_KEYWORD"] = 56] = "AFTER_DOCTYPE_PUBLIC_KEYWORD";
State3[State3["BEFORE_DOCTYPE_PUBLIC_IDENTIFIER"] = 57] = "BEFORE_DOCTYPE_PUBLIC_IDENTIFIER";
State3[State3["DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED"] = 58] = "DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED";
State3[State3["DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED"] = 59] = "DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED";
State3[State3["AFTER_DOCTYPE_PUBLIC_IDENTIFIER"] = 60] = "AFTER_DOCTYPE_PUBLIC_IDENTIFIER";
State3[State3["BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS"] = 61] = "BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS";
State3[State3["AFTER_DOCTYPE_SYSTEM_KEYWORD"] = 62] = "AFTER_DOCTYPE_SYSTEM_KEYWORD";
State3[State3["BEFORE_DOCTYPE_SYSTEM_IDENTIFIER"] = 63] = "BEFORE_DOCTYPE_SYSTEM_IDENTIFIER";
State3[State3["DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED"] = 64] = "DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED";
State3[State3["DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED"] = 65] = "DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED";
State3[State3["AFTER_DOCTYPE_SYSTEM_IDENTIFIER"] = 66] = "AFTER_DOCTYPE_SYSTEM_IDENTIFIER";
State3[State3["BOGUS_DOCTYPE"] = 67] = "BOGUS_DOCTYPE";
State3[State3["CDATA_SECTION"] = 68] = "CDATA_SECTION";
State3[State3["CDATA_SECTION_BRACKET"] = 69] = "CDATA_SECTION_BRACKET";
State3[State3["CDATA_SECTION_END"] = 70] = "CDATA_SECTION_END";
State3[State3["CHARACTER_REFERENCE"] = 71] = "CHARACTER_REFERENCE";
State3[State3["AMBIGUOUS_AMPERSAND"] = 72] = "AMBIGUOUS_AMPERSAND";
})(State || (State = {}));
var TokenizerMode = {
DATA: State.DATA,
RCDATA: State.RCDATA,
RAWTEXT: State.RAWTEXT,
SCRIPT_DATA: State.SCRIPT_DATA,
PLAINTEXT: State.PLAINTEXT,
CDATA_SECTION: State.CDATA_SECTION
};
function isAsciiDigit(cp) {
return cp >= CODE_POINTS.DIGIT_0 && cp <= CODE_POINTS.DIGIT_9;
}
function isAsciiUpper(cp) {
return cp >= CODE_POINTS.LATIN_CAPITAL_A && cp <= CODE_POINTS.LATIN_CAPITAL_Z;
}
function isAsciiLower(cp) {
return cp >= CODE_POINTS.LATIN_SMALL_A && cp <= CODE_POINTS.LATIN_SMALL_Z;
}
function isAsciiLetter(cp) {
return isAsciiLower(cp) || isAsciiUpper(cp);
}
function isAsciiAlphaNumeric3(cp) {
return isAsciiLetter(cp) || isAsciiDigit(cp);
}
function toAsciiLower(cp) {
return cp + 32;
}
function isWhitespace2(cp) {
return cp === CODE_POINTS.SPACE || cp === CODE_POINTS.LINE_FEED || cp === CODE_POINTS.TABULATION || cp === CODE_POINTS.FORM_FEED;
}
function isScriptDataDoubleEscapeSequenceEnd(cp) {
return isWhitespace2(cp) || cp === CODE_POINTS.SOLIDUS || cp === CODE_POINTS.GREATER_THAN_SIGN;
}
function getErrorForNumericCharacterReference(code2) {
if (code2 === CODE_POINTS.NULL) {
return ERR.nullCharacterReference;
} else if (code2 > 1114111) {
return ERR.characterReferenceOutsideUnicodeRange;
} else if (isSurrogate(code2)) {
return ERR.surrogateCharacterReference;
} else if (isUndefinedCodePoint(code2)) {
return ERR.noncharacterCharacterReference;
} else if (isControlCodePoint(code2) || code2 === CODE_POINTS.CARRIAGE_RETURN) {
return ERR.controlCharacterReference;
}
return null;
}
var Tokenizer = class {
constructor(options, handler) {
this.options = options;
this.handler = handler;
this.paused = false;
this.inLoop = false;
this.inForeignNode = false;
this.lastStartTagName = "";
this.active = false;
this.state = State.DATA;
this.returnState = State.DATA;
this.entityStartPos = 0;
this.consumedAfterSnapshot = -1;
this.currentCharacterToken = null;
this.currentToken = null;
this.currentAttr = { name: "", value: "" };
this.preprocessor = new Preprocessor(handler);
this.currentLocation = this.getCurrentLocation(-1);
this.entityDecoder = new EntityDecoder2(htmlDecodeTree, (cp, consumed) => {
this.preprocessor.pos = this.entityStartPos + consumed - 1;
this._flushCodePointConsumedAsCharacterReference(cp);
}, handler.onParseError ? {
missingSemicolonAfterCharacterReference: () => {
this._err(ERR.missingSemicolonAfterCharacterReference, 1);
},
absenceOfDigitsInNumericCharacterReference: (consumed) => {
this._err(ERR.absenceOfDigitsInNumericCharacterReference, this.entityStartPos - this.preprocessor.pos + consumed);
},
validateNumericCharacterReference: (code2) => {
const error2 = getErrorForNumericCharacterReference(code2);
if (error2)
this._err(error2, 1);
}
} : void 0);
}
_err(code2, cpOffset = 0) {
var _a3, _b;
(_b = (_a3 = this.handler).onParseError) === null || _b === void 0 ? void 0 : _b.call(_a3, this.preprocessor.getError(code2, cpOffset));
}
getCurrentLocation(offset2) {
if (!this.options.sourceCodeLocationInfo) {
return null;
}
return {
startLine: this.preprocessor.line,
startCol: this.preprocessor.col - offset2,
startOffset: this.preprocessor.offset - offset2,
endLine: -1,
endCol: -1,
endOffset: -1
};
}
_runParsingLoop() {
if (this.inLoop)
return;
this.inLoop = true;
while (this.active && !this.paused) {
this.consumedAfterSnapshot = 0;
const cp = this._consume();
if (!this._ensureHibernation()) {
this._callState(cp);
}
}
this.inLoop = false;
}
pause() {
this.paused = true;
}
resume(writeCallback) {
if (!this.paused) {
throw new Error("Parser was already resumed");
}
this.paused = false;
if (this.inLoop)
return;
this._runParsingLoop();
if (!this.paused) {
writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
}
}
write(chunk, isLastChunk, writeCallback) {
this.active = true;
this.preprocessor.write(chunk, isLastChunk);
this._runParsingLoop();
if (!this.paused) {
writeCallback === null || writeCallback === void 0 ? void 0 : writeCallback();
}
}
insertHtmlAtCurrentPos(chunk) {
this.active = true;
this.preprocessor.insertHtmlAtCurrentPos(chunk);
this._runParsingLoop();
}
_ensureHibernation() {
if (this.preprocessor.endOfChunkHit) {
this.preprocessor.retreat(this.consumedAfterSnapshot);
this.consumedAfterSnapshot = 0;
this.active = false;
return true;
}
return false;
}
_consume() {
this.consumedAfterSnapshot++;
return this.preprocessor.advance();
}
_advanceBy(count) {
this.consumedAfterSnapshot += count;
for (let i = 0; i < count; i++) {
this.preprocessor.advance();
}
}
_consumeSequenceIfMatch(pattern, caseSensitive) {
if (this.preprocessor.startsWith(pattern, caseSensitive)) {
this._advanceBy(pattern.length - 1);
return true;
}
return false;
}
_createStartTagToken() {
this.currentToken = {
type: TokenType.START_TAG,
tagName: "",
tagID: TAG_ID.UNKNOWN,
selfClosing: false,
ackSelfClosing: false,
attrs: [],
location: this.getCurrentLocation(1)
};
}
_createEndTagToken() {
this.currentToken = {
type: TokenType.END_TAG,
tagName: "",
tagID: TAG_ID.UNKNOWN,
selfClosing: false,
ackSelfClosing: false,
attrs: [],
location: this.getCurrentLocation(2)
};
}
_createCommentToken(offset2) {
this.currentToken = {
type: TokenType.COMMENT,
data: "",
location: this.getCurrentLocation(offset2)
};
}
_createDoctypeToken(initialName) {
this.currentToken = {
type: TokenType.DOCTYPE,
name: initialName,
forceQuirks: false,
publicId: null,
systemId: null,
location: this.currentLocation
};
}
_createCharacterToken(type, chars) {
this.currentCharacterToken = {
type,
chars,
location: this.currentLocation
};
}
_createAttr(attrNameFirstCh) {
this.currentAttr = {
name: attrNameFirstCh,
value: ""
};
this.currentLocation = this.getCurrentLocation(0);
}
_leaveAttrName() {
var _a3;
var _b;
const token = this.currentToken;
if (getTokenAttr(token, this.currentAttr.name) === null) {
token.attrs.push(this.currentAttr);
if (token.location && this.currentLocation) {
const attrLocations = (_a3 = (_b = token.location).attrs) !== null && _a3 !== void 0 ? _a3 : _b.attrs = /* @__PURE__ */ Object.create(null);
attrLocations[this.currentAttr.name] = this.currentLocation;
this._leaveAttrValue();
}
} else {
this._err(ERR.duplicateAttribute);
}
}
_leaveAttrValue() {
if (this.currentLocation) {
this.currentLocation.endLine = this.preprocessor.line;
this.currentLocation.endCol = this.preprocessor.col;
this.currentLocation.endOffset = this.preprocessor.offset;
}
}
prepareToken(ct) {
this._emitCurrentCharacterToken(ct.location);
this.currentToken = null;
if (ct.location) {
ct.location.endLine = this.preprocessor.line;
ct.location.endCol = this.preprocessor.col + 1;
ct.location.endOffset = this.preprocessor.offset + 1;
}
this.currentLocation = this.getCurrentLocation(-1);
}
emitCurrentTagToken() {
const ct = this.currentToken;
this.prepareToken(ct);
ct.tagID = getTagID(ct.tagName);
if (ct.type === TokenType.START_TAG) {
this.lastStartTagName = ct.tagName;
this.handler.onStartTag(ct);
} else {
if (ct.attrs.length > 0) {
this._err(ERR.endTagWithAttributes);
}
if (ct.selfClosing) {
this._err(ERR.endTagWithTrailingSolidus);
}
this.handler.onEndTag(ct);
}
this.preprocessor.dropParsedChunk();
}
emitCurrentComment(ct) {
this.prepareToken(ct);
this.handler.onComment(ct);
this.preprocessor.dropParsedChunk();
}
emitCurrentDoctype(ct) {
this.prepareToken(ct);
this.handler.onDoctype(ct);
this.preprocessor.dropParsedChunk();
}
_emitCurrentCharacterToken(nextLocation) {
if (this.currentCharacterToken) {
if (nextLocation && this.currentCharacterToken.location) {
this.currentCharacterToken.location.endLine = nextLocation.startLine;
this.currentCharacterToken.location.endCol = nextLocation.startCol;
this.currentCharacterToken.location.endOffset = nextLocation.startOffset;
}
switch (this.currentCharacterToken.type) {
case TokenType.CHARACTER: {
this.handler.onCharacter(this.currentCharacterToken);
break;
}
case TokenType.NULL_CHARACTER: {
this.handler.onNullCharacter(this.currentCharacterToken);
break;
}
case TokenType.WHITESPACE_CHARACTER: {
this.handler.onWhitespaceCharacter(this.currentCharacterToken);
break;
}
}
this.currentCharacterToken = null;
}
}
_emitEOFToken() {
const location = this.getCurrentLocation(0);
if (location) {
location.endLine = location.startLine;
location.endCol = location.startCol;
location.endOffset = location.startOffset;
}
this._emitCurrentCharacterToken(location);
this.handler.onEof({ type: TokenType.EOF, location });
this.active = false;
}
_appendCharToCurrentCharacterToken(type, ch) {
if (this.currentCharacterToken) {
if (this.currentCharacterToken.type === type) {
this.currentCharacterToken.chars += ch;
return;
} else {
this.currentLocation = this.getCurrentLocation(0);
this._emitCurrentCharacterToken(this.currentLocation);
this.preprocessor.dropParsedChunk();
}
}
this._createCharacterToken(type, ch);
}
_emitCodePoint(cp) {
const type = isWhitespace2(cp) ? TokenType.WHITESPACE_CHARACTER : cp === CODE_POINTS.NULL ? TokenType.NULL_CHARACTER : TokenType.CHARACTER;
this._appendCharToCurrentCharacterToken(type, String.fromCodePoint(cp));
}
_emitChars(ch) {
this._appendCharToCurrentCharacterToken(TokenType.CHARACTER, ch);
}
_startCharacterReference() {
this.returnState = this.state;
this.state = State.CHARACTER_REFERENCE;
this.entityStartPos = this.preprocessor.pos;
this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute() ? DecodingMode2.Attribute : DecodingMode2.Legacy);
}
_isCharacterReferenceInAttribute() {
return this.returnState === State.ATTRIBUTE_VALUE_DOUBLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_SINGLE_QUOTED || this.returnState === State.ATTRIBUTE_VALUE_UNQUOTED;
}
_flushCodePointConsumedAsCharacterReference(cp) {
if (this._isCharacterReferenceInAttribute()) {
this.currentAttr.value += String.fromCodePoint(cp);
} else {
this._emitCodePoint(cp);
}
}
_callState(cp) {
switch (this.state) {
case State.DATA: {
this._stateData(cp);
break;
}
case State.RCDATA: {
this._stateRcdata(cp);
break;
}
case State.RAWTEXT: {
this._stateRawtext(cp);
break;
}
case State.SCRIPT_DATA: {
this._stateScriptData(cp);
break;
}
case State.PLAINTEXT: {
this._statePlaintext(cp);
break;
}
case State.TAG_OPEN: {
this._stateTagOpen(cp);
break;
}
case State.END_TAG_OPEN: {
this._stateEndTagOpen(cp);
break;
}
case State.TAG_NAME: {
this._stateTagName(cp);
break;
}
case State.RCDATA_LESS_THAN_SIGN: {
this._stateRcdataLessThanSign(cp);
break;
}
case State.RCDATA_END_TAG_OPEN: {
this._stateRcdataEndTagOpen(cp);
break;
}
case State.RCDATA_END_TAG_NAME: {
this._stateRcdataEndTagName(cp);
break;
}
case State.RAWTEXT_LESS_THAN_SIGN: {
this._stateRawtextLessThanSign(cp);
break;
}
case State.RAWTEXT_END_TAG_OPEN: {
this._stateRawtextEndTagOpen(cp);
break;
}
case State.RAWTEXT_END_TAG_NAME: {
this._stateRawtextEndTagName(cp);
break;
}
case State.SCRIPT_DATA_LESS_THAN_SIGN: {
this._stateScriptDataLessThanSign(cp);
break;
}
case State.SCRIPT_DATA_END_TAG_OPEN: {
this._stateScriptDataEndTagOpen(cp);
break;
}
case State.SCRIPT_DATA_END_TAG_NAME: {
this._stateScriptDataEndTagName(cp);
break;
}
case State.SCRIPT_DATA_ESCAPE_START: {
this._stateScriptDataEscapeStart(cp);
break;
}
case State.SCRIPT_DATA_ESCAPE_START_DASH: {
this._stateScriptDataEscapeStartDash(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED: {
this._stateScriptDataEscaped(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED_DASH: {
this._stateScriptDataEscapedDash(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED_DASH_DASH: {
this._stateScriptDataEscapedDashDash(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
this._stateScriptDataEscapedLessThanSign(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN: {
this._stateScriptDataEscapedEndTagOpen(cp);
break;
}
case State.SCRIPT_DATA_ESCAPED_END_TAG_NAME: {
this._stateScriptDataEscapedEndTagName(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPE_START: {
this._stateScriptDataDoubleEscapeStart(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPED: {
this._stateScriptDataDoubleEscaped(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
this._stateScriptDataDoubleEscapedDash(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
this._stateScriptDataDoubleEscapedDashDash(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
this._stateScriptDataDoubleEscapedLessThanSign(cp);
break;
}
case State.SCRIPT_DATA_DOUBLE_ESCAPE_END: {
this._stateScriptDataDoubleEscapeEnd(cp);
break;
}
case State.BEFORE_ATTRIBUTE_NAME: {
this._stateBeforeAttributeName(cp);
break;
}
case State.ATTRIBUTE_NAME: {
this._stateAttributeName(cp);
break;
}
case State.AFTER_ATTRIBUTE_NAME: {
this._stateAfterAttributeName(cp);
break;
}
case State.BEFORE_ATTRIBUTE_VALUE: {
this._stateBeforeAttributeValue(cp);
break;
}
case State.ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
this._stateAttributeValueDoubleQuoted(cp);
break;
}
case State.ATTRIBUTE_VALUE_SINGLE_QUOTED: {
this._stateAttributeValueSingleQuoted(cp);
break;
}
case State.ATTRIBUTE_VALUE_UNQUOTED: {
this._stateAttributeValueUnquoted(cp);
break;
}
case State.AFTER_ATTRIBUTE_VALUE_QUOTED: {
this._stateAfterAttributeValueQuoted(cp);
break;
}
case State.SELF_CLOSING_START_TAG: {
this._stateSelfClosingStartTag(cp);
break;
}
case State.BOGUS_COMMENT: {
this._stateBogusComment(cp);
break;
}
case State.MARKUP_DECLARATION_OPEN: {
this._stateMarkupDeclarationOpen(cp);
break;
}
case State.COMMENT_START: {
this._stateCommentStart(cp);
break;
}
case State.COMMENT_START_DASH: {
this._stateCommentStartDash(cp);
break;
}
case State.COMMENT: {
this._stateComment(cp);
break;
}
case State.COMMENT_LESS_THAN_SIGN: {
this._stateCommentLessThanSign(cp);
break;
}
case State.COMMENT_LESS_THAN_SIGN_BANG: {
this._stateCommentLessThanSignBang(cp);
break;
}
case State.COMMENT_LESS_THAN_SIGN_BANG_DASH: {
this._stateCommentLessThanSignBangDash(cp);
break;
}
case State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH: {
this._stateCommentLessThanSignBangDashDash(cp);
break;
}
case State.COMMENT_END_DASH: {
this._stateCommentEndDash(cp);
break;
}
case State.COMMENT_END: {
this._stateCommentEnd(cp);
break;
}
case State.COMMENT_END_BANG: {
this._stateCommentEndBang(cp);
break;
}
case State.DOCTYPE: {
this._stateDoctype(cp);
break;
}
case State.BEFORE_DOCTYPE_NAME: {
this._stateBeforeDoctypeName(cp);
break;
}
case State.DOCTYPE_NAME: {
this._stateDoctypeName(cp);
break;
}
case State.AFTER_DOCTYPE_NAME: {
this._stateAfterDoctypeName(cp);
break;
}
case State.AFTER_DOCTYPE_PUBLIC_KEYWORD: {
this._stateAfterDoctypePublicKeyword(cp);
break;
}
case State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
this._stateBeforeDoctypePublicIdentifier(cp);
break;
}
case State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
this._stateDoctypePublicIdentifierDoubleQuoted(cp);
break;
}
case State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
this._stateDoctypePublicIdentifierSingleQuoted(cp);
break;
}
case State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
this._stateAfterDoctypePublicIdentifier(cp);
break;
}
case State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
this._stateBetweenDoctypePublicAndSystemIdentifiers(cp);
break;
}
case State.AFTER_DOCTYPE_SYSTEM_KEYWORD: {
this._stateAfterDoctypeSystemKeyword(cp);
break;
}
case State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
this._stateBeforeDoctypeSystemIdentifier(cp);
break;
}
case State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
this._stateDoctypeSystemIdentifierDoubleQuoted(cp);
break;
}
case State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
this._stateDoctypeSystemIdentifierSingleQuoted(cp);
break;
}
case State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
this._stateAfterDoctypeSystemIdentifier(cp);
break;
}
case State.BOGUS_DOCTYPE: {
this._stateBogusDoctype(cp);
break;
}
case State.CDATA_SECTION: {
this._stateCdataSection(cp);
break;
}
case State.CDATA_SECTION_BRACKET: {
this._stateCdataSectionBracket(cp);
break;
}
case State.CDATA_SECTION_END: {
this._stateCdataSectionEnd(cp);
break;
}
case State.CHARACTER_REFERENCE: {
this._stateCharacterReference();
break;
}
case State.AMBIGUOUS_AMPERSAND: {
this._stateAmbiguousAmpersand(cp);
break;
}
default: {
throw new Error("Unknown state");
}
}
}
_stateData(cp) {
switch (cp) {
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.TAG_OPEN;
break;
}
case CODE_POINTS.AMPERSAND: {
this._startCharacterReference();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitCodePoint(cp);
break;
}
case CODE_POINTS.EOF: {
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateRcdata(cp) {
switch (cp) {
case CODE_POINTS.AMPERSAND: {
this._startCharacterReference();
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.RCDATA_LESS_THAN_SIGN;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateRawtext(cp) {
switch (cp) {
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.RAWTEXT_LESS_THAN_SIGN;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateScriptData(cp) {
switch (cp) {
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.SCRIPT_DATA_LESS_THAN_SIGN;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_statePlaintext(cp) {
switch (cp) {
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateTagOpen(cp) {
if (isAsciiLetter(cp)) {
this._createStartTagToken();
this.state = State.TAG_NAME;
this._stateTagName(cp);
} else
switch (cp) {
case CODE_POINTS.EXCLAMATION_MARK: {
this.state = State.MARKUP_DECLARATION_OPEN;
break;
}
case CODE_POINTS.SOLIDUS: {
this.state = State.END_TAG_OPEN;
break;
}
case CODE_POINTS.QUESTION_MARK: {
this._err(ERR.unexpectedQuestionMarkInsteadOfTagName);
this._createCommentToken(1);
this.state = State.BOGUS_COMMENT;
this._stateBogusComment(cp);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofBeforeTagName);
this._emitChars("<");
this._emitEOFToken();
break;
}
default: {
this._err(ERR.invalidFirstCharacterOfTagName);
this._emitChars("<");
this.state = State.DATA;
this._stateData(cp);
}
}
}
_stateEndTagOpen(cp) {
if (isAsciiLetter(cp)) {
this._createEndTagToken();
this.state = State.TAG_NAME;
this._stateTagName(cp);
} else
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingEndTagName);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofBeforeTagName);
this._emitChars("");
this._emitEOFToken();
break;
}
default: {
this._err(ERR.invalidFirstCharacterOfTagName);
this._createCommentToken(2);
this.state = State.BOGUS_COMMENT;
this._stateBogusComment(cp);
}
}
}
_stateTagName(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.BEFORE_ATTRIBUTE_NAME;
break;
}
case CODE_POINTS.SOLIDUS: {
this.state = State.SELF_CLOSING_START_TAG;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.tagName += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
token.tagName += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
}
}
}
_stateRcdataLessThanSign(cp) {
if (cp === CODE_POINTS.SOLIDUS) {
this.state = State.RCDATA_END_TAG_OPEN;
} else {
this._emitChars("<");
this.state = State.RCDATA;
this._stateRcdata(cp);
}
}
_stateRcdataEndTagOpen(cp) {
if (isAsciiLetter(cp)) {
this.state = State.RCDATA_END_TAG_NAME;
this._stateRcdataEndTagName(cp);
} else {
this._emitChars("");
this.state = State.RCDATA;
this._stateRcdata(cp);
}
}
handleSpecialEndTag(_cp) {
if (!this.preprocessor.startsWith(this.lastStartTagName, false)) {
return !this._ensureHibernation();
}
this._createEndTagToken();
const token = this.currentToken;
token.tagName = this.lastStartTagName;
const cp = this.preprocessor.peek(this.lastStartTagName.length);
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this._advanceBy(this.lastStartTagName.length);
this.state = State.BEFORE_ATTRIBUTE_NAME;
return false;
}
case CODE_POINTS.SOLIDUS: {
this._advanceBy(this.lastStartTagName.length);
this.state = State.SELF_CLOSING_START_TAG;
return false;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._advanceBy(this.lastStartTagName.length);
this.emitCurrentTagToken();
this.state = State.DATA;
return false;
}
default: {
return !this._ensureHibernation();
}
}
}
_stateRcdataEndTagName(cp) {
if (this.handleSpecialEndTag(cp)) {
this._emitChars("");
this.state = State.RCDATA;
this._stateRcdata(cp);
}
}
_stateRawtextLessThanSign(cp) {
if (cp === CODE_POINTS.SOLIDUS) {
this.state = State.RAWTEXT_END_TAG_OPEN;
} else {
this._emitChars("<");
this.state = State.RAWTEXT;
this._stateRawtext(cp);
}
}
_stateRawtextEndTagOpen(cp) {
if (isAsciiLetter(cp)) {
this.state = State.RAWTEXT_END_TAG_NAME;
this._stateRawtextEndTagName(cp);
} else {
this._emitChars("");
this.state = State.RAWTEXT;
this._stateRawtext(cp);
}
}
_stateRawtextEndTagName(cp) {
if (this.handleSpecialEndTag(cp)) {
this._emitChars("");
this.state = State.RAWTEXT;
this._stateRawtext(cp);
}
}
_stateScriptDataLessThanSign(cp) {
switch (cp) {
case CODE_POINTS.SOLIDUS: {
this.state = State.SCRIPT_DATA_END_TAG_OPEN;
break;
}
case CODE_POINTS.EXCLAMATION_MARK: {
this.state = State.SCRIPT_DATA_ESCAPE_START;
this._emitChars("");
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.state = State.SCRIPT_DATA_ESCAPED;
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInScriptHtmlCommentLikeText);
this._emitEOFToken();
break;
}
default: {
this.state = State.SCRIPT_DATA_ESCAPED;
this._emitCodePoint(cp);
}
}
}
_stateScriptDataEscapedLessThanSign(cp) {
if (cp === CODE_POINTS.SOLIDUS) {
this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_OPEN;
} else if (isAsciiLetter(cp)) {
this._emitChars("<");
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_START;
this._stateScriptDataDoubleEscapeStart(cp);
} else {
this._emitChars("<");
this.state = State.SCRIPT_DATA_ESCAPED;
this._stateScriptDataEscaped(cp);
}
}
_stateScriptDataEscapedEndTagOpen(cp) {
if (isAsciiLetter(cp)) {
this.state = State.SCRIPT_DATA_ESCAPED_END_TAG_NAME;
this._stateScriptDataEscapedEndTagName(cp);
} else {
this._emitChars("");
this.state = State.SCRIPT_DATA_ESCAPED;
this._stateScriptDataEscaped(cp);
}
}
_stateScriptDataEscapedEndTagName(cp) {
if (this.handleSpecialEndTag(cp)) {
this._emitChars("");
this.state = State.SCRIPT_DATA_ESCAPED;
this._stateScriptDataEscaped(cp);
}
}
_stateScriptDataDoubleEscapeStart(cp) {
if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) {
this._emitCodePoint(cp);
for (let i = 0; i < SEQUENCES.SCRIPT.length; i++) {
this._emitCodePoint(this._consume());
}
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
} else if (!this._ensureHibernation()) {
this.state = State.SCRIPT_DATA_ESCAPED;
this._stateScriptDataEscaped(cp);
}
}
_stateScriptDataDoubleEscaped(cp) {
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH;
this._emitChars("-");
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
this._emitChars("<");
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInScriptHtmlCommentLikeText);
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateScriptDataDoubleEscapedDash(cp) {
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH;
this._emitChars("-");
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
this._emitChars("<");
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInScriptHtmlCommentLikeText);
this._emitEOFToken();
break;
}
default: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._emitCodePoint(cp);
}
}
}
_stateScriptDataDoubleEscapedDashDash(cp) {
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this._emitChars("-");
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN;
this._emitChars("<");
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.SCRIPT_DATA;
this._emitChars(">");
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._emitChars(REPLACEMENT_CHARACTER);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInScriptHtmlCommentLikeText);
this._emitEOFToken();
break;
}
default: {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._emitCodePoint(cp);
}
}
}
_stateScriptDataDoubleEscapedLessThanSign(cp) {
if (cp === CODE_POINTS.SOLIDUS) {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPE_END;
this._emitChars("/");
} else {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._stateScriptDataDoubleEscaped(cp);
}
}
_stateScriptDataDoubleEscapeEnd(cp) {
if (this.preprocessor.startsWith(SEQUENCES.SCRIPT, false) && isScriptDataDoubleEscapeSequenceEnd(this.preprocessor.peek(SEQUENCES.SCRIPT.length))) {
this._emitCodePoint(cp);
for (let i = 0; i < SEQUENCES.SCRIPT.length; i++) {
this._emitCodePoint(this._consume());
}
this.state = State.SCRIPT_DATA_ESCAPED;
} else if (!this._ensureHibernation()) {
this.state = State.SCRIPT_DATA_DOUBLE_ESCAPED;
this._stateScriptDataDoubleEscaped(cp);
}
}
_stateBeforeAttributeName(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.SOLIDUS:
case CODE_POINTS.GREATER_THAN_SIGN:
case CODE_POINTS.EOF: {
this.state = State.AFTER_ATTRIBUTE_NAME;
this._stateAfterAttributeName(cp);
break;
}
case CODE_POINTS.EQUALS_SIGN: {
this._err(ERR.unexpectedEqualsSignBeforeAttributeName);
this._createAttr("=");
this.state = State.ATTRIBUTE_NAME;
break;
}
default: {
this._createAttr("");
this.state = State.ATTRIBUTE_NAME;
this._stateAttributeName(cp);
}
}
}
_stateAttributeName(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED:
case CODE_POINTS.SOLIDUS:
case CODE_POINTS.GREATER_THAN_SIGN:
case CODE_POINTS.EOF: {
this._leaveAttrName();
this.state = State.AFTER_ATTRIBUTE_NAME;
this._stateAfterAttributeName(cp);
break;
}
case CODE_POINTS.EQUALS_SIGN: {
this._leaveAttrName();
this.state = State.BEFORE_ATTRIBUTE_VALUE;
break;
}
case CODE_POINTS.QUOTATION_MARK:
case CODE_POINTS.APOSTROPHE:
case CODE_POINTS.LESS_THAN_SIGN: {
this._err(ERR.unexpectedCharacterInAttributeName);
this.currentAttr.name += String.fromCodePoint(cp);
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.currentAttr.name += REPLACEMENT_CHARACTER;
break;
}
default: {
this.currentAttr.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
}
}
}
_stateAfterAttributeName(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.SOLIDUS: {
this.state = State.SELF_CLOSING_START_TAG;
break;
}
case CODE_POINTS.EQUALS_SIGN: {
this.state = State.BEFORE_ATTRIBUTE_VALUE;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this._createAttr("");
this.state = State.ATTRIBUTE_NAME;
this._stateAttributeName(cp);
}
}
}
_stateBeforeAttributeValue(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.QUOTATION_MARK: {
this.state = State.ATTRIBUTE_VALUE_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
this.state = State.ATTRIBUTE_VALUE_SINGLE_QUOTED;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingAttributeValue);
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
default: {
this.state = State.ATTRIBUTE_VALUE_UNQUOTED;
this._stateAttributeValueUnquoted(cp);
}
}
}
_stateAttributeValueDoubleQuoted(cp) {
switch (cp) {
case CODE_POINTS.QUOTATION_MARK: {
this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
break;
}
case CODE_POINTS.AMPERSAND: {
this._startCharacterReference();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.currentAttr.value += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this.currentAttr.value += String.fromCodePoint(cp);
}
}
}
_stateAttributeValueSingleQuoted(cp) {
switch (cp) {
case CODE_POINTS.APOSTROPHE: {
this.state = State.AFTER_ATTRIBUTE_VALUE_QUOTED;
break;
}
case CODE_POINTS.AMPERSAND: {
this._startCharacterReference();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.currentAttr.value += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this.currentAttr.value += String.fromCodePoint(cp);
}
}
}
_stateAttributeValueUnquoted(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this._leaveAttrValue();
this.state = State.BEFORE_ATTRIBUTE_NAME;
break;
}
case CODE_POINTS.AMPERSAND: {
this._startCharacterReference();
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._leaveAttrValue();
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this.currentAttr.value += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.QUOTATION_MARK:
case CODE_POINTS.APOSTROPHE:
case CODE_POINTS.LESS_THAN_SIGN:
case CODE_POINTS.EQUALS_SIGN:
case CODE_POINTS.GRAVE_ACCENT: {
this._err(ERR.unexpectedCharacterInUnquotedAttributeValue);
this.currentAttr.value += String.fromCodePoint(cp);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this.currentAttr.value += String.fromCodePoint(cp);
}
}
}
_stateAfterAttributeValueQuoted(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this._leaveAttrValue();
this.state = State.BEFORE_ATTRIBUTE_NAME;
break;
}
case CODE_POINTS.SOLIDUS: {
this._leaveAttrValue();
this.state = State.SELF_CLOSING_START_TAG;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._leaveAttrValue();
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingWhitespaceBetweenAttributes);
this.state = State.BEFORE_ATTRIBUTE_NAME;
this._stateBeforeAttributeName(cp);
}
}
}
_stateSelfClosingStartTag(cp) {
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
const token = this.currentToken;
token.selfClosing = true;
this.state = State.DATA;
this.emitCurrentTagToken();
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInTag);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.unexpectedSolidusInTag);
this.state = State.BEFORE_ATTRIBUTE_NAME;
this._stateBeforeAttributeName(cp);
}
}
}
_stateBogusComment(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentComment(token);
break;
}
case CODE_POINTS.EOF: {
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.data += REPLACEMENT_CHARACTER;
break;
}
default: {
token.data += String.fromCodePoint(cp);
}
}
}
_stateMarkupDeclarationOpen(cp) {
if (this._consumeSequenceIfMatch(SEQUENCES.DASH_DASH, true)) {
this._createCommentToken(SEQUENCES.DASH_DASH.length + 1);
this.state = State.COMMENT_START;
} else if (this._consumeSequenceIfMatch(SEQUENCES.DOCTYPE, false)) {
this.currentLocation = this.getCurrentLocation(SEQUENCES.DOCTYPE.length + 1);
this.state = State.DOCTYPE;
} else if (this._consumeSequenceIfMatch(SEQUENCES.CDATA_START, true)) {
if (this.inForeignNode) {
this.state = State.CDATA_SECTION;
} else {
this._err(ERR.cdataInHtmlContent);
this._createCommentToken(SEQUENCES.CDATA_START.length + 1);
this.currentToken.data = "[CDATA[";
this.state = State.BOGUS_COMMENT;
}
} else if (!this._ensureHibernation()) {
this._err(ERR.incorrectlyOpenedComment);
this._createCommentToken(2);
this.state = State.BOGUS_COMMENT;
this._stateBogusComment(cp);
}
}
_stateCommentStart(cp) {
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.COMMENT_START_DASH;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptClosingOfEmptyComment);
this.state = State.DATA;
const token = this.currentToken;
this.emitCurrentComment(token);
break;
}
default: {
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateCommentStartDash(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.COMMENT_END;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptClosingOfEmptyComment);
this.state = State.DATA;
this.emitCurrentComment(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInComment);
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
default: {
token.data += "-";
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateComment(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.COMMENT_END_DASH;
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
token.data += "<";
this.state = State.COMMENT_LESS_THAN_SIGN;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.data += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInComment);
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
default: {
token.data += String.fromCodePoint(cp);
}
}
}
_stateCommentLessThanSign(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.EXCLAMATION_MARK: {
token.data += "!";
this.state = State.COMMENT_LESS_THAN_SIGN_BANG;
break;
}
case CODE_POINTS.LESS_THAN_SIGN: {
token.data += "<";
break;
}
default: {
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateCommentLessThanSignBang(cp) {
if (cp === CODE_POINTS.HYPHEN_MINUS) {
this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH;
} else {
this.state = State.COMMENT;
this._stateComment(cp);
}
}
_stateCommentLessThanSignBangDash(cp) {
if (cp === CODE_POINTS.HYPHEN_MINUS) {
this.state = State.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH;
} else {
this.state = State.COMMENT_END_DASH;
this._stateCommentEndDash(cp);
}
}
_stateCommentLessThanSignBangDashDash(cp) {
if (cp !== CODE_POINTS.GREATER_THAN_SIGN && cp !== CODE_POINTS.EOF) {
this._err(ERR.nestedComment);
}
this.state = State.COMMENT_END;
this._stateCommentEnd(cp);
}
_stateCommentEndDash(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
this.state = State.COMMENT_END;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInComment);
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
default: {
token.data += "-";
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateCommentEnd(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentComment(token);
break;
}
case CODE_POINTS.EXCLAMATION_MARK: {
this.state = State.COMMENT_END_BANG;
break;
}
case CODE_POINTS.HYPHEN_MINUS: {
token.data += "-";
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInComment);
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
default: {
token.data += "--";
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateCommentEndBang(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.HYPHEN_MINUS: {
token.data += "--!";
this.state = State.COMMENT_END_DASH;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.incorrectlyClosedComment);
this.state = State.DATA;
this.emitCurrentComment(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInComment);
this.emitCurrentComment(token);
this._emitEOFToken();
break;
}
default: {
token.data += "--!";
this.state = State.COMMENT;
this._stateComment(cp);
}
}
}
_stateDoctype(cp) {
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.BEFORE_DOCTYPE_NAME;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.BEFORE_DOCTYPE_NAME;
this._stateBeforeDoctypeName(cp);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
this._createDoctypeToken(null);
const token = this.currentToken;
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingWhitespaceBeforeDoctypeName);
this.state = State.BEFORE_DOCTYPE_NAME;
this._stateBeforeDoctypeName(cp);
}
}
}
_stateBeforeDoctypeName(cp) {
if (isAsciiUpper(cp)) {
this._createDoctypeToken(String.fromCharCode(toAsciiLower(cp)));
this.state = State.DOCTYPE_NAME;
} else
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
this._createDoctypeToken(REPLACEMENT_CHARACTER);
this.state = State.DOCTYPE_NAME;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingDoctypeName);
this._createDoctypeToken(null);
const token = this.currentToken;
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
this._createDoctypeToken(null);
const token = this.currentToken;
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._createDoctypeToken(String.fromCodePoint(cp));
this.state = State.DOCTYPE_NAME;
}
}
}
_stateDoctypeName(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.AFTER_DOCTYPE_NAME;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.name += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
token.name += String.fromCodePoint(isAsciiUpper(cp) ? toAsciiLower(cp) : cp);
}
}
}
_stateAfterDoctypeName(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
if (this._consumeSequenceIfMatch(SEQUENCES.PUBLIC, false)) {
this.state = State.AFTER_DOCTYPE_PUBLIC_KEYWORD;
} else if (this._consumeSequenceIfMatch(SEQUENCES.SYSTEM, false)) {
this.state = State.AFTER_DOCTYPE_SYSTEM_KEYWORD;
} else if (!this._ensureHibernation()) {
this._err(ERR.invalidCharacterSequenceAfterDoctypeName);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
}
_stateAfterDoctypePublicKeyword(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case CODE_POINTS.QUOTATION_MARK: {
this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
token.publicId = "";
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
this._err(ERR.missingWhitespaceAfterDoctypePublicKeyword);
token.publicId = "";
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingDoctypePublicIdentifier);
token.forceQuirks = true;
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateBeforeDoctypePublicIdentifier(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.QUOTATION_MARK: {
token.publicId = "";
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
token.publicId = "";
this.state = State.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingDoctypePublicIdentifier);
token.forceQuirks = true;
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypePublicIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateDoctypePublicIdentifierDoubleQuoted(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.QUOTATION_MARK: {
this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.publicId += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptDoctypePublicIdentifier);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
token.publicId += String.fromCodePoint(cp);
}
}
}
_stateDoctypePublicIdentifierSingleQuoted(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.APOSTROPHE: {
this.state = State.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.publicId += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptDoctypePublicIdentifier);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
token.publicId += String.fromCodePoint(cp);
}
}
}
_stateAfterDoctypePublicIdentifier(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.QUOTATION_MARK: {
this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
this._err(ERR.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers);
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateBetweenDoctypePublicAndSystemIdentifiers(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.QUOTATION_MARK: {
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateAfterDoctypeSystemKeyword(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
this.state = State.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case CODE_POINTS.QUOTATION_MARK: {
this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
this._err(ERR.missingWhitespaceAfterDoctypeSystemKeyword);
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateBeforeDoctypeSystemIdentifier(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.QUOTATION_MARK: {
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;
break;
}
case CODE_POINTS.APOSTROPHE: {
token.systemId = "";
this.state = State.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.missingDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.DATA;
this.emitCurrentDoctype(token);
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.missingQuoteBeforeDoctypeSystemIdentifier);
token.forceQuirks = true;
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateDoctypeSystemIdentifierDoubleQuoted(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.QUOTATION_MARK: {
this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.systemId += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptDoctypeSystemIdentifier);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
token.systemId += String.fromCodePoint(cp);
}
}
}
_stateDoctypeSystemIdentifierSingleQuoted(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.APOSTROPHE: {
this.state = State.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
token.systemId += REPLACEMENT_CHARACTER;
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this._err(ERR.abruptDoctypeSystemIdentifier);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
token.systemId += String.fromCodePoint(cp);
}
}
}
_stateAfterDoctypeSystemIdentifier(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.SPACE:
case CODE_POINTS.LINE_FEED:
case CODE_POINTS.TABULATION:
case CODE_POINTS.FORM_FEED: {
break;
}
case CODE_POINTS.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInDoctype);
token.forceQuirks = true;
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default: {
this._err(ERR.unexpectedCharacterAfterDoctypeSystemIdentifier);
this.state = State.BOGUS_DOCTYPE;
this._stateBogusDoctype(cp);
}
}
}
_stateBogusDoctype(cp) {
const token = this.currentToken;
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
this.emitCurrentDoctype(token);
this.state = State.DATA;
break;
}
case CODE_POINTS.NULL: {
this._err(ERR.unexpectedNullCharacter);
break;
}
case CODE_POINTS.EOF: {
this.emitCurrentDoctype(token);
this._emitEOFToken();
break;
}
default:
}
}
_stateCdataSection(cp) {
switch (cp) {
case CODE_POINTS.RIGHT_SQUARE_BRACKET: {
this.state = State.CDATA_SECTION_BRACKET;
break;
}
case CODE_POINTS.EOF: {
this._err(ERR.eofInCdata);
this._emitEOFToken();
break;
}
default: {
this._emitCodePoint(cp);
}
}
}
_stateCdataSectionBracket(cp) {
if (cp === CODE_POINTS.RIGHT_SQUARE_BRACKET) {
this.state = State.CDATA_SECTION_END;
} else {
this._emitChars("]");
this.state = State.CDATA_SECTION;
this._stateCdataSection(cp);
}
}
_stateCdataSectionEnd(cp) {
switch (cp) {
case CODE_POINTS.GREATER_THAN_SIGN: {
this.state = State.DATA;
break;
}
case CODE_POINTS.RIGHT_SQUARE_BRACKET: {
this._emitChars("]");
break;
}
default: {
this._emitChars("]]");
this.state = State.CDATA_SECTION;
this._stateCdataSection(cp);
}
}
}
_stateCharacterReference() {
let length = this.entityDecoder.write(this.preprocessor.html, this.preprocessor.pos);
if (length < 0) {
if (this.preprocessor.lastChunkWritten) {
length = this.entityDecoder.end();
} else {
this.active = false;
this.preprocessor.pos = this.preprocessor.html.length - 1;
this.consumedAfterSnapshot = 0;
this.preprocessor.endOfChunkHit = true;
return;
}
}
if (length === 0) {
this.preprocessor.pos = this.entityStartPos;
this._flushCodePointConsumedAsCharacterReference(CODE_POINTS.AMPERSAND);
this.state = !this._isCharacterReferenceInAttribute() && isAsciiAlphaNumeric3(this.preprocessor.peek(1)) ? State.AMBIGUOUS_AMPERSAND : this.returnState;
} else {
this.state = this.returnState;
}
}
_stateAmbiguousAmpersand(cp) {
if (isAsciiAlphaNumeric3(cp)) {
this._flushCodePointConsumedAsCharacterReference(cp);
} else {
if (cp === CODE_POINTS.SEMICOLON) {
this._err(ERR.unknownNamedCharacterReference);
}
this.state = this.returnState;
this._callState(cp);
}
}
};
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/open-element-stack.js
var IMPLICIT_END_TAG_REQUIRED = /* @__PURE__ */ new Set([TAG_ID.DD, TAG_ID.DT, TAG_ID.LI, TAG_ID.OPTGROUP, TAG_ID.OPTION, TAG_ID.P, TAG_ID.RB, TAG_ID.RP, TAG_ID.RT, TAG_ID.RTC]);
var IMPLICIT_END_TAG_REQUIRED_THOROUGHLY = /* @__PURE__ */ new Set([
...IMPLICIT_END_TAG_REQUIRED,
TAG_ID.CAPTION,
TAG_ID.COLGROUP,
TAG_ID.TBODY,
TAG_ID.TD,
TAG_ID.TFOOT,
TAG_ID.TH,
TAG_ID.THEAD,
TAG_ID.TR
]);
var SCOPING_ELEMENTS_HTML = /* @__PURE__ */ new Set([
TAG_ID.APPLET,
TAG_ID.CAPTION,
TAG_ID.HTML,
TAG_ID.MARQUEE,
TAG_ID.OBJECT,
TAG_ID.TABLE,
TAG_ID.TD,
TAG_ID.TEMPLATE,
TAG_ID.TH
]);
var SCOPING_ELEMENTS_HTML_LIST = /* @__PURE__ */ new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.OL, TAG_ID.UL]);
var SCOPING_ELEMENTS_HTML_BUTTON = /* @__PURE__ */ new Set([...SCOPING_ELEMENTS_HTML, TAG_ID.BUTTON]);
var SCOPING_ELEMENTS_MATHML = /* @__PURE__ */ new Set([TAG_ID.ANNOTATION_XML, TAG_ID.MI, TAG_ID.MN, TAG_ID.MO, TAG_ID.MS, TAG_ID.MTEXT]);
var SCOPING_ELEMENTS_SVG = /* @__PURE__ */ new Set([TAG_ID.DESC, TAG_ID.FOREIGN_OBJECT, TAG_ID.TITLE]);
var TABLE_ROW_CONTEXT = /* @__PURE__ */ new Set([TAG_ID.TR, TAG_ID.TEMPLATE, TAG_ID.HTML]);
var TABLE_BODY_CONTEXT = /* @__PURE__ */ new Set([TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TEMPLATE, TAG_ID.HTML]);
var TABLE_CONTEXT = /* @__PURE__ */ new Set([TAG_ID.TABLE, TAG_ID.TEMPLATE, TAG_ID.HTML]);
var TABLE_CELLS = /* @__PURE__ */ new Set([TAG_ID.TD, TAG_ID.TH]);
var OpenElementStack = class {
get currentTmplContentOrNode() {
return this._isInTemplate() ? this.treeAdapter.getTemplateContent(this.current) : this.current;
}
constructor(document2, treeAdapter, handler) {
this.treeAdapter = treeAdapter;
this.handler = handler;
this.items = [];
this.tagIDs = [];
this.stackTop = -1;
this.tmplCount = 0;
this.currentTagId = TAG_ID.UNKNOWN;
this.current = document2;
}
_indexOf(element) {
return this.items.lastIndexOf(element, this.stackTop);
}
_isInTemplate() {
return this.currentTagId === TAG_ID.TEMPLATE && this.treeAdapter.getNamespaceURI(this.current) === NS.HTML;
}
_updateCurrentElement() {
this.current = this.items[this.stackTop];
this.currentTagId = this.tagIDs[this.stackTop];
}
push(element, tagID) {
this.stackTop++;
this.items[this.stackTop] = element;
this.current = element;
this.tagIDs[this.stackTop] = tagID;
this.currentTagId = tagID;
if (this._isInTemplate()) {
this.tmplCount++;
}
this.handler.onItemPush(element, tagID, true);
}
pop() {
const popped = this.current;
if (this.tmplCount > 0 && this._isInTemplate()) {
this.tmplCount--;
}
this.stackTop--;
this._updateCurrentElement();
this.handler.onItemPop(popped, true);
}
replace(oldElement, newElement) {
const idx = this._indexOf(oldElement);
this.items[idx] = newElement;
if (idx === this.stackTop) {
this.current = newElement;
}
}
insertAfter(referenceElement, newElement, newElementID) {
const insertionIdx = this._indexOf(referenceElement) + 1;
this.items.splice(insertionIdx, 0, newElement);
this.tagIDs.splice(insertionIdx, 0, newElementID);
this.stackTop++;
if (insertionIdx === this.stackTop) {
this._updateCurrentElement();
}
if (this.current && this.currentTagId !== void 0) {
this.handler.onItemPush(this.current, this.currentTagId, insertionIdx === this.stackTop);
}
}
popUntilTagNamePopped(tagName) {
let targetIdx = this.stackTop + 1;
do {
targetIdx = this.tagIDs.lastIndexOf(tagName, targetIdx - 1);
} while (targetIdx > 0 && this.treeAdapter.getNamespaceURI(this.items[targetIdx]) !== NS.HTML);
this.shortenToLength(Math.max(targetIdx, 0));
}
shortenToLength(idx) {
while (this.stackTop >= idx) {
const popped = this.current;
if (this.tmplCount > 0 && this._isInTemplate()) {
this.tmplCount -= 1;
}
this.stackTop--;
this._updateCurrentElement();
this.handler.onItemPop(popped, this.stackTop < idx);
}
}
popUntilElementPopped(element) {
const idx = this._indexOf(element);
this.shortenToLength(Math.max(idx, 0));
}
popUntilPopped(tagNames, targetNS) {
const idx = this._indexOfTagNames(tagNames, targetNS);
this.shortenToLength(Math.max(idx, 0));
}
popUntilNumberedHeaderPopped() {
this.popUntilPopped(NUMBERED_HEADERS, NS.HTML);
}
popUntilTableCellPopped() {
this.popUntilPopped(TABLE_CELLS, NS.HTML);
}
popAllUpToHtmlElement() {
this.tmplCount = 0;
this.shortenToLength(1);
}
_indexOfTagNames(tagNames, namespace) {
for (let i = this.stackTop; i >= 0; i--) {
if (tagNames.has(this.tagIDs[i]) && this.treeAdapter.getNamespaceURI(this.items[i]) === namespace) {
return i;
}
}
return -1;
}
clearBackTo(tagNames, targetNS) {
const idx = this._indexOfTagNames(tagNames, targetNS);
this.shortenToLength(idx + 1);
}
clearBackToTableContext() {
this.clearBackTo(TABLE_CONTEXT, NS.HTML);
}
clearBackToTableBodyContext() {
this.clearBackTo(TABLE_BODY_CONTEXT, NS.HTML);
}
clearBackToTableRowContext() {
this.clearBackTo(TABLE_ROW_CONTEXT, NS.HTML);
}
remove(element) {
const idx = this._indexOf(element);
if (idx >= 0) {
if (idx === this.stackTop) {
this.pop();
} else {
this.items.splice(idx, 1);
this.tagIDs.splice(idx, 1);
this.stackTop--;
this._updateCurrentElement();
this.handler.onItemPop(element, false);
}
}
}
tryPeekProperlyNestedBodyElement() {
return this.stackTop >= 1 && this.tagIDs[1] === TAG_ID.BODY ? this.items[1] : null;
}
contains(element) {
return this._indexOf(element) > -1;
}
getCommonAncestor(element) {
const elementIdx = this._indexOf(element) - 1;
return elementIdx >= 0 ? this.items[elementIdx] : null;
}
isRootHtmlElementCurrent() {
return this.stackTop === 0 && this.tagIDs[0] === TAG_ID.HTML;
}
hasInDynamicScope(tagName, htmlScope) {
for (let i = this.stackTop; i >= 0; i--) {
const tn = this.tagIDs[i];
switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
case NS.HTML: {
if (tn === tagName)
return true;
if (htmlScope.has(tn))
return false;
break;
}
case NS.SVG: {
if (SCOPING_ELEMENTS_SVG.has(tn))
return false;
break;
}
case NS.MATHML: {
if (SCOPING_ELEMENTS_MATHML.has(tn))
return false;
break;
}
}
}
return true;
}
hasInScope(tagName) {
return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML);
}
hasInListItemScope(tagName) {
return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_LIST);
}
hasInButtonScope(tagName) {
return this.hasInDynamicScope(tagName, SCOPING_ELEMENTS_HTML_BUTTON);
}
hasNumberedHeaderInScope() {
for (let i = this.stackTop; i >= 0; i--) {
const tn = this.tagIDs[i];
switch (this.treeAdapter.getNamespaceURI(this.items[i])) {
case NS.HTML: {
if (NUMBERED_HEADERS.has(tn))
return true;
if (SCOPING_ELEMENTS_HTML.has(tn))
return false;
break;
}
case NS.SVG: {
if (SCOPING_ELEMENTS_SVG.has(tn))
return false;
break;
}
case NS.MATHML: {
if (SCOPING_ELEMENTS_MATHML.has(tn))
return false;
break;
}
}
}
return true;
}
hasInTableScope(tagName) {
for (let i = this.stackTop; i >= 0; i--) {
if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
continue;
}
switch (this.tagIDs[i]) {
case tagName: {
return true;
}
case TAG_ID.TABLE:
case TAG_ID.HTML: {
return false;
}
}
}
return true;
}
hasTableBodyContextInTableScope() {
for (let i = this.stackTop; i >= 0; i--) {
if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
continue;
}
switch (this.tagIDs[i]) {
case TAG_ID.TBODY:
case TAG_ID.THEAD:
case TAG_ID.TFOOT: {
return true;
}
case TAG_ID.TABLE:
case TAG_ID.HTML: {
return false;
}
}
}
return true;
}
hasInSelectScope(tagName) {
for (let i = this.stackTop; i >= 0; i--) {
if (this.treeAdapter.getNamespaceURI(this.items[i]) !== NS.HTML) {
continue;
}
switch (this.tagIDs[i]) {
case tagName: {
return true;
}
case TAG_ID.OPTION:
case TAG_ID.OPTGROUP: {
break;
}
default: {
return false;
}
}
}
return true;
}
generateImpliedEndTags() {
while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED.has(this.currentTagId)) {
this.pop();
}
}
generateImpliedEndTagsThoroughly() {
while (this.currentTagId !== void 0 && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
this.pop();
}
}
generateImpliedEndTagsWithExclusion(exclusionId) {
while (this.currentTagId !== void 0 && this.currentTagId !== exclusionId && IMPLICIT_END_TAG_REQUIRED_THOROUGHLY.has(this.currentTagId)) {
this.pop();
}
}
};
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/formatting-element-list.js
var NOAH_ARK_CAPACITY = 3;
var EntryType;
(function(EntryType2) {
EntryType2[EntryType2["Marker"] = 0] = "Marker";
EntryType2[EntryType2["Element"] = 1] = "Element";
})(EntryType || (EntryType = {}));
var MARKER = { type: EntryType.Marker };
var FormattingElementList = class {
constructor(treeAdapter) {
this.treeAdapter = treeAdapter;
this.entries = [];
this.bookmark = null;
}
_getNoahArkConditionCandidates(newElement, neAttrs) {
const candidates = [];
const neAttrsLength = neAttrs.length;
const neTagName = this.treeAdapter.getTagName(newElement);
const neNamespaceURI = this.treeAdapter.getNamespaceURI(newElement);
for (let i = 0; i < this.entries.length; i++) {
const entry = this.entries[i];
if (entry.type === EntryType.Marker) {
break;
}
const { element } = entry;
if (this.treeAdapter.getTagName(element) === neTagName && this.treeAdapter.getNamespaceURI(element) === neNamespaceURI) {
const elementAttrs = this.treeAdapter.getAttrList(element);
if (elementAttrs.length === neAttrsLength) {
candidates.push({ idx: i, attrs: elementAttrs });
}
}
}
return candidates;
}
_ensureNoahArkCondition(newElement) {
if (this.entries.length < NOAH_ARK_CAPACITY)
return;
const neAttrs = this.treeAdapter.getAttrList(newElement);
const candidates = this._getNoahArkConditionCandidates(newElement, neAttrs);
if (candidates.length < NOAH_ARK_CAPACITY)
return;
const neAttrsMap = new Map(neAttrs.map((neAttr) => [neAttr.name, neAttr.value]));
let validCandidates = 0;
for (let i = 0; i < candidates.length; i++) {
const candidate = candidates[i];
if (candidate.attrs.every((cAttr) => neAttrsMap.get(cAttr.name) === cAttr.value)) {
validCandidates += 1;
if (validCandidates >= NOAH_ARK_CAPACITY) {
this.entries.splice(candidate.idx, 1);
}
}
}
}
insertMarker() {
this.entries.unshift(MARKER);
}
pushElement(element, token) {
this._ensureNoahArkCondition(element);
this.entries.unshift({
type: EntryType.Element,
element,
token
});
}
insertElementAfterBookmark(element, token) {
const bookmarkIdx = this.entries.indexOf(this.bookmark);
this.entries.splice(bookmarkIdx, 0, {
type: EntryType.Element,
element,
token
});
}
removeEntry(entry) {
const entryIndex = this.entries.indexOf(entry);
if (entryIndex !== -1) {
this.entries.splice(entryIndex, 1);
}
}
clearToLastMarker() {
const markerIdx = this.entries.indexOf(MARKER);
if (markerIdx === -1) {
this.entries.length = 0;
} else {
this.entries.splice(0, markerIdx + 1);
}
}
getElementEntryInScopeWithTagName(tagName) {
const entry = this.entries.find((entry2) => entry2.type === EntryType.Marker || this.treeAdapter.getTagName(entry2.element) === tagName);
return entry && entry.type === EntryType.Element ? entry : null;
}
getElementEntry(element) {
return this.entries.find((entry) => entry.type === EntryType.Element && entry.element === element);
}
};
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/tree-adapters/default.js
var defaultTreeAdapter = {
createDocument() {
return {
nodeName: "#document",
mode: DOCUMENT_MODE.NO_QUIRKS,
childNodes: []
};
},
createDocumentFragment() {
return {
nodeName: "#document-fragment",
childNodes: []
};
},
createElement(tagName, namespaceURI, attrs) {
return {
nodeName: tagName,
tagName,
attrs,
namespaceURI,
childNodes: [],
parentNode: null
};
},
createCommentNode(data2) {
return {
nodeName: "#comment",
data: data2,
parentNode: null
};
},
createTextNode(value) {
return {
nodeName: "#text",
value,
parentNode: null
};
},
appendChild(parentNode, newNode) {
parentNode.childNodes.push(newNode);
newNode.parentNode = parentNode;
},
insertBefore(parentNode, newNode, referenceNode) {
const insertionIdx = parentNode.childNodes.indexOf(referenceNode);
parentNode.childNodes.splice(insertionIdx, 0, newNode);
newNode.parentNode = parentNode;
},
setTemplateContent(templateElement, contentElement) {
templateElement.content = contentElement;
},
getTemplateContent(templateElement) {
return templateElement.content;
},
setDocumentType(document2, name2, publicId, systemId) {
const doctypeNode = document2.childNodes.find((node) => node.nodeName === "#documentType");
if (doctypeNode) {
doctypeNode.name = name2;
doctypeNode.publicId = publicId;
doctypeNode.systemId = systemId;
} else {
const node = {
nodeName: "#documentType",
name: name2,
publicId,
systemId,
parentNode: null
};
defaultTreeAdapter.appendChild(document2, node);
}
},
setDocumentMode(document2, mode) {
document2.mode = mode;
},
getDocumentMode(document2) {
return document2.mode;
},
detachNode(node) {
if (node.parentNode) {
const idx = node.parentNode.childNodes.indexOf(node);
node.parentNode.childNodes.splice(idx, 1);
node.parentNode = null;
}
},
insertText(parentNode, text5) {
if (parentNode.childNodes.length > 0) {
const prevNode = parentNode.childNodes[parentNode.childNodes.length - 1];
if (defaultTreeAdapter.isTextNode(prevNode)) {
prevNode.value += text5;
return;
}
}
defaultTreeAdapter.appendChild(parentNode, defaultTreeAdapter.createTextNode(text5));
},
insertTextBefore(parentNode, text5, referenceNode) {
const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
if (prevNode && defaultTreeAdapter.isTextNode(prevNode)) {
prevNode.value += text5;
} else {
defaultTreeAdapter.insertBefore(parentNode, defaultTreeAdapter.createTextNode(text5), referenceNode);
}
},
adoptAttributes(recipient, attrs) {
const recipientAttrsMap = new Set(recipient.attrs.map((attr2) => attr2.name));
for (let j = 0; j < attrs.length; j++) {
if (!recipientAttrsMap.has(attrs[j].name)) {
recipient.attrs.push(attrs[j]);
}
}
},
getFirstChild(node) {
return node.childNodes[0];
},
getChildNodes(node) {
return node.childNodes;
},
getParentNode(node) {
return node.parentNode;
},
getAttrList(element) {
return element.attrs;
},
getTagName(element) {
return element.tagName;
},
getNamespaceURI(element) {
return element.namespaceURI;
},
getTextNodeContent(textNode) {
return textNode.value;
},
getCommentNodeContent(commentNode) {
return commentNode.data;
},
getDocumentTypeNodeName(doctypeNode) {
return doctypeNode.name;
},
getDocumentTypeNodePublicId(doctypeNode) {
return doctypeNode.publicId;
},
getDocumentTypeNodeSystemId(doctypeNode) {
return doctypeNode.systemId;
},
isTextNode(node) {
return node.nodeName === "#text";
},
isCommentNode(node) {
return node.nodeName === "#comment";
},
isDocumentTypeNode(node) {
return node.nodeName === "#documentType";
},
isElementNode(node) {
return Object.prototype.hasOwnProperty.call(node, "tagName");
},
setNodeSourceCodeLocation(node, location) {
node.sourceCodeLocation = location;
},
getNodeSourceCodeLocation(node) {
return node.sourceCodeLocation;
},
updateNodeSourceCodeLocation(node, endLocation) {
node.sourceCodeLocation = { ...node.sourceCodeLocation, ...endLocation };
}
};
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/doctype.js
var VALID_DOCTYPE_NAME = "html";
var VALID_SYSTEM_ID = "about:legacy-compat";
var QUIRKS_MODE_SYSTEM_ID = "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd";
var QUIRKS_MODE_PUBLIC_ID_PREFIXES = [
"+//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//"
];
var QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
...QUIRKS_MODE_PUBLIC_ID_PREFIXES,
"-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//"
];
var QUIRKS_MODE_PUBLIC_IDS = /* @__PURE__ */ new Set([
"-//w3o//dtd w3 html strict 3.0//en//",
"-/w3c/dtd html 4.0 transitional/en",
"html"
]);
var LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = ["-//w3c//dtd xhtml 1.0 frameset//", "-//w3c//dtd xhtml 1.0 transitional//"];
var LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = [
...LIMITED_QUIRKS_PUBLIC_ID_PREFIXES,
"-//w3c//dtd html 4.01 frameset//",
"-//w3c//dtd html 4.01 transitional//"
];
function hasPrefix(publicId, prefixes) {
return prefixes.some((prefix) => publicId.startsWith(prefix));
}
function isConforming(token) {
return token.name === VALID_DOCTYPE_NAME && token.publicId === null && (token.systemId === null || token.systemId === VALID_SYSTEM_ID);
}
function getDocumentMode(token) {
if (token.name !== VALID_DOCTYPE_NAME) {
return DOCUMENT_MODE.QUIRKS;
}
const { systemId } = token;
if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) {
return DOCUMENT_MODE.QUIRKS;
}
let { publicId } = token;
if (publicId !== null) {
publicId = publicId.toLowerCase();
if (QUIRKS_MODE_PUBLIC_IDS.has(publicId)) {
return DOCUMENT_MODE.QUIRKS;
}
let prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES;
if (hasPrefix(publicId, prefixes)) {
return DOCUMENT_MODE.QUIRKS;
}
prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES;
if (hasPrefix(publicId, prefixes)) {
return DOCUMENT_MODE.LIMITED_QUIRKS;
}
}
return DOCUMENT_MODE.NO_QUIRKS;
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/common/foreign-content.js
var foreign_content_exports = {};
__export(foreign_content_exports, {
SVG_TAG_NAMES_ADJUSTMENT_MAP: () => SVG_TAG_NAMES_ADJUSTMENT_MAP,
adjustTokenMathMLAttrs: () => adjustTokenMathMLAttrs,
adjustTokenSVGAttrs: () => adjustTokenSVGAttrs,
adjustTokenSVGTagName: () => adjustTokenSVGTagName,
adjustTokenXMLAttrs: () => adjustTokenXMLAttrs,
causesExit: () => causesExit,
isIntegrationPoint: () => isIntegrationPoint
});
var MIME_TYPES = {
TEXT_HTML: "text/html",
APPLICATION_XML: "application/xhtml+xml"
};
var DEFINITION_URL_ATTR = "definitionurl";
var ADJUSTED_DEFINITION_URL_ATTR = "definitionURL";
var SVG_ATTRS_ADJUSTMENT_MAP = 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((attr2) => [attr2.toLowerCase(), attr2]));
var XML_ATTRS_ADJUSTMENT_MAP = /* @__PURE__ */ new Map([
["xlink:actuate", { prefix: "xlink", name: "actuate", namespace: NS.XLINK }],
["xlink:arcrole", { prefix: "xlink", name: "arcrole", namespace: NS.XLINK }],
["xlink:href", { prefix: "xlink", name: "href", namespace: NS.XLINK }],
["xlink:role", { prefix: "xlink", name: "role", namespace: NS.XLINK }],
["xlink:show", { prefix: "xlink", name: "show", namespace: NS.XLINK }],
["xlink:title", { prefix: "xlink", name: "title", namespace: NS.XLINK }],
["xlink:type", { prefix: "xlink", name: "type", namespace: NS.XLINK }],
["xml:lang", { prefix: "xml", name: "lang", namespace: NS.XML }],
["xml:space", { prefix: "xml", name: "space", namespace: NS.XML }],
["xmlns", { prefix: "", name: "xmlns", namespace: NS.XMLNS }],
["xmlns:xlink", { prefix: "xmlns", name: "xlink", namespace: NS.XMLNS }]
]);
var SVG_TAG_NAMES_ADJUSTMENT_MAP = 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((tn) => [tn.toLowerCase(), tn]));
var EXITS_FOREIGN_CONTENT = /* @__PURE__ */ new Set([
TAG_ID.B,
TAG_ID.BIG,
TAG_ID.BLOCKQUOTE,
TAG_ID.BODY,
TAG_ID.BR,
TAG_ID.CENTER,
TAG_ID.CODE,
TAG_ID.DD,
TAG_ID.DIV,
TAG_ID.DL,
TAG_ID.DT,
TAG_ID.EM,
TAG_ID.EMBED,
TAG_ID.H1,
TAG_ID.H2,
TAG_ID.H3,
TAG_ID.H4,
TAG_ID.H5,
TAG_ID.H6,
TAG_ID.HEAD,
TAG_ID.HR,
TAG_ID.I,
TAG_ID.IMG,
TAG_ID.LI,
TAG_ID.LISTING,
TAG_ID.MENU,
TAG_ID.META,
TAG_ID.NOBR,
TAG_ID.OL,
TAG_ID.P,
TAG_ID.PRE,
TAG_ID.RUBY,
TAG_ID.S,
TAG_ID.SMALL,
TAG_ID.SPAN,
TAG_ID.STRONG,
TAG_ID.STRIKE,
TAG_ID.SUB,
TAG_ID.SUP,
TAG_ID.TABLE,
TAG_ID.TT,
TAG_ID.U,
TAG_ID.UL,
TAG_ID.VAR
]);
function causesExit(startTagToken) {
const tn = startTagToken.tagID;
const isFontWithAttrs = tn === TAG_ID.FONT && startTagToken.attrs.some(({ name: name2 }) => name2 === ATTRS.COLOR || name2 === ATTRS.SIZE || name2 === ATTRS.FACE);
return isFontWithAttrs || EXITS_FOREIGN_CONTENT.has(tn);
}
function adjustTokenMathMLAttrs(token) {
for (let i = 0; i < token.attrs.length; i++) {
if (token.attrs[i].name === DEFINITION_URL_ATTR) {
token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR;
break;
}
}
}
function adjustTokenSVGAttrs(token) {
for (let i = 0; i < token.attrs.length; i++) {
const adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name);
if (adjustedAttrName != null) {
token.attrs[i].name = adjustedAttrName;
}
}
}
function adjustTokenXMLAttrs(token) {
for (let i = 0; i < token.attrs.length; i++) {
const adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP.get(token.attrs[i].name);
if (adjustedAttrEntry) {
token.attrs[i].prefix = adjustedAttrEntry.prefix;
token.attrs[i].name = adjustedAttrEntry.name;
token.attrs[i].namespace = adjustedAttrEntry.namespace;
}
}
}
function adjustTokenSVGTagName(token) {
const adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP.get(token.tagName);
if (adjustedTagName != null) {
token.tagName = adjustedTagName;
token.tagID = getTagID(token.tagName);
}
}
function isMathMLTextIntegrationPoint(tn, ns) {
return ns === NS.MATHML && (tn === TAG_ID.MI || tn === TAG_ID.MO || tn === TAG_ID.MN || tn === TAG_ID.MS || tn === TAG_ID.MTEXT);
}
function isHtmlIntegrationPoint(tn, ns, attrs) {
if (ns === NS.MATHML && tn === TAG_ID.ANNOTATION_XML) {
for (let i = 0; i < attrs.length; i++) {
if (attrs[i].name === ATTRS.ENCODING) {
const value = attrs[i].value.toLowerCase();
return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML;
}
}
}
return ns === NS.SVG && (tn === TAG_ID.FOREIGN_OBJECT || tn === TAG_ID.DESC || tn === TAG_ID.TITLE);
}
function isIntegrationPoint(tn, ns, attrs, foreignNS) {
return (!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs) || (!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns);
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/parser/index.js
var HIDDEN_INPUT_TYPE = "hidden";
var AA_OUTER_LOOP_ITER = 8;
var AA_INNER_LOOP_ITER = 3;
var InsertionMode;
(function(InsertionMode2) {
InsertionMode2[InsertionMode2["INITIAL"] = 0] = "INITIAL";
InsertionMode2[InsertionMode2["BEFORE_HTML"] = 1] = "BEFORE_HTML";
InsertionMode2[InsertionMode2["BEFORE_HEAD"] = 2] = "BEFORE_HEAD";
InsertionMode2[InsertionMode2["IN_HEAD"] = 3] = "IN_HEAD";
InsertionMode2[InsertionMode2["IN_HEAD_NO_SCRIPT"] = 4] = "IN_HEAD_NO_SCRIPT";
InsertionMode2[InsertionMode2["AFTER_HEAD"] = 5] = "AFTER_HEAD";
InsertionMode2[InsertionMode2["IN_BODY"] = 6] = "IN_BODY";
InsertionMode2[InsertionMode2["TEXT"] = 7] = "TEXT";
InsertionMode2[InsertionMode2["IN_TABLE"] = 8] = "IN_TABLE";
InsertionMode2[InsertionMode2["IN_TABLE_TEXT"] = 9] = "IN_TABLE_TEXT";
InsertionMode2[InsertionMode2["IN_CAPTION"] = 10] = "IN_CAPTION";
InsertionMode2[InsertionMode2["IN_COLUMN_GROUP"] = 11] = "IN_COLUMN_GROUP";
InsertionMode2[InsertionMode2["IN_TABLE_BODY"] = 12] = "IN_TABLE_BODY";
InsertionMode2[InsertionMode2["IN_ROW"] = 13] = "IN_ROW";
InsertionMode2[InsertionMode2["IN_CELL"] = 14] = "IN_CELL";
InsertionMode2[InsertionMode2["IN_SELECT"] = 15] = "IN_SELECT";
InsertionMode2[InsertionMode2["IN_SELECT_IN_TABLE"] = 16] = "IN_SELECT_IN_TABLE";
InsertionMode2[InsertionMode2["IN_TEMPLATE"] = 17] = "IN_TEMPLATE";
InsertionMode2[InsertionMode2["AFTER_BODY"] = 18] = "AFTER_BODY";
InsertionMode2[InsertionMode2["IN_FRAMESET"] = 19] = "IN_FRAMESET";
InsertionMode2[InsertionMode2["AFTER_FRAMESET"] = 20] = "AFTER_FRAMESET";
InsertionMode2[InsertionMode2["AFTER_AFTER_BODY"] = 21] = "AFTER_AFTER_BODY";
InsertionMode2[InsertionMode2["AFTER_AFTER_FRAMESET"] = 22] = "AFTER_AFTER_FRAMESET";
})(InsertionMode || (InsertionMode = {}));
var BASE_LOC = {
startLine: -1,
startCol: -1,
startOffset: -1,
endLine: -1,
endCol: -1,
endOffset: -1
};
var TABLE_STRUCTURE_TAGS = /* @__PURE__ */ new Set([TAG_ID.TABLE, TAG_ID.TBODY, TAG_ID.TFOOT, TAG_ID.THEAD, TAG_ID.TR]);
var defaultParserOptions = {
scriptingEnabled: true,
sourceCodeLocationInfo: false,
treeAdapter: defaultTreeAdapter,
onParseError: null
};
var Parser = class {
constructor(options, document2, fragmentContext = null, scriptHandler = null) {
this.fragmentContext = fragmentContext;
this.scriptHandler = scriptHandler;
this.currentToken = null;
this.stopped = false;
this.insertionMode = InsertionMode.INITIAL;
this.originalInsertionMode = InsertionMode.INITIAL;
this.headElement = null;
this.formElement = null;
this.currentNotInHTML = false;
this.tmplInsertionModeStack = [];
this.pendingCharacterTokens = [];
this.hasNonWhitespacePendingCharacterToken = false;
this.framesetOk = true;
this.skipNextNewLine = false;
this.fosterParentingEnabled = false;
this.options = {
...defaultParserOptions,
...options
};
this.treeAdapter = this.options.treeAdapter;
this.onParseError = this.options.onParseError;
if (this.onParseError) {
this.options.sourceCodeLocationInfo = true;
}
this.document = document2 !== null && document2 !== void 0 ? document2 : this.treeAdapter.createDocument();
this.tokenizer = new Tokenizer(this.options, this);
this.activeFormattingElements = new FormattingElementList(this.treeAdapter);
this.fragmentContextID = fragmentContext ? getTagID(this.treeAdapter.getTagName(fragmentContext)) : TAG_ID.UNKNOWN;
this._setContextModes(fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : this.document, this.fragmentContextID);
this.openElements = new OpenElementStack(this.document, this.treeAdapter, this);
}
static parse(html4, options) {
const parser = new this(options);
parser.tokenizer.write(html4, true);
return parser.document;
}
static getFragmentParser(fragmentContext, options) {
const opts = {
...defaultParserOptions,
...options
};
fragmentContext !== null && fragmentContext !== void 0 ? fragmentContext : fragmentContext = opts.treeAdapter.createElement(TAG_NAMES.TEMPLATE, NS.HTML, []);
const documentMock = opts.treeAdapter.createElement("documentmock", NS.HTML, []);
const parser = new this(opts, documentMock, fragmentContext);
if (parser.fragmentContextID === TAG_ID.TEMPLATE) {
parser.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
}
parser._initTokenizerForFragmentParsing();
parser._insertFakeRootElement();
parser._resetInsertionMode();
parser._findFormInFragmentContext();
return parser;
}
getFragment() {
const rootElement = this.treeAdapter.getFirstChild(this.document);
const fragment = this.treeAdapter.createDocumentFragment();
this._adoptNodes(rootElement, fragment);
return fragment;
}
_err(token, code2, beforeToken) {
var _a3;
if (!this.onParseError)
return;
const loc = (_a3 = token.location) !== null && _a3 !== void 0 ? _a3 : BASE_LOC;
const err = {
code: code2,
startLine: loc.startLine,
startCol: loc.startCol,
startOffset: loc.startOffset,
endLine: beforeToken ? loc.startLine : loc.endLine,
endCol: beforeToken ? loc.startCol : loc.endCol,
endOffset: beforeToken ? loc.startOffset : loc.endOffset
};
this.onParseError(err);
}
onItemPush(node, tid, isTop) {
var _a3, _b;
(_b = (_a3 = this.treeAdapter).onItemPush) === null || _b === void 0 ? void 0 : _b.call(_a3, node);
if (isTop && this.openElements.stackTop > 0)
this._setContextModes(node, tid);
}
onItemPop(node, isTop) {
var _a3, _b;
if (this.options.sourceCodeLocationInfo) {
this._setEndLocation(node, this.currentToken);
}
(_b = (_a3 = this.treeAdapter).onItemPop) === null || _b === void 0 ? void 0 : _b.call(_a3, node, this.openElements.current);
if (isTop) {
let current;
let currentTagId;
if (this.openElements.stackTop === 0 && this.fragmentContext) {
current = this.fragmentContext;
currentTagId = this.fragmentContextID;
} else {
({ current, currentTagId } = this.openElements);
}
this._setContextModes(current, currentTagId);
}
}
_setContextModes(current, tid) {
const isHTML = current === this.document || current && this.treeAdapter.getNamespaceURI(current) === NS.HTML;
this.currentNotInHTML = !isHTML;
this.tokenizer.inForeignNode = !isHTML && current !== void 0 && tid !== void 0 && !this._isIntegrationPoint(tid, current);
}
_switchToTextParsing(currentToken, nextTokenizerState) {
this._insertElement(currentToken, NS.HTML);
this.tokenizer.state = nextTokenizerState;
this.originalInsertionMode = this.insertionMode;
this.insertionMode = InsertionMode.TEXT;
}
switchToPlaintextParsing() {
this.insertionMode = InsertionMode.TEXT;
this.originalInsertionMode = InsertionMode.IN_BODY;
this.tokenizer.state = TokenizerMode.PLAINTEXT;
}
_getAdjustedCurrentElement() {
return this.openElements.stackTop === 0 && this.fragmentContext ? this.fragmentContext : this.openElements.current;
}
_findFormInFragmentContext() {
let node = this.fragmentContext;
while (node) {
if (this.treeAdapter.getTagName(node) === TAG_NAMES.FORM) {
this.formElement = node;
break;
}
node = this.treeAdapter.getParentNode(node);
}
}
_initTokenizerForFragmentParsing() {
if (!this.fragmentContext || this.treeAdapter.getNamespaceURI(this.fragmentContext) !== NS.HTML) {
return;
}
switch (this.fragmentContextID) {
case TAG_ID.TITLE:
case TAG_ID.TEXTAREA: {
this.tokenizer.state = TokenizerMode.RCDATA;
break;
}
case TAG_ID.STYLE:
case TAG_ID.XMP:
case TAG_ID.IFRAME:
case TAG_ID.NOEMBED:
case TAG_ID.NOFRAMES:
case TAG_ID.NOSCRIPT: {
this.tokenizer.state = TokenizerMode.RAWTEXT;
break;
}
case TAG_ID.SCRIPT: {
this.tokenizer.state = TokenizerMode.SCRIPT_DATA;
break;
}
case TAG_ID.PLAINTEXT: {
this.tokenizer.state = TokenizerMode.PLAINTEXT;
break;
}
default:
}
}
_setDocumentType(token) {
const name2 = token.name || "";
const publicId = token.publicId || "";
const systemId = token.systemId || "";
this.treeAdapter.setDocumentType(this.document, name2, publicId, systemId);
if (token.location) {
const documentChildren = this.treeAdapter.getChildNodes(this.document);
const docTypeNode = documentChildren.find((node) => this.treeAdapter.isDocumentTypeNode(node));
if (docTypeNode) {
this.treeAdapter.setNodeSourceCodeLocation(docTypeNode, token.location);
}
}
}
_attachElementToTree(element, location) {
if (this.options.sourceCodeLocationInfo) {
const loc = location && {
...location,
startTag: location
};
this.treeAdapter.setNodeSourceCodeLocation(element, loc);
}
if (this._shouldFosterParentOnInsertion()) {
this._fosterParentElement(element);
} else {
const parent2 = this.openElements.currentTmplContentOrNode;
this.treeAdapter.appendChild(parent2 !== null && parent2 !== void 0 ? parent2 : this.document, element);
}
}
_appendElement(token, namespaceURI) {
const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
this._attachElementToTree(element, token.location);
}
_insertElement(token, namespaceURI) {
const element = this.treeAdapter.createElement(token.tagName, namespaceURI, token.attrs);
this._attachElementToTree(element, token.location);
this.openElements.push(element, token.tagID);
}
_insertFakeElement(tagName, tagID) {
const element = this.treeAdapter.createElement(tagName, NS.HTML, []);
this._attachElementToTree(element, null);
this.openElements.push(element, tagID);
}
_insertTemplate(token) {
const tmpl = this.treeAdapter.createElement(token.tagName, NS.HTML, token.attrs);
const content = this.treeAdapter.createDocumentFragment();
this.treeAdapter.setTemplateContent(tmpl, content);
this._attachElementToTree(tmpl, token.location);
this.openElements.push(tmpl, token.tagID);
if (this.options.sourceCodeLocationInfo)
this.treeAdapter.setNodeSourceCodeLocation(content, null);
}
_insertFakeRootElement() {
const element = this.treeAdapter.createElement(TAG_NAMES.HTML, NS.HTML, []);
if (this.options.sourceCodeLocationInfo)
this.treeAdapter.setNodeSourceCodeLocation(element, null);
this.treeAdapter.appendChild(this.openElements.current, element);
this.openElements.push(element, TAG_ID.HTML);
}
_appendCommentNode(token, parent2) {
const commentNode = this.treeAdapter.createCommentNode(token.data);
this.treeAdapter.appendChild(parent2, commentNode);
if (this.options.sourceCodeLocationInfo) {
this.treeAdapter.setNodeSourceCodeLocation(commentNode, token.location);
}
}
_insertCharacters(token) {
let parent2;
let beforeElement;
if (this._shouldFosterParentOnInsertion()) {
({ parent: parent2, beforeElement } = this._findFosterParentingLocation());
if (beforeElement) {
this.treeAdapter.insertTextBefore(parent2, token.chars, beforeElement);
} else {
this.treeAdapter.insertText(parent2, token.chars);
}
} else {
parent2 = this.openElements.currentTmplContentOrNode;
this.treeAdapter.insertText(parent2, token.chars);
}
if (!token.location)
return;
const siblings2 = this.treeAdapter.getChildNodes(parent2);
const textNodeIdx = beforeElement ? siblings2.lastIndexOf(beforeElement) : siblings2.length;
const textNode = siblings2[textNodeIdx - 1];
const tnLoc = this.treeAdapter.getNodeSourceCodeLocation(textNode);
if (tnLoc) {
const { endLine, endCol, endOffset } = token.location;
this.treeAdapter.updateNodeSourceCodeLocation(textNode, { endLine, endCol, endOffset });
} else if (this.options.sourceCodeLocationInfo) {
this.treeAdapter.setNodeSourceCodeLocation(textNode, token.location);
}
}
_adoptNodes(donor, recipient) {
for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
this.treeAdapter.detachNode(child);
this.treeAdapter.appendChild(recipient, child);
}
}
_setEndLocation(element, closingToken) {
if (this.treeAdapter.getNodeSourceCodeLocation(element) && closingToken.location) {
const ctLoc = closingToken.location;
const tn = this.treeAdapter.getTagName(element);
const endLoc = closingToken.type === TokenType.END_TAG && tn === closingToken.tagName ? {
endTag: { ...ctLoc },
endLine: ctLoc.endLine,
endCol: ctLoc.endCol,
endOffset: ctLoc.endOffset
} : {
endLine: ctLoc.startLine,
endCol: ctLoc.startCol,
endOffset: ctLoc.startOffset
};
this.treeAdapter.updateNodeSourceCodeLocation(element, endLoc);
}
}
shouldProcessStartTagTokenInForeignContent(token) {
if (!this.currentNotInHTML)
return false;
let current;
let currentTagId;
if (this.openElements.stackTop === 0 && this.fragmentContext) {
current = this.fragmentContext;
currentTagId = this.fragmentContextID;
} else {
({ current, currentTagId } = this.openElements);
}
if (token.tagID === TAG_ID.SVG && this.treeAdapter.getTagName(current) === TAG_NAMES.ANNOTATION_XML && this.treeAdapter.getNamespaceURI(current) === NS.MATHML) {
return false;
}
return this.tokenizer.inForeignNode || (token.tagID === TAG_ID.MGLYPH || token.tagID === TAG_ID.MALIGNMARK) && currentTagId !== void 0 && !this._isIntegrationPoint(currentTagId, current, NS.HTML);
}
_processToken(token) {
switch (token.type) {
case TokenType.CHARACTER: {
this.onCharacter(token);
break;
}
case TokenType.NULL_CHARACTER: {
this.onNullCharacter(token);
break;
}
case TokenType.COMMENT: {
this.onComment(token);
break;
}
case TokenType.DOCTYPE: {
this.onDoctype(token);
break;
}
case TokenType.START_TAG: {
this._processStartTag(token);
break;
}
case TokenType.END_TAG: {
this.onEndTag(token);
break;
}
case TokenType.EOF: {
this.onEof(token);
break;
}
case TokenType.WHITESPACE_CHARACTER: {
this.onWhitespaceCharacter(token);
break;
}
}
}
_isIntegrationPoint(tid, element, foreignNS) {
const ns = this.treeAdapter.getNamespaceURI(element);
const attrs = this.treeAdapter.getAttrList(element);
return isIntegrationPoint(tid, ns, attrs, foreignNS);
}
_reconstructActiveFormattingElements() {
const listLength = this.activeFormattingElements.entries.length;
if (listLength) {
const endIndex = this.activeFormattingElements.entries.findIndex((entry) => entry.type === EntryType.Marker || this.openElements.contains(entry.element));
const unopenIdx = endIndex === -1 ? listLength - 1 : endIndex - 1;
for (let i = unopenIdx; i >= 0; i--) {
const entry = this.activeFormattingElements.entries[i];
this._insertElement(entry.token, this.treeAdapter.getNamespaceURI(entry.element));
entry.element = this.openElements.current;
}
}
}
_closeTableCell() {
this.openElements.generateImpliedEndTags();
this.openElements.popUntilTableCellPopped();
this.activeFormattingElements.clearToLastMarker();
this.insertionMode = InsertionMode.IN_ROW;
}
_closePElement() {
this.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.P);
this.openElements.popUntilTagNamePopped(TAG_ID.P);
}
_resetInsertionMode() {
for (let i = this.openElements.stackTop; i >= 0; i--) {
switch (i === 0 && this.fragmentContext ? this.fragmentContextID : this.openElements.tagIDs[i]) {
case TAG_ID.TR: {
this.insertionMode = InsertionMode.IN_ROW;
return;
}
case TAG_ID.TBODY:
case TAG_ID.THEAD:
case TAG_ID.TFOOT: {
this.insertionMode = InsertionMode.IN_TABLE_BODY;
return;
}
case TAG_ID.CAPTION: {
this.insertionMode = InsertionMode.IN_CAPTION;
return;
}
case TAG_ID.COLGROUP: {
this.insertionMode = InsertionMode.IN_COLUMN_GROUP;
return;
}
case TAG_ID.TABLE: {
this.insertionMode = InsertionMode.IN_TABLE;
return;
}
case TAG_ID.BODY: {
this.insertionMode = InsertionMode.IN_BODY;
return;
}
case TAG_ID.FRAMESET: {
this.insertionMode = InsertionMode.IN_FRAMESET;
return;
}
case TAG_ID.SELECT: {
this._resetInsertionModeForSelect(i);
return;
}
case TAG_ID.TEMPLATE: {
this.insertionMode = this.tmplInsertionModeStack[0];
return;
}
case TAG_ID.HTML: {
this.insertionMode = this.headElement ? InsertionMode.AFTER_HEAD : InsertionMode.BEFORE_HEAD;
return;
}
case TAG_ID.TD:
case TAG_ID.TH: {
if (i > 0) {
this.insertionMode = InsertionMode.IN_CELL;
return;
}
break;
}
case TAG_ID.HEAD: {
if (i > 0) {
this.insertionMode = InsertionMode.IN_HEAD;
return;
}
break;
}
}
}
this.insertionMode = InsertionMode.IN_BODY;
}
_resetInsertionModeForSelect(selectIdx) {
if (selectIdx > 0) {
for (let i = selectIdx - 1; i > 0; i--) {
const tn = this.openElements.tagIDs[i];
if (tn === TAG_ID.TEMPLATE) {
break;
} else if (tn === TAG_ID.TABLE) {
this.insertionMode = InsertionMode.IN_SELECT_IN_TABLE;
return;
}
}
}
this.insertionMode = InsertionMode.IN_SELECT;
}
_isElementCausesFosterParenting(tn) {
return TABLE_STRUCTURE_TAGS.has(tn);
}
_shouldFosterParentOnInsertion() {
return this.fosterParentingEnabled && this.openElements.currentTagId !== void 0 && this._isElementCausesFosterParenting(this.openElements.currentTagId);
}
_findFosterParentingLocation() {
for (let i = this.openElements.stackTop; i >= 0; i--) {
const openElement = this.openElements.items[i];
switch (this.openElements.tagIDs[i]) {
case TAG_ID.TEMPLATE: {
if (this.treeAdapter.getNamespaceURI(openElement) === NS.HTML) {
return { parent: this.treeAdapter.getTemplateContent(openElement), beforeElement: null };
}
break;
}
case TAG_ID.TABLE: {
const parent2 = this.treeAdapter.getParentNode(openElement);
if (parent2) {
return { parent: parent2, beforeElement: openElement };
}
return { parent: this.openElements.items[i - 1], beforeElement: null };
}
default:
}
}
return { parent: this.openElements.items[0], beforeElement: null };
}
_fosterParentElement(element) {
const location = this._findFosterParentingLocation();
if (location.beforeElement) {
this.treeAdapter.insertBefore(location.parent, element, location.beforeElement);
} else {
this.treeAdapter.appendChild(location.parent, element);
}
}
_isSpecialElement(element, id) {
const ns = this.treeAdapter.getNamespaceURI(element);
return SPECIAL_ELEMENTS[ns].has(id);
}
onCharacter(token) {
this.skipNextNewLine = false;
if (this.tokenizer.inForeignNode) {
characterInForeignContent(this, token);
return;
}
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
tokenInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HTML: {
tokenBeforeHtml(this, token);
break;
}
case InsertionMode.BEFORE_HEAD: {
tokenBeforeHead(this, token);
break;
}
case InsertionMode.IN_HEAD: {
tokenInHead(this, token);
break;
}
case InsertionMode.IN_HEAD_NO_SCRIPT: {
tokenInHeadNoScript(this, token);
break;
}
case InsertionMode.AFTER_HEAD: {
tokenAfterHead(this, token);
break;
}
case InsertionMode.IN_BODY:
case InsertionMode.IN_CAPTION:
case InsertionMode.IN_CELL:
case InsertionMode.IN_TEMPLATE: {
characterInBody(this, token);
break;
}
case InsertionMode.TEXT:
case InsertionMode.IN_SELECT:
case InsertionMode.IN_SELECT_IN_TABLE: {
this._insertCharacters(token);
break;
}
case InsertionMode.IN_TABLE:
case InsertionMode.IN_TABLE_BODY:
case InsertionMode.IN_ROW: {
characterInTable(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
characterInTableText(this, token);
break;
}
case InsertionMode.IN_COLUMN_GROUP: {
tokenInColumnGroup(this, token);
break;
}
case InsertionMode.AFTER_BODY: {
tokenAfterBody(this, token);
break;
}
case InsertionMode.AFTER_AFTER_BODY: {
tokenAfterAfterBody(this, token);
break;
}
default:
}
}
onNullCharacter(token) {
this.skipNextNewLine = false;
if (this.tokenizer.inForeignNode) {
nullCharacterInForeignContent(this, token);
return;
}
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
tokenInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HTML: {
tokenBeforeHtml(this, token);
break;
}
case InsertionMode.BEFORE_HEAD: {
tokenBeforeHead(this, token);
break;
}
case InsertionMode.IN_HEAD: {
tokenInHead(this, token);
break;
}
case InsertionMode.IN_HEAD_NO_SCRIPT: {
tokenInHeadNoScript(this, token);
break;
}
case InsertionMode.AFTER_HEAD: {
tokenAfterHead(this, token);
break;
}
case InsertionMode.TEXT: {
this._insertCharacters(token);
break;
}
case InsertionMode.IN_TABLE:
case InsertionMode.IN_TABLE_BODY:
case InsertionMode.IN_ROW: {
characterInTable(this, token);
break;
}
case InsertionMode.IN_COLUMN_GROUP: {
tokenInColumnGroup(this, token);
break;
}
case InsertionMode.AFTER_BODY: {
tokenAfterBody(this, token);
break;
}
case InsertionMode.AFTER_AFTER_BODY: {
tokenAfterAfterBody(this, token);
break;
}
default:
}
}
onComment(token) {
this.skipNextNewLine = false;
if (this.currentNotInHTML) {
appendComment(this, token);
return;
}
switch (this.insertionMode) {
case InsertionMode.INITIAL:
case InsertionMode.BEFORE_HTML:
case InsertionMode.BEFORE_HEAD:
case InsertionMode.IN_HEAD:
case InsertionMode.IN_HEAD_NO_SCRIPT:
case InsertionMode.AFTER_HEAD:
case InsertionMode.IN_BODY:
case InsertionMode.IN_TABLE:
case InsertionMode.IN_CAPTION:
case InsertionMode.IN_COLUMN_GROUP:
case InsertionMode.IN_TABLE_BODY:
case InsertionMode.IN_ROW:
case InsertionMode.IN_CELL:
case InsertionMode.IN_SELECT:
case InsertionMode.IN_SELECT_IN_TABLE:
case InsertionMode.IN_TEMPLATE:
case InsertionMode.IN_FRAMESET:
case InsertionMode.AFTER_FRAMESET: {
appendComment(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
tokenInTableText(this, token);
break;
}
case InsertionMode.AFTER_BODY: {
appendCommentToRootHtmlElement(this, token);
break;
}
case InsertionMode.AFTER_AFTER_BODY:
case InsertionMode.AFTER_AFTER_FRAMESET: {
appendCommentToDocument(this, token);
break;
}
default:
}
}
onDoctype(token) {
this.skipNextNewLine = false;
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
doctypeInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HEAD:
case InsertionMode.IN_HEAD:
case InsertionMode.IN_HEAD_NO_SCRIPT:
case InsertionMode.AFTER_HEAD: {
this._err(token, ERR.misplacedDoctype);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
tokenInTableText(this, token);
break;
}
default:
}
}
onStartTag(token) {
this.skipNextNewLine = false;
this.currentToken = token;
this._processStartTag(token);
if (token.selfClosing && !token.ackSelfClosing) {
this._err(token, ERR.nonVoidHtmlElementStartTagWithTrailingSolidus);
}
}
_processStartTag(token) {
if (this.shouldProcessStartTagTokenInForeignContent(token)) {
startTagInForeignContent(this, token);
} else {
this._startTagOutsideForeignContent(token);
}
}
_startTagOutsideForeignContent(token) {
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
tokenInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HTML: {
startTagBeforeHtml(this, token);
break;
}
case InsertionMode.BEFORE_HEAD: {
startTagBeforeHead(this, token);
break;
}
case InsertionMode.IN_HEAD: {
startTagInHead(this, token);
break;
}
case InsertionMode.IN_HEAD_NO_SCRIPT: {
startTagInHeadNoScript(this, token);
break;
}
case InsertionMode.AFTER_HEAD: {
startTagAfterHead(this, token);
break;
}
case InsertionMode.IN_BODY: {
startTagInBody(this, token);
break;
}
case InsertionMode.IN_TABLE: {
startTagInTable(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
tokenInTableText(this, token);
break;
}
case InsertionMode.IN_CAPTION: {
startTagInCaption(this, token);
break;
}
case InsertionMode.IN_COLUMN_GROUP: {
startTagInColumnGroup(this, token);
break;
}
case InsertionMode.IN_TABLE_BODY: {
startTagInTableBody(this, token);
break;
}
case InsertionMode.IN_ROW: {
startTagInRow(this, token);
break;
}
case InsertionMode.IN_CELL: {
startTagInCell(this, token);
break;
}
case InsertionMode.IN_SELECT: {
startTagInSelect(this, token);
break;
}
case InsertionMode.IN_SELECT_IN_TABLE: {
startTagInSelectInTable(this, token);
break;
}
case InsertionMode.IN_TEMPLATE: {
startTagInTemplate(this, token);
break;
}
case InsertionMode.AFTER_BODY: {
startTagAfterBody(this, token);
break;
}
case InsertionMode.IN_FRAMESET: {
startTagInFrameset(this, token);
break;
}
case InsertionMode.AFTER_FRAMESET: {
startTagAfterFrameset(this, token);
break;
}
case InsertionMode.AFTER_AFTER_BODY: {
startTagAfterAfterBody(this, token);
break;
}
case InsertionMode.AFTER_AFTER_FRAMESET: {
startTagAfterAfterFrameset(this, token);
break;
}
default:
}
}
onEndTag(token) {
this.skipNextNewLine = false;
this.currentToken = token;
if (this.currentNotInHTML) {
endTagInForeignContent(this, token);
} else {
this._endTagOutsideForeignContent(token);
}
}
_endTagOutsideForeignContent(token) {
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
tokenInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HTML: {
endTagBeforeHtml(this, token);
break;
}
case InsertionMode.BEFORE_HEAD: {
endTagBeforeHead(this, token);
break;
}
case InsertionMode.IN_HEAD: {
endTagInHead(this, token);
break;
}
case InsertionMode.IN_HEAD_NO_SCRIPT: {
endTagInHeadNoScript(this, token);
break;
}
case InsertionMode.AFTER_HEAD: {
endTagAfterHead(this, token);
break;
}
case InsertionMode.IN_BODY: {
endTagInBody(this, token);
break;
}
case InsertionMode.TEXT: {
endTagInText(this, token);
break;
}
case InsertionMode.IN_TABLE: {
endTagInTable(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
tokenInTableText(this, token);
break;
}
case InsertionMode.IN_CAPTION: {
endTagInCaption(this, token);
break;
}
case InsertionMode.IN_COLUMN_GROUP: {
endTagInColumnGroup(this, token);
break;
}
case InsertionMode.IN_TABLE_BODY: {
endTagInTableBody(this, token);
break;
}
case InsertionMode.IN_ROW: {
endTagInRow(this, token);
break;
}
case InsertionMode.IN_CELL: {
endTagInCell(this, token);
break;
}
case InsertionMode.IN_SELECT: {
endTagInSelect(this, token);
break;
}
case InsertionMode.IN_SELECT_IN_TABLE: {
endTagInSelectInTable(this, token);
break;
}
case InsertionMode.IN_TEMPLATE: {
endTagInTemplate(this, token);
break;
}
case InsertionMode.AFTER_BODY: {
endTagAfterBody(this, token);
break;
}
case InsertionMode.IN_FRAMESET: {
endTagInFrameset(this, token);
break;
}
case InsertionMode.AFTER_FRAMESET: {
endTagAfterFrameset(this, token);
break;
}
case InsertionMode.AFTER_AFTER_BODY: {
tokenAfterAfterBody(this, token);
break;
}
default:
}
}
onEof(token) {
switch (this.insertionMode) {
case InsertionMode.INITIAL: {
tokenInInitialMode(this, token);
break;
}
case InsertionMode.BEFORE_HTML: {
tokenBeforeHtml(this, token);
break;
}
case InsertionMode.BEFORE_HEAD: {
tokenBeforeHead(this, token);
break;
}
case InsertionMode.IN_HEAD: {
tokenInHead(this, token);
break;
}
case InsertionMode.IN_HEAD_NO_SCRIPT: {
tokenInHeadNoScript(this, token);
break;
}
case InsertionMode.AFTER_HEAD: {
tokenAfterHead(this, token);
break;
}
case InsertionMode.IN_BODY:
case InsertionMode.IN_TABLE:
case InsertionMode.IN_CAPTION:
case InsertionMode.IN_COLUMN_GROUP:
case InsertionMode.IN_TABLE_BODY:
case InsertionMode.IN_ROW:
case InsertionMode.IN_CELL:
case InsertionMode.IN_SELECT:
case InsertionMode.IN_SELECT_IN_TABLE: {
eofInBody(this, token);
break;
}
case InsertionMode.TEXT: {
eofInText(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
tokenInTableText(this, token);
break;
}
case InsertionMode.IN_TEMPLATE: {
eofInTemplate(this, token);
break;
}
case InsertionMode.AFTER_BODY:
case InsertionMode.IN_FRAMESET:
case InsertionMode.AFTER_FRAMESET:
case InsertionMode.AFTER_AFTER_BODY:
case InsertionMode.AFTER_AFTER_FRAMESET: {
stopParsing(this, token);
break;
}
default:
}
}
onWhitespaceCharacter(token) {
if (this.skipNextNewLine) {
this.skipNextNewLine = false;
if (token.chars.charCodeAt(0) === CODE_POINTS.LINE_FEED) {
if (token.chars.length === 1) {
return;
}
token.chars = token.chars.substr(1);
}
}
if (this.tokenizer.inForeignNode) {
this._insertCharacters(token);
return;
}
switch (this.insertionMode) {
case InsertionMode.IN_HEAD:
case InsertionMode.IN_HEAD_NO_SCRIPT:
case InsertionMode.AFTER_HEAD:
case InsertionMode.TEXT:
case InsertionMode.IN_COLUMN_GROUP:
case InsertionMode.IN_SELECT:
case InsertionMode.IN_SELECT_IN_TABLE:
case InsertionMode.IN_FRAMESET:
case InsertionMode.AFTER_FRAMESET: {
this._insertCharacters(token);
break;
}
case InsertionMode.IN_BODY:
case InsertionMode.IN_CAPTION:
case InsertionMode.IN_CELL:
case InsertionMode.IN_TEMPLATE:
case InsertionMode.AFTER_BODY:
case InsertionMode.AFTER_AFTER_BODY:
case InsertionMode.AFTER_AFTER_FRAMESET: {
whitespaceCharacterInBody(this, token);
break;
}
case InsertionMode.IN_TABLE:
case InsertionMode.IN_TABLE_BODY:
case InsertionMode.IN_ROW: {
characterInTable(this, token);
break;
}
case InsertionMode.IN_TABLE_TEXT: {
whitespaceCharacterInTableText(this, token);
break;
}
default:
}
}
};
function aaObtainFormattingElementEntry(p, token) {
let formattingElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(token.tagName);
if (formattingElementEntry) {
if (!p.openElements.contains(formattingElementEntry.element)) {
p.activeFormattingElements.removeEntry(formattingElementEntry);
formattingElementEntry = null;
} else if (!p.openElements.hasInScope(token.tagID)) {
formattingElementEntry = null;
}
} else {
genericEndTagInBody(p, token);
}
return formattingElementEntry;
}
function aaObtainFurthestBlock(p, formattingElementEntry) {
let furthestBlock = null;
let idx = p.openElements.stackTop;
for (; idx >= 0; idx--) {
const element = p.openElements.items[idx];
if (element === formattingElementEntry.element) {
break;
}
if (p._isSpecialElement(element, p.openElements.tagIDs[idx])) {
furthestBlock = element;
}
}
if (!furthestBlock) {
p.openElements.shortenToLength(Math.max(idx, 0));
p.activeFormattingElements.removeEntry(formattingElementEntry);
}
return furthestBlock;
}
function aaInnerLoop(p, furthestBlock, formattingElement) {
let lastElement = furthestBlock;
let nextElement = p.openElements.getCommonAncestor(furthestBlock);
for (let i = 0, element = nextElement; element !== formattingElement; i++, element = nextElement) {
nextElement = p.openElements.getCommonAncestor(element);
const elementEntry = p.activeFormattingElements.getElementEntry(element);
const counterOverflow = elementEntry && i >= AA_INNER_LOOP_ITER;
const shouldRemoveFromOpenElements = !elementEntry || counterOverflow;
if (shouldRemoveFromOpenElements) {
if (counterOverflow) {
p.activeFormattingElements.removeEntry(elementEntry);
}
p.openElements.remove(element);
} else {
element = aaRecreateElementFromEntry(p, elementEntry);
if (lastElement === furthestBlock) {
p.activeFormattingElements.bookmark = elementEntry;
}
p.treeAdapter.detachNode(lastElement);
p.treeAdapter.appendChild(element, lastElement);
lastElement = element;
}
}
return lastElement;
}
function aaRecreateElementFromEntry(p, elementEntry) {
const ns = p.treeAdapter.getNamespaceURI(elementEntry.element);
const newElement = p.treeAdapter.createElement(elementEntry.token.tagName, ns, elementEntry.token.attrs);
p.openElements.replace(elementEntry.element, newElement);
elementEntry.element = newElement;
return newElement;
}
function aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement) {
const tn = p.treeAdapter.getTagName(commonAncestor);
const tid = getTagID(tn);
if (p._isElementCausesFosterParenting(tid)) {
p._fosterParentElement(lastElement);
} else {
const ns = p.treeAdapter.getNamespaceURI(commonAncestor);
if (tid === TAG_ID.TEMPLATE && ns === NS.HTML) {
commonAncestor = p.treeAdapter.getTemplateContent(commonAncestor);
}
p.treeAdapter.appendChild(commonAncestor, lastElement);
}
}
function aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry) {
const ns = p.treeAdapter.getNamespaceURI(formattingElementEntry.element);
const { token } = formattingElementEntry;
const newElement = p.treeAdapter.createElement(token.tagName, ns, token.attrs);
p._adoptNodes(furthestBlock, newElement);
p.treeAdapter.appendChild(furthestBlock, newElement);
p.activeFormattingElements.insertElementAfterBookmark(newElement, token);
p.activeFormattingElements.removeEntry(formattingElementEntry);
p.openElements.remove(formattingElementEntry.element);
p.openElements.insertAfter(furthestBlock, newElement, token.tagID);
}
function callAdoptionAgency(p, token) {
for (let i = 0; i < AA_OUTER_LOOP_ITER; i++) {
const formattingElementEntry = aaObtainFormattingElementEntry(p, token);
if (!formattingElementEntry) {
break;
}
const furthestBlock = aaObtainFurthestBlock(p, formattingElementEntry);
if (!furthestBlock) {
break;
}
p.activeFormattingElements.bookmark = formattingElementEntry;
const lastElement = aaInnerLoop(p, furthestBlock, formattingElementEntry.element);
const commonAncestor = p.openElements.getCommonAncestor(formattingElementEntry.element);
p.treeAdapter.detachNode(lastElement);
if (commonAncestor)
aaInsertLastNodeInCommonAncestor(p, commonAncestor, lastElement);
aaReplaceFormattingElement(p, furthestBlock, formattingElementEntry);
}
}
function appendComment(p, token) {
p._appendCommentNode(token, p.openElements.currentTmplContentOrNode);
}
function appendCommentToRootHtmlElement(p, token) {
p._appendCommentNode(token, p.openElements.items[0]);
}
function appendCommentToDocument(p, token) {
p._appendCommentNode(token, p.document);
}
function stopParsing(p, token) {
p.stopped = true;
if (token.location) {
const target = p.fragmentContext ? 0 : 2;
for (let i = p.openElements.stackTop; i >= target; i--) {
p._setEndLocation(p.openElements.items[i], token);
}
if (!p.fragmentContext && p.openElements.stackTop >= 0) {
const htmlElement = p.openElements.items[0];
const htmlLocation = p.treeAdapter.getNodeSourceCodeLocation(htmlElement);
if (htmlLocation && !htmlLocation.endTag) {
p._setEndLocation(htmlElement, token);
if (p.openElements.stackTop >= 1) {
const bodyElement = p.openElements.items[1];
const bodyLocation = p.treeAdapter.getNodeSourceCodeLocation(bodyElement);
if (bodyLocation && !bodyLocation.endTag) {
p._setEndLocation(bodyElement, token);
}
}
}
}
}
}
function doctypeInInitialMode(p, token) {
p._setDocumentType(token);
const mode = token.forceQuirks ? DOCUMENT_MODE.QUIRKS : getDocumentMode(token);
if (!isConforming(token)) {
p._err(token, ERR.nonConformingDoctype);
}
p.treeAdapter.setDocumentMode(p.document, mode);
p.insertionMode = InsertionMode.BEFORE_HTML;
}
function tokenInInitialMode(p, token) {
p._err(token, ERR.missingDoctype, true);
p.treeAdapter.setDocumentMode(p.document, DOCUMENT_MODE.QUIRKS);
p.insertionMode = InsertionMode.BEFORE_HTML;
p._processToken(token);
}
function startTagBeforeHtml(p, token) {
if (token.tagID === TAG_ID.HTML) {
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.BEFORE_HEAD;
} else {
tokenBeforeHtml(p, token);
}
}
function endTagBeforeHtml(p, token) {
const tn = token.tagID;
if (tn === TAG_ID.HTML || tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.BR) {
tokenBeforeHtml(p, token);
}
}
function tokenBeforeHtml(p, token) {
p._insertFakeRootElement();
p.insertionMode = InsertionMode.BEFORE_HEAD;
p._processToken(token);
}
function startTagBeforeHead(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.HEAD: {
p._insertElement(token, NS.HTML);
p.headElement = p.openElements.current;
p.insertionMode = InsertionMode.IN_HEAD;
break;
}
default: {
tokenBeforeHead(p, token);
}
}
}
function endTagBeforeHead(p, token) {
const tn = token.tagID;
if (tn === TAG_ID.HEAD || tn === TAG_ID.BODY || tn === TAG_ID.HTML || tn === TAG_ID.BR) {
tokenBeforeHead(p, token);
} else {
p._err(token, ERR.endTagWithoutMatchingOpenElement);
}
}
function tokenBeforeHead(p, token) {
p._insertFakeElement(TAG_NAMES.HEAD, TAG_ID.HEAD);
p.headElement = p.openElements.current;
p.insertionMode = InsertionMode.IN_HEAD;
p._processToken(token);
}
function startTagInHead(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.BASE:
case TAG_ID.BASEFONT:
case TAG_ID.BGSOUND:
case TAG_ID.LINK:
case TAG_ID.META: {
p._appendElement(token, NS.HTML);
token.ackSelfClosing = true;
break;
}
case TAG_ID.TITLE: {
p._switchToTextParsing(token, TokenizerMode.RCDATA);
break;
}
case TAG_ID.NOSCRIPT: {
if (p.options.scriptingEnabled) {
p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
} else {
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_HEAD_NO_SCRIPT;
}
break;
}
case TAG_ID.NOFRAMES:
case TAG_ID.STYLE: {
p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
break;
}
case TAG_ID.SCRIPT: {
p._switchToTextParsing(token, TokenizerMode.SCRIPT_DATA);
break;
}
case TAG_ID.TEMPLATE: {
p._insertTemplate(token);
p.activeFormattingElements.insertMarker();
p.framesetOk = false;
p.insertionMode = InsertionMode.IN_TEMPLATE;
p.tmplInsertionModeStack.unshift(InsertionMode.IN_TEMPLATE);
break;
}
case TAG_ID.HEAD: {
p._err(token, ERR.misplacedStartTagForHeadElement);
break;
}
default: {
tokenInHead(p, token);
}
}
}
function endTagInHead(p, token) {
switch (token.tagID) {
case TAG_ID.HEAD: {
p.openElements.pop();
p.insertionMode = InsertionMode.AFTER_HEAD;
break;
}
case TAG_ID.BODY:
case TAG_ID.BR:
case TAG_ID.HTML: {
tokenInHead(p, token);
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
default: {
p._err(token, ERR.endTagWithoutMatchingOpenElement);
}
}
}
function templateEndTagInHead(p, token) {
if (p.openElements.tmplCount > 0) {
p.openElements.generateImpliedEndTagsThoroughly();
if (p.openElements.currentTagId !== TAG_ID.TEMPLATE) {
p._err(token, ERR.closingOfElementWithOpenChildElements);
}
p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
p.activeFormattingElements.clearToLastMarker();
p.tmplInsertionModeStack.shift();
p._resetInsertionMode();
} else {
p._err(token, ERR.endTagWithoutMatchingOpenElement);
}
}
function tokenInHead(p, token) {
p.openElements.pop();
p.insertionMode = InsertionMode.AFTER_HEAD;
p._processToken(token);
}
function startTagInHeadNoScript(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.BASEFONT:
case TAG_ID.BGSOUND:
case TAG_ID.HEAD:
case TAG_ID.LINK:
case TAG_ID.META:
case TAG_ID.NOFRAMES:
case TAG_ID.STYLE: {
startTagInHead(p, token);
break;
}
case TAG_ID.NOSCRIPT: {
p._err(token, ERR.nestedNoscriptInHead);
break;
}
default: {
tokenInHeadNoScript(p, token);
}
}
}
function endTagInHeadNoScript(p, token) {
switch (token.tagID) {
case TAG_ID.NOSCRIPT: {
p.openElements.pop();
p.insertionMode = InsertionMode.IN_HEAD;
break;
}
case TAG_ID.BR: {
tokenInHeadNoScript(p, token);
break;
}
default: {
p._err(token, ERR.endTagWithoutMatchingOpenElement);
}
}
}
function tokenInHeadNoScript(p, token) {
const errCode = token.type === TokenType.EOF ? ERR.openElementsLeftAfterEof : ERR.disallowedContentInNoscriptInHead;
p._err(token, errCode);
p.openElements.pop();
p.insertionMode = InsertionMode.IN_HEAD;
p._processToken(token);
}
function startTagAfterHead(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.BODY: {
p._insertElement(token, NS.HTML);
p.framesetOk = false;
p.insertionMode = InsertionMode.IN_BODY;
break;
}
case TAG_ID.FRAMESET: {
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_FRAMESET;
break;
}
case TAG_ID.BASE:
case TAG_ID.BASEFONT:
case TAG_ID.BGSOUND:
case TAG_ID.LINK:
case TAG_ID.META:
case TAG_ID.NOFRAMES:
case TAG_ID.SCRIPT:
case TAG_ID.STYLE:
case TAG_ID.TEMPLATE:
case TAG_ID.TITLE: {
p._err(token, ERR.abandonedHeadElementChild);
p.openElements.push(p.headElement, TAG_ID.HEAD);
startTagInHead(p, token);
p.openElements.remove(p.headElement);
break;
}
case TAG_ID.HEAD: {
p._err(token, ERR.misplacedStartTagForHeadElement);
break;
}
default: {
tokenAfterHead(p, token);
}
}
}
function endTagAfterHead(p, token) {
switch (token.tagID) {
case TAG_ID.BODY:
case TAG_ID.HTML:
case TAG_ID.BR: {
tokenAfterHead(p, token);
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
default: {
p._err(token, ERR.endTagWithoutMatchingOpenElement);
}
}
}
function tokenAfterHead(p, token) {
p._insertFakeElement(TAG_NAMES.BODY, TAG_ID.BODY);
p.insertionMode = InsertionMode.IN_BODY;
modeInBody(p, token);
}
function modeInBody(p, token) {
switch (token.type) {
case TokenType.CHARACTER: {
characterInBody(p, token);
break;
}
case TokenType.WHITESPACE_CHARACTER: {
whitespaceCharacterInBody(p, token);
break;
}
case TokenType.COMMENT: {
appendComment(p, token);
break;
}
case TokenType.START_TAG: {
startTagInBody(p, token);
break;
}
case TokenType.END_TAG: {
endTagInBody(p, token);
break;
}
case TokenType.EOF: {
eofInBody(p, token);
break;
}
default:
}
}
function whitespaceCharacterInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertCharacters(token);
}
function characterInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertCharacters(token);
p.framesetOk = false;
}
function htmlStartTagInBody(p, token) {
if (p.openElements.tmplCount === 0) {
p.treeAdapter.adoptAttributes(p.openElements.items[0], token.attrs);
}
}
function bodyStartTagInBody(p, token) {
const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
if (bodyElement && p.openElements.tmplCount === 0) {
p.framesetOk = false;
p.treeAdapter.adoptAttributes(bodyElement, token.attrs);
}
}
function framesetStartTagInBody(p, token) {
const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
if (p.framesetOk && bodyElement) {
p.treeAdapter.detachNode(bodyElement);
p.openElements.popAllUpToHtmlElement();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_FRAMESET;
}
}
function addressStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
}
function numberedHeaderStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
if (p.openElements.currentTagId !== void 0 && NUMBERED_HEADERS.has(p.openElements.currentTagId)) {
p.openElements.pop();
}
p._insertElement(token, NS.HTML);
}
function preStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
p.skipNextNewLine = true;
p.framesetOk = false;
}
function formStartTagInBody(p, token) {
const inTemplate = p.openElements.tmplCount > 0;
if (!p.formElement || inTemplate) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
if (!inTemplate) {
p.formElement = p.openElements.current;
}
}
}
function listItemStartTagInBody(p, token) {
p.framesetOk = false;
const tn = token.tagID;
for (let i = p.openElements.stackTop; i >= 0; i--) {
const elementId = p.openElements.tagIDs[i];
if (tn === TAG_ID.LI && elementId === TAG_ID.LI || (tn === TAG_ID.DD || tn === TAG_ID.DT) && (elementId === TAG_ID.DD || elementId === TAG_ID.DT)) {
p.openElements.generateImpliedEndTagsWithExclusion(elementId);
p.openElements.popUntilTagNamePopped(elementId);
break;
}
if (elementId !== TAG_ID.ADDRESS && elementId !== TAG_ID.DIV && elementId !== TAG_ID.P && p._isSpecialElement(p.openElements.items[i], elementId)) {
break;
}
}
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
}
function plaintextStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
p.tokenizer.state = TokenizerMode.PLAINTEXT;
}
function buttonStartTagInBody(p, token) {
if (p.openElements.hasInScope(TAG_ID.BUTTON)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(TAG_ID.BUTTON);
}
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
p.framesetOk = false;
}
function aStartTagInBody(p, token) {
const activeElementEntry = p.activeFormattingElements.getElementEntryInScopeWithTagName(TAG_NAMES.A);
if (activeElementEntry) {
callAdoptionAgency(p, token);
p.openElements.remove(activeElementEntry.element);
p.activeFormattingElements.removeEntry(activeElementEntry);
}
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
p.activeFormattingElements.pushElement(p.openElements.current, token);
}
function bStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
p.activeFormattingElements.pushElement(p.openElements.current, token);
}
function nobrStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
if (p.openElements.hasInScope(TAG_ID.NOBR)) {
callAdoptionAgency(p, token);
p._reconstructActiveFormattingElements();
}
p._insertElement(token, NS.HTML);
p.activeFormattingElements.pushElement(p.openElements.current, token);
}
function appletStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
p.activeFormattingElements.insertMarker();
p.framesetOk = false;
}
function tableStartTagInBody(p, token) {
if (p.treeAdapter.getDocumentMode(p.document) !== DOCUMENT_MODE.QUIRKS && p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._insertElement(token, NS.HTML);
p.framesetOk = false;
p.insertionMode = InsertionMode.IN_TABLE;
}
function areaStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._appendElement(token, NS.HTML);
p.framesetOk = false;
token.ackSelfClosing = true;
}
function isHiddenInput(token) {
const inputType = getTokenAttr(token, ATTRS.TYPE);
return inputType != null && inputType.toLowerCase() === HIDDEN_INPUT_TYPE;
}
function inputStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._appendElement(token, NS.HTML);
if (!isHiddenInput(token)) {
p.framesetOk = false;
}
token.ackSelfClosing = true;
}
function paramStartTagInBody(p, token) {
p._appendElement(token, NS.HTML);
token.ackSelfClosing = true;
}
function hrStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._appendElement(token, NS.HTML);
p.framesetOk = false;
token.ackSelfClosing = true;
}
function imageStartTagInBody(p, token) {
token.tagName = TAG_NAMES.IMG;
token.tagID = TAG_ID.IMG;
areaStartTagInBody(p, token);
}
function textareaStartTagInBody(p, token) {
p._insertElement(token, NS.HTML);
p.skipNextNewLine = true;
p.tokenizer.state = TokenizerMode.RCDATA;
p.originalInsertionMode = p.insertionMode;
p.framesetOk = false;
p.insertionMode = InsertionMode.TEXT;
}
function xmpStartTagInBody(p, token) {
if (p.openElements.hasInButtonScope(TAG_ID.P)) {
p._closePElement();
}
p._reconstructActiveFormattingElements();
p.framesetOk = false;
p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
}
function iframeStartTagInBody(p, token) {
p.framesetOk = false;
p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
}
function rawTextStartTagInBody(p, token) {
p._switchToTextParsing(token, TokenizerMode.RAWTEXT);
}
function selectStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
p.framesetOk = false;
p.insertionMode = p.insertionMode === InsertionMode.IN_TABLE || p.insertionMode === InsertionMode.IN_CAPTION || p.insertionMode === InsertionMode.IN_TABLE_BODY || p.insertionMode === InsertionMode.IN_ROW || p.insertionMode === InsertionMode.IN_CELL ? InsertionMode.IN_SELECT_IN_TABLE : InsertionMode.IN_SELECT;
}
function optgroupStartTagInBody(p, token) {
if (p.openElements.currentTagId === TAG_ID.OPTION) {
p.openElements.pop();
}
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
}
function rbStartTagInBody(p, token) {
if (p.openElements.hasInScope(TAG_ID.RUBY)) {
p.openElements.generateImpliedEndTags();
}
p._insertElement(token, NS.HTML);
}
function rtStartTagInBody(p, token) {
if (p.openElements.hasInScope(TAG_ID.RUBY)) {
p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.RTC);
}
p._insertElement(token, NS.HTML);
}
function mathStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
adjustTokenMathMLAttrs(token);
adjustTokenXMLAttrs(token);
if (token.selfClosing) {
p._appendElement(token, NS.MATHML);
} else {
p._insertElement(token, NS.MATHML);
}
token.ackSelfClosing = true;
}
function svgStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
adjustTokenSVGAttrs(token);
adjustTokenXMLAttrs(token);
if (token.selfClosing) {
p._appendElement(token, NS.SVG);
} else {
p._insertElement(token, NS.SVG);
}
token.ackSelfClosing = true;
}
function genericStartTagInBody(p, token) {
p._reconstructActiveFormattingElements();
p._insertElement(token, NS.HTML);
}
function startTagInBody(p, token) {
switch (token.tagID) {
case TAG_ID.I:
case TAG_ID.S:
case TAG_ID.B:
case TAG_ID.U:
case TAG_ID.EM:
case TAG_ID.TT:
case TAG_ID.BIG:
case TAG_ID.CODE:
case TAG_ID.FONT:
case TAG_ID.SMALL:
case TAG_ID.STRIKE:
case TAG_ID.STRONG: {
bStartTagInBody(p, token);
break;
}
case TAG_ID.A: {
aStartTagInBody(p, token);
break;
}
case TAG_ID.H1:
case TAG_ID.H2:
case TAG_ID.H3:
case TAG_ID.H4:
case TAG_ID.H5:
case TAG_ID.H6: {
numberedHeaderStartTagInBody(p, token);
break;
}
case TAG_ID.P:
case TAG_ID.DL:
case TAG_ID.OL:
case TAG_ID.UL:
case TAG_ID.DIV:
case TAG_ID.DIR:
case TAG_ID.NAV:
case TAG_ID.MAIN:
case TAG_ID.MENU:
case TAG_ID.ASIDE:
case TAG_ID.CENTER:
case TAG_ID.FIGURE:
case TAG_ID.FOOTER:
case TAG_ID.HEADER:
case TAG_ID.HGROUP:
case TAG_ID.DIALOG:
case TAG_ID.DETAILS:
case TAG_ID.ADDRESS:
case TAG_ID.ARTICLE:
case TAG_ID.SEARCH:
case TAG_ID.SECTION:
case TAG_ID.SUMMARY:
case TAG_ID.FIELDSET:
case TAG_ID.BLOCKQUOTE:
case TAG_ID.FIGCAPTION: {
addressStartTagInBody(p, token);
break;
}
case TAG_ID.LI:
case TAG_ID.DD:
case TAG_ID.DT: {
listItemStartTagInBody(p, token);
break;
}
case TAG_ID.BR:
case TAG_ID.IMG:
case TAG_ID.WBR:
case TAG_ID.AREA:
case TAG_ID.EMBED:
case TAG_ID.KEYGEN: {
areaStartTagInBody(p, token);
break;
}
case TAG_ID.HR: {
hrStartTagInBody(p, token);
break;
}
case TAG_ID.RB:
case TAG_ID.RTC: {
rbStartTagInBody(p, token);
break;
}
case TAG_ID.RT:
case TAG_ID.RP: {
rtStartTagInBody(p, token);
break;
}
case TAG_ID.PRE:
case TAG_ID.LISTING: {
preStartTagInBody(p, token);
break;
}
case TAG_ID.XMP: {
xmpStartTagInBody(p, token);
break;
}
case TAG_ID.SVG: {
svgStartTagInBody(p, token);
break;
}
case TAG_ID.HTML: {
htmlStartTagInBody(p, token);
break;
}
case TAG_ID.BASE:
case TAG_ID.LINK:
case TAG_ID.META:
case TAG_ID.STYLE:
case TAG_ID.TITLE:
case TAG_ID.SCRIPT:
case TAG_ID.BGSOUND:
case TAG_ID.BASEFONT:
case TAG_ID.TEMPLATE: {
startTagInHead(p, token);
break;
}
case TAG_ID.BODY: {
bodyStartTagInBody(p, token);
break;
}
case TAG_ID.FORM: {
formStartTagInBody(p, token);
break;
}
case TAG_ID.NOBR: {
nobrStartTagInBody(p, token);
break;
}
case TAG_ID.MATH: {
mathStartTagInBody(p, token);
break;
}
case TAG_ID.TABLE: {
tableStartTagInBody(p, token);
break;
}
case TAG_ID.INPUT: {
inputStartTagInBody(p, token);
break;
}
case TAG_ID.PARAM:
case TAG_ID.TRACK:
case TAG_ID.SOURCE: {
paramStartTagInBody(p, token);
break;
}
case TAG_ID.IMAGE: {
imageStartTagInBody(p, token);
break;
}
case TAG_ID.BUTTON: {
buttonStartTagInBody(p, token);
break;
}
case TAG_ID.APPLET:
case TAG_ID.OBJECT:
case TAG_ID.MARQUEE: {
appletStartTagInBody(p, token);
break;
}
case TAG_ID.IFRAME: {
iframeStartTagInBody(p, token);
break;
}
case TAG_ID.SELECT: {
selectStartTagInBody(p, token);
break;
}
case TAG_ID.OPTION:
case TAG_ID.OPTGROUP: {
optgroupStartTagInBody(p, token);
break;
}
case TAG_ID.NOEMBED:
case TAG_ID.NOFRAMES: {
rawTextStartTagInBody(p, token);
break;
}
case TAG_ID.FRAMESET: {
framesetStartTagInBody(p, token);
break;
}
case TAG_ID.TEXTAREA: {
textareaStartTagInBody(p, token);
break;
}
case TAG_ID.NOSCRIPT: {
if (p.options.scriptingEnabled) {
rawTextStartTagInBody(p, token);
} else {
genericStartTagInBody(p, token);
}
break;
}
case TAG_ID.PLAINTEXT: {
plaintextStartTagInBody(p, token);
break;
}
case TAG_ID.COL:
case TAG_ID.TH:
case TAG_ID.TD:
case TAG_ID.TR:
case TAG_ID.HEAD:
case TAG_ID.FRAME:
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD:
case TAG_ID.CAPTION:
case TAG_ID.COLGROUP: {
break;
}
default: {
genericStartTagInBody(p, token);
}
}
}
function bodyEndTagInBody(p, token) {
if (p.openElements.hasInScope(TAG_ID.BODY)) {
p.insertionMode = InsertionMode.AFTER_BODY;
if (p.options.sourceCodeLocationInfo) {
const bodyElement = p.openElements.tryPeekProperlyNestedBodyElement();
if (bodyElement) {
p._setEndLocation(bodyElement, token);
}
}
}
}
function htmlEndTagInBody(p, token) {
if (p.openElements.hasInScope(TAG_ID.BODY)) {
p.insertionMode = InsertionMode.AFTER_BODY;
endTagAfterBody(p, token);
}
}
function addressEndTagInBody(p, token) {
const tn = token.tagID;
if (p.openElements.hasInScope(tn)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(tn);
}
}
function formEndTagInBody(p) {
const inTemplate = p.openElements.tmplCount > 0;
const { formElement } = p;
if (!inTemplate) {
p.formElement = null;
}
if ((formElement || inTemplate) && p.openElements.hasInScope(TAG_ID.FORM)) {
p.openElements.generateImpliedEndTags();
if (inTemplate) {
p.openElements.popUntilTagNamePopped(TAG_ID.FORM);
} else if (formElement) {
p.openElements.remove(formElement);
}
}
}
function pEndTagInBody(p) {
if (!p.openElements.hasInButtonScope(TAG_ID.P)) {
p._insertFakeElement(TAG_NAMES.P, TAG_ID.P);
}
p._closePElement();
}
function liEndTagInBody(p) {
if (p.openElements.hasInListItemScope(TAG_ID.LI)) {
p.openElements.generateImpliedEndTagsWithExclusion(TAG_ID.LI);
p.openElements.popUntilTagNamePopped(TAG_ID.LI);
}
}
function ddEndTagInBody(p, token) {
const tn = token.tagID;
if (p.openElements.hasInScope(tn)) {
p.openElements.generateImpliedEndTagsWithExclusion(tn);
p.openElements.popUntilTagNamePopped(tn);
}
}
function numberedHeaderEndTagInBody(p) {
if (p.openElements.hasNumberedHeaderInScope()) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilNumberedHeaderPopped();
}
}
function appletEndTagInBody(p, token) {
const tn = token.tagID;
if (p.openElements.hasInScope(tn)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(tn);
p.activeFormattingElements.clearToLastMarker();
}
}
function brEndTagInBody(p) {
p._reconstructActiveFormattingElements();
p._insertFakeElement(TAG_NAMES.BR, TAG_ID.BR);
p.openElements.pop();
p.framesetOk = false;
}
function genericEndTagInBody(p, token) {
const tn = token.tagName;
const tid = token.tagID;
for (let i = p.openElements.stackTop; i > 0; i--) {
const element = p.openElements.items[i];
const elementId = p.openElements.tagIDs[i];
if (tid === elementId && (tid !== TAG_ID.UNKNOWN || p.treeAdapter.getTagName(element) === tn)) {
p.openElements.generateImpliedEndTagsWithExclusion(tid);
if (p.openElements.stackTop >= i)
p.openElements.shortenToLength(i);
break;
}
if (p._isSpecialElement(element, elementId)) {
break;
}
}
}
function endTagInBody(p, token) {
switch (token.tagID) {
case TAG_ID.A:
case TAG_ID.B:
case TAG_ID.I:
case TAG_ID.S:
case TAG_ID.U:
case TAG_ID.EM:
case TAG_ID.TT:
case TAG_ID.BIG:
case TAG_ID.CODE:
case TAG_ID.FONT:
case TAG_ID.NOBR:
case TAG_ID.SMALL:
case TAG_ID.STRIKE:
case TAG_ID.STRONG: {
callAdoptionAgency(p, token);
break;
}
case TAG_ID.P: {
pEndTagInBody(p);
break;
}
case TAG_ID.DL:
case TAG_ID.UL:
case TAG_ID.OL:
case TAG_ID.DIR:
case TAG_ID.DIV:
case TAG_ID.NAV:
case TAG_ID.PRE:
case TAG_ID.MAIN:
case TAG_ID.MENU:
case TAG_ID.ASIDE:
case TAG_ID.BUTTON:
case TAG_ID.CENTER:
case TAG_ID.FIGURE:
case TAG_ID.FOOTER:
case TAG_ID.HEADER:
case TAG_ID.HGROUP:
case TAG_ID.DIALOG:
case TAG_ID.ADDRESS:
case TAG_ID.ARTICLE:
case TAG_ID.DETAILS:
case TAG_ID.SEARCH:
case TAG_ID.SECTION:
case TAG_ID.SUMMARY:
case TAG_ID.LISTING:
case TAG_ID.FIELDSET:
case TAG_ID.BLOCKQUOTE:
case TAG_ID.FIGCAPTION: {
addressEndTagInBody(p, token);
break;
}
case TAG_ID.LI: {
liEndTagInBody(p);
break;
}
case TAG_ID.DD:
case TAG_ID.DT: {
ddEndTagInBody(p, token);
break;
}
case TAG_ID.H1:
case TAG_ID.H2:
case TAG_ID.H3:
case TAG_ID.H4:
case TAG_ID.H5:
case TAG_ID.H6: {
numberedHeaderEndTagInBody(p);
break;
}
case TAG_ID.BR: {
brEndTagInBody(p);
break;
}
case TAG_ID.BODY: {
bodyEndTagInBody(p, token);
break;
}
case TAG_ID.HTML: {
htmlEndTagInBody(p, token);
break;
}
case TAG_ID.FORM: {
formEndTagInBody(p);
break;
}
case TAG_ID.APPLET:
case TAG_ID.OBJECT:
case TAG_ID.MARQUEE: {
appletEndTagInBody(p, token);
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
default: {
genericEndTagInBody(p, token);
}
}
}
function eofInBody(p, token) {
if (p.tmplInsertionModeStack.length > 0) {
eofInTemplate(p, token);
} else {
stopParsing(p, token);
}
}
function endTagInText(p, token) {
var _a3;
if (token.tagID === TAG_ID.SCRIPT) {
(_a3 = p.scriptHandler) === null || _a3 === void 0 ? void 0 : _a3.call(p, p.openElements.current);
}
p.openElements.pop();
p.insertionMode = p.originalInsertionMode;
}
function eofInText(p, token) {
p._err(token, ERR.eofInElementThatCanContainOnlyText);
p.openElements.pop();
p.insertionMode = p.originalInsertionMode;
p.onEof(token);
}
function characterInTable(p, token) {
if (p.openElements.currentTagId !== void 0 && TABLE_STRUCTURE_TAGS.has(p.openElements.currentTagId)) {
p.pendingCharacterTokens.length = 0;
p.hasNonWhitespacePendingCharacterToken = false;
p.originalInsertionMode = p.insertionMode;
p.insertionMode = InsertionMode.IN_TABLE_TEXT;
switch (token.type) {
case TokenType.CHARACTER: {
characterInTableText(p, token);
break;
}
case TokenType.WHITESPACE_CHARACTER: {
whitespaceCharacterInTableText(p, token);
break;
}
}
} else {
tokenInTable(p, token);
}
}
function captionStartTagInTable(p, token) {
p.openElements.clearBackToTableContext();
p.activeFormattingElements.insertMarker();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_CAPTION;
}
function colgroupStartTagInTable(p, token) {
p.openElements.clearBackToTableContext();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
}
function colStartTagInTable(p, token) {
p.openElements.clearBackToTableContext();
p._insertFakeElement(TAG_NAMES.COLGROUP, TAG_ID.COLGROUP);
p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
startTagInColumnGroup(p, token);
}
function tbodyStartTagInTable(p, token) {
p.openElements.clearBackToTableContext();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_TABLE_BODY;
}
function tdStartTagInTable(p, token) {
p.openElements.clearBackToTableContext();
p._insertFakeElement(TAG_NAMES.TBODY, TAG_ID.TBODY);
p.insertionMode = InsertionMode.IN_TABLE_BODY;
startTagInTableBody(p, token);
}
function tableStartTagInTable(p, token) {
if (p.openElements.hasInTableScope(TAG_ID.TABLE)) {
p.openElements.popUntilTagNamePopped(TAG_ID.TABLE);
p._resetInsertionMode();
p._processStartTag(token);
}
}
function inputStartTagInTable(p, token) {
if (isHiddenInput(token)) {
p._appendElement(token, NS.HTML);
} else {
tokenInTable(p, token);
}
token.ackSelfClosing = true;
}
function formStartTagInTable(p, token) {
if (!p.formElement && p.openElements.tmplCount === 0) {
p._insertElement(token, NS.HTML);
p.formElement = p.openElements.current;
p.openElements.pop();
}
}
function startTagInTable(p, token) {
switch (token.tagID) {
case TAG_ID.TD:
case TAG_ID.TH:
case TAG_ID.TR: {
tdStartTagInTable(p, token);
break;
}
case TAG_ID.STYLE:
case TAG_ID.SCRIPT:
case TAG_ID.TEMPLATE: {
startTagInHead(p, token);
break;
}
case TAG_ID.COL: {
colStartTagInTable(p, token);
break;
}
case TAG_ID.FORM: {
formStartTagInTable(p, token);
break;
}
case TAG_ID.TABLE: {
tableStartTagInTable(p, token);
break;
}
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD: {
tbodyStartTagInTable(p, token);
break;
}
case TAG_ID.INPUT: {
inputStartTagInTable(p, token);
break;
}
case TAG_ID.CAPTION: {
captionStartTagInTable(p, token);
break;
}
case TAG_ID.COLGROUP: {
colgroupStartTagInTable(p, token);
break;
}
default: {
tokenInTable(p, token);
}
}
}
function endTagInTable(p, token) {
switch (token.tagID) {
case TAG_ID.TABLE: {
if (p.openElements.hasInTableScope(TAG_ID.TABLE)) {
p.openElements.popUntilTagNamePopped(TAG_ID.TABLE);
p._resetInsertionMode();
}
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
case TAG_ID.BODY:
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.HTML:
case TAG_ID.TBODY:
case TAG_ID.TD:
case TAG_ID.TFOOT:
case TAG_ID.TH:
case TAG_ID.THEAD:
case TAG_ID.TR: {
break;
}
default: {
tokenInTable(p, token);
}
}
}
function tokenInTable(p, token) {
const savedFosterParentingState = p.fosterParentingEnabled;
p.fosterParentingEnabled = true;
modeInBody(p, token);
p.fosterParentingEnabled = savedFosterParentingState;
}
function whitespaceCharacterInTableText(p, token) {
p.pendingCharacterTokens.push(token);
}
function characterInTableText(p, token) {
p.pendingCharacterTokens.push(token);
p.hasNonWhitespacePendingCharacterToken = true;
}
function tokenInTableText(p, token) {
let i = 0;
if (p.hasNonWhitespacePendingCharacterToken) {
for (; i < p.pendingCharacterTokens.length; i++) {
tokenInTable(p, p.pendingCharacterTokens[i]);
}
} else {
for (; i < p.pendingCharacterTokens.length; i++) {
p._insertCharacters(p.pendingCharacterTokens[i]);
}
}
p.insertionMode = p.originalInsertionMode;
p._processToken(token);
}
var TABLE_VOID_ELEMENTS = /* @__PURE__ */ new Set([TAG_ID.CAPTION, TAG_ID.COL, TAG_ID.COLGROUP, TAG_ID.TBODY, TAG_ID.TD, TAG_ID.TFOOT, TAG_ID.TH, TAG_ID.THEAD, TAG_ID.TR]);
function startTagInCaption(p, token) {
const tn = token.tagID;
if (TABLE_VOID_ELEMENTS.has(tn)) {
if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION);
p.activeFormattingElements.clearToLastMarker();
p.insertionMode = InsertionMode.IN_TABLE;
startTagInTable(p, token);
}
} else {
startTagInBody(p, token);
}
}
function endTagInCaption(p, token) {
const tn = token.tagID;
switch (tn) {
case TAG_ID.CAPTION:
case TAG_ID.TABLE: {
if (p.openElements.hasInTableScope(TAG_ID.CAPTION)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(TAG_ID.CAPTION);
p.activeFormattingElements.clearToLastMarker();
p.insertionMode = InsertionMode.IN_TABLE;
if (tn === TAG_ID.TABLE) {
endTagInTable(p, token);
}
}
break;
}
case TAG_ID.BODY:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.HTML:
case TAG_ID.TBODY:
case TAG_ID.TD:
case TAG_ID.TFOOT:
case TAG_ID.TH:
case TAG_ID.THEAD:
case TAG_ID.TR: {
break;
}
default: {
endTagInBody(p, token);
}
}
}
function startTagInColumnGroup(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.COL: {
p._appendElement(token, NS.HTML);
token.ackSelfClosing = true;
break;
}
case TAG_ID.TEMPLATE: {
startTagInHead(p, token);
break;
}
default: {
tokenInColumnGroup(p, token);
}
}
}
function endTagInColumnGroup(p, token) {
switch (token.tagID) {
case TAG_ID.COLGROUP: {
if (p.openElements.currentTagId === TAG_ID.COLGROUP) {
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE;
}
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
case TAG_ID.COL: {
break;
}
default: {
tokenInColumnGroup(p, token);
}
}
}
function tokenInColumnGroup(p, token) {
if (p.openElements.currentTagId === TAG_ID.COLGROUP) {
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE;
p._processToken(token);
}
}
function startTagInTableBody(p, token) {
switch (token.tagID) {
case TAG_ID.TR: {
p.openElements.clearBackToTableBodyContext();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_ROW;
break;
}
case TAG_ID.TH:
case TAG_ID.TD: {
p.openElements.clearBackToTableBodyContext();
p._insertFakeElement(TAG_NAMES.TR, TAG_ID.TR);
p.insertionMode = InsertionMode.IN_ROW;
startTagInRow(p, token);
break;
}
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD: {
if (p.openElements.hasTableBodyContextInTableScope()) {
p.openElements.clearBackToTableBodyContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE;
startTagInTable(p, token);
}
break;
}
default: {
startTagInTable(p, token);
}
}
}
function endTagInTableBody(p, token) {
const tn = token.tagID;
switch (token.tagID) {
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD: {
if (p.openElements.hasInTableScope(tn)) {
p.openElements.clearBackToTableBodyContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE;
}
break;
}
case TAG_ID.TABLE: {
if (p.openElements.hasTableBodyContextInTableScope()) {
p.openElements.clearBackToTableBodyContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE;
endTagInTable(p, token);
}
break;
}
case TAG_ID.BODY:
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.HTML:
case TAG_ID.TD:
case TAG_ID.TH:
case TAG_ID.TR: {
break;
}
default: {
endTagInTable(p, token);
}
}
}
function startTagInRow(p, token) {
switch (token.tagID) {
case TAG_ID.TH:
case TAG_ID.TD: {
p.openElements.clearBackToTableRowContext();
p._insertElement(token, NS.HTML);
p.insertionMode = InsertionMode.IN_CELL;
p.activeFormattingElements.insertMarker();
break;
}
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD:
case TAG_ID.TR: {
if (p.openElements.hasInTableScope(TAG_ID.TR)) {
p.openElements.clearBackToTableRowContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE_BODY;
startTagInTableBody(p, token);
}
break;
}
default: {
startTagInTable(p, token);
}
}
}
function endTagInRow(p, token) {
switch (token.tagID) {
case TAG_ID.TR: {
if (p.openElements.hasInTableScope(TAG_ID.TR)) {
p.openElements.clearBackToTableRowContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE_BODY;
}
break;
}
case TAG_ID.TABLE: {
if (p.openElements.hasInTableScope(TAG_ID.TR)) {
p.openElements.clearBackToTableRowContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE_BODY;
endTagInTableBody(p, token);
}
break;
}
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD: {
if (p.openElements.hasInTableScope(token.tagID) || p.openElements.hasInTableScope(TAG_ID.TR)) {
p.openElements.clearBackToTableRowContext();
p.openElements.pop();
p.insertionMode = InsertionMode.IN_TABLE_BODY;
endTagInTableBody(p, token);
}
break;
}
case TAG_ID.BODY:
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.HTML:
case TAG_ID.TD:
case TAG_ID.TH: {
break;
}
default: {
endTagInTable(p, token);
}
}
}
function startTagInCell(p, token) {
const tn = token.tagID;
if (TABLE_VOID_ELEMENTS.has(tn)) {
if (p.openElements.hasInTableScope(TAG_ID.TD) || p.openElements.hasInTableScope(TAG_ID.TH)) {
p._closeTableCell();
startTagInRow(p, token);
}
} else {
startTagInBody(p, token);
}
}
function endTagInCell(p, token) {
const tn = token.tagID;
switch (tn) {
case TAG_ID.TD:
case TAG_ID.TH: {
if (p.openElements.hasInTableScope(tn)) {
p.openElements.generateImpliedEndTags();
p.openElements.popUntilTagNamePopped(tn);
p.activeFormattingElements.clearToLastMarker();
p.insertionMode = InsertionMode.IN_ROW;
}
break;
}
case TAG_ID.TABLE:
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD:
case TAG_ID.TR: {
if (p.openElements.hasInTableScope(tn)) {
p._closeTableCell();
endTagInRow(p, token);
}
break;
}
case TAG_ID.BODY:
case TAG_ID.CAPTION:
case TAG_ID.COL:
case TAG_ID.COLGROUP:
case TAG_ID.HTML: {
break;
}
default: {
endTagInBody(p, token);
}
}
}
function startTagInSelect(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.OPTION: {
if (p.openElements.currentTagId === TAG_ID.OPTION) {
p.openElements.pop();
}
p._insertElement(token, NS.HTML);
break;
}
case TAG_ID.OPTGROUP: {
if (p.openElements.currentTagId === TAG_ID.OPTION) {
p.openElements.pop();
}
if (p.openElements.currentTagId === TAG_ID.OPTGROUP) {
p.openElements.pop();
}
p._insertElement(token, NS.HTML);
break;
}
case TAG_ID.HR: {
if (p.openElements.currentTagId === TAG_ID.OPTION) {
p.openElements.pop();
}
if (p.openElements.currentTagId === TAG_ID.OPTGROUP) {
p.openElements.pop();
}
p._appendElement(token, NS.HTML);
token.ackSelfClosing = true;
break;
}
case TAG_ID.INPUT:
case TAG_ID.KEYGEN:
case TAG_ID.TEXTAREA:
case TAG_ID.SELECT: {
if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) {
p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
p._resetInsertionMode();
if (token.tagID !== TAG_ID.SELECT) {
p._processStartTag(token);
}
}
break;
}
case TAG_ID.SCRIPT:
case TAG_ID.TEMPLATE: {
startTagInHead(p, token);
break;
}
default:
}
}
function endTagInSelect(p, token) {
switch (token.tagID) {
case TAG_ID.OPTGROUP: {
if (p.openElements.stackTop > 0 && p.openElements.currentTagId === TAG_ID.OPTION && p.openElements.tagIDs[p.openElements.stackTop - 1] === TAG_ID.OPTGROUP) {
p.openElements.pop();
}
if (p.openElements.currentTagId === TAG_ID.OPTGROUP) {
p.openElements.pop();
}
break;
}
case TAG_ID.OPTION: {
if (p.openElements.currentTagId === TAG_ID.OPTION) {
p.openElements.pop();
}
break;
}
case TAG_ID.SELECT: {
if (p.openElements.hasInSelectScope(TAG_ID.SELECT)) {
p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
p._resetInsertionMode();
}
break;
}
case TAG_ID.TEMPLATE: {
templateEndTagInHead(p, token);
break;
}
default:
}
}
function startTagInSelectInTable(p, token) {
const tn = token.tagID;
if (tn === TAG_ID.CAPTION || tn === TAG_ID.TABLE || tn === TAG_ID.TBODY || tn === TAG_ID.TFOOT || tn === TAG_ID.THEAD || tn === TAG_ID.TR || tn === TAG_ID.TD || tn === TAG_ID.TH) {
p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
p._resetInsertionMode();
p._processStartTag(token);
} else {
startTagInSelect(p, token);
}
}
function endTagInSelectInTable(p, token) {
const tn = token.tagID;
if (tn === TAG_ID.CAPTION || tn === TAG_ID.TABLE || tn === TAG_ID.TBODY || tn === TAG_ID.TFOOT || tn === TAG_ID.THEAD || tn === TAG_ID.TR || tn === TAG_ID.TD || tn === TAG_ID.TH) {
if (p.openElements.hasInTableScope(tn)) {
p.openElements.popUntilTagNamePopped(TAG_ID.SELECT);
p._resetInsertionMode();
p.onEndTag(token);
}
} else {
endTagInSelect(p, token);
}
}
function startTagInTemplate(p, token) {
switch (token.tagID) {
case TAG_ID.BASE:
case TAG_ID.BASEFONT:
case TAG_ID.BGSOUND:
case TAG_ID.LINK:
case TAG_ID.META:
case TAG_ID.NOFRAMES:
case TAG_ID.SCRIPT:
case TAG_ID.STYLE:
case TAG_ID.TEMPLATE:
case TAG_ID.TITLE: {
startTagInHead(p, token);
break;
}
case TAG_ID.CAPTION:
case TAG_ID.COLGROUP:
case TAG_ID.TBODY:
case TAG_ID.TFOOT:
case TAG_ID.THEAD: {
p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE;
p.insertionMode = InsertionMode.IN_TABLE;
startTagInTable(p, token);
break;
}
case TAG_ID.COL: {
p.tmplInsertionModeStack[0] = InsertionMode.IN_COLUMN_GROUP;
p.insertionMode = InsertionMode.IN_COLUMN_GROUP;
startTagInColumnGroup(p, token);
break;
}
case TAG_ID.TR: {
p.tmplInsertionModeStack[0] = InsertionMode.IN_TABLE_BODY;
p.insertionMode = InsertionMode.IN_TABLE_BODY;
startTagInTableBody(p, token);
break;
}
case TAG_ID.TD:
case TAG_ID.TH: {
p.tmplInsertionModeStack[0] = InsertionMode.IN_ROW;
p.insertionMode = InsertionMode.IN_ROW;
startTagInRow(p, token);
break;
}
default: {
p.tmplInsertionModeStack[0] = InsertionMode.IN_BODY;
p.insertionMode = InsertionMode.IN_BODY;
startTagInBody(p, token);
}
}
}
function endTagInTemplate(p, token) {
if (token.tagID === TAG_ID.TEMPLATE) {
templateEndTagInHead(p, token);
}
}
function eofInTemplate(p, token) {
if (p.openElements.tmplCount > 0) {
p.openElements.popUntilTagNamePopped(TAG_ID.TEMPLATE);
p.activeFormattingElements.clearToLastMarker();
p.tmplInsertionModeStack.shift();
p._resetInsertionMode();
p.onEof(token);
} else {
stopParsing(p, token);
}
}
function startTagAfterBody(p, token) {
if (token.tagID === TAG_ID.HTML) {
startTagInBody(p, token);
} else {
tokenAfterBody(p, token);
}
}
function endTagAfterBody(p, token) {
var _a3;
if (token.tagID === TAG_ID.HTML) {
if (!p.fragmentContext) {
p.insertionMode = InsertionMode.AFTER_AFTER_BODY;
}
if (p.options.sourceCodeLocationInfo && p.openElements.tagIDs[0] === TAG_ID.HTML) {
p._setEndLocation(p.openElements.items[0], token);
const bodyElement = p.openElements.items[1];
if (bodyElement && !((_a3 = p.treeAdapter.getNodeSourceCodeLocation(bodyElement)) === null || _a3 === void 0 ? void 0 : _a3.endTag)) {
p._setEndLocation(bodyElement, token);
}
}
} else {
tokenAfterBody(p, token);
}
}
function tokenAfterBody(p, token) {
p.insertionMode = InsertionMode.IN_BODY;
modeInBody(p, token);
}
function startTagInFrameset(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.FRAMESET: {
p._insertElement(token, NS.HTML);
break;
}
case TAG_ID.FRAME: {
p._appendElement(token, NS.HTML);
token.ackSelfClosing = true;
break;
}
case TAG_ID.NOFRAMES: {
startTagInHead(p, token);
break;
}
default:
}
}
function endTagInFrameset(p, token) {
if (token.tagID === TAG_ID.FRAMESET && !p.openElements.isRootHtmlElementCurrent()) {
p.openElements.pop();
if (!p.fragmentContext && p.openElements.currentTagId !== TAG_ID.FRAMESET) {
p.insertionMode = InsertionMode.AFTER_FRAMESET;
}
}
}
function startTagAfterFrameset(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.NOFRAMES: {
startTagInHead(p, token);
break;
}
default:
}
}
function endTagAfterFrameset(p, token) {
if (token.tagID === TAG_ID.HTML) {
p.insertionMode = InsertionMode.AFTER_AFTER_FRAMESET;
}
}
function startTagAfterAfterBody(p, token) {
if (token.tagID === TAG_ID.HTML) {
startTagInBody(p, token);
} else {
tokenAfterAfterBody(p, token);
}
}
function tokenAfterAfterBody(p, token) {
p.insertionMode = InsertionMode.IN_BODY;
modeInBody(p, token);
}
function startTagAfterAfterFrameset(p, token) {
switch (token.tagID) {
case TAG_ID.HTML: {
startTagInBody(p, token);
break;
}
case TAG_ID.NOFRAMES: {
startTagInHead(p, token);
break;
}
default:
}
}
function nullCharacterInForeignContent(p, token) {
token.chars = REPLACEMENT_CHARACTER;
p._insertCharacters(token);
}
function characterInForeignContent(p, token) {
p._insertCharacters(token);
p.framesetOk = false;
}
function popUntilHtmlOrIntegrationPoint(p) {
while (p.treeAdapter.getNamespaceURI(p.openElements.current) !== NS.HTML && p.openElements.currentTagId !== void 0 && !p._isIntegrationPoint(p.openElements.currentTagId, p.openElements.current)) {
p.openElements.pop();
}
}
function startTagInForeignContent(p, token) {
if (causesExit(token)) {
popUntilHtmlOrIntegrationPoint(p);
p._startTagOutsideForeignContent(token);
} else {
const current = p._getAdjustedCurrentElement();
const currentNs = p.treeAdapter.getNamespaceURI(current);
if (currentNs === NS.MATHML) {
adjustTokenMathMLAttrs(token);
} else if (currentNs === NS.SVG) {
adjustTokenSVGTagName(token);
adjustTokenSVGAttrs(token);
}
adjustTokenXMLAttrs(token);
if (token.selfClosing) {
p._appendElement(token, currentNs);
} else {
p._insertElement(token, currentNs);
}
token.ackSelfClosing = true;
}
}
function endTagInForeignContent(p, token) {
if (token.tagID === TAG_ID.P || token.tagID === TAG_ID.BR) {
popUntilHtmlOrIntegrationPoint(p);
p._endTagOutsideForeignContent(token);
return;
}
for (let i = p.openElements.stackTop; i > 0; i--) {
const element = p.openElements.items[i];
if (p.treeAdapter.getNamespaceURI(element) === NS.HTML) {
p._endTagOutsideForeignContent(token);
break;
}
const tagName = p.treeAdapter.getTagName(element);
if (tagName.toLowerCase() === token.tagName) {
token.tagName = tagName;
p.openElements.shortenToLength(i);
break;
}
}
}
// ../../node_modules/.pnpm/entities@6.0.0/node_modules/entities/dist/esm/escape.js
var getCodePoint2 = String.prototype.codePointAt == null ? (c, index2) => (c.charCodeAt(index2) & 64512) === 55296 ? (c.charCodeAt(index2) - 55296) * 1024 + c.charCodeAt(index2 + 1) - 56320 + 65536 : c.charCodeAt(index2) : (input, index2) => input.codePointAt(index2);
function getEscaper2(regex, map4) {
return function escape3(data2) {
let match3;
let lastIndex = 0;
let result = "";
while (match3 = regex.exec(data2)) {
if (lastIndex !== match3.index) {
result += data2.substring(lastIndex, match3.index);
}
result += map4.get(match3[0].charCodeAt(0));
lastIndex = match3.index + 1;
}
return result + data2.substring(lastIndex);
};
}
var escapeAttribute2 = /* @__PURE__ */ getEscaper2(/["&\u00A0]/g, /* @__PURE__ */ new Map([
[34, """],
[38, "&"],
[160, " "]
]));
var escapeText2 = /* @__PURE__ */ getEscaper2(/[&<>\u00A0]/g, /* @__PURE__ */ new Map([
[38, "&"],
[60, "<"],
[62, ">"],
[160, " "]
]));
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/serializer/index.js
var VOID_ELEMENTS = /* @__PURE__ */ new Set([
TAG_NAMES.AREA,
TAG_NAMES.BASE,
TAG_NAMES.BASEFONT,
TAG_NAMES.BGSOUND,
TAG_NAMES.BR,
TAG_NAMES.COL,
TAG_NAMES.EMBED,
TAG_NAMES.FRAME,
TAG_NAMES.HR,
TAG_NAMES.IMG,
TAG_NAMES.INPUT,
TAG_NAMES.KEYGEN,
TAG_NAMES.LINK,
TAG_NAMES.META,
TAG_NAMES.PARAM,
TAG_NAMES.SOURCE,
TAG_NAMES.TRACK,
TAG_NAMES.WBR
]);
function isVoidElement(node, options) {
return options.treeAdapter.isElementNode(node) && options.treeAdapter.getNamespaceURI(node) === NS.HTML && VOID_ELEMENTS.has(options.treeAdapter.getTagName(node));
}
var defaultOpts3 = { treeAdapter: defaultTreeAdapter, scriptingEnabled: true };
function serializeOuter(node, options) {
const opts = { ...defaultOpts3, ...options };
return serializeNode(node, opts);
}
function serializeChildNodes(parentNode, options) {
let html4 = "";
const container = options.treeAdapter.isElementNode(parentNode) && options.treeAdapter.getTagName(parentNode) === TAG_NAMES.TEMPLATE && options.treeAdapter.getNamespaceURI(parentNode) === NS.HTML ? options.treeAdapter.getTemplateContent(parentNode) : parentNode;
const childNodes = options.treeAdapter.getChildNodes(container);
if (childNodes) {
for (const currentNode of childNodes) {
html4 += serializeNode(currentNode, options);
}
}
return html4;
}
function serializeNode(node, options) {
if (options.treeAdapter.isElementNode(node)) {
return serializeElement(node, options);
}
if (options.treeAdapter.isTextNode(node)) {
return serializeTextNode(node, options);
}
if (options.treeAdapter.isCommentNode(node)) {
return serializeCommentNode(node, options);
}
if (options.treeAdapter.isDocumentTypeNode(node)) {
return serializeDocumentTypeNode(node, options);
}
return "";
}
function serializeElement(node, options) {
const tn = options.treeAdapter.getTagName(node);
return `<${tn}${serializeAttributes(node, options)}>${isVoidElement(node, options) ? "" : `${serializeChildNodes(node, options)}${tn}>`}`;
}
function serializeAttributes(node, { treeAdapter }) {
let html4 = "";
for (const attr2 of treeAdapter.getAttrList(node)) {
html4 += " ";
if (attr2.namespace) {
switch (attr2.namespace) {
case NS.XML: {
html4 += `xml:${attr2.name}`;
break;
}
case NS.XMLNS: {
if (attr2.name !== "xmlns") {
html4 += "xmlns:";
}
html4 += attr2.name;
break;
}
case NS.XLINK: {
html4 += `xlink:${attr2.name}`;
break;
}
default: {
html4 += `${attr2.prefix}:${attr2.name}`;
}
}
} else {
html4 += attr2.name;
}
html4 += `="${escapeAttribute2(attr2.value)}"`;
}
return html4;
}
function serializeTextNode(node, options) {
const { treeAdapter } = options;
const content = treeAdapter.getTextNodeContent(node);
const parent2 = treeAdapter.getParentNode(node);
const parentTn = parent2 && treeAdapter.isElementNode(parent2) && treeAdapter.getTagName(parent2);
return parentTn && treeAdapter.getNamespaceURI(parent2) === NS.HTML && hasUnescapedText(parentTn, options.scriptingEnabled) ? content : escapeText2(content);
}
function serializeCommentNode(node, { treeAdapter }) {
return ``;
}
function serializeDocumentTypeNode(node, { treeAdapter }) {
return ``;
}
// ../../node_modules/.pnpm/parse5@7.3.0/node_modules/parse5/dist/index.js
function parse5(html4, options) {
return Parser.parse(html4, options);
}
function parseFragment(fragmentContext, html4, options) {
if (typeof fragmentContext === "string") {
options = html4;
html4 = fragmentContext;
fragmentContext = null;
}
const parser = Parser.getFragmentParser(fragmentContext, options);
parser.tokenizer.write(html4, true);
return parser.getFragment();
}
// ../../node_modules/.pnpm/parse5-htmlparser2-tree-adapter@7.1.0/node_modules/parse5-htmlparser2-tree-adapter/dist/index.js
function enquoteDoctypeId(id) {
const quote = id.includes('"') ? "'" : '"';
return quote + id + quote;
}
function serializeDoctypeContent(name2, publicId, systemId) {
let str = "!DOCTYPE ";
if (name2) {
str += name2;
}
if (publicId) {
str += ` PUBLIC ${enquoteDoctypeId(publicId)}`;
} else if (systemId) {
str += " SYSTEM";
}
if (systemId) {
str += ` ${enquoteDoctypeId(systemId)}`;
}
return str;
}
var adapter = {
isCommentNode: isComment,
isElementNode: isTag2,
isTextNode: isText,
createDocument() {
const node = new Document([]);
node["x-mode"] = html_exports.DOCUMENT_MODE.NO_QUIRKS;
return node;
},
createDocumentFragment() {
return new Document([]);
},
createElement(tagName, namespaceURI, attrs) {
const attribs = /* @__PURE__ */ Object.create(null);
const attribsNamespace = /* @__PURE__ */ Object.create(null);
const attribsPrefix = /* @__PURE__ */ Object.create(null);
for (let i = 0; i < attrs.length; i++) {
const attrName = attrs[i].name;
attribs[attrName] = attrs[i].value;
attribsNamespace[attrName] = attrs[i].namespace;
attribsPrefix[attrName] = attrs[i].prefix;
}
const node = new Element(tagName, attribs, []);
node.namespace = namespaceURI;
node["x-attribsNamespace"] = attribsNamespace;
node["x-attribsPrefix"] = attribsPrefix;
return node;
},
createCommentNode(data2) {
return new Comment2(data2);
},
createTextNode(value) {
return new Text2(value);
},
appendChild(parentNode, newNode) {
const prev2 = parentNode.children[parentNode.children.length - 1];
if (prev2) {
prev2.next = newNode;
newNode.prev = prev2;
}
parentNode.children.push(newNode);
newNode.parent = parentNode;
},
insertBefore(parentNode, newNode, referenceNode) {
const insertionIdx = parentNode.children.indexOf(referenceNode);
const { prev: prev2 } = referenceNode;
if (prev2) {
prev2.next = newNode;
newNode.prev = prev2;
}
referenceNode.prev = newNode;
newNode.next = referenceNode;
parentNode.children.splice(insertionIdx, 0, newNode);
newNode.parent = parentNode;
},
setTemplateContent(templateElement, contentElement) {
adapter.appendChild(templateElement, contentElement);
},
getTemplateContent(templateElement) {
return templateElement.children[0];
},
setDocumentType(document2, name2, publicId, systemId) {
const data2 = serializeDoctypeContent(name2, publicId, systemId);
let doctypeNode = document2.children.find((node) => isDirective(node) && node.name === "!doctype");
if (doctypeNode) {
doctypeNode.data = data2 !== null && data2 !== void 0 ? data2 : null;
} else {
doctypeNode = new ProcessingInstruction("!doctype", data2);
adapter.appendChild(document2, doctypeNode);
}
doctypeNode["x-name"] = name2;
doctypeNode["x-publicId"] = publicId;
doctypeNode["x-systemId"] = systemId;
},
setDocumentMode(document2, mode) {
document2["x-mode"] = mode;
},
getDocumentMode(document2) {
return document2["x-mode"];
},
detachNode(node) {
if (node.parent) {
const idx = node.parent.children.indexOf(node);
const { prev: prev2, next: next2 } = node;
node.prev = null;
node.next = null;
if (prev2) {
prev2.next = next2;
}
if (next2) {
next2.prev = prev2;
}
node.parent.children.splice(idx, 1);
node.parent = null;
}
},
insertText(parentNode, text5) {
const lastChild = parentNode.children[parentNode.children.length - 1];
if (lastChild && isText(lastChild)) {
lastChild.data += text5;
} else {
adapter.appendChild(parentNode, adapter.createTextNode(text5));
}
},
insertTextBefore(parentNode, text5, referenceNode) {
const prevNode = parentNode.children[parentNode.children.indexOf(referenceNode) - 1];
if (prevNode && isText(prevNode)) {
prevNode.data += text5;
} else {
adapter.insertBefore(parentNode, adapter.createTextNode(text5), referenceNode);
}
},
adoptAttributes(recipient, attrs) {
for (let i = 0; i < attrs.length; i++) {
const attrName = attrs[i].name;
if (recipient.attribs[attrName] === void 0) {
recipient.attribs[attrName] = attrs[i].value;
recipient["x-attribsNamespace"][attrName] = attrs[i].namespace;
recipient["x-attribsPrefix"][attrName] = attrs[i].prefix;
}
}
},
getFirstChild(node) {
return node.children[0];
},
getChildNodes(node) {
return node.children;
},
getParentNode(node) {
return node.parent;
},
getAttrList(element) {
return element.attributes;
},
getTagName(element) {
return element.name;
},
getNamespaceURI(element) {
return element.namespace;
},
getTextNodeContent(textNode) {
return textNode.data;
},
getCommentNodeContent(commentNode) {
return commentNode.data;
},
getDocumentTypeNodeName(doctypeNode) {
var _a3;
return (_a3 = doctypeNode["x-name"]) !== null && _a3 !== void 0 ? _a3 : "";
},
getDocumentTypeNodePublicId(doctypeNode) {
var _a3;
return (_a3 = doctypeNode["x-publicId"]) !== null && _a3 !== void 0 ? _a3 : "";
},
getDocumentTypeNodeSystemId(doctypeNode) {
var _a3;
return (_a3 = doctypeNode["x-systemId"]) !== null && _a3 !== void 0 ? _a3 : "";
},
isDocumentTypeNode(node) {
return isDirective(node) && node.name === "!doctype";
},
setNodeSourceCodeLocation(node, location) {
if (location) {
node.startIndex = location.startOffset;
node.endIndex = location.endOffset;
}
node.sourceCodeLocation = location;
},
getNodeSourceCodeLocation(node) {
return node.sourceCodeLocation;
},
updateNodeSourceCodeLocation(node, endLocation) {
if (endLocation.endOffset != null)
node.endIndex = endLocation.endOffset;
node.sourceCodeLocation = {
...node.sourceCodeLocation,
...endLocation
};
}
};
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/parsers/parse5-adapter.js
function parseWithParse5(content, options, isDocument3, context) {
const opts = {
scriptingEnabled: typeof options.scriptingEnabled === "boolean" ? options.scriptingEnabled : true,
treeAdapter: adapter,
sourceCodeLocationInfo: options.sourceCodeLocationInfo
};
return isDocument3 ? parse5(content, opts) : parseFragment(context, content, opts);
}
var renderOpts = { treeAdapter: adapter };
function renderWithParse5(dom) {
const nodes = "length" in dom ? dom : [dom];
for (let index2 = 0; index2 < nodes.length; index2 += 1) {
const node = nodes[index2];
if (isDocument(node)) {
Array.prototype.splice.call(nodes, index2, 1, ...node.children);
}
}
let result = "";
for (let index2 = 0; index2 < nodes.length; index2 += 1) {
const node = nodes[index2];
result += serializeOuter(node, renderOpts);
}
return result;
}
// ../../node_modules/.pnpm/htmlparser2@8.0.2/node_modules/htmlparser2/lib/esm/Tokenizer.js
var CharCodes3;
(function(CharCodes4) {
CharCodes4[CharCodes4["Tab"] = 9] = "Tab";
CharCodes4[CharCodes4["NewLine"] = 10] = "NewLine";
CharCodes4[CharCodes4["FormFeed"] = 12] = "FormFeed";
CharCodes4[CharCodes4["CarriageReturn"] = 13] = "CarriageReturn";
CharCodes4[CharCodes4["Space"] = 32] = "Space";
CharCodes4[CharCodes4["ExclamationMark"] = 33] = "ExclamationMark";
CharCodes4[CharCodes4["Number"] = 35] = "Number";
CharCodes4[CharCodes4["Amp"] = 38] = "Amp";
CharCodes4[CharCodes4["SingleQuote"] = 39] = "SingleQuote";
CharCodes4[CharCodes4["DoubleQuote"] = 34] = "DoubleQuote";
CharCodes4[CharCodes4["Dash"] = 45] = "Dash";
CharCodes4[CharCodes4["Slash"] = 47] = "Slash";
CharCodes4[CharCodes4["Zero"] = 48] = "Zero";
CharCodes4[CharCodes4["Nine"] = 57] = "Nine";
CharCodes4[CharCodes4["Semi"] = 59] = "Semi";
CharCodes4[CharCodes4["Lt"] = 60] = "Lt";
CharCodes4[CharCodes4["Eq"] = 61] = "Eq";
CharCodes4[CharCodes4["Gt"] = 62] = "Gt";
CharCodes4[CharCodes4["Questionmark"] = 63] = "Questionmark";
CharCodes4[CharCodes4["UpperA"] = 65] = "UpperA";
CharCodes4[CharCodes4["LowerA"] = 97] = "LowerA";
CharCodes4[CharCodes4["UpperF"] = 70] = "UpperF";
CharCodes4[CharCodes4["LowerF"] = 102] = "LowerF";
CharCodes4[CharCodes4["UpperZ"] = 90] = "UpperZ";
CharCodes4[CharCodes4["LowerZ"] = 122] = "LowerZ";
CharCodes4[CharCodes4["LowerX"] = 120] = "LowerX";
CharCodes4[CharCodes4["OpeningSquareBracket"] = 91] = "OpeningSquareBracket";
})(CharCodes3 || (CharCodes3 = {}));
var State2;
(function(State3) {
State3[State3["Text"] = 1] = "Text";
State3[State3["BeforeTagName"] = 2] = "BeforeTagName";
State3[State3["InTagName"] = 3] = "InTagName";
State3[State3["InSelfClosingTag"] = 4] = "InSelfClosingTag";
State3[State3["BeforeClosingTagName"] = 5] = "BeforeClosingTagName";
State3[State3["InClosingTagName"] = 6] = "InClosingTagName";
State3[State3["AfterClosingTagName"] = 7] = "AfterClosingTagName";
State3[State3["BeforeAttributeName"] = 8] = "BeforeAttributeName";
State3[State3["InAttributeName"] = 9] = "InAttributeName";
State3[State3["AfterAttributeName"] = 10] = "AfterAttributeName";
State3[State3["BeforeAttributeValue"] = 11] = "BeforeAttributeValue";
State3[State3["InAttributeValueDq"] = 12] = "InAttributeValueDq";
State3[State3["InAttributeValueSq"] = 13] = "InAttributeValueSq";
State3[State3["InAttributeValueNq"] = 14] = "InAttributeValueNq";
State3[State3["BeforeDeclaration"] = 15] = "BeforeDeclaration";
State3[State3["InDeclaration"] = 16] = "InDeclaration";
State3[State3["InProcessingInstruction"] = 17] = "InProcessingInstruction";
State3[State3["BeforeComment"] = 18] = "BeforeComment";
State3[State3["CDATASequence"] = 19] = "CDATASequence";
State3[State3["InSpecialComment"] = 20] = "InSpecialComment";
State3[State3["InCommentLike"] = 21] = "InCommentLike";
State3[State3["BeforeSpecialS"] = 22] = "BeforeSpecialS";
State3[State3["SpecialStartSequence"] = 23] = "SpecialStartSequence";
State3[State3["InSpecialTag"] = 24] = "InSpecialTag";
State3[State3["BeforeEntity"] = 25] = "BeforeEntity";
State3[State3["BeforeNumericEntity"] = 26] = "BeforeNumericEntity";
State3[State3["InNamedEntity"] = 27] = "InNamedEntity";
State3[State3["InNumericEntity"] = 28] = "InNumericEntity";
State3[State3["InHexEntity"] = 29] = "InHexEntity";
})(State2 || (State2 = {}));
function isWhitespace3(c) {
return c === CharCodes3.Space || c === CharCodes3.NewLine || c === CharCodes3.Tab || c === CharCodes3.FormFeed || c === CharCodes3.CarriageReturn;
}
function isEndOfTagSection(c) {
return c === CharCodes3.Slash || c === CharCodes3.Gt || isWhitespace3(c);
}
function isNumber4(c) {
return c >= CharCodes3.Zero && c <= CharCodes3.Nine;
}
function isASCIIAlpha(c) {
return c >= CharCodes3.LowerA && c <= CharCodes3.LowerZ || c >= CharCodes3.UpperA && c <= CharCodes3.UpperZ;
}
function isHexDigit(c) {
return c >= CharCodes3.UpperA && c <= CharCodes3.UpperF || c >= CharCodes3.LowerA && c <= CharCodes3.LowerF;
}
var QuoteType;
(function(QuoteType2) {
QuoteType2[QuoteType2["NoValue"] = 0] = "NoValue";
QuoteType2[QuoteType2["Unquoted"] = 1] = "Unquoted";
QuoteType2[QuoteType2["Single"] = 2] = "Single";
QuoteType2[QuoteType2["Double"] = 3] = "Double";
})(QuoteType || (QuoteType = {}));
var Sequences = {
Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
CdataEnd: new Uint8Array([93, 93, 62]),
CommentEnd: new Uint8Array([45, 45, 62]),
ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101])
};
var Tokenizer2 = class {
constructor({ xmlMode = false, decodeEntities = true }, cbs) {
this.cbs = cbs;
this.state = State2.Text;
this.buffer = "";
this.sectionStart = 0;
this.index = 0;
this.baseState = State2.Text;
this.isSpecial = false;
this.running = true;
this.offset = 0;
this.currentSequence = void 0;
this.sequenceIndex = 0;
this.trieIndex = 0;
this.trieCurrent = 0;
this.entityResult = 0;
this.entityExcess = 0;
this.xmlMode = xmlMode;
this.decodeEntities = decodeEntities;
this.entityTrie = xmlMode ? decode_data_xml_default : decode_data_html_default;
}
reset() {
this.state = State2.Text;
this.buffer = "";
this.sectionStart = 0;
this.index = 0;
this.baseState = State2.Text;
this.currentSequence = void 0;
this.running = true;
this.offset = 0;
}
write(chunk) {
this.offset += this.buffer.length;
this.buffer = chunk;
this.parse();
}
end() {
if (this.running)
this.finish();
}
pause() {
this.running = false;
}
resume() {
this.running = true;
if (this.index < this.buffer.length + this.offset) {
this.parse();
}
}
getIndex() {
return this.index;
}
getSectionStart() {
return this.sectionStart;
}
stateText(c) {
if (c === CharCodes3.Lt || !this.decodeEntities && this.fastForwardTo(CharCodes3.Lt)) {
if (this.index > this.sectionStart) {
this.cbs.ontext(this.sectionStart, this.index);
}
this.state = State2.BeforeTagName;
this.sectionStart = this.index;
} else if (this.decodeEntities && c === CharCodes3.Amp) {
this.state = State2.BeforeEntity;
}
}
stateSpecialStartSequence(c) {
const isEnd = this.sequenceIndex === this.currentSequence.length;
const isMatch = isEnd ? isEndOfTagSection(c) : (c | 32) === this.currentSequence[this.sequenceIndex];
if (!isMatch) {
this.isSpecial = false;
} else if (!isEnd) {
this.sequenceIndex++;
return;
}
this.sequenceIndex = 0;
this.state = State2.InTagName;
this.stateInTagName(c);
}
stateInSpecialTag(c) {
if (this.sequenceIndex === this.currentSequence.length) {
if (c === CharCodes3.Gt || isWhitespace3(c)) {
const endOfText = this.index - this.currentSequence.length;
if (this.sectionStart < endOfText) {
const actualIndex = this.index;
this.index = endOfText;
this.cbs.ontext(this.sectionStart, endOfText);
this.index = actualIndex;
}
this.isSpecial = false;
this.sectionStart = endOfText + 2;
this.stateInClosingTagName(c);
return;
}
this.sequenceIndex = 0;
}
if ((c | 32) === this.currentSequence[this.sequenceIndex]) {
this.sequenceIndex += 1;
} else if (this.sequenceIndex === 0) {
if (this.currentSequence === Sequences.TitleEnd) {
if (this.decodeEntities && c === CharCodes3.Amp) {
this.state = State2.BeforeEntity;
}
} else if (this.fastForwardTo(CharCodes3.Lt)) {
this.sequenceIndex = 1;
}
} else {
this.sequenceIndex = Number(c === CharCodes3.Lt);
}
}
stateCDATASequence(c) {
if (c === Sequences.Cdata[this.sequenceIndex]) {
if (++this.sequenceIndex === Sequences.Cdata.length) {
this.state = State2.InCommentLike;
this.currentSequence = Sequences.CdataEnd;
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
}
} else {
this.sequenceIndex = 0;
this.state = State2.InDeclaration;
this.stateInDeclaration(c);
}
}
fastForwardTo(c) {
while (++this.index < this.buffer.length + this.offset) {
if (this.buffer.charCodeAt(this.index - this.offset) === c) {
return true;
}
}
this.index = this.buffer.length + this.offset - 1;
return false;
}
stateInCommentLike(c) {
if (c === this.currentSequence[this.sequenceIndex]) {
if (++this.sequenceIndex === this.currentSequence.length) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, this.index, 2);
} else {
this.cbs.oncomment(this.sectionStart, this.index, 2);
}
this.sequenceIndex = 0;
this.sectionStart = this.index + 1;
this.state = State2.Text;
}
} else if (this.sequenceIndex === 0) {
if (this.fastForwardTo(this.currentSequence[0])) {
this.sequenceIndex = 1;
}
} else if (c !== this.currentSequence[this.sequenceIndex - 1]) {
this.sequenceIndex = 0;
}
}
isTagStartChar(c) {
return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
}
startSpecial(sequence, offset2) {
this.isSpecial = true;
this.currentSequence = sequence;
this.sequenceIndex = offset2;
this.state = State2.SpecialStartSequence;
}
stateBeforeTagName(c) {
if (c === CharCodes3.ExclamationMark) {
this.state = State2.BeforeDeclaration;
this.sectionStart = this.index + 1;
} else if (c === CharCodes3.Questionmark) {
this.state = State2.InProcessingInstruction;
this.sectionStart = this.index + 1;
} else if (this.isTagStartChar(c)) {
const lower = c | 32;
this.sectionStart = this.index;
if (!this.xmlMode && lower === Sequences.TitleEnd[2]) {
this.startSpecial(Sequences.TitleEnd, 3);
} else {
this.state = !this.xmlMode && lower === Sequences.ScriptEnd[2] ? State2.BeforeSpecialS : State2.InTagName;
}
} else if (c === CharCodes3.Slash) {
this.state = State2.BeforeClosingTagName;
} else {
this.state = State2.Text;
this.stateText(c);
}
}
stateInTagName(c) {
if (isEndOfTagSection(c)) {
this.cbs.onopentagname(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State2.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateBeforeClosingTagName(c) {
if (isWhitespace3(c)) {
} else if (c === CharCodes3.Gt) {
this.state = State2.Text;
} else {
this.state = this.isTagStartChar(c) ? State2.InClosingTagName : State2.InSpecialComment;
this.sectionStart = this.index;
}
}
stateInClosingTagName(c) {
if (c === CharCodes3.Gt || isWhitespace3(c)) {
this.cbs.onclosetag(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State2.AfterClosingTagName;
this.stateAfterClosingTagName(c);
}
}
stateAfterClosingTagName(c) {
if (c === CharCodes3.Gt || this.fastForwardTo(CharCodes3.Gt)) {
this.state = State2.Text;
this.baseState = State2.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeAttributeName(c) {
if (c === CharCodes3.Gt) {
this.cbs.onopentagend(this.index);
if (this.isSpecial) {
this.state = State2.InSpecialTag;
this.sequenceIndex = 0;
} else {
this.state = State2.Text;
}
this.baseState = this.state;
this.sectionStart = this.index + 1;
} else if (c === CharCodes3.Slash) {
this.state = State2.InSelfClosingTag;
} else if (!isWhitespace3(c)) {
this.state = State2.InAttributeName;
this.sectionStart = this.index;
}
}
stateInSelfClosingTag(c) {
if (c === CharCodes3.Gt) {
this.cbs.onselfclosingtag(this.index);
this.state = State2.Text;
this.baseState = State2.Text;
this.sectionStart = this.index + 1;
this.isSpecial = false;
} else if (!isWhitespace3(c)) {
this.state = State2.BeforeAttributeName;
this.stateBeforeAttributeName(c);
}
}
stateInAttributeName(c) {
if (c === CharCodes3.Eq || isEndOfTagSection(c)) {
this.cbs.onattribname(this.sectionStart, this.index);
this.sectionStart = -1;
this.state = State2.AfterAttributeName;
this.stateAfterAttributeName(c);
}
}
stateAfterAttributeName(c) {
if (c === CharCodes3.Eq) {
this.state = State2.BeforeAttributeValue;
} else if (c === CharCodes3.Slash || c === CharCodes3.Gt) {
this.cbs.onattribend(QuoteType.NoValue, this.index);
this.state = State2.BeforeAttributeName;
this.stateBeforeAttributeName(c);
} else if (!isWhitespace3(c)) {
this.cbs.onattribend(QuoteType.NoValue, this.index);
this.state = State2.InAttributeName;
this.sectionStart = this.index;
}
}
stateBeforeAttributeValue(c) {
if (c === CharCodes3.DoubleQuote) {
this.state = State2.InAttributeValueDq;
this.sectionStart = this.index + 1;
} else if (c === CharCodes3.SingleQuote) {
this.state = State2.InAttributeValueSq;
this.sectionStart = this.index + 1;
} else if (!isWhitespace3(c)) {
this.sectionStart = this.index;
this.state = State2.InAttributeValueNq;
this.stateInAttributeValueNoQuotes(c);
}
}
handleInAttributeValue(c, quote) {
if (c === quote || !this.decodeEntities && this.fastForwardTo(quote)) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(quote === CharCodes3.DoubleQuote ? QuoteType.Double : QuoteType.Single, this.index);
this.state = State2.BeforeAttributeName;
} else if (this.decodeEntities && c === CharCodes3.Amp) {
this.baseState = this.state;
this.state = State2.BeforeEntity;
}
}
stateInAttributeValueDoubleQuotes(c) {
this.handleInAttributeValue(c, CharCodes3.DoubleQuote);
}
stateInAttributeValueSingleQuotes(c) {
this.handleInAttributeValue(c, CharCodes3.SingleQuote);
}
stateInAttributeValueNoQuotes(c) {
if (isWhitespace3(c) || c === CharCodes3.Gt) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = -1;
this.cbs.onattribend(QuoteType.Unquoted, this.index);
this.state = State2.BeforeAttributeName;
this.stateBeforeAttributeName(c);
} else if (this.decodeEntities && c === CharCodes3.Amp) {
this.baseState = this.state;
this.state = State2.BeforeEntity;
}
}
stateBeforeDeclaration(c) {
if (c === CharCodes3.OpeningSquareBracket) {
this.state = State2.CDATASequence;
this.sequenceIndex = 0;
} else {
this.state = c === CharCodes3.Dash ? State2.BeforeComment : State2.InDeclaration;
}
}
stateInDeclaration(c) {
if (c === CharCodes3.Gt || this.fastForwardTo(CharCodes3.Gt)) {
this.cbs.ondeclaration(this.sectionStart, this.index);
this.state = State2.Text;
this.sectionStart = this.index + 1;
}
}
stateInProcessingInstruction(c) {
if (c === CharCodes3.Gt || this.fastForwardTo(CharCodes3.Gt)) {
this.cbs.onprocessinginstruction(this.sectionStart, this.index);
this.state = State2.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeComment(c) {
if (c === CharCodes3.Dash) {
this.state = State2.InCommentLike;
this.currentSequence = Sequences.CommentEnd;
this.sequenceIndex = 2;
this.sectionStart = this.index + 1;
} else {
this.state = State2.InDeclaration;
}
}
stateInSpecialComment(c) {
if (c === CharCodes3.Gt || this.fastForwardTo(CharCodes3.Gt)) {
this.cbs.oncomment(this.sectionStart, this.index, 0);
this.state = State2.Text;
this.sectionStart = this.index + 1;
}
}
stateBeforeSpecialS(c) {
const lower = c | 32;
if (lower === Sequences.ScriptEnd[3]) {
this.startSpecial(Sequences.ScriptEnd, 4);
} else if (lower === Sequences.StyleEnd[3]) {
this.startSpecial(Sequences.StyleEnd, 4);
} else {
this.state = State2.InTagName;
this.stateInTagName(c);
}
}
stateBeforeEntity(c) {
this.entityExcess = 1;
this.entityResult = 0;
if (c === CharCodes3.Number) {
this.state = State2.BeforeNumericEntity;
} else if (c === CharCodes3.Amp) {
} else {
this.trieIndex = 0;
this.trieCurrent = this.entityTrie[0];
this.state = State2.InNamedEntity;
this.stateInNamedEntity(c);
}
}
stateInNamedEntity(c) {
this.entityExcess += 1;
this.trieIndex = determineBranch(this.entityTrie, this.trieCurrent, this.trieIndex + 1, c);
if (this.trieIndex < 0) {
this.emitNamedEntity();
this.index--;
return;
}
this.trieCurrent = this.entityTrie[this.trieIndex];
const masked = this.trieCurrent & BinTrieFlags.VALUE_LENGTH;
if (masked) {
const valueLength = (masked >> 14) - 1;
if (!this.allowLegacyEntity() && c !== CharCodes3.Semi) {
this.trieIndex += valueLength;
} else {
const entityStart = this.index - this.entityExcess + 1;
if (entityStart > this.sectionStart) {
this.emitPartial(this.sectionStart, entityStart);
}
this.entityResult = this.trieIndex;
this.trieIndex += valueLength;
this.entityExcess = 0;
this.sectionStart = this.index + 1;
if (valueLength === 0) {
this.emitNamedEntity();
}
}
}
}
emitNamedEntity() {
this.state = this.baseState;
if (this.entityResult === 0) {
return;
}
const valueLength = (this.entityTrie[this.entityResult] & BinTrieFlags.VALUE_LENGTH) >> 14;
switch (valueLength) {
case 1: {
this.emitCodePoint(this.entityTrie[this.entityResult] & ~BinTrieFlags.VALUE_LENGTH);
break;
}
case 2: {
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
break;
}
case 3: {
this.emitCodePoint(this.entityTrie[this.entityResult + 1]);
this.emitCodePoint(this.entityTrie[this.entityResult + 2]);
}
}
}
stateBeforeNumericEntity(c) {
if ((c | 32) === CharCodes3.LowerX) {
this.entityExcess++;
this.state = State2.InHexEntity;
} else {
this.state = State2.InNumericEntity;
this.stateInNumericEntity(c);
}
}
emitNumericEntity(strict) {
const entityStart = this.index - this.entityExcess - 1;
const numberStart = entityStart + 2 + Number(this.state === State2.InHexEntity);
if (numberStart !== this.index) {
if (entityStart > this.sectionStart) {
this.emitPartial(this.sectionStart, entityStart);
}
this.sectionStart = this.index + Number(strict);
this.emitCodePoint(replaceCodePoint(this.entityResult));
}
this.state = this.baseState;
}
stateInNumericEntity(c) {
if (c === CharCodes3.Semi) {
this.emitNumericEntity(true);
} else if (isNumber4(c)) {
this.entityResult = this.entityResult * 10 + (c - CharCodes3.Zero);
this.entityExcess++;
} else {
if (this.allowLegacyEntity()) {
this.emitNumericEntity(false);
} else {
this.state = this.baseState;
}
this.index--;
}
}
stateInHexEntity(c) {
if (c === CharCodes3.Semi) {
this.emitNumericEntity(true);
} else if (isNumber4(c)) {
this.entityResult = this.entityResult * 16 + (c - CharCodes3.Zero);
this.entityExcess++;
} else if (isHexDigit(c)) {
this.entityResult = this.entityResult * 16 + ((c | 32) - CharCodes3.LowerA + 10);
this.entityExcess++;
} else {
if (this.allowLegacyEntity()) {
this.emitNumericEntity(false);
} else {
this.state = this.baseState;
}
this.index--;
}
}
allowLegacyEntity() {
return !this.xmlMode && (this.baseState === State2.Text || this.baseState === State2.InSpecialTag);
}
cleanup() {
if (this.running && this.sectionStart !== this.index) {
if (this.state === State2.Text || this.state === State2.InSpecialTag && this.sequenceIndex === 0) {
this.cbs.ontext(this.sectionStart, this.index);
this.sectionStart = this.index;
} else if (this.state === State2.InAttributeValueDq || this.state === State2.InAttributeValueSq || this.state === State2.InAttributeValueNq) {
this.cbs.onattribdata(this.sectionStart, this.index);
this.sectionStart = this.index;
}
}
}
shouldContinue() {
return this.index < this.buffer.length + this.offset && this.running;
}
parse() {
while (this.shouldContinue()) {
const c = this.buffer.charCodeAt(this.index - this.offset);
switch (this.state) {
case State2.Text: {
this.stateText(c);
break;
}
case State2.SpecialStartSequence: {
this.stateSpecialStartSequence(c);
break;
}
case State2.InSpecialTag: {
this.stateInSpecialTag(c);
break;
}
case State2.CDATASequence: {
this.stateCDATASequence(c);
break;
}
case State2.InAttributeValueDq: {
this.stateInAttributeValueDoubleQuotes(c);
break;
}
case State2.InAttributeName: {
this.stateInAttributeName(c);
break;
}
case State2.InCommentLike: {
this.stateInCommentLike(c);
break;
}
case State2.InSpecialComment: {
this.stateInSpecialComment(c);
break;
}
case State2.BeforeAttributeName: {
this.stateBeforeAttributeName(c);
break;
}
case State2.InTagName: {
this.stateInTagName(c);
break;
}
case State2.InClosingTagName: {
this.stateInClosingTagName(c);
break;
}
case State2.BeforeTagName: {
this.stateBeforeTagName(c);
break;
}
case State2.AfterAttributeName: {
this.stateAfterAttributeName(c);
break;
}
case State2.InAttributeValueSq: {
this.stateInAttributeValueSingleQuotes(c);
break;
}
case State2.BeforeAttributeValue: {
this.stateBeforeAttributeValue(c);
break;
}
case State2.BeforeClosingTagName: {
this.stateBeforeClosingTagName(c);
break;
}
case State2.AfterClosingTagName: {
this.stateAfterClosingTagName(c);
break;
}
case State2.BeforeSpecialS: {
this.stateBeforeSpecialS(c);
break;
}
case State2.InAttributeValueNq: {
this.stateInAttributeValueNoQuotes(c);
break;
}
case State2.InSelfClosingTag: {
this.stateInSelfClosingTag(c);
break;
}
case State2.InDeclaration: {
this.stateInDeclaration(c);
break;
}
case State2.BeforeDeclaration: {
this.stateBeforeDeclaration(c);
break;
}
case State2.BeforeComment: {
this.stateBeforeComment(c);
break;
}
case State2.InProcessingInstruction: {
this.stateInProcessingInstruction(c);
break;
}
case State2.InNamedEntity: {
this.stateInNamedEntity(c);
break;
}
case State2.BeforeEntity: {
this.stateBeforeEntity(c);
break;
}
case State2.InHexEntity: {
this.stateInHexEntity(c);
break;
}
case State2.InNumericEntity: {
this.stateInNumericEntity(c);
break;
}
default: {
this.stateBeforeNumericEntity(c);
}
}
this.index++;
}
this.cleanup();
}
finish() {
if (this.state === State2.InNamedEntity) {
this.emitNamedEntity();
}
if (this.sectionStart < this.index) {
this.handleTrailingData();
}
this.cbs.onend();
}
handleTrailingData() {
const endIndex = this.buffer.length + this.offset;
if (this.state === State2.InCommentLike) {
if (this.currentSequence === Sequences.CdataEnd) {
this.cbs.oncdata(this.sectionStart, endIndex, 0);
} else {
this.cbs.oncomment(this.sectionStart, endIndex, 0);
}
} else if (this.state === State2.InNumericEntity && this.allowLegacyEntity()) {
this.emitNumericEntity(false);
} else if (this.state === State2.InHexEntity && this.allowLegacyEntity()) {
this.emitNumericEntity(false);
} else if (this.state === State2.InTagName || this.state === State2.BeforeAttributeName || this.state === State2.BeforeAttributeValue || this.state === State2.AfterAttributeName || this.state === State2.InAttributeName || this.state === State2.InAttributeValueSq || this.state === State2.InAttributeValueDq || this.state === State2.InAttributeValueNq || this.state === State2.InClosingTagName) {
} else {
this.cbs.ontext(this.sectionStart, endIndex);
}
}
emitPartial(start, endIndex) {
if (this.baseState !== State2.Text && this.baseState !== State2.InSpecialTag) {
this.cbs.onattribdata(start, endIndex);
} else {
this.cbs.ontext(start, endIndex);
}
}
emitCodePoint(cp) {
if (this.baseState !== State2.Text && this.baseState !== State2.InSpecialTag) {
this.cbs.onattribentity(cp);
} else {
this.cbs.ontextentity(cp);
}
}
};
// ../../node_modules/.pnpm/htmlparser2@8.0.2/node_modules/htmlparser2/lib/esm/Parser.js
var formTags = /* @__PURE__ */ new Set([
"input",
"option",
"optgroup",
"select",
"button",
"datalist",
"textarea"
]);
var pTag = /* @__PURE__ */ new Set(["p"]);
var tableSectionTags = /* @__PURE__ */ new Set(["thead", "tbody"]);
var ddtTags = /* @__PURE__ */ new Set(["dd", "dt"]);
var rtpTags = /* @__PURE__ */ new Set(["rt", "rp"]);
var openImpliesClose = /* @__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", pTag],
["h1", pTag],
["h2", pTag],
["h3", pTag],
["h4", pTag],
["h5", pTag],
["h6", pTag],
["select", formTags],
["input", formTags],
["output", formTags],
["button", formTags],
["datalist", formTags],
["textarea", formTags],
["option", /* @__PURE__ */ new Set(["option"])],
["optgroup", /* @__PURE__ */ new Set(["optgroup", "option"])],
["dd", ddtTags],
["dt", ddtTags],
["address", pTag],
["article", pTag],
["aside", pTag],
["blockquote", pTag],
["details", pTag],
["div", pTag],
["dl", pTag],
["fieldset", pTag],
["figcaption", pTag],
["figure", pTag],
["footer", pTag],
["form", pTag],
["header", pTag],
["hr", pTag],
["main", pTag],
["nav", pTag],
["ol", pTag],
["pre", pTag],
["section", pTag],
["table", pTag],
["ul", pTag],
["rt", rtpTags],
["rp", rtpTags],
["tbody", tableSectionTags],
["tfoot", tableSectionTags]
]);
var voidElements = /* @__PURE__ */ new Set([
"area",
"base",
"basefont",
"br",
"col",
"command",
"embed",
"frame",
"hr",
"img",
"input",
"isindex",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr"
]);
var foreignContextElements = /* @__PURE__ */ new Set(["math", "svg"]);
var htmlIntegrationElements = /* @__PURE__ */ new Set([
"mi",
"mo",
"mn",
"ms",
"mtext",
"annotation-xml",
"foreignobject",
"desc",
"title"
]);
var reNameEnd = /\s|\//;
var Parser2 = class {
constructor(cbs, options = {}) {
var _a3, _b, _c, _d, _e;
this.options = options;
this.startIndex = 0;
this.endIndex = 0;
this.openTagStart = 0;
this.tagname = "";
this.attribname = "";
this.attribvalue = "";
this.attribs = null;
this.stack = [];
this.foreignContext = [];
this.buffers = [];
this.bufferOffset = 0;
this.writeIndex = 0;
this.ended = false;
this.cbs = cbs !== null && cbs !== void 0 ? cbs : {};
this.lowerCaseTagNames = (_a3 = options.lowerCaseTags) !== null && _a3 !== void 0 ? _a3 : !options.xmlMode;
this.lowerCaseAttributeNames = (_b = options.lowerCaseAttributeNames) !== null && _b !== void 0 ? _b : !options.xmlMode;
this.tokenizer = new ((_c = options.Tokenizer) !== null && _c !== void 0 ? _c : Tokenizer2)(this.options, this);
(_e = (_d = this.cbs).onparserinit) === null || _e === void 0 ? void 0 : _e.call(_d, this);
}
ontext(start, endIndex) {
var _a3, _b;
const data2 = this.getSlice(start, endIndex);
this.endIndex = endIndex - 1;
(_b = (_a3 = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a3, data2);
this.startIndex = endIndex;
}
ontextentity(cp) {
var _a3, _b;
const index2 = this.tokenizer.getSectionStart();
this.endIndex = index2 - 1;
(_b = (_a3 = this.cbs).ontext) === null || _b === void 0 ? void 0 : _b.call(_a3, fromCodePoint(cp));
this.startIndex = index2;
}
isVoidElement(name2) {
return !this.options.xmlMode && voidElements.has(name2);
}
onopentagname(start, endIndex) {
this.endIndex = endIndex;
let name2 = this.getSlice(start, endIndex);
if (this.lowerCaseTagNames) {
name2 = name2.toLowerCase();
}
this.emitOpenTag(name2);
}
emitOpenTag(name2) {
var _a3, _b, _c, _d;
this.openTagStart = this.startIndex;
this.tagname = name2;
const impliesClose = !this.options.xmlMode && openImpliesClose.get(name2);
if (impliesClose) {
while (this.stack.length > 0 && impliesClose.has(this.stack[this.stack.length - 1])) {
const element = this.stack.pop();
(_b = (_a3 = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a3, element, true);
}
}
if (!this.isVoidElement(name2)) {
this.stack.push(name2);
if (foreignContextElements.has(name2)) {
this.foreignContext.push(true);
} else if (htmlIntegrationElements.has(name2)) {
this.foreignContext.push(false);
}
}
(_d = (_c = this.cbs).onopentagname) === null || _d === void 0 ? void 0 : _d.call(_c, name2);
if (this.cbs.onopentag)
this.attribs = {};
}
endOpenTag(isImplied) {
var _a3, _b;
this.startIndex = this.openTagStart;
if (this.attribs) {
(_b = (_a3 = this.cbs).onopentag) === null || _b === void 0 ? void 0 : _b.call(_a3, this.tagname, this.attribs, isImplied);
this.attribs = null;
}
if (this.cbs.onclosetag && this.isVoidElement(this.tagname)) {
this.cbs.onclosetag(this.tagname, true);
}
this.tagname = "";
}
onopentagend(endIndex) {
this.endIndex = endIndex;
this.endOpenTag(false);
this.startIndex = endIndex + 1;
}
onclosetag(start, endIndex) {
var _a3, _b, _c, _d, _e, _f;
this.endIndex = endIndex;
let name2 = this.getSlice(start, endIndex);
if (this.lowerCaseTagNames) {
name2 = name2.toLowerCase();
}
if (foreignContextElements.has(name2) || htmlIntegrationElements.has(name2)) {
this.foreignContext.pop();
}
if (!this.isVoidElement(name2)) {
const pos = this.stack.lastIndexOf(name2);
if (pos !== -1) {
if (this.cbs.onclosetag) {
let count = this.stack.length - pos;
while (count--) {
this.cbs.onclosetag(this.stack.pop(), count !== 0);
}
} else
this.stack.length = pos;
} else if (!this.options.xmlMode && name2 === "p") {
this.emitOpenTag("p");
this.closeCurrentTag(true);
}
} else if (!this.options.xmlMode && name2 === "br") {
(_b = (_a3 = this.cbs).onopentagname) === null || _b === void 0 ? void 0 : _b.call(_a3, "br");
(_d = (_c = this.cbs).onopentag) === null || _d === void 0 ? void 0 : _d.call(_c, "br", {}, true);
(_f = (_e = this.cbs).onclosetag) === null || _f === void 0 ? void 0 : _f.call(_e, "br", false);
}
this.startIndex = endIndex + 1;
}
onselfclosingtag(endIndex) {
this.endIndex = endIndex;
if (this.options.xmlMode || this.options.recognizeSelfClosing || this.foreignContext[this.foreignContext.length - 1]) {
this.closeCurrentTag(false);
this.startIndex = endIndex + 1;
} else {
this.onopentagend(endIndex);
}
}
closeCurrentTag(isOpenImplied) {
var _a3, _b;
const name2 = this.tagname;
this.endOpenTag(isOpenImplied);
if (this.stack[this.stack.length - 1] === name2) {
(_b = (_a3 = this.cbs).onclosetag) === null || _b === void 0 ? void 0 : _b.call(_a3, name2, !isOpenImplied);
this.stack.pop();
}
}
onattribname(start, endIndex) {
this.startIndex = start;
const name2 = this.getSlice(start, endIndex);
this.attribname = this.lowerCaseAttributeNames ? name2.toLowerCase() : name2;
}
onattribdata(start, endIndex) {
this.attribvalue += this.getSlice(start, endIndex);
}
onattribentity(cp) {
this.attribvalue += fromCodePoint(cp);
}
onattribend(quote, endIndex) {
var _a3, _b;
this.endIndex = endIndex;
(_b = (_a3 = this.cbs).onattribute) === null || _b === void 0 ? void 0 : _b.call(_a3, this.attribname, this.attribvalue, quote === QuoteType.Double ? '"' : quote === QuoteType.Single ? "'" : quote === QuoteType.NoValue ? void 0 : null);
if (this.attribs && !Object.prototype.hasOwnProperty.call(this.attribs, this.attribname)) {
this.attribs[this.attribname] = this.attribvalue;
}
this.attribvalue = "";
}
getInstructionName(value) {
const index2 = value.search(reNameEnd);
let name2 = index2 < 0 ? value : value.substr(0, index2);
if (this.lowerCaseTagNames) {
name2 = name2.toLowerCase();
}
return name2;
}
ondeclaration(start, endIndex) {
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex);
if (this.cbs.onprocessinginstruction) {
const name2 = this.getInstructionName(value);
this.cbs.onprocessinginstruction(`!${name2}`, `!${value}`);
}
this.startIndex = endIndex + 1;
}
onprocessinginstruction(start, endIndex) {
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex);
if (this.cbs.onprocessinginstruction) {
const name2 = this.getInstructionName(value);
this.cbs.onprocessinginstruction(`?${name2}`, `?${value}`);
}
this.startIndex = endIndex + 1;
}
oncomment(start, endIndex, offset2) {
var _a3, _b, _c, _d;
this.endIndex = endIndex;
(_b = (_a3 = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a3, this.getSlice(start, endIndex - offset2));
(_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
this.startIndex = endIndex + 1;
}
oncdata(start, endIndex, offset2) {
var _a3, _b, _c, _d, _e, _f, _g, _h, _j, _k;
this.endIndex = endIndex;
const value = this.getSlice(start, endIndex - offset2);
if (this.options.xmlMode || this.options.recognizeCDATA) {
(_b = (_a3 = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a3);
(_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
(_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
} else {
(_h = (_g = this.cbs).oncomment) === null || _h === void 0 ? void 0 : _h.call(_g, `[CDATA[${value}]]`);
(_k = (_j = this.cbs).oncommentend) === null || _k === void 0 ? void 0 : _k.call(_j);
}
this.startIndex = endIndex + 1;
}
onend() {
var _a3, _b;
if (this.cbs.onclosetag) {
this.endIndex = this.startIndex;
for (let index2 = this.stack.length; index2 > 0; this.cbs.onclosetag(this.stack[--index2], true))
;
}
(_b = (_a3 = this.cbs).onend) === null || _b === void 0 ? void 0 : _b.call(_a3);
}
reset() {
var _a3, _b, _c, _d;
(_b = (_a3 = this.cbs).onreset) === null || _b === void 0 ? void 0 : _b.call(_a3);
this.tokenizer.reset();
this.tagname = "";
this.attribname = "";
this.attribs = null;
this.stack.length = 0;
this.startIndex = 0;
this.endIndex = 0;
(_d = (_c = this.cbs).onparserinit) === null || _d === void 0 ? void 0 : _d.call(_c, this);
this.buffers.length = 0;
this.bufferOffset = 0;
this.writeIndex = 0;
this.ended = false;
}
parseComplete(data2) {
this.reset();
this.end(data2);
}
getSlice(start, end2) {
while (start - this.bufferOffset >= this.buffers[0].length) {
this.shiftBuffer();
}
let slice2 = this.buffers[0].slice(start - this.bufferOffset, end2 - this.bufferOffset);
while (end2 - this.bufferOffset > this.buffers[0].length) {
this.shiftBuffer();
slice2 += this.buffers[0].slice(0, end2 - this.bufferOffset);
}
return slice2;
}
shiftBuffer() {
this.bufferOffset += this.buffers[0].length;
this.writeIndex--;
this.buffers.shift();
}
write(chunk) {
var _a3, _b;
if (this.ended) {
(_b = (_a3 = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a3, new Error(".write() after done!"));
return;
}
this.buffers.push(chunk);
if (this.tokenizer.running) {
this.tokenizer.write(chunk);
this.writeIndex++;
}
}
end(chunk) {
var _a3, _b;
if (this.ended) {
(_b = (_a3 = this.cbs).onerror) === null || _b === void 0 ? void 0 : _b.call(_a3, new Error(".end() after done!"));
return;
}
if (chunk)
this.write(chunk);
this.ended = true;
this.tokenizer.end();
}
pause() {
this.tokenizer.pause();
}
resume() {
this.tokenizer.resume();
while (this.tokenizer.running && this.writeIndex < this.buffers.length) {
this.tokenizer.write(this.buffers[this.writeIndex++]);
}
if (this.ended)
this.tokenizer.end();
}
parseChunk(chunk) {
this.write(chunk);
}
done(chunk) {
this.end(chunk);
}
};
// ../../node_modules/.pnpm/htmlparser2@8.0.2/node_modules/htmlparser2/lib/esm/index.js
function parseDocument(data2, options) {
const handler = new DomHandler(void 0, options);
new Parser2(handler, options).end(data2);
return handler.root;
}
// ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/index.js
var parse6 = getParse((content, options, isDocument3, context) => options.xmlMode || options._useHtmlParser2 ? parseDocument(content, options) : parseWithParse5(content, options, isDocument3, context));
var load = getLoad(parse6, (dom, options) => options.xmlMode || options._useHtmlParser2 ? esm_default(dom, options) : renderWithParse5(dom));
var esm_default2 = load([]);
var { contains: contains2 } = static_exports;
var { merge: merge2 } = static_exports;
var { parseHTML: parseHTML2 } = static_exports;
var { root: root2 } = static_exports;
// ../../node_modules/.pnpm/markmap-html-parser@0.17.1_markmap-common@0.18.9/node_modules/markmap-html-parser/dist/index.mjs
var defaultSelectorRules = {
"div,p": ({ $node }) => ({
queue: $node.children()
}),
"h1,h2,h3,h4,h5,h6": ({ $node, getContent }) => ({
...getContent($node.contents())
}),
"ul,ol": ({ $node }) => ({
queue: $node.children(),
nesting: true
}),
li: ({ $node, getContent }) => {
const queue = $node.children().filter("ul,ol");
let content;
if ($node.contents().first().is("div,p")) {
content = getContent($node.children().first());
} else {
let $contents = $node.contents();
const i = $contents.index(queue);
if (i >= 0)
$contents = $contents.slice(0, i);
content = getContent($contents);
}
return {
queue,
nesting: true,
...content
};
},
"table,pre,p>img:only-child": ({ $node, getContent }) => ({
...getContent($node)
})
};
var defaultOptions2 = {
selector: "h1,h2,h3,h4,h5,h6,ul,ol,li,table,pre,p>img:only-child",
selectorRules: defaultSelectorRules
};
var MARKMAP_COMMENT_PREFIX = "markmap: ";
var SELECTOR_HEADING = /^h[1-6]$/;
var SELECTOR_LIST = /^[uo]l$/;
var SELECTOR_LIST_ITEM = /^li$/;
function getLevel(tagName) {
if (SELECTOR_HEADING.test(tagName))
return +tagName[1];
if (SELECTOR_LIST.test(tagName))
return 8;
if (SELECTOR_LIST_ITEM.test(tagName))
return 9;
return 7;
}
function parseHtml(html4, opts) {
const options = {
...defaultOptions2,
...opts
};
const $2 = load(html4);
const $root = $2("body");
let id = 0;
const rootNode = {
id,
tag: "",
html: "",
level: 0,
parent: 0,
childrenLevel: 0,
children: []
};
const headingStack = [];
let skippingHeading = 0;
checkNodes($root.children());
return rootNode;
function addChild(props) {
var _a3;
const { parent: parent2 } = props;
const node = {
id: ++id,
tag: props.tagName,
level: props.level,
html: props.html,
childrenLevel: 0,
children: props.nesting ? [] : void 0,
parent: parent2.id
};
if ((_a3 = props.comments) == null ? void 0 : _a3.length) {
node.comments = props.comments;
}
if (Object.keys(props.data || {}).length) {
node.data = props.data;
}
if (parent2.children) {
if (parent2.childrenLevel === 0 || parent2.childrenLevel > node.level) {
parent2.children = [];
parent2.childrenLevel = node.level;
}
if (parent2.childrenLevel === node.level) {
parent2.children.push(node);
}
}
return node;
}
function getCurrentHeading(level) {
let heading2;
while ((heading2 = headingStack.at(-1)) && heading2.level >= level) {
headingStack.pop();
}
return heading2 || rootNode;
}
function getContent($node) {
var _a3;
const result = extractMagicComments($node);
const html22 = (_a3 = $2.html(result.$node)) == null ? void 0 : _a3.trimEnd();
return { comments: result.comments, html: html22 };
}
function extractMagicComments($node) {
const comments = [];
$node = $node.filter((_, child) => {
if (child.type === "comment") {
const data2 = child.data.trim();
if (data2.startsWith(MARKMAP_COMMENT_PREFIX)) {
comments.push(data2.slice(MARKMAP_COMMENT_PREFIX.length).trim());
return false;
}
}
return true;
});
return { $node, comments };
}
function checkNodes($els, node) {
$els.each((_, child) => {
var _a3;
const $child = $2(child);
const rule = (_a3 = Object.entries(options.selectorRules).find(
([selector]) => $child.is(selector)
)) == null ? void 0 : _a3[1];
const result = rule == null ? void 0 : rule({ $node: $child, $: $2, getContent });
if ((result == null ? void 0 : result.queue) && !result.nesting) {
checkNodes(result.queue, node);
return;
}
const level = getLevel(child.tagName);
if (!result) {
if (level <= 6) {
skippingHeading = level;
}
return;
}
if (skippingHeading > 0 && level > skippingHeading)
return;
if (!$child.is(options.selector))
return;
skippingHeading = 0;
const isHeading = level <= 6;
let data2 = $child.data();
if ($child.children("code:only-child").length) {
data2 = {
...data2,
...$child.children().data()
};
}
const childNode = addChild({
parent: node || getCurrentHeading(level),
nesting: !!result.queue || isHeading,
tagName: child.tagName,
level,
html: result.html || "",
comments: result.comments,
data: data2
});
if (isHeading)
headingStack.push(childNode);
if (result.queue)
checkNodes(result.queue, childNode);
});
}
}
function convertNode(htmlRoot) {
return walkTree(htmlRoot, (htmlNode, next2) => {
const node = {
content: htmlNode.html,
children: next2() || []
};
if (htmlNode.data) {
node.payload = {
...htmlNode.data
};
}
if (htmlNode.comments) {
if (htmlNode.comments.includes("foldAll")) {
node.payload = { ...node.payload, fold: 2 };
} else if (htmlNode.comments.includes("fold")) {
node.payload = { ...node.payload, fold: 1 };
}
}
return node;
});
}
function buildTree(html4, opts) {
const htmlRoot = parseHtml(html4, opts);
return convertNode(htmlRoot);
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/utils.mjs
var utils_exports = {};
__export(utils_exports, {
arrayReplaceAt: () => arrayReplaceAt,
assign: () => assign,
escapeHtml: () => escapeHtml,
escapeRE: () => escapeRE,
fromCodePoint: () => fromCodePoint3,
has: () => has2,
isMdAsciiPunct: () => isMdAsciiPunct,
isPunctChar: () => isPunctChar,
isSpace: () => isSpace,
isString: () => isString2,
isValidEntityCode: () => isValidEntityCode,
isWhiteSpace: () => isWhiteSpace,
lib: () => lib,
normalizeReference: () => normalizeReference,
unescapeAll: () => unescapeAll,
unescapeMd: () => unescapeMd
});
// ../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/index.mjs
var mdurl_exports = {};
__export(mdurl_exports, {
decode: () => decode_default,
encode: () => encode_default,
format: () => format,
parse: () => parse_default
});
// ../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/decode.mjs
var decodeCache = {};
function getDecodeCache(exclude) {
let cache = decodeCache[exclude];
if (cache) {
return cache;
}
cache = decodeCache[exclude] = [];
for (let i = 0; i < 128; i++) {
const ch = String.fromCharCode(i);
cache.push(ch);
}
for (let i = 0; i < exclude.length; i++) {
const ch = exclude.charCodeAt(i);
cache[ch] = "%" + ("0" + ch.toString(16).toUpperCase()).slice(-2);
}
return cache;
}
function decode(string2, exclude) {
if (typeof exclude !== "string") {
exclude = decode.defaultChars;
}
const cache = getDecodeCache(exclude);
return string2.replace(/(%[a-f0-9]{2})+/gi, function(seq2) {
let result = "";
for (let i = 0, l2 = seq2.length; i < l2; i += 3) {
const b1 = parseInt(seq2.slice(i + 1, i + 3), 16);
if (b1 < 128) {
result += cache[b1];
continue;
}
if ((b1 & 224) === 192 && i + 3 < l2) {
const b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
if ((b2 & 192) === 128) {
const chr = b1 << 6 & 1984 | b2 & 63;
if (chr < 128) {
result += "\uFFFD\uFFFD";
} else {
result += String.fromCharCode(chr);
}
i += 3;
continue;
}
}
if ((b1 & 240) === 224 && i + 6 < l2) {
const b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
const b3 = parseInt(seq2.slice(i + 7, i + 9), 16);
if ((b2 & 192) === 128 && (b3 & 192) === 128) {
const chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;
if (chr < 2048 || chr >= 55296 && chr <= 57343) {
result += "\uFFFD\uFFFD\uFFFD";
} else {
result += String.fromCharCode(chr);
}
i += 6;
continue;
}
}
if ((b1 & 248) === 240 && i + 9 < l2) {
const b2 = parseInt(seq2.slice(i + 4, i + 6), 16);
const b3 = parseInt(seq2.slice(i + 7, i + 9), 16);
const b4 = parseInt(seq2.slice(i + 10, i + 12), 16);
if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {
let chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;
if (chr < 65536 || chr > 1114111) {
result += "\uFFFD\uFFFD\uFFFD\uFFFD";
} else {
chr -= 65536;
result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));
}
i += 9;
continue;
}
}
result += "\uFFFD";
}
return result;
});
}
decode.defaultChars = ";/?:@&=+$,#";
decode.componentChars = "";
var decode_default = decode;
// ../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/encode.mjs
var encodeCache = {};
function getEncodeCache(exclude) {
let cache = encodeCache[exclude];
if (cache) {
return cache;
}
cache = encodeCache[exclude] = [];
for (let i = 0; i < 128; i++) {
const ch = String.fromCharCode(i);
if (/^[0-9a-z]$/i.test(ch)) {
cache.push(ch);
} else {
cache.push("%" + ("0" + i.toString(16).toUpperCase()).slice(-2));
}
}
for (let i = 0; i < exclude.length; i++) {
cache[exclude.charCodeAt(i)] = exclude[i];
}
return cache;
}
function encode(string2, exclude, keepEscaped) {
if (typeof exclude !== "string") {
keepEscaped = exclude;
exclude = encode.defaultChars;
}
if (typeof keepEscaped === "undefined") {
keepEscaped = true;
}
const cache = getEncodeCache(exclude);
let result = "";
for (let i = 0, l2 = string2.length; i < l2; i++) {
const code2 = string2.charCodeAt(i);
if (keepEscaped && code2 === 37 && i + 2 < l2) {
if (/^[0-9a-f]{2}$/i.test(string2.slice(i + 1, i + 3))) {
result += string2.slice(i, i + 3);
i += 2;
continue;
}
}
if (code2 < 128) {
result += cache[code2];
continue;
}
if (code2 >= 55296 && code2 <= 57343) {
if (code2 >= 55296 && code2 <= 56319 && i + 1 < l2) {
const nextCode = string2.charCodeAt(i + 1);
if (nextCode >= 56320 && nextCode <= 57343) {
result += encodeURIComponent(string2[i] + string2[i + 1]);
i++;
continue;
}
}
result += "%EF%BF%BD";
continue;
}
result += encodeURIComponent(string2[i]);
}
return result;
}
encode.defaultChars = ";/?:@&=+$,-_.!~*'()#";
encode.componentChars = "-_.!~*'()";
var encode_default = encode;
// ../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/format.mjs
function format(url) {
let result = "";
result += url.protocol || "";
result += url.slashes ? "//" : "";
result += url.auth ? url.auth + "@" : "";
if (url.hostname && url.hostname.indexOf(":") !== -1) {
result += "[" + url.hostname + "]";
} else {
result += url.hostname || "";
}
result += url.port ? ":" + url.port : "";
result += url.pathname || "";
result += url.search || "";
result += url.hash || "";
return result;
}
// ../../node_modules/.pnpm/mdurl@2.0.0/node_modules/mdurl/lib/parse.mjs
function Url() {
this.protocol = null;
this.slashes = null;
this.auth = null;
this.port = null;
this.hostname = null;
this.hash = null;
this.search = null;
this.pathname = null;
}
var protocolPattern = /^([a-z0-9.+-]+:)/i;
var portPattern = /:[0-9]*$/;
var simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;
var delims = ["<", ">", '"', "`", " ", "\r", "\n", " "];
var unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims);
var autoEscape = ["'"].concat(unwise);
var nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape);
var hostEndingChars = ["/", "?", "#"];
var hostnameMaxLen = 255;
var hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;
var hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;
var hostlessProtocol = {
javascript: true,
"javascript:": true
};
var slashedProtocol = {
http: true,
https: true,
ftp: true,
gopher: true,
file: true,
"http:": true,
"https:": true,
"ftp:": true,
"gopher:": true,
"file:": true
};
function urlParse(url, slashesDenoteHost) {
if (url && url instanceof Url)
return url;
const u = new Url();
u.parse(url, slashesDenoteHost);
return u;
}
Url.prototype.parse = function(url, slashesDenoteHost) {
let lowerProto, hec, slashes;
let rest = url;
rest = rest.trim();
if (!slashesDenoteHost && url.split("#").length === 1) {
const simplePath = simplePathPattern.exec(rest);
if (simplePath) {
this.pathname = simplePath[1];
if (simplePath[2]) {
this.search = simplePath[2];
}
return this;
}
}
let proto = protocolPattern.exec(rest);
if (proto) {
proto = proto[0];
lowerProto = proto.toLowerCase();
this.protocol = proto;
rest = rest.substr(proto.length);
}
if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
slashes = rest.substr(0, 2) === "//";
if (slashes && !(proto && hostlessProtocol[proto])) {
rest = rest.substr(2);
this.slashes = true;
}
}
if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
let hostEnd = -1;
for (let i = 0; i < hostEndingChars.length; i++) {
hec = rest.indexOf(hostEndingChars[i]);
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
hostEnd = hec;
}
}
let auth, atSign;
if (hostEnd === -1) {
atSign = rest.lastIndexOf("@");
} else {
atSign = rest.lastIndexOf("@", hostEnd);
}
if (atSign !== -1) {
auth = rest.slice(0, atSign);
rest = rest.slice(atSign + 1);
this.auth = auth;
}
hostEnd = -1;
for (let i = 0; i < nonHostChars.length; i++) {
hec = rest.indexOf(nonHostChars[i]);
if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {
hostEnd = hec;
}
}
if (hostEnd === -1) {
hostEnd = rest.length;
}
if (rest[hostEnd - 1] === ":") {
hostEnd--;
}
const host = rest.slice(0, hostEnd);
rest = rest.slice(hostEnd);
this.parseHost(host);
this.hostname = this.hostname || "";
const ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
if (!ipv6Hostname) {
const hostparts = this.hostname.split(/\./);
for (let i = 0, l2 = hostparts.length; i < l2; i++) {
const part = hostparts[i];
if (!part) {
continue;
}
if (!part.match(hostnamePartPattern)) {
let newpart = "";
for (let j = 0, k = part.length; j < k; j++) {
if (part.charCodeAt(j) > 127) {
newpart += "x";
} else {
newpart += part[j];
}
}
if (!newpart.match(hostnamePartPattern)) {
const validParts = hostparts.slice(0, i);
const notHost = hostparts.slice(i + 1);
const bit = part.match(hostnamePartStart);
if (bit) {
validParts.push(bit[1]);
notHost.unshift(bit[2]);
}
if (notHost.length) {
rest = notHost.join(".") + rest;
}
this.hostname = validParts.join(".");
break;
}
}
}
}
if (this.hostname.length > hostnameMaxLen) {
this.hostname = "";
}
if (ipv6Hostname) {
this.hostname = this.hostname.substr(1, this.hostname.length - 2);
}
}
const hash = rest.indexOf("#");
if (hash !== -1) {
this.hash = rest.substr(hash);
rest = rest.slice(0, hash);
}
const qm = rest.indexOf("?");
if (qm !== -1) {
this.search = rest.substr(qm);
rest = rest.slice(0, qm);
}
if (rest) {
this.pathname = rest;
}
if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
this.pathname = "";
}
return this;
};
Url.prototype.parseHost = function(host) {
let port = portPattern.exec(host);
if (port) {
port = port[0];
if (port !== ":") {
this.port = port.substr(1);
}
host = host.substr(0, host.length - port.length);
}
if (host) {
this.hostname = host;
}
};
var parse_default = urlParse;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/index.mjs
var uc_exports = {};
__export(uc_exports, {
Any: () => regex_default,
Cc: () => regex_default2,
Cf: () => regex_default3,
P: () => regex_default4,
S: () => regex_default5,
Z: () => regex_default6
});
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/properties/Any/regex.mjs
var regex_default = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cc/regex.mjs
var regex_default2 = /[\0-\x1F\x7F-\x9F]/;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Cf/regex.mjs
var regex_default3 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/P/regex.mjs
var regex_default4 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/S/regex.mjs
var regex_default5 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;
// ../../node_modules/.pnpm/uc.micro@2.1.0/node_modules/uc.micro/categories/Z/regex.mjs
var regex_default6 = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/utils.mjs
function _class(obj) {
return Object.prototype.toString.call(obj);
}
function isString2(obj) {
return _class(obj) === "[object String]";
}
var _hasOwnProperty = Object.prototype.hasOwnProperty;
function has2(object, key) {
return _hasOwnProperty.call(object, key);
}
function assign(obj) {
const sources = Array.prototype.slice.call(arguments, 1);
sources.forEach(function(source) {
if (!source) {
return;
}
if (typeof source !== "object") {
throw new TypeError(source + "must be object");
}
Object.keys(source).forEach(function(key) {
obj[key] = source[key];
});
});
return obj;
}
function arrayReplaceAt(src, pos, newElements) {
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
}
function isValidEntityCode(c) {
if (c >= 55296 && c <= 57343) {
return false;
}
if (c >= 64976 && c <= 65007) {
return false;
}
if ((c & 65535) === 65535 || (c & 65535) === 65534) {
return false;
}
if (c >= 0 && c <= 8) {
return false;
}
if (c === 11) {
return false;
}
if (c >= 14 && c <= 31) {
return false;
}
if (c >= 127 && c <= 159) {
return false;
}
if (c > 1114111) {
return false;
}
return true;
}
function fromCodePoint3(c) {
if (c > 65535) {
c -= 65536;
const surrogate1 = 55296 + (c >> 10);
const surrogate2 = 56320 + (c & 1023);
return String.fromCharCode(surrogate1, surrogate2);
}
return String.fromCharCode(c);
}
var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
var ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;
var UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + "|" + ENTITY_RE.source, "gi");
var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
function replaceEntityPattern(match3, name2) {
if (name2.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name2)) {
const code2 = name2[1].toLowerCase() === "x" ? parseInt(name2.slice(2), 16) : parseInt(name2.slice(1), 10);
if (isValidEntityCode(code2)) {
return fromCodePoint3(code2);
}
return match3;
}
const decoded = decodeHTML(match3);
if (decoded !== match3) {
return decoded;
}
return match3;
}
function unescapeMd(str) {
if (str.indexOf("\\") < 0) {
return str;
}
return str.replace(UNESCAPE_MD_RE, "$1");
}
function unescapeAll(str) {
if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) {
return str;
}
return str.replace(UNESCAPE_ALL_RE, function(match3, escaped, entity2) {
if (escaped) {
return escaped;
}
return replaceEntityPattern(match3, entity2);
});
}
var HTML_ESCAPE_TEST_RE = /[&<>"]/;
var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
var HTML_REPLACEMENTS = {
"&": "&",
"<": "<",
">": ">",
'"': """
};
function replaceUnsafeChar(ch) {
return HTML_REPLACEMENTS[ch];
}
function escapeHtml(str) {
if (HTML_ESCAPE_TEST_RE.test(str)) {
return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
}
return str;
}
var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
function escapeRE(str) {
return str.replace(REGEXP_ESCAPE_RE, "\\$&");
}
function isSpace(code2) {
switch (code2) {
case 9:
case 32:
return true;
}
return false;
}
function isWhiteSpace(code2) {
if (code2 >= 8192 && code2 <= 8202) {
return true;
}
switch (code2) {
case 9:
case 10:
case 11:
case 12:
case 13:
case 32:
case 160:
case 5760:
case 8239:
case 8287:
case 12288:
return true;
}
return false;
}
function isPunctChar(ch) {
return regex_default4.test(ch) || regex_default5.test(ch);
}
function isMdAsciiPunct(ch) {
switch (ch) {
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 64:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 123:
case 124:
case 125:
case 126:
return true;
default:
return false;
}
}
function normalizeReference(str) {
str = str.trim().replace(/\s+/g, " ");
if ("\u1E9E".toLowerCase() === "\u1E7E") {
str = str.replace(/ẞ/g, "\xDF");
}
return str.toLowerCase().toUpperCase();
}
var lib = { mdurl: mdurl_exports, ucmicro: uc_exports };
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/index.mjs
var helpers_exports = {};
__export(helpers_exports, {
parseLinkDestination: () => parseLinkDestination,
parseLinkLabel: () => parseLinkLabel,
parseLinkTitle: () => parseLinkTitle
});
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_label.mjs
function parseLinkLabel(state, start, disableNested) {
let level, found, marker, prevPos;
const max = state.posMax;
const oldPos = state.pos;
state.pos = start + 1;
level = 1;
while (state.pos < max) {
marker = state.src.charCodeAt(state.pos);
if (marker === 93) {
level--;
if (level === 0) {
found = true;
break;
}
}
prevPos = state.pos;
state.md.inline.skipToken(state);
if (marker === 91) {
if (prevPos === state.pos - 1) {
level++;
} else if (disableNested) {
state.pos = oldPos;
return -1;
}
}
}
let labelEnd = -1;
if (found) {
labelEnd = state.pos;
}
state.pos = oldPos;
return labelEnd;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs
function parseLinkDestination(str, start, max) {
let code2;
let pos = start;
const result = {
ok: false,
pos: 0,
str: ""
};
if (str.charCodeAt(pos) === 60) {
pos++;
while (pos < max) {
code2 = str.charCodeAt(pos);
if (code2 === 10) {
return result;
}
if (code2 === 60) {
return result;
}
if (code2 === 62) {
result.pos = pos + 1;
result.str = unescapeAll(str.slice(start + 1, pos));
result.ok = true;
return result;
}
if (code2 === 92 && pos + 1 < max) {
pos += 2;
continue;
}
pos++;
}
return result;
}
let level = 0;
while (pos < max) {
code2 = str.charCodeAt(pos);
if (code2 === 32) {
break;
}
if (code2 < 32 || code2 === 127) {
break;
}
if (code2 === 92 && pos + 1 < max) {
if (str.charCodeAt(pos + 1) === 32) {
break;
}
pos += 2;
continue;
}
if (code2 === 40) {
level++;
if (level > 32) {
return result;
}
}
if (code2 === 41) {
if (level === 0) {
break;
}
level--;
}
pos++;
}
if (start === pos) {
return result;
}
if (level !== 0) {
return result;
}
result.str = unescapeAll(str.slice(start, pos));
result.pos = pos;
result.ok = true;
return result;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/helpers/parse_link_title.mjs
function parseLinkTitle(str, start, max, prev_state) {
let code2;
let pos = start;
const state = {
ok: false,
can_continue: false,
pos: 0,
str: "",
marker: 0
};
if (prev_state) {
state.str = prev_state.str;
state.marker = prev_state.marker;
} else {
if (pos >= max) {
return state;
}
let marker = str.charCodeAt(pos);
if (marker !== 34 && marker !== 39 && marker !== 40) {
return state;
}
start++;
pos++;
if (marker === 40) {
marker = 41;
}
state.marker = marker;
}
while (pos < max) {
code2 = str.charCodeAt(pos);
if (code2 === state.marker) {
state.pos = pos + 1;
state.str += unescapeAll(str.slice(start, pos));
state.ok = true;
return state;
} else if (code2 === 40 && state.marker === 41) {
return state;
} else if (code2 === 92 && pos + 1 < max) {
pos++;
}
pos++;
}
state.can_continue = true;
state.str += unescapeAll(str.slice(start, pos));
return state;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/renderer.mjs
var default_rules = {};
default_rules.code_inline = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
return "" + escapeHtml(token.content) + "";
};
default_rules.code_block = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
return "" + escapeHtml(tokens[idx].content) + "
\n";
};
default_rules.fence = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
const info = token.info ? unescapeAll(token.info).trim() : "";
let langName = "";
let langAttrs = "";
if (info) {
const arr = info.split(/(\s+)/g);
langName = arr[0];
langAttrs = arr.slice(2).join("");
}
let highlighted;
if (options.highlight) {
highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
} else {
highlighted = escapeHtml(token.content);
}
if (highlighted.indexOf("${highlighted}
`;
}
return `${highlighted}
`;
};
default_rules.image = function(tokens, idx, options, env, slf) {
const token = tokens[idx];
token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
return slf.renderToken(tokens, idx, options);
};
default_rules.hardbreak = function(tokens, idx, options) {
return options.xhtmlOut ? "
\n" : "
\n";
};
default_rules.softbreak = function(tokens, idx, options) {
return options.breaks ? options.xhtmlOut ? "
\n" : "
\n" : "\n";
};
default_rules.text = function(tokens, idx) {
return escapeHtml(tokens[idx].content);
};
default_rules.html_block = function(tokens, idx) {
return tokens[idx].content;
};
default_rules.html_inline = function(tokens, idx) {
return tokens[idx].content;
};
function Renderer() {
this.rules = assign({}, default_rules);
}
Renderer.prototype.renderAttrs = function renderAttrs(token) {
let i, l2, result;
if (!token.attrs) {
return "";
}
result = "";
for (i = 0, l2 = token.attrs.length; i < l2; i++) {
result += " " + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"';
}
return result;
};
Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {
const token = tokens[idx];
let result = "";
if (token.hidden) {
return "";
}
if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {
result += "\n";
}
result += (token.nesting === -1 ? "" : "<") + token.tag;
result += this.renderAttrs(token);
if (token.nesting === 0 && options.xhtmlOut) {
result += " /";
}
let needLf = false;
if (token.block) {
needLf = true;
if (token.nesting === 1) {
if (idx + 1 < tokens.length) {
const nextToken = tokens[idx + 1];
if (nextToken.type === "inline" || nextToken.hidden) {
needLf = false;
} else if (nextToken.nesting === -1 && nextToken.tag === token.tag) {
needLf = false;
}
}
}
}
result += needLf ? ">\n" : ">";
return result;
};
Renderer.prototype.renderInline = function(tokens, options, env) {
let result = "";
const rules = this.rules;
for (let i = 0, len = tokens.length; i < len; i++) {
const type = tokens[i].type;
if (typeof rules[type] !== "undefined") {
result += rules[type](tokens, i, options, env, this);
} else {
result += this.renderToken(tokens, i, options);
}
}
return result;
};
Renderer.prototype.renderInlineAsText = function(tokens, options, env) {
let result = "";
for (let i = 0, len = tokens.length; i < len; i++) {
switch (tokens[i].type) {
case "text":
result += tokens[i].content;
break;
case "image":
result += this.renderInlineAsText(tokens[i].children, options, env);
break;
case "html_inline":
case "html_block":
result += tokens[i].content;
break;
case "softbreak":
case "hardbreak":
result += "\n";
break;
default:
}
}
return result;
};
Renderer.prototype.render = function(tokens, options, env) {
let result = "";
const rules = this.rules;
for (let i = 0, len = tokens.length; i < len; i++) {
const type = tokens[i].type;
if (type === "inline") {
result += this.renderInline(tokens[i].children, options, env);
} else if (typeof rules[type] !== "undefined") {
result += rules[type](tokens, i, options, env, this);
} else {
result += this.renderToken(tokens, i, options, env);
}
}
return result;
};
var renderer_default = Renderer;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/ruler.mjs
function Ruler() {
this.__rules__ = [];
this.__cache__ = null;
}
Ruler.prototype.__find__ = function(name2) {
for (let i = 0; i < this.__rules__.length; i++) {
if (this.__rules__[i].name === name2) {
return i;
}
}
return -1;
};
Ruler.prototype.__compile__ = function() {
const self2 = this;
const chains = [""];
self2.__rules__.forEach(function(rule) {
if (!rule.enabled) {
return;
}
rule.alt.forEach(function(altName) {
if (chains.indexOf(altName) < 0) {
chains.push(altName);
}
});
});
self2.__cache__ = {};
chains.forEach(function(chain) {
self2.__cache__[chain] = [];
self2.__rules__.forEach(function(rule) {
if (!rule.enabled) {
return;
}
if (chain && rule.alt.indexOf(chain) < 0) {
return;
}
self2.__cache__[chain].push(rule.fn);
});
});
};
Ruler.prototype.at = function(name2, fn, options) {
const index2 = this.__find__(name2);
const opt = options || {};
if (index2 === -1) {
throw new Error("Parser rule not found: " + name2);
}
this.__rules__[index2].fn = fn;
this.__rules__[index2].alt = opt.alt || [];
this.__cache__ = null;
};
Ruler.prototype.before = function(beforeName, ruleName, fn, options) {
const index2 = this.__find__(beforeName);
const opt = options || {};
if (index2 === -1) {
throw new Error("Parser rule not found: " + beforeName);
}
this.__rules__.splice(index2, 0, {
name: ruleName,
enabled: true,
fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
Ruler.prototype.after = function(afterName, ruleName, fn, options) {
const index2 = this.__find__(afterName);
const opt = options || {};
if (index2 === -1) {
throw new Error("Parser rule not found: " + afterName);
}
this.__rules__.splice(index2 + 1, 0, {
name: ruleName,
enabled: true,
fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
Ruler.prototype.push = function(ruleName, fn, options) {
const opt = options || {};
this.__rules__.push({
name: ruleName,
enabled: true,
fn,
alt: opt.alt || []
});
this.__cache__ = null;
};
Ruler.prototype.enable = function(list2, ignoreInvalid) {
if (!Array.isArray(list2)) {
list2 = [list2];
}
const result = [];
list2.forEach(function(name2) {
const idx = this.__find__(name2);
if (idx < 0) {
if (ignoreInvalid) {
return;
}
throw new Error("Rules manager: invalid rule name " + name2);
}
this.__rules__[idx].enabled = true;
result.push(name2);
}, this);
this.__cache__ = null;
return result;
};
Ruler.prototype.enableOnly = function(list2, ignoreInvalid) {
if (!Array.isArray(list2)) {
list2 = [list2];
}
this.__rules__.forEach(function(rule) {
rule.enabled = false;
});
this.enable(list2, ignoreInvalid);
};
Ruler.prototype.disable = function(list2, ignoreInvalid) {
if (!Array.isArray(list2)) {
list2 = [list2];
}
const result = [];
list2.forEach(function(name2) {
const idx = this.__find__(name2);
if (idx < 0) {
if (ignoreInvalid) {
return;
}
throw new Error("Rules manager: invalid rule name " + name2);
}
this.__rules__[idx].enabled = false;
result.push(name2);
}, this);
this.__cache__ = null;
return result;
};
Ruler.prototype.getRules = function(chainName) {
if (this.__cache__ === null) {
this.__compile__();
}
return this.__cache__[chainName] || [];
};
var ruler_default = Ruler;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/token.mjs
function Token(type, tag, nesting) {
this.type = type;
this.tag = tag;
this.attrs = null;
this.map = null;
this.nesting = nesting;
this.level = 0;
this.children = null;
this.content = "";
this.markup = "";
this.info = "";
this.meta = null;
this.block = false;
this.hidden = false;
}
Token.prototype.attrIndex = function attrIndex(name2) {
if (!this.attrs) {
return -1;
}
const attrs = this.attrs;
for (let i = 0, len = attrs.length; i < len; i++) {
if (attrs[i][0] === name2) {
return i;
}
}
return -1;
};
Token.prototype.attrPush = function attrPush(attrData) {
if (this.attrs) {
this.attrs.push(attrData);
} else {
this.attrs = [attrData];
}
};
Token.prototype.attrSet = function attrSet(name2, value) {
const idx = this.attrIndex(name2);
const attrData = [name2, value];
if (idx < 0) {
this.attrPush(attrData);
} else {
this.attrs[idx] = attrData;
}
};
Token.prototype.attrGet = function attrGet(name2) {
const idx = this.attrIndex(name2);
let value = null;
if (idx >= 0) {
value = this.attrs[idx][1];
}
return value;
};
Token.prototype.attrJoin = function attrJoin(name2, value) {
const idx = this.attrIndex(name2);
if (idx < 0) {
this.attrPush([name2, value]);
} else {
this.attrs[idx][1] = this.attrs[idx][1] + " " + value;
}
};
var token_default = Token;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/state_core.mjs
function StateCore(src, md, env) {
this.src = src;
this.env = env;
this.tokens = [];
this.inlineMode = false;
this.md = md;
}
StateCore.prototype.Token = token_default;
var state_core_default = StateCore;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/normalize.mjs
var NEWLINES_RE = /\r\n?|\n/g;
var NULL_RE = /\0/g;
function normalize(state) {
let str;
str = state.src.replace(NEWLINES_RE, "\n");
str = str.replace(NULL_RE, "\uFFFD");
state.src = str;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/block.mjs
function block(state) {
let token;
if (state.inlineMode) {
token = new state.Token("inline", "", 0);
token.content = state.src;
token.map = [0, 1];
token.children = [];
state.tokens.push(token);
} else {
state.md.block.parse(state.src, state.md, state.env, state.tokens);
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/inline.mjs
function inline(state) {
const tokens = state.tokens;
for (let i = 0, l2 = tokens.length; i < l2; i++) {
const tok = tokens[i];
if (tok.type === "inline") {
state.md.inline.parse(tok.content, state.md, state.env, tok.children);
}
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/linkify.mjs
function isLinkOpen(str) {
return /^\s]/i.test(str);
}
function isLinkClose(str) {
return /^<\/a\s*>/i.test(str);
}
function linkify(state) {
const blockTokens = state.tokens;
if (!state.md.options.linkify) {
return;
}
for (let j = 0, l2 = blockTokens.length; j < l2; j++) {
if (blockTokens[j].type !== "inline" || !state.md.linkify.pretest(blockTokens[j].content)) {
continue;
}
let tokens = blockTokens[j].children;
let htmlLinkLevel = 0;
for (let i = tokens.length - 1; i >= 0; i--) {
const currentToken = tokens[i];
if (currentToken.type === "link_close") {
i--;
while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") {
i--;
}
continue;
}
if (currentToken.type === "html_inline") {
if (isLinkOpen(currentToken.content) && htmlLinkLevel > 0) {
htmlLinkLevel--;
}
if (isLinkClose(currentToken.content)) {
htmlLinkLevel++;
}
}
if (htmlLinkLevel > 0) {
continue;
}
if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
const text5 = currentToken.content;
let links = state.md.linkify.match(text5);
const nodes = [];
let level = currentToken.level;
let lastPos = 0;
if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === "text_special") {
links = links.slice(1);
}
for (let ln = 0; ln < links.length; ln++) {
const url = links[ln].url;
const fullUrl = state.md.normalizeLink(url);
if (!state.md.validateLink(fullUrl)) {
continue;
}
let urlText = links[ln].text;
if (!links[ln].schema) {
urlText = state.md.normalizeLinkText("http://" + urlText).replace(/^http:\/\//, "");
} else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) {
urlText = state.md.normalizeLinkText("mailto:" + urlText).replace(/^mailto:/, "");
} else {
urlText = state.md.normalizeLinkText(urlText);
}
const pos = links[ln].index;
if (pos > lastPos) {
const token = new state.Token("text", "", 0);
token.content = text5.slice(lastPos, pos);
token.level = level;
nodes.push(token);
}
const token_o = new state.Token("link_open", "a", 1);
token_o.attrs = [["href", fullUrl]];
token_o.level = level++;
token_o.markup = "linkify";
token_o.info = "auto";
nodes.push(token_o);
const token_t = new state.Token("text", "", 0);
token_t.content = urlText;
token_t.level = level;
nodes.push(token_t);
const token_c = new state.Token("link_close", "a", -1);
token_c.level = --level;
token_c.markup = "linkify";
token_c.info = "auto";
nodes.push(token_c);
lastPos = links[ln].lastIndex;
}
if (lastPos < text5.length) {
const token = new state.Token("text", "", 0);
token.content = text5.slice(lastPos);
token.level = level;
nodes.push(token);
}
blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);
}
}
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/replacements.mjs
var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
var SCOPED_ABBR_RE = /\((c|tm|r)\)/ig;
var SCOPED_ABBR = {
c: "\xA9",
r: "\xAE",
tm: "\u2122"
};
function replaceFn(match3, name2) {
return SCOPED_ABBR[name2.toLowerCase()];
}
function replace_scoped(inlineTokens) {
let inside_autolink = 0;
for (let i = inlineTokens.length - 1; i >= 0; i--) {
const token = inlineTokens[i];
if (token.type === "text" && !inside_autolink) {
token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
}
if (token.type === "link_open" && token.info === "auto") {
inside_autolink--;
}
if (token.type === "link_close" && token.info === "auto") {
inside_autolink++;
}
}
}
function replace_rare(inlineTokens) {
let inside_autolink = 0;
for (let i = inlineTokens.length - 1; i >= 0; i--) {
const token = inlineTokens[i];
if (token.type === "text" && !inside_autolink) {
if (RARE_RE.test(token.content)) {
token.content = token.content.replace(/\+-/g, "\xB1").replace(/\.{2,}/g, "\u2026").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1\u2014").replace(/(^|\s)--(?=\s|$)/mg, "$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1\u2013");
}
}
if (token.type === "link_open" && token.info === "auto") {
inside_autolink--;
}
if (token.type === "link_close" && token.info === "auto") {
inside_autolink++;
}
}
}
function replace(state) {
let blkIdx;
if (!state.md.options.typographer) {
return;
}
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
if (state.tokens[blkIdx].type !== "inline") {
continue;
}
if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
replace_scoped(state.tokens[blkIdx].children);
}
if (RARE_RE.test(state.tokens[blkIdx].content)) {
replace_rare(state.tokens[blkIdx].children);
}
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/smartquotes.mjs
var QUOTE_TEST_RE = /['"]/;
var QUOTE_RE = /['"]/g;
var APOSTROPHE = "\u2019";
function replaceAt(str, index2, ch) {
return str.slice(0, index2) + ch + str.slice(index2 + 1);
}
function process_inlines(tokens, state) {
let j;
const stack = [];
for (let i = 0; i < tokens.length; i++) {
const token = tokens[i];
const thisLevel = tokens[i].level;
for (j = stack.length - 1; j >= 0; j--) {
if (stack[j].level <= thisLevel) {
break;
}
}
stack.length = j + 1;
if (token.type !== "text") {
continue;
}
let text5 = token.content;
let pos = 0;
let max = text5.length;
OUTER:
while (pos < max) {
QUOTE_RE.lastIndex = pos;
const t2 = QUOTE_RE.exec(text5);
if (!t2) {
break;
}
let canOpen = true;
let canClose = true;
pos = t2.index + 1;
const isSingle = t2[0] === "'";
let lastChar = 32;
if (t2.index - 1 >= 0) {
lastChar = text5.charCodeAt(t2.index - 1);
} else {
for (j = i - 1; j >= 0; j--) {
if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak")
break;
if (!tokens[j].content)
continue;
lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
break;
}
}
let nextChar = 32;
if (pos < max) {
nextChar = text5.charCodeAt(pos);
} else {
for (j = i + 1; j < tokens.length; j++) {
if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak")
break;
if (!tokens[j].content)
continue;
nextChar = tokens[j].content.charCodeAt(0);
break;
}
}
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
const isLastWhiteSpace = isWhiteSpace(lastChar);
const isNextWhiteSpace = isWhiteSpace(nextChar);
if (isNextWhiteSpace) {
canOpen = false;
} else if (isNextPunctChar) {
if (!(isLastWhiteSpace || isLastPunctChar)) {
canOpen = false;
}
}
if (isLastWhiteSpace) {
canClose = false;
} else if (isLastPunctChar) {
if (!(isNextWhiteSpace || isNextPunctChar)) {
canClose = false;
}
}
if (nextChar === 34 && t2[0] === '"') {
if (lastChar >= 48 && lastChar <= 57) {
canClose = canOpen = false;
}
}
if (canOpen && canClose) {
canOpen = isLastPunctChar;
canClose = isNextPunctChar;
}
if (!canOpen && !canClose) {
if (isSingle) {
token.content = replaceAt(token.content, t2.index, APOSTROPHE);
}
continue;
}
if (canClose) {
for (j = stack.length - 1; j >= 0; j--) {
let item = stack[j];
if (stack[j].level < thisLevel) {
break;
}
if (item.single === isSingle && stack[j].level === thisLevel) {
item = stack[j];
let openQuote;
let closeQuote;
if (isSingle) {
openQuote = state.md.options.quotes[2];
closeQuote = state.md.options.quotes[3];
} else {
openQuote = state.md.options.quotes[0];
closeQuote = state.md.options.quotes[1];
}
token.content = replaceAt(token.content, t2.index, closeQuote);
tokens[item.token].content = replaceAt(
tokens[item.token].content,
item.pos,
openQuote
);
pos += closeQuote.length - 1;
if (item.token === i) {
pos += openQuote.length - 1;
}
text5 = token.content;
max = text5.length;
stack.length = j;
continue OUTER;
}
}
}
if (canOpen) {
stack.push({
token: i,
pos: t2.index,
single: isSingle,
level: thisLevel
});
} else if (canClose && isSingle) {
token.content = replaceAt(token.content, t2.index, APOSTROPHE);
}
}
}
}
function smartquotes(state) {
if (!state.md.options.typographer) {
return;
}
for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
continue;
}
process_inlines(state.tokens[blkIdx].children, state);
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_core/text_join.mjs
function text_join(state) {
let curr, last2;
const blockTokens = state.tokens;
const l2 = blockTokens.length;
for (let j = 0; j < l2; j++) {
if (blockTokens[j].type !== "inline")
continue;
const tokens = blockTokens[j].children;
const max = tokens.length;
for (curr = 0; curr < max; curr++) {
if (tokens[curr].type === "text_special") {
tokens[curr].type = "text";
}
}
for (curr = last2 = 0; curr < max; curr++) {
if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
} else {
if (curr !== last2) {
tokens[last2] = tokens[curr];
}
last2++;
}
}
if (curr !== last2) {
tokens.length = last2;
}
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_core.mjs
var _rules = [
["normalize", normalize],
["block", block],
["inline", inline],
["linkify", linkify],
["replacements", replace],
["smartquotes", smartquotes],
["text_join", text_join]
];
function Core() {
this.ruler = new ruler_default();
for (let i = 0; i < _rules.length; i++) {
this.ruler.push(_rules[i][0], _rules[i][1]);
}
}
Core.prototype.process = function(state) {
const rules = this.ruler.getRules("");
for (let i = 0, l2 = rules.length; i < l2; i++) {
rules[i](state);
}
};
Core.prototype.State = state_core_default;
var parser_core_default = Core;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/state_block.mjs
function StateBlock(src, md, env, tokens) {
this.src = src;
this.md = md;
this.env = env;
this.tokens = tokens;
this.bMarks = [];
this.eMarks = [];
this.tShift = [];
this.sCount = [];
this.bsCount = [];
this.blkIndent = 0;
this.line = 0;
this.lineMax = 0;
this.tight = false;
this.ddIndent = -1;
this.listIndent = -1;
this.parentType = "root";
this.level = 0;
const s2 = this.src;
for (let start = 0, pos = 0, indent = 0, offset2 = 0, len = s2.length, indent_found = false; pos < len; pos++) {
const ch = s2.charCodeAt(pos);
if (!indent_found) {
if (isSpace(ch)) {
indent++;
if (ch === 9) {
offset2 += 4 - offset2 % 4;
} else {
offset2++;
}
continue;
} else {
indent_found = true;
}
}
if (ch === 10 || pos === len - 1) {
if (ch !== 10) {
pos++;
}
this.bMarks.push(start);
this.eMarks.push(pos);
this.tShift.push(indent);
this.sCount.push(offset2);
this.bsCount.push(0);
indent_found = false;
indent = 0;
offset2 = 0;
start = pos + 1;
}
}
this.bMarks.push(s2.length);
this.eMarks.push(s2.length);
this.tShift.push(0);
this.sCount.push(0);
this.bsCount.push(0);
this.lineMax = this.bMarks.length - 1;
}
StateBlock.prototype.push = function(type, tag, nesting) {
const token = new token_default(type, tag, nesting);
token.block = true;
if (nesting < 0)
this.level--;
token.level = this.level;
if (nesting > 0)
this.level++;
this.tokens.push(token);
return token;
};
StateBlock.prototype.isEmpty = function isEmpty(line) {
return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
};
StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {
for (let max = this.lineMax; from < max; from++) {
if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {
break;
}
}
return from;
};
StateBlock.prototype.skipSpaces = function skipSpaces(pos) {
for (let max = this.src.length; pos < max; pos++) {
const ch = this.src.charCodeAt(pos);
if (!isSpace(ch)) {
break;
}
}
return pos;
};
StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {
if (pos <= min) {
return pos;
}
while (pos > min) {
if (!isSpace(this.src.charCodeAt(--pos))) {
return pos + 1;
}
}
return pos;
};
StateBlock.prototype.skipChars = function skipChars(pos, code2) {
for (let max = this.src.length; pos < max; pos++) {
if (this.src.charCodeAt(pos) !== code2) {
break;
}
}
return pos;
};
StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code2, min) {
if (pos <= min) {
return pos;
}
while (pos > min) {
if (code2 !== this.src.charCodeAt(--pos)) {
return pos + 1;
}
}
return pos;
};
StateBlock.prototype.getLines = function getLines(begin, end2, indent, keepLastLF) {
if (begin >= end2) {
return "";
}
const queue = new Array(end2 - begin);
for (let i = 0, line = begin; line < end2; line++, i++) {
let lineIndent = 0;
const lineStart = this.bMarks[line];
let first2 = lineStart;
let last2;
if (line + 1 < end2 || keepLastLF) {
last2 = this.eMarks[line] + 1;
} else {
last2 = this.eMarks[line];
}
while (first2 < last2 && lineIndent < indent) {
const ch = this.src.charCodeAt(first2);
if (isSpace(ch)) {
if (ch === 9) {
lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
} else {
lineIndent++;
}
} else if (first2 - lineStart < this.tShift[line]) {
lineIndent++;
} else {
break;
}
first2++;
}
if (lineIndent > indent) {
queue[i] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first2, last2);
} else {
queue[i] = this.src.slice(first2, last2);
}
}
return queue.join("");
};
StateBlock.prototype.Token = token_default;
var state_block_default = StateBlock;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/table.mjs
var MAX_AUTOCOMPLETED_CELLS = 65536;
function getLine(state, line) {
const pos = state.bMarks[line] + state.tShift[line];
const max = state.eMarks[line];
return state.src.slice(pos, max);
}
function escapedSplit(str) {
const result = [];
const max = str.length;
let pos = 0;
let ch = str.charCodeAt(pos);
let isEscaped = false;
let lastPos = 0;
let current = "";
while (pos < max) {
if (ch === 124) {
if (!isEscaped) {
result.push(current + str.substring(lastPos, pos));
current = "";
lastPos = pos + 1;
} else {
current += str.substring(lastPos, pos - 1);
lastPos = pos;
}
}
isEscaped = ch === 92;
pos++;
ch = str.charCodeAt(pos);
}
result.push(current + str.substring(lastPos));
return result;
}
function table(state, startLine, endLine, silent) {
if (startLine + 2 > endLine) {
return false;
}
let nextLine = startLine + 1;
if (state.sCount[nextLine] < state.blkIndent) {
return false;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
return false;
}
let pos = state.bMarks[nextLine] + state.tShift[nextLine];
if (pos >= state.eMarks[nextLine]) {
return false;
}
const firstCh = state.src.charCodeAt(pos++);
if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) {
return false;
}
if (pos >= state.eMarks[nextLine]) {
return false;
}
const secondCh = state.src.charCodeAt(pos++);
if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) {
return false;
}
if (firstCh === 45 && isSpace(secondCh)) {
return false;
}
while (pos < state.eMarks[nextLine]) {
const ch = state.src.charCodeAt(pos);
if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) {
return false;
}
pos++;
}
let lineText = getLine(state, startLine + 1);
let columns = lineText.split("|");
const aligns = [];
for (let i = 0; i < columns.length; i++) {
const t2 = columns[i].trim();
if (!t2) {
if (i === 0 || i === columns.length - 1) {
continue;
} else {
return false;
}
}
if (!/^:?-+:?$/.test(t2)) {
return false;
}
if (t2.charCodeAt(t2.length - 1) === 58) {
aligns.push(t2.charCodeAt(0) === 58 ? "center" : "right");
} else if (t2.charCodeAt(0) === 58) {
aligns.push("left");
} else {
aligns.push("");
}
}
lineText = getLine(state, startLine).trim();
if (lineText.indexOf("|") === -1) {
return false;
}
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
columns = escapedSplit(lineText);
if (columns.length && columns[0] === "")
columns.shift();
if (columns.length && columns[columns.length - 1] === "")
columns.pop();
const columnCount = columns.length;
if (columnCount === 0 || columnCount !== aligns.length) {
return false;
}
if (silent) {
return true;
}
const oldParentType = state.parentType;
state.parentType = "table";
const terminatorRules = state.md.block.ruler.getRules("blockquote");
const token_to = state.push("table_open", "table", 1);
const tableLines = [startLine, 0];
token_to.map = tableLines;
const token_tho = state.push("thead_open", "thead", 1);
token_tho.map = [startLine, startLine + 1];
const token_htro = state.push("tr_open", "tr", 1);
token_htro.map = [startLine, startLine + 1];
for (let i = 0; i < columns.length; i++) {
const token_ho = state.push("th_open", "th", 1);
if (aligns[i]) {
token_ho.attrs = [["style", "text-align:" + aligns[i]]];
}
const token_il = state.push("inline", "", 0);
token_il.content = columns[i].trim();
token_il.children = [];
state.push("th_close", "th", -1);
}
state.push("tr_close", "tr", -1);
state.push("thead_close", "thead", -1);
let tbodyLines;
let autocompletedCells = 0;
for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
if (state.sCount[nextLine] < state.blkIndent) {
break;
}
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
break;
}
lineText = getLine(state, nextLine).trim();
if (!lineText) {
break;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
break;
}
columns = escapedSplit(lineText);
if (columns.length && columns[0] === "")
columns.shift();
if (columns.length && columns[columns.length - 1] === "")
columns.pop();
autocompletedCells += columnCount - columns.length;
if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) {
break;
}
if (nextLine === startLine + 2) {
const token_tbo = state.push("tbody_open", "tbody", 1);
token_tbo.map = tbodyLines = [startLine + 2, 0];
}
const token_tro = state.push("tr_open", "tr", 1);
token_tro.map = [nextLine, nextLine + 1];
for (let i = 0; i < columnCount; i++) {
const token_tdo = state.push("td_open", "td", 1);
if (aligns[i]) {
token_tdo.attrs = [["style", "text-align:" + aligns[i]]];
}
const token_il = state.push("inline", "", 0);
token_il.content = columns[i] ? columns[i].trim() : "";
token_il.children = [];
state.push("td_close", "td", -1);
}
state.push("tr_close", "tr", -1);
}
if (tbodyLines) {
state.push("tbody_close", "tbody", -1);
tbodyLines[1] = nextLine;
}
state.push("table_close", "table", -1);
tableLines[1] = nextLine;
state.parentType = oldParentType;
state.line = nextLine;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/code.mjs
function code(state, startLine, endLine) {
if (state.sCount[startLine] - state.blkIndent < 4) {
return false;
}
let nextLine = startLine + 1;
let last2 = nextLine;
while (nextLine < endLine) {
if (state.isEmpty(nextLine)) {
nextLine++;
continue;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
nextLine++;
last2 = nextLine;
continue;
}
break;
}
state.line = last2;
const token = state.push("code_block", "code", 0);
token.content = state.getLines(startLine, last2, 4 + state.blkIndent, false) + "\n";
token.map = [startLine, state.line];
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/fence.mjs
function fence(state, startLine, endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
if (pos + 3 > max) {
return false;
}
const marker = state.src.charCodeAt(pos);
if (marker !== 126 && marker !== 96) {
return false;
}
let mem = pos;
pos = state.skipChars(pos, marker);
let len = pos - mem;
if (len < 3) {
return false;
}
const markup = state.src.slice(mem, pos);
const params = state.src.slice(pos, max);
if (marker === 96) {
if (params.indexOf(String.fromCharCode(marker)) >= 0) {
return false;
}
}
if (silent) {
return true;
}
let nextLine = startLine;
let haveEndMarker = false;
for (; ; ) {
nextLine++;
if (nextLine >= endLine) {
break;
}
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
break;
}
if (state.src.charCodeAt(pos) !== marker) {
continue;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
continue;
}
pos = state.skipChars(pos, marker);
if (pos - mem < len) {
continue;
}
pos = state.skipSpaces(pos);
if (pos < max) {
continue;
}
haveEndMarker = true;
break;
}
len = state.sCount[startLine];
state.line = nextLine + (haveEndMarker ? 1 : 0);
const token = state.push("fence", "code", 0);
token.info = params;
token.content = state.getLines(startLine + 1, nextLine, len, true);
token.markup = markup;
token.map = [startLine, state.line];
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/blockquote.mjs
function blockquote(state, startLine, endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
const oldLineMax = state.lineMax;
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
if (state.src.charCodeAt(pos) !== 62) {
return false;
}
if (silent) {
return true;
}
const oldBMarks = [];
const oldBSCount = [];
const oldSCount = [];
const oldTShift = [];
const terminatorRules = state.md.block.ruler.getRules("blockquote");
const oldParentType = state.parentType;
state.parentType = "blockquote";
let lastLineEmpty = false;
let nextLine;
for (nextLine = startLine; nextLine < endLine; nextLine++) {
const isOutdented = state.sCount[nextLine] < state.blkIndent;
pos = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
if (pos >= max) {
break;
}
if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
let initial = state.sCount[nextLine] + 1;
let spaceAfterMarker;
let adjustTab;
if (state.src.charCodeAt(pos) === 32) {
pos++;
initial++;
adjustTab = false;
spaceAfterMarker = true;
} else if (state.src.charCodeAt(pos) === 9) {
spaceAfterMarker = true;
if ((state.bsCount[nextLine] + initial) % 4 === 3) {
pos++;
initial++;
adjustTab = false;
} else {
adjustTab = true;
}
} else {
spaceAfterMarker = false;
}
let offset2 = initial;
oldBMarks.push(state.bMarks[nextLine]);
state.bMarks[nextLine] = pos;
while (pos < max) {
const ch = state.src.charCodeAt(pos);
if (isSpace(ch)) {
if (ch === 9) {
offset2 += 4 - (offset2 + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
} else {
offset2++;
}
} else {
break;
}
pos++;
}
lastLineEmpty = pos >= max;
oldBSCount.push(state.bsCount[nextLine]);
state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] = offset2 - initial;
oldTShift.push(state.tShift[nextLine]);
state.tShift[nextLine] = pos - state.bMarks[nextLine];
continue;
}
if (lastLineEmpty) {
break;
}
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
state.lineMax = nextLine;
if (state.blkIndent !== 0) {
oldBMarks.push(state.bMarks[nextLine]);
oldBSCount.push(state.bsCount[nextLine]);
oldTShift.push(state.tShift[nextLine]);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] -= state.blkIndent;
}
break;
}
oldBMarks.push(state.bMarks[nextLine]);
oldBSCount.push(state.bsCount[nextLine]);
oldTShift.push(state.tShift[nextLine]);
oldSCount.push(state.sCount[nextLine]);
state.sCount[nextLine] = -1;
}
const oldIndent = state.blkIndent;
state.blkIndent = 0;
const token_o = state.push("blockquote_open", "blockquote", 1);
token_o.markup = ">";
const lines = [startLine, 0];
token_o.map = lines;
state.md.block.tokenize(state, startLine, nextLine);
const token_c = state.push("blockquote_close", "blockquote", -1);
token_c.markup = ">";
state.lineMax = oldLineMax;
state.parentType = oldParentType;
lines[1] = state.line;
for (let i = 0; i < oldTShift.length; i++) {
state.bMarks[i + startLine] = oldBMarks[i];
state.tShift[i + startLine] = oldTShift[i];
state.sCount[i + startLine] = oldSCount[i];
state.bsCount[i + startLine] = oldBSCount[i];
}
state.blkIndent = oldIndent;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/hr.mjs
function hr(state, startLine, endLine, silent) {
const max = state.eMarks[startLine];
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
let pos = state.bMarks[startLine] + state.tShift[startLine];
const marker = state.src.charCodeAt(pos++);
if (marker !== 42 && marker !== 45 && marker !== 95) {
return false;
}
let cnt = 1;
while (pos < max) {
const ch = state.src.charCodeAt(pos++);
if (ch !== marker && !isSpace(ch)) {
return false;
}
if (ch === marker) {
cnt++;
}
}
if (cnt < 3) {
return false;
}
if (silent) {
return true;
}
state.line = startLine + 1;
const token = state.push("hr", "hr", 0);
token.map = [startLine, state.line];
token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/list.mjs
function skipBulletListMarker(state, startLine) {
const max = state.eMarks[startLine];
let pos = state.bMarks[startLine] + state.tShift[startLine];
const marker = state.src.charCodeAt(pos++);
if (marker !== 42 && marker !== 45 && marker !== 43) {
return -1;
}
if (pos < max) {
const ch = state.src.charCodeAt(pos);
if (!isSpace(ch)) {
return -1;
}
}
return pos;
}
function skipOrderedListMarker(state, startLine) {
const start = state.bMarks[startLine] + state.tShift[startLine];
const max = state.eMarks[startLine];
let pos = start;
if (pos + 1 >= max) {
return -1;
}
let ch = state.src.charCodeAt(pos++);
if (ch < 48 || ch > 57) {
return -1;
}
for (; ; ) {
if (pos >= max) {
return -1;
}
ch = state.src.charCodeAt(pos++);
if (ch >= 48 && ch <= 57) {
if (pos - start >= 10) {
return -1;
}
continue;
}
if (ch === 41 || ch === 46) {
break;
}
return -1;
}
if (pos < max) {
ch = state.src.charCodeAt(pos);
if (!isSpace(ch)) {
return -1;
}
}
return pos;
}
function markTightParagraphs(state, idx) {
const level = state.level + 2;
for (let i = idx + 2, l2 = state.tokens.length - 2; i < l2; i++) {
if (state.tokens[i].level === level && state.tokens[i].type === "paragraph_open") {
state.tokens[i + 2].hidden = true;
state.tokens[i].hidden = true;
i += 2;
}
}
}
function list(state, startLine, endLine, silent) {
let max, pos, start, token;
let nextLine = startLine;
let tight = true;
if (state.sCount[nextLine] - state.blkIndent >= 4) {
return false;
}
if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {
return false;
}
let isTerminatingParagraph = false;
if (silent && state.parentType === "paragraph") {
if (state.sCount[nextLine] >= state.blkIndent) {
isTerminatingParagraph = true;
}
}
let isOrdered;
let markerValue;
let posAfterMarker;
if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
isOrdered = true;
start = state.bMarks[nextLine] + state.tShift[nextLine];
markerValue = Number(state.src.slice(start, posAfterMarker - 1));
if (isTerminatingParagraph && markerValue !== 1)
return false;
} else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {
isOrdered = false;
} else {
return false;
}
if (isTerminatingParagraph) {
if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine])
return false;
}
if (silent) {
return true;
}
const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
const listTokIdx = state.tokens.length;
if (isOrdered) {
token = state.push("ordered_list_open", "ol", 1);
if (markerValue !== 1) {
token.attrs = [["start", markerValue]];
}
} else {
token = state.push("bullet_list_open", "ul", 1);
}
const listLines = [nextLine, 0];
token.map = listLines;
token.markup = String.fromCharCode(markerCharCode);
let prevEmptyEnd = false;
const terminatorRules = state.md.block.ruler.getRules("list");
const oldParentType = state.parentType;
state.parentType = "list";
while (nextLine < endLine) {
pos = posAfterMarker;
max = state.eMarks[nextLine];
const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
let offset2 = initial;
while (pos < max) {
const ch = state.src.charCodeAt(pos);
if (ch === 9) {
offset2 += 4 - (offset2 + state.bsCount[nextLine]) % 4;
} else if (ch === 32) {
offset2++;
} else {
break;
}
pos++;
}
const contentStart = pos;
let indentAfterMarker;
if (contentStart >= max) {
indentAfterMarker = 1;
} else {
indentAfterMarker = offset2 - initial;
}
if (indentAfterMarker > 4) {
indentAfterMarker = 1;
}
const indent = initial + indentAfterMarker;
token = state.push("list_item_open", "li", 1);
token.markup = String.fromCharCode(markerCharCode);
const itemLines = [nextLine, 0];
token.map = itemLines;
if (isOrdered) {
token.info = state.src.slice(start, posAfterMarker - 1);
}
const oldTight = state.tight;
const oldTShift = state.tShift[nextLine];
const oldSCount = state.sCount[nextLine];
const oldListIndent = state.listIndent;
state.listIndent = state.blkIndent;
state.blkIndent = indent;
state.tight = true;
state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
state.sCount[nextLine] = offset2;
if (contentStart >= max && state.isEmpty(nextLine + 1)) {
state.line = Math.min(state.line + 2, endLine);
} else {
state.md.block.tokenize(state, nextLine, endLine, true);
}
if (!state.tight || prevEmptyEnd) {
tight = false;
}
prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
state.blkIndent = state.listIndent;
state.listIndent = oldListIndent;
state.tShift[nextLine] = oldTShift;
state.sCount[nextLine] = oldSCount;
state.tight = oldTight;
token = state.push("list_item_close", "li", -1);
token.markup = String.fromCharCode(markerCharCode);
nextLine = state.line;
itemLines[1] = nextLine;
if (nextLine >= endLine) {
break;
}
if (state.sCount[nextLine] < state.blkIndent) {
break;
}
if (state.sCount[nextLine] - state.blkIndent >= 4) {
break;
}
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
break;
}
if (isOrdered) {
posAfterMarker = skipOrderedListMarker(state, nextLine);
if (posAfterMarker < 0) {
break;
}
start = state.bMarks[nextLine] + state.tShift[nextLine];
} else {
posAfterMarker = skipBulletListMarker(state, nextLine);
if (posAfterMarker < 0) {
break;
}
}
if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {
break;
}
}
if (isOrdered) {
token = state.push("ordered_list_close", "ol", -1);
} else {
token = state.push("bullet_list_close", "ul", -1);
}
token.markup = String.fromCharCode(markerCharCode);
listLines[1] = nextLine;
state.line = nextLine;
state.parentType = oldParentType;
if (tight) {
markTightParagraphs(state, listTokIdx);
}
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/reference.mjs
function reference(state, startLine, _endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
let nextLine = startLine + 1;
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
if (state.src.charCodeAt(pos) !== 91) {
return false;
}
function getNextLine(nextLine2) {
const endLine = state.lineMax;
if (nextLine2 >= endLine || state.isEmpty(nextLine2)) {
return null;
}
let isContinuation = false;
if (state.sCount[nextLine2] - state.blkIndent > 3) {
isContinuation = true;
}
if (state.sCount[nextLine2] < 0) {
isContinuation = true;
}
if (!isContinuation) {
const terminatorRules = state.md.block.ruler.getRules("reference");
const oldParentType = state.parentType;
state.parentType = "reference";
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine2, endLine, true)) {
terminate = true;
break;
}
}
state.parentType = oldParentType;
if (terminate) {
return null;
}
}
const pos2 = state.bMarks[nextLine2] + state.tShift[nextLine2];
const max2 = state.eMarks[nextLine2];
return state.src.slice(pos2, max2 + 1);
}
let str = state.src.slice(pos, max + 1);
max = str.length;
let labelEnd = -1;
for (pos = 1; pos < max; pos++) {
const ch = str.charCodeAt(pos);
if (ch === 91) {
return false;
} else if (ch === 93) {
labelEnd = pos;
break;
} else if (ch === 10) {
const lineContent = getNextLine(nextLine);
if (lineContent !== null) {
str += lineContent;
max = str.length;
nextLine++;
}
} else if (ch === 92) {
pos++;
if (pos < max && str.charCodeAt(pos) === 10) {
const lineContent = getNextLine(nextLine);
if (lineContent !== null) {
str += lineContent;
max = str.length;
nextLine++;
}
}
}
}
if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) {
return false;
}
for (pos = labelEnd + 2; pos < max; pos++) {
const ch = str.charCodeAt(pos);
if (ch === 10) {
const lineContent = getNextLine(nextLine);
if (lineContent !== null) {
str += lineContent;
max = str.length;
nextLine++;
}
} else if (isSpace(ch)) {
} else {
break;
}
}
const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
if (!destRes.ok) {
return false;
}
const href = state.md.normalizeLink(destRes.str);
if (!state.md.validateLink(href)) {
return false;
}
pos = destRes.pos;
const destEndPos = pos;
const destEndLineNo = nextLine;
const start = pos;
for (; pos < max; pos++) {
const ch = str.charCodeAt(pos);
if (ch === 10) {
const lineContent = getNextLine(nextLine);
if (lineContent !== null) {
str += lineContent;
max = str.length;
nextLine++;
}
} else if (isSpace(ch)) {
} else {
break;
}
}
let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
while (titleRes.can_continue) {
const lineContent = getNextLine(nextLine);
if (lineContent === null)
break;
str += lineContent;
pos = max;
max = str.length;
nextLine++;
titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
}
let title;
if (pos < max && start !== pos && titleRes.ok) {
title = titleRes.str;
pos = titleRes.pos;
} else {
title = "";
pos = destEndPos;
nextLine = destEndLineNo;
}
while (pos < max) {
const ch = str.charCodeAt(pos);
if (!isSpace(ch)) {
break;
}
pos++;
}
if (pos < max && str.charCodeAt(pos) !== 10) {
if (title) {
title = "";
pos = destEndPos;
nextLine = destEndLineNo;
while (pos < max) {
const ch = str.charCodeAt(pos);
if (!isSpace(ch)) {
break;
}
pos++;
}
}
}
if (pos < max && str.charCodeAt(pos) !== 10) {
return false;
}
const label = normalizeReference(str.slice(1, labelEnd));
if (!label) {
return false;
}
if (silent) {
return true;
}
if (typeof state.env.references === "undefined") {
state.env.references = {};
}
if (typeof state.env.references[label] === "undefined") {
state.env.references[label] = { title, href };
}
state.line = nextLine;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_blocks.mjs
var html_blocks_default = [
"address",
"article",
"aside",
"base",
"basefont",
"blockquote",
"body",
"caption",
"center",
"col",
"colgroup",
"dd",
"details",
"dialog",
"dir",
"div",
"dl",
"dt",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"frame",
"frameset",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hr",
"html",
"iframe",
"legend",
"li",
"link",
"main",
"menu",
"menuitem",
"nav",
"noframes",
"ol",
"optgroup",
"option",
"p",
"param",
"search",
"section",
"summary",
"table",
"tbody",
"td",
"tfoot",
"th",
"thead",
"title",
"tr",
"track",
"ul"
];
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/common/html_re.mjs
var attr_name = "[a-zA-Z_:][a-zA-Z0-9:._-]*";
var unquoted = "[^\"'=<>`\\x00-\\x20]+";
var single_quoted = "'[^']*'";
var double_quoted = '"[^"]*"';
var attr_value = "(?:" + unquoted + "|" + single_quoted + "|" + double_quoted + ")";
var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
var comment = "";
var processing = "<[?][\\s\\S]*?[?]>";
var declaration = "]*>";
var cdata = "";
var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment + "|" + processing + "|" + declaration + "|" + cdata + ")");
var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/html_block.mjs
var HTML_SEQUENCES = [
[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true],
[/^/, true],
[/^<\?/, /\?>/, true],
[/^/, true],
[/^/, true],
[new RegExp("^?(" + html_blocks_default.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, true],
[new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + "\\s*$"), /^$/, false]
];
function html_block(state, startLine, endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
if (!state.md.options.html) {
return false;
}
if (state.src.charCodeAt(pos) !== 60) {
return false;
}
let lineText = state.src.slice(pos, max);
let i = 0;
for (; i < HTML_SEQUENCES.length; i++) {
if (HTML_SEQUENCES[i][0].test(lineText)) {
break;
}
}
if (i === HTML_SEQUENCES.length) {
return false;
}
if (silent) {
return HTML_SEQUENCES[i][2];
}
let nextLine = startLine + 1;
if (!HTML_SEQUENCES[i][1].test(lineText)) {
for (; nextLine < endLine; nextLine++) {
if (state.sCount[nextLine] < state.blkIndent) {
break;
}
pos = state.bMarks[nextLine] + state.tShift[nextLine];
max = state.eMarks[nextLine];
lineText = state.src.slice(pos, max);
if (HTML_SEQUENCES[i][1].test(lineText)) {
if (lineText.length !== 0) {
nextLine++;
}
break;
}
}
}
state.line = nextLine;
const token = state.push("html_block", "", 0);
token.map = [startLine, nextLine];
token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/heading.mjs
function heading(state, startLine, endLine, silent) {
let pos = state.bMarks[startLine] + state.tShift[startLine];
let max = state.eMarks[startLine];
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
let ch = state.src.charCodeAt(pos);
if (ch !== 35 || pos >= max) {
return false;
}
let level = 1;
ch = state.src.charCodeAt(++pos);
while (ch === 35 && pos < max && level <= 6) {
level++;
ch = state.src.charCodeAt(++pos);
}
if (level > 6 || pos < max && !isSpace(ch)) {
return false;
}
if (silent) {
return true;
}
max = state.skipSpacesBack(max, pos);
const tmp = state.skipCharsBack(max, 35, pos);
if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {
max = tmp;
}
state.line = startLine + 1;
const token_o = state.push("heading_open", "h" + String(level), 1);
token_o.markup = "########".slice(0, level);
token_o.map = [startLine, state.line];
const token_i = state.push("inline", "", 0);
token_i.content = state.src.slice(pos, max).trim();
token_i.map = [startLine, state.line];
token_i.children = [];
const token_c = state.push("heading_close", "h" + String(level), -1);
token_c.markup = "########".slice(0, level);
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/lheading.mjs
function lheading(state, startLine, endLine) {
const terminatorRules = state.md.block.ruler.getRules("paragraph");
if (state.sCount[startLine] - state.blkIndent >= 4) {
return false;
}
const oldParentType = state.parentType;
state.parentType = "paragraph";
let level = 0;
let marker;
let nextLine = startLine + 1;
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
if (state.sCount[nextLine] - state.blkIndent > 3) {
continue;
}
if (state.sCount[nextLine] >= state.blkIndent) {
let pos = state.bMarks[nextLine] + state.tShift[nextLine];
const max = state.eMarks[nextLine];
if (pos < max) {
marker = state.src.charCodeAt(pos);
if (marker === 45 || marker === 61) {
pos = state.skipChars(pos, marker);
pos = state.skipSpaces(pos);
if (pos >= max) {
level = marker === 61 ? 1 : 2;
break;
}
}
}
}
if (state.sCount[nextLine] < 0) {
continue;
}
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
break;
}
}
if (!level) {
return false;
}
const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
state.line = nextLine + 1;
const token_o = state.push("heading_open", "h" + String(level), 1);
token_o.markup = String.fromCharCode(marker);
token_o.map = [startLine, state.line];
const token_i = state.push("inline", "", 0);
token_i.content = content;
token_i.map = [startLine, state.line - 1];
token_i.children = [];
const token_c = state.push("heading_close", "h" + String(level), -1);
token_c.markup = String.fromCharCode(marker);
state.parentType = oldParentType;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_block/paragraph.mjs
function paragraph(state, startLine, endLine) {
const terminatorRules = state.md.block.ruler.getRules("paragraph");
const oldParentType = state.parentType;
let nextLine = startLine + 1;
state.parentType = "paragraph";
for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
if (state.sCount[nextLine] - state.blkIndent > 3) {
continue;
}
if (state.sCount[nextLine] < 0) {
continue;
}
let terminate = false;
for (let i = 0, l2 = terminatorRules.length; i < l2; i++) {
if (terminatorRules[i](state, nextLine, endLine, true)) {
terminate = true;
break;
}
}
if (terminate) {
break;
}
}
const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();
state.line = nextLine;
const token_o = state.push("paragraph_open", "p", 1);
token_o.map = [startLine, state.line];
const token_i = state.push("inline", "", 0);
token_i.content = content;
token_i.map = [startLine, state.line];
token_i.children = [];
state.push("paragraph_close", "p", -1);
state.parentType = oldParentType;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_block.mjs
var _rules2 = [
["table", table, ["paragraph", "reference"]],
["code", code],
["fence", fence, ["paragraph", "reference", "blockquote", "list"]],
["blockquote", blockquote, ["paragraph", "reference", "blockquote", "list"]],
["hr", hr, ["paragraph", "reference", "blockquote", "list"]],
["list", list, ["paragraph", "reference", "blockquote"]],
["reference", reference],
["html_block", html_block, ["paragraph", "reference", "blockquote"]],
["heading", heading, ["paragraph", "reference", "blockquote"]],
["lheading", lheading],
["paragraph", paragraph]
];
function ParserBlock() {
this.ruler = new ruler_default();
for (let i = 0; i < _rules2.length; i++) {
this.ruler.push(_rules2[i][0], _rules2[i][1], { alt: (_rules2[i][2] || []).slice() });
}
}
ParserBlock.prototype.tokenize = function(state, startLine, endLine) {
const rules = this.ruler.getRules("");
const len = rules.length;
const maxNesting = state.md.options.maxNesting;
let line = startLine;
let hasEmptyLines = false;
while (line < endLine) {
state.line = line = state.skipEmptyLines(line);
if (line >= endLine) {
break;
}
if (state.sCount[line] < state.blkIndent) {
break;
}
if (state.level >= maxNesting) {
state.line = endLine;
break;
}
const prevLine = state.line;
let ok = false;
for (let i = 0; i < len; i++) {
ok = rules[i](state, line, endLine, false);
if (ok) {
if (prevLine >= state.line) {
throw new Error("block rule didn't increment state.line");
}
break;
}
}
if (!ok)
throw new Error("none of the block rules matched");
state.tight = !hasEmptyLines;
if (state.isEmpty(state.line - 1)) {
hasEmptyLines = true;
}
line = state.line;
if (line < endLine && state.isEmpty(line)) {
hasEmptyLines = true;
line++;
state.line = line;
}
}
};
ParserBlock.prototype.parse = function(src, md, env, outTokens) {
if (!src) {
return;
}
const state = new this.State(src, md, env, outTokens);
this.tokenize(state, state.line, state.lineMax);
};
ParserBlock.prototype.State = state_block_default;
var parser_block_default = ParserBlock;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/state_inline.mjs
function StateInline(src, md, env, outTokens) {
this.src = src;
this.env = env;
this.md = md;
this.tokens = outTokens;
this.tokens_meta = Array(outTokens.length);
this.pos = 0;
this.posMax = this.src.length;
this.level = 0;
this.pending = "";
this.pendingLevel = 0;
this.cache = {};
this.delimiters = [];
this._prev_delimiters = [];
this.backticks = {};
this.backticksScanned = false;
this.linkLevel = 0;
}
StateInline.prototype.pushPending = function() {
const token = new token_default("text", "", 0);
token.content = this.pending;
token.level = this.pendingLevel;
this.tokens.push(token);
this.pending = "";
return token;
};
StateInline.prototype.push = function(type, tag, nesting) {
if (this.pending) {
this.pushPending();
}
const token = new token_default(type, tag, nesting);
let token_meta = null;
if (nesting < 0) {
this.level--;
this.delimiters = this._prev_delimiters.pop();
}
token.level = this.level;
if (nesting > 0) {
this.level++;
this._prev_delimiters.push(this.delimiters);
this.delimiters = [];
token_meta = { delimiters: this.delimiters };
}
this.pendingLevel = this.level;
this.tokens.push(token);
this.tokens_meta.push(token_meta);
return token;
};
StateInline.prototype.scanDelims = function(start, canSplitWord) {
const max = this.posMax;
const marker = this.src.charCodeAt(start);
const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;
let pos = start;
while (pos < max && this.src.charCodeAt(pos) === marker) {
pos++;
}
const count = pos - start;
const nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));
const isLastWhiteSpace = isWhiteSpace(lastChar);
const isNextWhiteSpace = isWhiteSpace(nextChar);
const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);
const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);
const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);
return { can_open, can_close, length: count };
};
StateInline.prototype.Token = token_default;
var state_inline_default = StateInline;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/text.mjs
function isTerminatorChar(ch) {
switch (ch) {
case 10:
case 33:
case 35:
case 36:
case 37:
case 38:
case 42:
case 43:
case 45:
case 58:
case 60:
case 61:
case 62:
case 64:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 123:
case 125:
case 126:
return true;
default:
return false;
}
}
function text4(state, silent) {
let pos = state.pos;
while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {
pos++;
}
if (pos === state.pos) {
return false;
}
if (!silent) {
state.pending += state.src.slice(state.pos, pos);
}
state.pos = pos;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/linkify.mjs
var SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
function linkify2(state, silent) {
if (!state.md.options.linkify)
return false;
if (state.linkLevel > 0)
return false;
const pos = state.pos;
const max = state.posMax;
if (pos + 3 > max)
return false;
if (state.src.charCodeAt(pos) !== 58)
return false;
if (state.src.charCodeAt(pos + 1) !== 47)
return false;
if (state.src.charCodeAt(pos + 2) !== 47)
return false;
const match3 = state.pending.match(SCHEME_RE);
if (!match3)
return false;
const proto = match3[1];
const link2 = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length));
if (!link2)
return false;
let url = link2.url;
if (url.length <= proto.length)
return false;
url = url.replace(/\*+$/, "");
const fullUrl = state.md.normalizeLink(url);
if (!state.md.validateLink(fullUrl))
return false;
if (!silent) {
state.pending = state.pending.slice(0, -proto.length);
const token_o = state.push("link_open", "a", 1);
token_o.attrs = [["href", fullUrl]];
token_o.markup = "linkify";
token_o.info = "auto";
const token_t = state.push("text", "", 0);
token_t.content = state.md.normalizeLinkText(url);
const token_c = state.push("link_close", "a", -1);
token_c.markup = "linkify";
token_c.info = "auto";
}
state.pos += url.length - proto.length;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/newline.mjs
function newline(state, silent) {
let pos = state.pos;
if (state.src.charCodeAt(pos) !== 10) {
return false;
}
const pmax = state.pending.length - 1;
const max = state.posMax;
if (!silent) {
if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {
if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
let ws = pmax - 1;
while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32)
ws--;
state.pending = state.pending.slice(0, ws);
state.push("hardbreak", "br", 0);
} else {
state.pending = state.pending.slice(0, -1);
state.push("softbreak", "br", 0);
}
} else {
state.push("softbreak", "br", 0);
}
}
pos++;
while (pos < max && isSpace(state.src.charCodeAt(pos))) {
pos++;
}
state.pos = pos;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/escape.mjs
var ESCAPED = [];
for (let i = 0; i < 256; i++) {
ESCAPED.push(0);
}
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
ESCAPED[ch.charCodeAt(0)] = 1;
});
function escape2(state, silent) {
let pos = state.pos;
const max = state.posMax;
if (state.src.charCodeAt(pos) !== 92)
return false;
pos++;
if (pos >= max)
return false;
let ch1 = state.src.charCodeAt(pos);
if (ch1 === 10) {
if (!silent) {
state.push("hardbreak", "br", 0);
}
pos++;
while (pos < max) {
ch1 = state.src.charCodeAt(pos);
if (!isSpace(ch1))
break;
pos++;
}
state.pos = pos;
return true;
}
let escapedStr = state.src[pos];
if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
const ch2 = state.src.charCodeAt(pos + 1);
if (ch2 >= 56320 && ch2 <= 57343) {
escapedStr += state.src[pos + 1];
pos++;
}
}
const origStr = "\\" + escapedStr;
if (!silent) {
const token = state.push("text_special", "", 0);
if (ch1 < 256 && ESCAPED[ch1] !== 0) {
token.content = escapedStr;
} else {
token.content = origStr;
}
token.markup = origStr;
token.info = "escape";
}
state.pos = pos + 1;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/backticks.mjs
function backtick(state, silent) {
let pos = state.pos;
const ch = state.src.charCodeAt(pos);
if (ch !== 96) {
return false;
}
const start = pos;
pos++;
const max = state.posMax;
while (pos < max && state.src.charCodeAt(pos) === 96) {
pos++;
}
const marker = state.src.slice(start, pos);
const openerLength = marker.length;
if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
if (!silent)
state.pending += marker;
state.pos += openerLength;
return true;
}
let matchEnd = pos;
let matchStart;
while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1) {
matchEnd = matchStart + 1;
while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96) {
matchEnd++;
}
const closerLength = matchEnd - matchStart;
if (closerLength === openerLength) {
if (!silent) {
const token = state.push("code_inline", "code", 0);
token.markup = marker;
token.content = state.src.slice(pos, matchStart).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
}
state.pos = matchEnd;
return true;
}
state.backticks[closerLength] = matchStart;
}
state.backticksScanned = true;
if (!silent)
state.pending += marker;
state.pos += openerLength;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs
function strikethrough_tokenize(state, silent) {
const start = state.pos;
const marker = state.src.charCodeAt(start);
if (silent) {
return false;
}
if (marker !== 126) {
return false;
}
const scanned = state.scanDelims(state.pos, true);
let len = scanned.length;
const ch = String.fromCharCode(marker);
if (len < 2) {
return false;
}
let token;
if (len % 2) {
token = state.push("text", "", 0);
token.content = ch;
len--;
}
for (let i = 0; i < len; i += 2) {
token = state.push("text", "", 0);
token.content = ch + ch;
state.delimiters.push({
marker,
length: 0,
token: state.tokens.length - 1,
end: -1,
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
}
function postProcess(state, delimiters) {
let token;
const loneMarkers = [];
const max = delimiters.length;
for (let i = 0; i < max; i++) {
const startDelim = delimiters[i];
if (startDelim.marker !== 126) {
continue;
}
if (startDelim.end === -1) {
continue;
}
const endDelim = delimiters[startDelim.end];
token = state.tokens[startDelim.token];
token.type = "s_open";
token.tag = "s";
token.nesting = 1;
token.markup = "~~";
token.content = "";
token = state.tokens[endDelim.token];
token.type = "s_close";
token.tag = "s";
token.nesting = -1;
token.markup = "~~";
token.content = "";
if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") {
loneMarkers.push(endDelim.token - 1);
}
}
while (loneMarkers.length) {
const i = loneMarkers.pop();
let j = i + 1;
while (j < state.tokens.length && state.tokens[j].type === "s_close") {
j++;
}
j--;
if (i !== j) {
token = state.tokens[j];
state.tokens[j] = state.tokens[i];
state.tokens[i] = token;
}
}
}
function strikethrough_postProcess(state) {
const tokens_meta = state.tokens_meta;
const max = state.tokens_meta.length;
postProcess(state, state.delimiters);
for (let curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess(state, tokens_meta[curr].delimiters);
}
}
}
var strikethrough_default = {
tokenize: strikethrough_tokenize,
postProcess: strikethrough_postProcess
};
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/emphasis.mjs
function emphasis_tokenize(state, silent) {
const start = state.pos;
const marker = state.src.charCodeAt(start);
if (silent) {
return false;
}
if (marker !== 95 && marker !== 42) {
return false;
}
const scanned = state.scanDelims(state.pos, marker === 42);
for (let i = 0; i < scanned.length; i++) {
const token = state.push("text", "", 0);
token.content = String.fromCharCode(marker);
state.delimiters.push({
marker,
length: scanned.length,
token: state.tokens.length - 1,
end: -1,
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
}
function postProcess2(state, delimiters) {
const max = delimiters.length;
for (let i = max - 1; i >= 0; i--) {
const startDelim = delimiters[i];
if (startDelim.marker !== 95 && startDelim.marker !== 42) {
continue;
}
if (startDelim.end === -1) {
continue;
}
const endDelim = delimiters[startDelim.end];
const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1;
const ch = String.fromCharCode(startDelim.marker);
const token_o = state.tokens[startDelim.token];
token_o.type = isStrong ? "strong_open" : "em_open";
token_o.tag = isStrong ? "strong" : "em";
token_o.nesting = 1;
token_o.markup = isStrong ? ch + ch : ch;
token_o.content = "";
const token_c = state.tokens[endDelim.token];
token_c.type = isStrong ? "strong_close" : "em_close";
token_c.tag = isStrong ? "strong" : "em";
token_c.nesting = -1;
token_c.markup = isStrong ? ch + ch : ch;
token_c.content = "";
if (isStrong) {
state.tokens[delimiters[i - 1].token].content = "";
state.tokens[delimiters[startDelim.end + 1].token].content = "";
i--;
}
}
}
function emphasis_post_process(state) {
const tokens_meta = state.tokens_meta;
const max = state.tokens_meta.length;
postProcess2(state, state.delimiters);
for (let curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess2(state, tokens_meta[curr].delimiters);
}
}
}
var emphasis_default = {
tokenize: emphasis_tokenize,
postProcess: emphasis_post_process
};
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/link.mjs
function link(state, silent) {
let code2, label, res, ref;
let href = "";
let title = "";
let start = state.pos;
let parseReference = true;
if (state.src.charCodeAt(state.pos) !== 91) {
return false;
}
const oldPos = state.pos;
const max = state.posMax;
const labelStart = state.pos + 1;
const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
if (labelEnd < 0) {
return false;
}
let pos = labelEnd + 1;
if (pos < max && state.src.charCodeAt(pos) === 40) {
parseReference = false;
pos++;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
if (pos >= max) {
return false;
}
start = pos;
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
if (res.ok) {
href = state.md.normalizeLink(res.str);
if (state.md.validateLink(href)) {
pos = res.pos;
} else {
href = "";
}
start = pos;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
if (pos < max && start !== pos && res.ok) {
title = res.str;
pos = res.pos;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
}
}
if (pos >= max || state.src.charCodeAt(pos) !== 41) {
parseReference = true;
}
pos++;
}
if (parseReference) {
if (typeof state.env.references === "undefined") {
return false;
}
if (pos < max && state.src.charCodeAt(pos) === 91) {
start = pos + 1;
pos = state.md.helpers.parseLinkLabel(state, pos);
if (pos >= 0) {
label = state.src.slice(start, pos++);
} else {
pos = labelEnd + 1;
}
} else {
pos = labelEnd + 1;
}
if (!label) {
label = state.src.slice(labelStart, labelEnd);
}
ref = state.env.references[normalizeReference(label)];
if (!ref) {
state.pos = oldPos;
return false;
}
href = ref.href;
title = ref.title;
}
if (!silent) {
state.pos = labelStart;
state.posMax = labelEnd;
const token_o = state.push("link_open", "a", 1);
const attrs = [["href", href]];
token_o.attrs = attrs;
if (title) {
attrs.push(["title", title]);
}
state.linkLevel++;
state.md.inline.tokenize(state);
state.linkLevel--;
state.push("link_close", "a", -1);
}
state.pos = pos;
state.posMax = max;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/image.mjs
function image(state, silent) {
let code2, content, label, pos, ref, res, title, start;
let href = "";
const oldPos = state.pos;
const max = state.posMax;
if (state.src.charCodeAt(state.pos) !== 33) {
return false;
}
if (state.src.charCodeAt(state.pos + 1) !== 91) {
return false;
}
const labelStart = state.pos + 2;
const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
if (labelEnd < 0) {
return false;
}
pos = labelEnd + 1;
if (pos < max && state.src.charCodeAt(pos) === 40) {
pos++;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
if (pos >= max) {
return false;
}
start = pos;
res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
if (res.ok) {
href = state.md.normalizeLink(res.str);
if (state.md.validateLink(href)) {
pos = res.pos;
} else {
href = "";
}
}
start = pos;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
if (pos < max && start !== pos && res.ok) {
title = res.str;
pos = res.pos;
for (; pos < max; pos++) {
code2 = state.src.charCodeAt(pos);
if (!isSpace(code2) && code2 !== 10) {
break;
}
}
} else {
title = "";
}
if (pos >= max || state.src.charCodeAt(pos) !== 41) {
state.pos = oldPos;
return false;
}
pos++;
} else {
if (typeof state.env.references === "undefined") {
return false;
}
if (pos < max && state.src.charCodeAt(pos) === 91) {
start = pos + 1;
pos = state.md.helpers.parseLinkLabel(state, pos);
if (pos >= 0) {
label = state.src.slice(start, pos++);
} else {
pos = labelEnd + 1;
}
} else {
pos = labelEnd + 1;
}
if (!label) {
label = state.src.slice(labelStart, labelEnd);
}
ref = state.env.references[normalizeReference(label)];
if (!ref) {
state.pos = oldPos;
return false;
}
href = ref.href;
title = ref.title;
}
if (!silent) {
content = state.src.slice(labelStart, labelEnd);
const tokens = [];
state.md.inline.parse(
content,
state.md,
state.env,
tokens
);
const token = state.push("image", "img", 0);
const attrs = [["src", href], ["alt", ""]];
token.attrs = attrs;
token.children = tokens;
token.content = content;
if (title) {
attrs.push(["title", title]);
}
}
state.pos = pos;
state.posMax = max;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/autolink.mjs
var EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;
var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
function autolink(state, silent) {
let pos = state.pos;
if (state.src.charCodeAt(pos) !== 60) {
return false;
}
const start = state.pos;
const max = state.posMax;
for (; ; ) {
if (++pos >= max)
return false;
const ch = state.src.charCodeAt(pos);
if (ch === 60)
return false;
if (ch === 62)
break;
}
const url = state.src.slice(start + 1, pos);
if (AUTOLINK_RE.test(url)) {
const fullUrl = state.md.normalizeLink(url);
if (!state.md.validateLink(fullUrl)) {
return false;
}
if (!silent) {
const token_o = state.push("link_open", "a", 1);
token_o.attrs = [["href", fullUrl]];
token_o.markup = "autolink";
token_o.info = "auto";
const token_t = state.push("text", "", 0);
token_t.content = state.md.normalizeLinkText(url);
const token_c = state.push("link_close", "a", -1);
token_c.markup = "autolink";
token_c.info = "auto";
}
state.pos += url.length + 2;
return true;
}
if (EMAIL_RE.test(url)) {
const fullUrl = state.md.normalizeLink("mailto:" + url);
if (!state.md.validateLink(fullUrl)) {
return false;
}
if (!silent) {
const token_o = state.push("link_open", "a", 1);
token_o.attrs = [["href", fullUrl]];
token_o.markup = "autolink";
token_o.info = "auto";
const token_t = state.push("text", "", 0);
token_t.content = state.md.normalizeLinkText(url);
const token_c = state.push("link_close", "a", -1);
token_c.markup = "autolink";
token_c.info = "auto";
}
state.pos += url.length + 2;
return true;
}
return false;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/html_inline.mjs
function isLinkOpen2(str) {
return /^\s]/i.test(str);
}
function isLinkClose2(str) {
return /^<\/a\s*>/i.test(str);
}
function isLetter(ch) {
const lc = ch | 32;
return lc >= 97 && lc <= 122;
}
function html_inline(state, silent) {
if (!state.md.options.html) {
return false;
}
const max = state.posMax;
const pos = state.pos;
if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) {
return false;
}
const ch = state.src.charCodeAt(pos + 1);
if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) {
return false;
}
const match3 = state.src.slice(pos).match(HTML_TAG_RE);
if (!match3) {
return false;
}
if (!silent) {
const token = state.push("html_inline", "", 0);
token.content = match3[0];
if (isLinkOpen2(token.content))
state.linkLevel++;
if (isLinkClose2(token.content))
state.linkLevel--;
}
state.pos += match3[0].length;
return true;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/entity.mjs
var DIGITAL_RE = /^((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
function entity(state, silent) {
const pos = state.pos;
const max = state.posMax;
if (state.src.charCodeAt(pos) !== 38)
return false;
if (pos + 1 >= max)
return false;
const ch = state.src.charCodeAt(pos + 1);
if (ch === 35) {
const match3 = state.src.slice(pos).match(DIGITAL_RE);
if (match3) {
if (!silent) {
const code2 = match3[1][0].toLowerCase() === "x" ? parseInt(match3[1].slice(1), 16) : parseInt(match3[1], 10);
const token = state.push("text_special", "", 0);
token.content = isValidEntityCode(code2) ? fromCodePoint3(code2) : fromCodePoint3(65533);
token.markup = match3[0];
token.info = "entity";
}
state.pos += match3[0].length;
return true;
}
} else {
const match3 = state.src.slice(pos).match(NAMED_RE);
if (match3) {
const decoded = decodeHTML(match3[0]);
if (decoded !== match3[0]) {
if (!silent) {
const token = state.push("text_special", "", 0);
token.content = decoded;
token.markup = match3[0];
token.info = "entity";
}
state.pos += match3[0].length;
return true;
}
}
}
return false;
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs
function processDelimiters(delimiters) {
const openersBottom = {};
const max = delimiters.length;
if (!max)
return;
let headerIdx = 0;
let lastTokenIdx = -2;
const jumps = [];
for (let closerIdx = 0; closerIdx < max; closerIdx++) {
const closer = delimiters[closerIdx];
jumps.push(0);
if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
headerIdx = closerIdx;
}
lastTokenIdx = closer.token;
closer.length = closer.length || 0;
if (!closer.close)
continue;
if (!openersBottom.hasOwnProperty(closer.marker)) {
openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1];
}
const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
let openerIdx = headerIdx - jumps[headerIdx] - 1;
let newMinOpenerIdx = openerIdx;
for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
const opener = delimiters[openerIdx];
if (opener.marker !== closer.marker)
continue;
if (opener.open && opener.end < 0) {
let isOddMatch = false;
if (opener.close || closer.open) {
if ((opener.length + closer.length) % 3 === 0) {
if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
isOddMatch = true;
}
}
}
if (!isOddMatch) {
const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
jumps[closerIdx] = closerIdx - openerIdx + lastJump;
jumps[openerIdx] = lastJump;
closer.open = false;
opener.end = closerIdx;
opener.close = false;
newMinOpenerIdx = -1;
lastTokenIdx = -2;
break;
}
}
}
if (newMinOpenerIdx !== -1) {
openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
}
}
}
function link_pairs(state) {
const tokens_meta = state.tokens_meta;
const max = state.tokens_meta.length;
processDelimiters(state.delimiters);
for (let curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
processDelimiters(tokens_meta[curr].delimiters);
}
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs
function fragments_join(state) {
let curr, last2;
let level = 0;
const tokens = state.tokens;
const max = state.tokens.length;
for (curr = last2 = 0; curr < max; curr++) {
if (tokens[curr].nesting < 0)
level--;
tokens[curr].level = level;
if (tokens[curr].nesting > 0)
level++;
if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") {
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
} else {
if (curr !== last2) {
tokens[last2] = tokens[curr];
}
last2++;
}
}
if (curr !== last2) {
tokens.length = last2;
}
}
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/parser_inline.mjs
var _rules3 = [
["text", text4],
["linkify", linkify2],
["newline", newline],
["escape", escape2],
["backticks", backtick],
["strikethrough", strikethrough_default.tokenize],
["emphasis", emphasis_default.tokenize],
["link", link],
["image", image],
["autolink", autolink],
["html_inline", html_inline],
["entity", entity]
];
var _rules22 = [
["balance_pairs", link_pairs],
["strikethrough", strikethrough_default.postProcess],
["emphasis", emphasis_default.postProcess],
["fragments_join", fragments_join]
];
function ParserInline() {
this.ruler = new ruler_default();
for (let i = 0; i < _rules3.length; i++) {
this.ruler.push(_rules3[i][0], _rules3[i][1]);
}
this.ruler2 = new ruler_default();
for (let i = 0; i < _rules22.length; i++) {
this.ruler2.push(_rules22[i][0], _rules22[i][1]);
}
}
ParserInline.prototype.skipToken = function(state) {
const pos = state.pos;
const rules = this.ruler.getRules("");
const len = rules.length;
const maxNesting = state.md.options.maxNesting;
const cache = state.cache;
if (typeof cache[pos] !== "undefined") {
state.pos = cache[pos];
return;
}
let ok = false;
if (state.level < maxNesting) {
for (let i = 0; i < len; i++) {
state.level++;
ok = rules[i](state, true);
state.level--;
if (ok) {
if (pos >= state.pos) {
throw new Error("inline rule didn't increment state.pos");
}
break;
}
}
} else {
state.pos = state.posMax;
}
if (!ok) {
state.pos++;
}
cache[pos] = state.pos;
};
ParserInline.prototype.tokenize = function(state) {
const rules = this.ruler.getRules("");
const len = rules.length;
const end2 = state.posMax;
const maxNesting = state.md.options.maxNesting;
while (state.pos < end2) {
const prevPos = state.pos;
let ok = false;
if (state.level < maxNesting) {
for (let i = 0; i < len; i++) {
ok = rules[i](state, false);
if (ok) {
if (prevPos >= state.pos) {
throw new Error("inline rule didn't increment state.pos");
}
break;
}
}
}
if (ok) {
if (state.pos >= end2) {
break;
}
continue;
}
state.pending += state.src[state.pos++];
}
if (state.pending) {
state.pushPending();
}
};
ParserInline.prototype.parse = function(str, md, env, outTokens) {
const state = new this.State(str, md, env, outTokens);
this.tokenize(state);
const rules = this.ruler2.getRules("");
const len = rules.length;
for (let i = 0; i < len; i++) {
rules[i](state);
}
};
ParserInline.prototype.State = state_inline_default;
var parser_inline_default = ParserInline;
// ../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/lib/re.mjs
function re_default(opts) {
const re = {};
opts = opts || {};
re.src_Any = regex_default.source;
re.src_Cc = regex_default2.source;
re.src_Z = regex_default6.source;
re.src_P = regex_default4.source;
re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join("|");
re.src_ZCc = [re.src_Z, re.src_Cc].join("|");
const text_separators = "[><\uFF5C]";
re.src_pseudo_letter = "(?:(?!" + text_separators + "|" + re.src_ZPCc + ")" + re.src_Any + ")";
re.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";
re.src_auth = "(?:(?:(?!" + re.src_ZCc + "|[@/\\[\\]()]).)+@)?";
re.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?";
re.src_host_terminator = "(?=$|" + text_separators + "|" + re.src_ZPCc + ")(?!" + (opts["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + re.src_ZPCc + "))";
re.src_path = "(?:[/?#](?:(?!" + re.src_ZCc + "|" + text_separators + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + re.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + re.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + re.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + re.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + re.src_ZCc + "|[']).)+\\'|\\'(?=" + re.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + re.src_ZCc + "|[.]|$)|" + (opts["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + ",(?!" + re.src_ZCc + "|$)|;(?!" + re.src_ZCc + "|$)|\\!+(?!" + re.src_ZCc + "|[!]|$)|\\?(?!" + re.src_ZCc + "|[?]|$))+|\\/)?";
re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*';
re.src_xn = "xn--[a-z0-9\\-]{1,59}";
re.src_domain_root = "(?:" + re.src_xn + "|" + re.src_pseudo_letter + "{1,63})";
re.src_domain = "(?:" + re.src_xn + "|(?:" + re.src_pseudo_letter + ")|(?:" + re.src_pseudo_letter + "(?:-|" + re.src_pseudo_letter + "){0,61}" + re.src_pseudo_letter + "))";
re.src_host = "(?:(?:(?:(?:" + re.src_domain + ")\\.)*" + re.src_domain + "))";
re.tpl_host_fuzzy = "(?:" + re.src_ip4 + "|(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%)))";
re.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + re.src_domain + ")\\.)+(?:%TLDS%))";
re.src_host_strict = re.src_host + re.src_host_terminator;
re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;
re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;
re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;
re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;
re.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + re.src_ZPCc + "|>|$))";
re.tpl_email_fuzzy = "(^|" + text_separators + '|"|\\(|' + re.src_ZCc + ")(" + re.src_email_name + "@" + re.tpl_host_fuzzy_strict + ")";
re.tpl_link_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_fuzzy_strict + re.src_path + ")";
re.tpl_link_no_ip_fuzzy = "(^|(?![.:/\\-_@])(?:[$+<=>^`|\uFF5C]|" + re.src_ZPCc + "))((?![$+<=>^`|\uFF5C])" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ")";
return re;
}
// ../../node_modules/.pnpm/linkify-it@5.0.0/node_modules/linkify-it/index.mjs
function assign2(obj) {
const sources = Array.prototype.slice.call(arguments, 1);
sources.forEach(function(source) {
if (!source) {
return;
}
Object.keys(source).forEach(function(key) {
obj[key] = source[key];
});
});
return obj;
}
function _class2(obj) {
return Object.prototype.toString.call(obj);
}
function isString3(obj) {
return _class2(obj) === "[object String]";
}
function isObject(obj) {
return _class2(obj) === "[object Object]";
}
function isRegExp(obj) {
return _class2(obj) === "[object RegExp]";
}
function isFunction(obj) {
return _class2(obj) === "[object Function]";
}
function escapeRE2(str) {
return str.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
}
var defaultOptions3 = {
fuzzyLink: true,
fuzzyEmail: true,
fuzzyIP: false
};
function isOptionsObj(obj) {
return Object.keys(obj || {}).reduce(function(acc, k) {
return acc || defaultOptions3.hasOwnProperty(k);
}, false);
}
var defaultSchemas = {
"http:": {
validate: function(text5, pos, self2) {
const tail = text5.slice(pos);
if (!self2.re.http) {
self2.re.http = new RegExp(
"^\\/\\/" + self2.re.src_auth + self2.re.src_host_port_strict + self2.re.src_path,
"i"
);
}
if (self2.re.http.test(tail)) {
return tail.match(self2.re.http)[0].length;
}
return 0;
}
},
"https:": "http:",
"ftp:": "http:",
"//": {
validate: function(text5, pos, self2) {
const tail = text5.slice(pos);
if (!self2.re.no_http) {
self2.re.no_http = new RegExp(
"^" + self2.re.src_auth + "(?:localhost|(?:(?:" + self2.re.src_domain + ")\\.)+" + self2.re.src_domain_root + ")" + self2.re.src_port + self2.re.src_host_terminator + self2.re.src_path,
"i"
);
}
if (self2.re.no_http.test(tail)) {
if (pos >= 3 && text5[pos - 3] === ":") {
return 0;
}
if (pos >= 3 && text5[pos - 3] === "/") {
return 0;
}
return tail.match(self2.re.no_http)[0].length;
}
return 0;
}
},
"mailto:": {
validate: function(text5, pos, self2) {
const tail = text5.slice(pos);
if (!self2.re.mailto) {
self2.re.mailto = new RegExp(
"^" + self2.re.src_email_name + "@" + self2.re.src_host_strict,
"i"
);
}
if (self2.re.mailto.test(tail)) {
return tail.match(self2.re.mailto)[0].length;
}
return 0;
}
}
};
var tlds_2ch_src_re = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]";
var tlds_default = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");
function resetScanCache(self2) {
self2.__index__ = -1;
self2.__text_cache__ = "";
}
function createValidator(re) {
return function(text5, pos) {
const tail = text5.slice(pos);
if (re.test(tail)) {
return tail.match(re)[0].length;
}
return 0;
};
}
function createNormalizer() {
return function(match3, self2) {
self2.normalize(match3);
};
}
function compile4(self2) {
const re = self2.re = re_default(self2.__opts__);
const tlds2 = self2.__tlds__.slice();
self2.onCompile();
if (!self2.__tlds_replaced__) {
tlds2.push(tlds_2ch_src_re);
}
tlds2.push(re.src_xn);
re.src_tlds = tlds2.join("|");
function untpl(tpl) {
return tpl.replace("%TLDS%", re.src_tlds);
}
re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), "i");
re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), "i");
re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), "i");
re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), "i");
const aliases2 = [];
self2.__compiled__ = {};
function schemaError(name2, val2) {
throw new Error('(LinkifyIt) Invalid schema "' + name2 + '": ' + val2);
}
Object.keys(self2.__schemas__).forEach(function(name2) {
const val2 = self2.__schemas__[name2];
if (val2 === null) {
return;
}
const compiled = { validate: null, link: null };
self2.__compiled__[name2] = compiled;
if (isObject(val2)) {
if (isRegExp(val2.validate)) {
compiled.validate = createValidator(val2.validate);
} else if (isFunction(val2.validate)) {
compiled.validate = val2.validate;
} else {
schemaError(name2, val2);
}
if (isFunction(val2.normalize)) {
compiled.normalize = val2.normalize;
} else if (!val2.normalize) {
compiled.normalize = createNormalizer();
} else {
schemaError(name2, val2);
}
return;
}
if (isString3(val2)) {
aliases2.push(name2);
return;
}
schemaError(name2, val2);
});
aliases2.forEach(function(alias) {
if (!self2.__compiled__[self2.__schemas__[alias]]) {
return;
}
self2.__compiled__[alias].validate = self2.__compiled__[self2.__schemas__[alias]].validate;
self2.__compiled__[alias].normalize = self2.__compiled__[self2.__schemas__[alias]].normalize;
});
self2.__compiled__[""] = { validate: null, normalize: createNormalizer() };
const slist = Object.keys(self2.__compiled__).filter(function(name2) {
return name2.length > 0 && self2.__compiled__[name2];
}).map(escapeRE2).join("|");
self2.re.schema_test = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "i");
self2.re.schema_search = RegExp("(^|(?!_)(?:[><\uFF5C]|" + re.src_ZPCc + "))(" + slist + ")", "ig");
self2.re.schema_at_start = RegExp("^" + self2.re.schema_search.source, "i");
self2.re.pretest = RegExp(
"(" + self2.re.schema_test.source + ")|(" + self2.re.host_fuzzy_test.source + ")|@",
"i"
);
resetScanCache(self2);
}
function Match(self2, shift) {
const start = self2.__index__;
const end2 = self2.__last_index__;
const text5 = self2.__text_cache__.slice(start, end2);
this.schema = self2.__schema__.toLowerCase();
this.index = start + shift;
this.lastIndex = end2 + shift;
this.raw = text5;
this.text = text5;
this.url = text5;
}
function createMatch(self2, shift) {
const match3 = new Match(self2, shift);
self2.__compiled__[match3.schema].normalize(match3, self2);
return match3;
}
function LinkifyIt(schemas2, options) {
if (!(this instanceof LinkifyIt)) {
return new LinkifyIt(schemas2, options);
}
if (!options) {
if (isOptionsObj(schemas2)) {
options = schemas2;
schemas2 = {};
}
}
this.__opts__ = assign2({}, defaultOptions3, options);
this.__index__ = -1;
this.__last_index__ = -1;
this.__schema__ = "";
this.__text_cache__ = "";
this.__schemas__ = assign2({}, defaultSchemas, schemas2);
this.__compiled__ = {};
this.__tlds__ = tlds_default;
this.__tlds_replaced__ = false;
this.re = {};
compile4(this);
}
LinkifyIt.prototype.add = function add2(schema4, definition) {
this.__schemas__[schema4] = definition;
compile4(this);
return this;
};
LinkifyIt.prototype.set = function set(options) {
this.__opts__ = assign2(this.__opts__, options);
return this;
};
LinkifyIt.prototype.test = function test(text5) {
this.__text_cache__ = text5;
this.__index__ = -1;
if (!text5.length) {
return false;
}
let m, ml, me, len, shift, next2, re, tld_pos, at_pos;
if (this.re.schema_test.test(text5)) {
re = this.re.schema_search;
re.lastIndex = 0;
while ((m = re.exec(text5)) !== null) {
len = this.testSchemaAt(text5, m[2], re.lastIndex);
if (len) {
this.__schema__ = m[2];
this.__index__ = m.index + m[1].length;
this.__last_index__ = m.index + m[0].length + len;
break;
}
}
}
if (this.__opts__.fuzzyLink && this.__compiled__["http:"]) {
tld_pos = text5.search(this.re.host_fuzzy_test);
if (tld_pos >= 0) {
if (this.__index__ < 0 || tld_pos < this.__index__) {
if ((ml = text5.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {
shift = ml.index + ml[1].length;
if (this.__index__ < 0 || shift < this.__index__) {
this.__schema__ = "";
this.__index__ = shift;
this.__last_index__ = ml.index + ml[0].length;
}
}
}
}
}
if (this.__opts__.fuzzyEmail && this.__compiled__["mailto:"]) {
at_pos = text5.indexOf("@");
if (at_pos >= 0) {
if ((me = text5.match(this.re.email_fuzzy)) !== null) {
shift = me.index + me[1].length;
next2 = me.index + me[0].length;
if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next2 > this.__last_index__) {
this.__schema__ = "mailto:";
this.__index__ = shift;
this.__last_index__ = next2;
}
}
}
}
return this.__index__ >= 0;
};
LinkifyIt.prototype.pretest = function pretest(text5) {
return this.re.pretest.test(text5);
};
LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text5, schema4, pos) {
if (!this.__compiled__[schema4.toLowerCase()]) {
return 0;
}
return this.__compiled__[schema4.toLowerCase()].validate(text5, pos, this);
};
LinkifyIt.prototype.match = function match2(text5) {
const result = [];
let shift = 0;
if (this.__index__ >= 0 && this.__text_cache__ === text5) {
result.push(createMatch(this, shift));
shift = this.__last_index__;
}
let tail = shift ? text5.slice(shift) : text5;
while (this.test(tail)) {
result.push(createMatch(this, shift));
tail = tail.slice(this.__last_index__);
shift += this.__last_index__;
}
if (result.length) {
return result;
}
return null;
};
LinkifyIt.prototype.matchAtStart = function matchAtStart(text5) {
this.__text_cache__ = text5;
this.__index__ = -1;
if (!text5.length)
return null;
const m = this.re.schema_at_start.exec(text5);
if (!m)
return null;
const len = this.testSchemaAt(text5, m[2], m[0].length);
if (!len)
return null;
this.__schema__ = m[2];
this.__index__ = m.index + m[1].length;
this.__last_index__ = m.index + m[0].length + len;
return createMatch(this, 0);
};
LinkifyIt.prototype.tlds = function tlds(list2, keepOld) {
list2 = Array.isArray(list2) ? list2 : [list2];
if (!keepOld) {
this.__tlds__ = list2.slice();
this.__tlds_replaced__ = true;
compile4(this);
return this;
}
this.__tlds__ = this.__tlds__.concat(list2).sort().filter(function(el, idx, arr) {
return el !== arr[idx - 1];
}).reverse();
compile4(this);
return this;
};
LinkifyIt.prototype.normalize = function normalize2(match3) {
if (!match3.schema) {
match3.url = "http://" + match3.url;
}
if (match3.schema === "mailto:" && !/^mailto:/i.test(match3.url)) {
match3.url = "mailto:" + match3.url;
}
};
LinkifyIt.prototype.onCompile = function onCompile() {
};
var linkify_it_default = LinkifyIt;
// ../../node_modules/.pnpm/punycode.js@2.3.1/node_modules/punycode.js/punycode.es6.js
var maxInt = 2147483647;
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128;
var delimiter = "-";
var regexPunycode = /^xn--/;
var regexNonASCII = /[^\0-\x7F]/;
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g;
var errors = {
"overflow": "Overflow: input needs wider integers to process",
"not-basic": "Illegal input >= 0x80 (not a basic code point)",
"invalid-input": "Invalid input"
};
var baseMinusTMin = base - tMin;
var floor = Math.floor;
var stringFromCharCode = String.fromCharCode;
function error(type) {
throw new RangeError(errors[type]);
}
function map2(array, callback) {
const result = [];
let length = array.length;
while (length--) {
result[length] = callback(array[length]);
}
return result;
}
function mapDomain(domain, callback) {
const parts = domain.split("@");
let result = "";
if (parts.length > 1) {
result = parts[0] + "@";
domain = parts[1];
}
domain = domain.replace(regexSeparators, ".");
const labels = domain.split(".");
const encoded = map2(labels, callback).join(".");
return result + encoded;
}
function ucs2decode(string2) {
const output = [];
let counter = 0;
const length = string2.length;
while (counter < length) {
const value = string2.charCodeAt(counter++);
if (value >= 55296 && value <= 56319 && counter < length) {
const extra = string2.charCodeAt(counter++);
if ((extra & 64512) == 56320) {
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
} else {
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
var ucs2encode = (codePoints) => String.fromCodePoint(...codePoints);
var basicToDigit = function(codePoint) {
if (codePoint >= 48 && codePoint < 58) {
return 26 + (codePoint - 48);
}
if (codePoint >= 65 && codePoint < 91) {
return codePoint - 65;
}
if (codePoint >= 97 && codePoint < 123) {
return codePoint - 97;
}
return base;
};
var digitToBasic = function(digit, flag) {
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};
var adapt = function(delta, numPoints, firstTime) {
let k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
var decode2 = function(input) {
const output = [];
const inputLength = input.length;
let i = 0;
let n2 = initialN;
let bias = initialBias;
let basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (let j = 0; j < basic; ++j) {
if (input.charCodeAt(j) >= 128) {
error("not-basic");
}
output.push(input.charCodeAt(j));
}
for (let index2 = basic > 0 ? basic + 1 : 0; index2 < inputLength; ) {
const oldi = i;
for (let w = 1, k = base; ; k += base) {
if (index2 >= inputLength) {
error("invalid-input");
}
const digit = basicToDigit(input.charCodeAt(index2++));
if (digit >= base) {
error("invalid-input");
}
if (digit > floor((maxInt - i) / w)) {
error("overflow");
}
i += digit * w;
const t2 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
if (digit < t2) {
break;
}
const baseMinusT = base - t2;
if (w > floor(maxInt / baseMinusT)) {
error("overflow");
}
w *= baseMinusT;
}
const out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
if (floor(i / out) > maxInt - n2) {
error("overflow");
}
n2 += floor(i / out);
i %= out;
output.splice(i++, 0, n2);
}
return String.fromCodePoint(...output);
};
var encode2 = function(input) {
const output = [];
input = ucs2decode(input);
const inputLength = input.length;
let n2 = initialN;
let delta = 0;
let bias = initialBias;
for (const currentValue of input) {
if (currentValue < 128) {
output.push(stringFromCharCode(currentValue));
}
}
const basicLength = output.length;
let handledCPCount = basicLength;
if (basicLength) {
output.push(delimiter);
}
while (handledCPCount < inputLength) {
let m = maxInt;
for (const currentValue of input) {
if (currentValue >= n2 && currentValue < m) {
m = currentValue;
}
}
const handledCPCountPlusOne = handledCPCount + 1;
if (m - n2 > floor((maxInt - delta) / handledCPCountPlusOne)) {
error("overflow");
}
delta += (m - n2) * handledCPCountPlusOne;
n2 = m;
for (const currentValue of input) {
if (currentValue < n2 && ++delta > maxInt) {
error("overflow");
}
if (currentValue === n2) {
let q = delta;
for (let k = base; ; k += base) {
const t2 = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
if (q < t2) {
break;
}
const qMinusT = q - t2;
const baseMinusT = base - t2;
output.push(
stringFromCharCode(digitToBasic(t2 + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q, 0)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n2;
}
return output.join("");
};
var toUnicode = function(input) {
return mapDomain(input, function(string2) {
return regexPunycode.test(string2) ? decode2(string2.slice(4).toLowerCase()) : string2;
});
};
var toASCII = function(input) {
return mapDomain(input, function(string2) {
return regexNonASCII.test(string2) ? "xn--" + encode2(string2) : string2;
});
};
var punycode = {
"version": "2.3.1",
"ucs2": {
"decode": ucs2decode,
"encode": ucs2encode
},
"decode": decode2,
"encode": encode2,
"toASCII": toASCII,
"toUnicode": toUnicode
};
var punycode_es6_default = punycode;
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/default.mjs
var default_default = {
options: {
html: false,
xhtmlOut: false,
breaks: false,
langPrefix: "language-",
linkify: false,
typographer: false,
quotes: "\u201C\u201D\u2018\u2019",
highlight: null,
maxNesting: 100
},
components: {
core: {},
block: {},
inline: {}
}
};
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/zero.mjs
var zero_default = {
options: {
html: false,
xhtmlOut: false,
breaks: false,
langPrefix: "language-",
linkify: false,
typographer: false,
quotes: "\u201C\u201D\u2018\u2019",
highlight: null,
maxNesting: 20
},
components: {
core: {
rules: [
"normalize",
"block",
"inline",
"text_join"
]
},
block: {
rules: [
"paragraph"
]
},
inline: {
rules: [
"text"
],
rules2: [
"balance_pairs",
"fragments_join"
]
}
}
};
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/presets/commonmark.mjs
var commonmark_default = {
options: {
html: true,
xhtmlOut: true,
breaks: false,
langPrefix: "language-",
linkify: false,
typographer: false,
quotes: "\u201C\u201D\u2018\u2019",
highlight: null,
maxNesting: 20
},
components: {
core: {
rules: [
"normalize",
"block",
"inline",
"text_join"
]
},
block: {
rules: [
"blockquote",
"code",
"fence",
"heading",
"hr",
"html_block",
"lheading",
"list",
"reference",
"paragraph"
]
},
inline: {
rules: [
"autolink",
"backticks",
"emphasis",
"entity",
"escape",
"html_inline",
"image",
"link",
"newline",
"text"
],
rules2: [
"balance_pairs",
"emphasis",
"fragments_join"
]
}
}
};
// ../../node_modules/.pnpm/markdown-it@14.1.0/node_modules/markdown-it/lib/index.mjs
var config = {
default: default_default,
zero: zero_default,
commonmark: commonmark_default
};
var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
function validateLink(url) {
const str = url.trim().toLowerCase();
return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true;
}
var RECODE_HOSTNAME_FOR = ["http:", "https:", "mailto:"];
function normalizeLink(url) {
const parsed = parse_default(url, true);
if (parsed.hostname) {
if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
try {
parsed.hostname = punycode_es6_default.toASCII(parsed.hostname);
} catch (er) {
}
}
}
return encode_default(format(parsed));
}
function normalizeLinkText(url) {
const parsed = parse_default(url, true);
if (parsed.hostname) {
if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {
try {
parsed.hostname = punycode_es6_default.toUnicode(parsed.hostname);
} catch (er) {
}
}
}
return decode_default(format(parsed), decode_default.defaultChars + "%");
}
function MarkdownIt(presetName, options) {
if (!(this instanceof MarkdownIt)) {
return new MarkdownIt(presetName, options);
}
if (!options) {
if (!isString2(presetName)) {
options = presetName || {};
presetName = "default";
}
}
this.inline = new parser_inline_default();
this.block = new parser_block_default();
this.core = new parser_core_default();
this.renderer = new renderer_default();
this.linkify = new linkify_it_default();
this.validateLink = validateLink;
this.normalizeLink = normalizeLink;
this.normalizeLinkText = normalizeLinkText;
this.utils = utils_exports;
this.helpers = assign({}, helpers_exports);
this.options = {};
this.configure(presetName);
if (options) {
this.set(options);
}
}
MarkdownIt.prototype.set = function(options) {
assign(this.options, options);
return this;
};
MarkdownIt.prototype.configure = function(presets) {
const self2 = this;
if (isString2(presets)) {
const presetName = presets;
presets = config[presetName];
if (!presets) {
throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name');
}
}
if (!presets) {
throw new Error("Wrong `markdown-it` preset, can't be empty");
}
if (presets.options) {
self2.set(presets.options);
}
if (presets.components) {
Object.keys(presets.components).forEach(function(name2) {
if (presets.components[name2].rules) {
self2[name2].ruler.enableOnly(presets.components[name2].rules);
}
if (presets.components[name2].rules2) {
self2[name2].ruler2.enableOnly(presets.components[name2].rules2);
}
});
}
return this;
};
MarkdownIt.prototype.enable = function(list2, ignoreInvalid) {
let result = [];
if (!Array.isArray(list2)) {
list2 = [list2];
}
["core", "block", "inline"].forEach(function(chain) {
result = result.concat(this[chain].ruler.enable(list2, true));
}, this);
result = result.concat(this.inline.ruler2.enable(list2, true));
const missed = list2.filter(function(name2) {
return result.indexOf(name2) < 0;
});
if (missed.length && !ignoreInvalid) {
throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + missed);
}
return this;
};
MarkdownIt.prototype.disable = function(list2, ignoreInvalid) {
let result = [];
if (!Array.isArray(list2)) {
list2 = [list2];
}
["core", "block", "inline"].forEach(function(chain) {
result = result.concat(this[chain].ruler.disable(list2, true));
}, this);
result = result.concat(this.inline.ruler2.disable(list2, true));
const missed = list2.filter(function(name2) {
return result.indexOf(name2) < 0;
});
if (missed.length && !ignoreInvalid) {
throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + missed);
}
return this;
};
MarkdownIt.prototype.use = function(plugin2) {
const args = [this].concat(Array.prototype.slice.call(arguments, 1));
plugin2.apply(plugin2, args);
return this;
};
MarkdownIt.prototype.parse = function(src, env) {
if (typeof src !== "string") {
throw new Error("Input data should be a String");
}
const state = new this.core.State(src, this, env);
this.core.process(state);
return state.tokens;
};
MarkdownIt.prototype.render = function(src, env) {
env = env || {};
return this.renderer.render(this.parse(src, env), this.options, env);
};
MarkdownIt.prototype.parseInline = function(src, env) {
const state = new this.core.State(src, this, env);
state.inlineMode = true;
this.core.process(state);
return state.tokens;
};
MarkdownIt.prototype.renderInline = function(src, env) {
env = env || {};
return this.renderer.render(this.parseInline(src, env), this.options, env);
};
var lib_default = MarkdownIt;
// ../../node_modules/.pnpm/markdown-it-ins@4.0.0/node_modules/markdown-it-ins/index.mjs
function ins_plugin(md) {
function tokenize(state, silent) {
const start = state.pos;
const marker = state.src.charCodeAt(start);
if (silent) {
return false;
}
if (marker !== 43) {
return false;
}
const scanned = state.scanDelims(state.pos, true);
let len = scanned.length;
const ch = String.fromCharCode(marker);
if (len < 2) {
return false;
}
if (len % 2) {
const token = state.push("text", "", 0);
token.content = ch;
len--;
}
for (let i = 0; i < len; i += 2) {
const token = state.push("text", "", 0);
token.content = ch + ch;
if (!scanned.can_open && !scanned.can_close) {
continue;
}
state.delimiters.push({
marker,
length: 0,
jump: i / 2,
token: state.tokens.length - 1,
end: -1,
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
}
function postProcess3(state, delimiters) {
let token;
const loneMarkers = [];
const max = delimiters.length;
for (let i = 0; i < max; i++) {
const startDelim = delimiters[i];
if (startDelim.marker !== 43) {
continue;
}
if (startDelim.end === -1) {
continue;
}
const endDelim = delimiters[startDelim.end];
token = state.tokens[startDelim.token];
token.type = "ins_open";
token.tag = "ins";
token.nesting = 1;
token.markup = "++";
token.content = "";
token = state.tokens[endDelim.token];
token.type = "ins_close";
token.tag = "ins";
token.nesting = -1;
token.markup = "++";
token.content = "";
if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "+") {
loneMarkers.push(endDelim.token - 1);
}
}
while (loneMarkers.length) {
const i = loneMarkers.pop();
let j = i + 1;
while (j < state.tokens.length && state.tokens[j].type === "ins_close") {
j++;
}
j--;
if (i !== j) {
token = state.tokens[j];
state.tokens[j] = state.tokens[i];
state.tokens[i] = token;
}
}
}
md.inline.ruler.before("emphasis", "ins", tokenize);
md.inline.ruler2.before("emphasis", "ins", function(state) {
const tokens_meta = state.tokens_meta;
const max = (state.tokens_meta || []).length;
postProcess3(state, state.delimiters);
for (let curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess3(state, tokens_meta[curr].delimiters);
}
}
});
}
// ../../node_modules/.pnpm/markdown-it-mark@4.0.0/node_modules/markdown-it-mark/index.mjs
function ins_plugin2(md) {
function tokenize(state, silent) {
const start = state.pos;
const marker = state.src.charCodeAt(start);
if (silent) {
return false;
}
if (marker !== 61) {
return false;
}
const scanned = state.scanDelims(state.pos, true);
let len = scanned.length;
const ch = String.fromCharCode(marker);
if (len < 2) {
return false;
}
if (len % 2) {
const token = state.push("text", "", 0);
token.content = ch;
len--;
}
for (let i = 0; i < len; i += 2) {
const token = state.push("text", "", 0);
token.content = ch + ch;
if (!scanned.can_open && !scanned.can_close) {
continue;
}
state.delimiters.push({
marker,
length: 0,
jump: i / 2,
token: state.tokens.length - 1,
end: -1,
open: scanned.can_open,
close: scanned.can_close
});
}
state.pos += scanned.length;
return true;
}
function postProcess3(state, delimiters) {
const loneMarkers = [];
const max = delimiters.length;
for (let i = 0; i < max; i++) {
const startDelim = delimiters[i];
if (startDelim.marker !== 61) {
continue;
}
if (startDelim.end === -1) {
continue;
}
const endDelim = delimiters[startDelim.end];
const token_o = state.tokens[startDelim.token];
token_o.type = "mark_open";
token_o.tag = "mark";
token_o.nesting = 1;
token_o.markup = "==";
token_o.content = "";
const token_c = state.tokens[endDelim.token];
token_c.type = "mark_close";
token_c.tag = "mark";
token_c.nesting = -1;
token_c.markup = "==";
token_c.content = "";
if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "=") {
loneMarkers.push(endDelim.token - 1);
}
}
while (loneMarkers.length) {
const i = loneMarkers.pop();
let j = i + 1;
while (j < state.tokens.length && state.tokens[j].type === "mark_close") {
j++;
}
j--;
if (i !== j) {
const token = state.tokens[j];
state.tokens[j] = state.tokens[i];
state.tokens[i] = token;
}
}
}
md.inline.ruler.before("emphasis", "mark", tokenize);
md.inline.ruler2.before("emphasis", "mark", function(state) {
let curr;
const tokens_meta = state.tokens_meta;
const max = (state.tokens_meta || []).length;
postProcess3(state, state.delimiters);
for (curr = 0; curr < max; curr++) {
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
postProcess3(state, tokens_meta[curr].delimiters);
}
}
});
}
// ../../node_modules/.pnpm/markdown-it-sub@2.0.0/node_modules/markdown-it-sub/index.mjs
var UNESCAPE_RE = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
function subscript(state, silent) {
const max = state.posMax;
const start = state.pos;
if (state.src.charCodeAt(start) !== 126) {
return false;
}
if (silent) {
return false;
}
if (start + 2 >= max) {
return false;
}
state.pos = start + 1;
let found = false;
while (state.pos < max) {
if (state.src.charCodeAt(state.pos) === 126) {
found = true;
break;
}
state.md.inline.skipToken(state);
}
if (!found || start + 1 === state.pos) {
state.pos = start;
return false;
}
const content = state.src.slice(start + 1, state.pos);
if (content.match(/(^|[^\\])(\\\\)*\s/)) {
state.pos = start;
return false;
}
state.posMax = state.pos;
state.pos = start + 1;
const token_so = state.push("sub_open", "sub", 1);
token_so.markup = "~";
const token_t = state.push("text", "", 0);
token_t.content = content.replace(UNESCAPE_RE, "$1");
const token_sc = state.push("sub_close", "sub", -1);
token_sc.markup = "~";
state.pos = state.posMax + 1;
state.posMax = max;
return true;
}
function sub_plugin(md) {
md.inline.ruler.after("emphasis", "sub", subscript);
}
// ../../node_modules/.pnpm/markdown-it-sup@2.0.0/node_modules/markdown-it-sup/index.mjs
var UNESCAPE_RE2 = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;
function superscript(state, silent) {
const max = state.posMax;
const start = state.pos;
if (state.src.charCodeAt(start) !== 94) {
return false;
}
if (silent) {
return false;
}
if (start + 2 >= max) {
return false;
}
state.pos = start + 1;
let found = false;
while (state.pos < max) {
if (state.src.charCodeAt(state.pos) === 94) {
found = true;
break;
}
state.md.inline.skipToken(state);
}
if (!found || start + 1 === state.pos) {
state.pos = start;
return false;
}
const content = state.src.slice(start + 1, state.pos);
if (content.match(/(^|[^\\])(\\\\)*\s/)) {
state.pos = start;
return false;
}
state.posMax = state.pos;
state.pos = start + 1;
const token_so = state.push("sup_open", "sup", 1);
token_so.markup = "^";
const token_t = state.push("text", "", 0);
token_t.content = content.replace(UNESCAPE_RE2, "$1");
const token_sc = state.push("sup_close", "sup", -1);
token_sc.markup = "^";
state.pos = state.posMax + 1;
state.posMax = max;
return true;
}
function sup_plugin(md) {
md.inline.ruler.after("emphasis", "sup", superscript);
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/identity.js
var ALIAS = Symbol.for("yaml.alias");
var DOC = Symbol.for("yaml.document");
var MAP = Symbol.for("yaml.map");
var PAIR = Symbol.for("yaml.pair");
var SCALAR = Symbol.for("yaml.scalar");
var SEQ = Symbol.for("yaml.seq");
var NODE_TYPE2 = Symbol.for("yaml.node.type");
var isAlias = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === ALIAS;
var isDocument2 = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === DOC;
var isMap = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === MAP;
var isPair = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === PAIR;
var isScalar = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === SCALAR;
var isSeq = (node) => !!node && typeof node === "object" && node[NODE_TYPE2] === SEQ;
function isCollection(node) {
if (node && typeof node === "object")
switch (node[NODE_TYPE2]) {
case MAP:
case SEQ:
return true;
}
return false;
}
function isNode2(node) {
if (node && typeof node === "object")
switch (node[NODE_TYPE2]) {
case ALIAS:
case MAP:
case SCALAR:
case SEQ:
return true;
}
return false;
}
var hasAnchor = (node) => (isScalar(node) || isCollection(node)) && !!node.anchor;
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/visit.js
var BREAK = Symbol("break visit");
var SKIP = Symbol("skip children");
var REMOVE = Symbol("remove node");
function visit(node, visitor) {
const visitor_ = initVisitor(visitor);
if (isDocument2(node)) {
const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
if (cd === REMOVE)
node.contents = null;
} else
visit_(null, node, visitor_, Object.freeze([]));
}
visit.BREAK = BREAK;
visit.SKIP = SKIP;
visit.REMOVE = REMOVE;
function visit_(key, node, visitor, path) {
const ctrl = callVisitor(key, node, visitor, path);
if (isNode2(ctrl) || isPair(ctrl)) {
replaceNode(key, path, ctrl);
return visit_(key, ctrl, visitor, path);
}
if (typeof ctrl !== "symbol") {
if (isCollection(node)) {
path = Object.freeze(path.concat(node));
for (let i = 0; i < node.items.length; ++i) {
const ci = visit_(i, node.items[i], visitor, path);
if (typeof ci === "number")
i = ci - 1;
else if (ci === BREAK)
return BREAK;
else if (ci === REMOVE) {
node.items.splice(i, 1);
i -= 1;
}
}
} else if (isPair(node)) {
path = Object.freeze(path.concat(node));
const ck = visit_("key", node.key, visitor, path);
if (ck === BREAK)
return BREAK;
else if (ck === REMOVE)
node.key = null;
const cv = visit_("value", node.value, visitor, path);
if (cv === BREAK)
return BREAK;
else if (cv === REMOVE)
node.value = null;
}
}
return ctrl;
}
async function visitAsync(node, visitor) {
const visitor_ = initVisitor(visitor);
if (isDocument2(node)) {
const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
if (cd === REMOVE)
node.contents = null;
} else
await visitAsync_(null, node, visitor_, Object.freeze([]));
}
visitAsync.BREAK = BREAK;
visitAsync.SKIP = SKIP;
visitAsync.REMOVE = REMOVE;
async function visitAsync_(key, node, visitor, path) {
const ctrl = await callVisitor(key, node, visitor, path);
if (isNode2(ctrl) || isPair(ctrl)) {
replaceNode(key, path, ctrl);
return visitAsync_(key, ctrl, visitor, path);
}
if (typeof ctrl !== "symbol") {
if (isCollection(node)) {
path = Object.freeze(path.concat(node));
for (let i = 0; i < node.items.length; ++i) {
const ci = await visitAsync_(i, node.items[i], visitor, path);
if (typeof ci === "number")
i = ci - 1;
else if (ci === BREAK)
return BREAK;
else if (ci === REMOVE) {
node.items.splice(i, 1);
i -= 1;
}
}
} else if (isPair(node)) {
path = Object.freeze(path.concat(node));
const ck = await visitAsync_("key", node.key, visitor, path);
if (ck === BREAK)
return BREAK;
else if (ck === REMOVE)
node.key = null;
const cv = await visitAsync_("value", node.value, visitor, path);
if (cv === BREAK)
return BREAK;
else if (cv === REMOVE)
node.value = null;
}
}
return ctrl;
}
function initVisitor(visitor) {
if (typeof visitor === "object" && (visitor.Collection || visitor.Node || visitor.Value)) {
return Object.assign({
Alias: visitor.Node,
Map: visitor.Node,
Scalar: visitor.Node,
Seq: visitor.Node
}, visitor.Value && {
Map: visitor.Value,
Scalar: visitor.Value,
Seq: visitor.Value
}, visitor.Collection && {
Map: visitor.Collection,
Seq: visitor.Collection
}, visitor);
}
return visitor;
}
function callVisitor(key, node, visitor, path) {
var _a3, _b, _c, _d, _e;
if (typeof visitor === "function")
return visitor(key, node, path);
if (isMap(node))
return (_a3 = visitor.Map) == null ? void 0 : _a3.call(visitor, key, node, path);
if (isSeq(node))
return (_b = visitor.Seq) == null ? void 0 : _b.call(visitor, key, node, path);
if (isPair(node))
return (_c = visitor.Pair) == null ? void 0 : _c.call(visitor, key, node, path);
if (isScalar(node))
return (_d = visitor.Scalar) == null ? void 0 : _d.call(visitor, key, node, path);
if (isAlias(node))
return (_e = visitor.Alias) == null ? void 0 : _e.call(visitor, key, node, path);
return void 0;
}
function replaceNode(key, path, node) {
const parent2 = path[path.length - 1];
if (isCollection(parent2)) {
parent2.items[key] = node;
} else if (isPair(parent2)) {
if (key === "key")
parent2.key = node;
else
parent2.value = node;
} else if (isDocument2(parent2)) {
parent2.contents = node;
} else {
const pt = isAlias(parent2) ? "alias" : "scalar";
throw new Error(`Cannot replace node with ${pt} parent`);
}
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/doc/directives.js
var escapeChars = {
"!": "%21",
",": "%2C",
"[": "%5B",
"]": "%5D",
"{": "%7B",
"}": "%7D"
};
var escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, (ch) => escapeChars[ch]);
var Directives = class {
constructor(yaml, tags) {
this.docStart = null;
this.docEnd = false;
this.yaml = Object.assign({}, Directives.defaultYaml, yaml);
this.tags = Object.assign({}, Directives.defaultTags, tags);
}
clone() {
const copy = new Directives(this.yaml, this.tags);
copy.docStart = this.docStart;
return copy;
}
atDocument() {
const res = new Directives(this.yaml, this.tags);
switch (this.yaml.version) {
case "1.1":
this.atNextDocument = true;
break;
case "1.2":
this.atNextDocument = false;
this.yaml = {
explicit: Directives.defaultYaml.explicit,
version: "1.2"
};
this.tags = Object.assign({}, Directives.defaultTags);
break;
}
return res;
}
add(line, onError) {
if (this.atNextDocument) {
this.yaml = { explicit: Directives.defaultYaml.explicit, version: "1.1" };
this.tags = Object.assign({}, Directives.defaultTags);
this.atNextDocument = false;
}
const parts = line.trim().split(/[ \t]+/);
const name2 = parts.shift();
switch (name2) {
case "%TAG": {
if (parts.length !== 2) {
onError(0, "%TAG directive should contain exactly two parts");
if (parts.length < 2)
return false;
}
const [handle, prefix] = parts;
this.tags[handle] = prefix;
return true;
}
case "%YAML": {
this.yaml.explicit = true;
if (parts.length !== 1) {
onError(0, "%YAML directive should contain exactly one part");
return false;
}
const [version] = parts;
if (version === "1.1" || version === "1.2") {
this.yaml.version = version;
return true;
} else {
const isValid = /^\d+\.\d+$/.test(version);
onError(6, `Unsupported YAML version ${version}`, isValid);
return false;
}
}
default:
onError(0, `Unknown directive ${name2}`, true);
return false;
}
}
tagName(source, onError) {
if (source === "!")
return "!";
if (source[0] !== "!") {
onError(`Not a valid tag: ${source}`);
return null;
}
if (source[1] === "<") {
const verbatim = source.slice(2, -1);
if (verbatim === "!" || verbatim === "!!") {
onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
return null;
}
if (source[source.length - 1] !== ">")
onError("Verbatim tags must end with a >");
return verbatim;
}
const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
if (!suffix)
onError(`The ${source} tag has no suffix`);
const prefix = this.tags[handle];
if (prefix) {
try {
return prefix + decodeURIComponent(suffix);
} catch (error2) {
onError(String(error2));
return null;
}
}
if (handle === "!")
return source;
onError(`Could not resolve tag: ${source}`);
return null;
}
tagString(tag) {
for (const [handle, prefix] of Object.entries(this.tags)) {
if (tag.startsWith(prefix))
return handle + escapeTagName(tag.substring(prefix.length));
}
return tag[0] === "!" ? tag : `!<${tag}>`;
}
toString(doc) {
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
const tagEntries = Object.entries(this.tags);
let tagNames;
if (doc && tagEntries.length > 0 && isNode2(doc.contents)) {
const tags = {};
visit(doc.contents, (_key, node) => {
if (isNode2(node) && node.tag)
tags[node.tag] = true;
});
tagNames = Object.keys(tags);
} else
tagNames = [];
for (const [handle, prefix] of tagEntries) {
if (handle === "!!" && prefix === "tag:yaml.org,2002:")
continue;
if (!doc || tagNames.some((tn) => tn.startsWith(prefix)))
lines.push(`%TAG ${handle} ${prefix}`);
}
return lines.join("\n");
}
};
Directives.defaultYaml = { explicit: false, version: "1.2" };
Directives.defaultTags = { "!!": "tag:yaml.org,2002:" };
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/doc/anchors.js
function anchorIsValid(anchor) {
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
const sa = JSON.stringify(anchor);
const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
throw new Error(msg);
}
return true;
}
function anchorNames(root3) {
const anchors = /* @__PURE__ */ new Set();
visit(root3, {
Value(_key, node) {
if (node.anchor)
anchors.add(node.anchor);
}
});
return anchors;
}
function findNewAnchor(prefix, exclude) {
for (let i = 1; true; ++i) {
const name2 = `${prefix}${i}`;
if (!exclude.has(name2))
return name2;
}
}
function createNodeAnchors(doc, prefix) {
const aliasObjects = [];
const sourceObjects = /* @__PURE__ */ new Map();
let prevAnchors = null;
return {
onAnchor: (source) => {
aliasObjects.push(source);
if (!prevAnchors)
prevAnchors = anchorNames(doc);
const anchor = findNewAnchor(prefix, prevAnchors);
prevAnchors.add(anchor);
return anchor;
},
setAnchors: () => {
for (const source of aliasObjects) {
const ref = sourceObjects.get(source);
if (typeof ref === "object" && ref.anchor && (isScalar(ref.node) || isCollection(ref.node))) {
ref.node.anchor = ref.anchor;
} else {
const error2 = new Error("Failed to resolve repeated object (this should not happen)");
error2.source = source;
throw error2;
}
}
},
sourceObjects
};
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/doc/applyReviver.js
function applyReviver(reviver, obj, key, val2) {
if (val2 && typeof val2 === "object") {
if (Array.isArray(val2)) {
for (let i = 0, len = val2.length; i < len; ++i) {
const v0 = val2[i];
const v1 = applyReviver(reviver, val2, String(i), v0);
if (v1 === void 0)
delete val2[i];
else if (v1 !== v0)
val2[i] = v1;
}
} else if (val2 instanceof Map) {
for (const k of Array.from(val2.keys())) {
const v0 = val2.get(k);
const v1 = applyReviver(reviver, val2, k, v0);
if (v1 === void 0)
val2.delete(k);
else if (v1 !== v0)
val2.set(k, v1);
}
} else if (val2 instanceof Set) {
for (const v0 of Array.from(val2)) {
const v1 = applyReviver(reviver, val2, v0, v0);
if (v1 === void 0)
val2.delete(v0);
else if (v1 !== v0) {
val2.delete(v0);
val2.add(v1);
}
}
} else {
for (const [k, v0] of Object.entries(val2)) {
const v1 = applyReviver(reviver, val2, k, v0);
if (v1 === void 0)
delete val2[k];
else if (v1 !== v0)
val2[k] = v1;
}
}
}
return reviver.call(obj, key, val2);
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/toJS.js
function toJS(value, arg, ctx) {
if (Array.isArray(value))
return value.map((v, i) => toJS(v, String(i), ctx));
if (value && typeof value.toJSON === "function") {
if (!ctx || !hasAnchor(value))
return value.toJSON(arg, ctx);
const data2 = { aliasCount: 0, count: 1, res: void 0 };
ctx.anchors.set(value, data2);
ctx.onCreate = (res2) => {
data2.res = res2;
delete ctx.onCreate;
};
const res = value.toJSON(arg, ctx);
if (ctx.onCreate)
ctx.onCreate(res);
return res;
}
if (typeof value === "bigint" && !(ctx == null ? void 0 : ctx.keep))
return Number(value);
return value;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/Node.js
var NodeBase = class {
constructor(type) {
Object.defineProperty(this, NODE_TYPE2, { value: type });
}
clone() {
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
if (this.range)
copy.range = this.range.slice();
return copy;
}
toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
if (!isDocument2(doc))
throw new TypeError("A document argument is required");
const ctx = {
anchors: /* @__PURE__ */ new Map(),
doc,
keep: true,
mapAsMap: mapAsMap === true,
mapKeyWarned: false,
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
};
const res = toJS(this, "", ctx);
if (typeof onAnchor === "function")
for (const { count, res: res2 } of ctx.anchors.values())
onAnchor(res2, count);
return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res;
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/Alias.js
var Alias = class extends NodeBase {
constructor(source) {
super(ALIAS);
this.source = source;
Object.defineProperty(this, "tag", {
set() {
throw new Error("Alias nodes cannot have tags");
}
});
}
resolve(doc) {
let found = void 0;
visit(doc, {
Node: (_key, node) => {
if (node === this)
return visit.BREAK;
if (node.anchor === this.source)
found = node;
}
});
return found;
}
toJSON(_arg, ctx) {
if (!ctx)
return { source: this.source };
const { anchors, doc, maxAliasCount } = ctx;
const source = this.resolve(doc);
if (!source) {
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
throw new ReferenceError(msg);
}
let data2 = anchors.get(source);
if (!data2) {
toJS(source, null, ctx);
data2 = anchors.get(source);
}
if (!data2 || data2.res === void 0) {
const msg = "This should not happen: Alias anchor was not resolved?";
throw new ReferenceError(msg);
}
if (maxAliasCount >= 0) {
data2.count += 1;
if (data2.aliasCount === 0)
data2.aliasCount = getAliasCount(doc, source, anchors);
if (data2.count * data2.aliasCount > maxAliasCount) {
const msg = "Excessive alias count indicates a resource exhaustion attack";
throw new ReferenceError(msg);
}
}
return data2.res;
}
toString(ctx, _onComment, _onChompKeep) {
const src = `*${this.source}`;
if (ctx) {
anchorIsValid(this.source);
if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
throw new Error(msg);
}
if (ctx.implicitKey)
return `${src} `;
}
return src;
}
};
function getAliasCount(doc, node, anchors) {
if (isAlias(node)) {
const source = node.resolve(doc);
const anchor = anchors && source && anchors.get(source);
return anchor ? anchor.count * anchor.aliasCount : 0;
} else if (isCollection(node)) {
let count = 0;
for (const item of node.items) {
const c = getAliasCount(doc, item, anchors);
if (c > count)
count = c;
}
return count;
} else if (isPair(node)) {
const kc = getAliasCount(doc, node.key, anchors);
const vc = getAliasCount(doc, node.value, anchors);
return Math.max(kc, vc);
}
return 1;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/Scalar.js
var isScalarValue = (value) => !value || typeof value !== "function" && typeof value !== "object";
var Scalar = class extends NodeBase {
constructor(value) {
super(SCALAR);
this.value = value;
}
toJSON(arg, ctx) {
return (ctx == null ? void 0 : ctx.keep) ? this.value : toJS(this.value, arg, ctx);
}
toString() {
return String(this.value);
}
};
Scalar.BLOCK_FOLDED = "BLOCK_FOLDED";
Scalar.BLOCK_LITERAL = "BLOCK_LITERAL";
Scalar.PLAIN = "PLAIN";
Scalar.QUOTE_DOUBLE = "QUOTE_DOUBLE";
Scalar.QUOTE_SINGLE = "QUOTE_SINGLE";
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/doc/createNode.js
var defaultTagPrefix = "tag:yaml.org,2002:";
function findTagObject(value, tagName, tags) {
var _a3;
if (tagName) {
const match3 = tags.filter((t2) => t2.tag === tagName);
const tagObj = (_a3 = match3.find((t2) => !t2.format)) != null ? _a3 : match3[0];
if (!tagObj)
throw new Error(`Tag ${tagName} not found`);
return tagObj;
}
return tags.find((t2) => {
var _a4;
return ((_a4 = t2.identify) == null ? void 0 : _a4.call(t2, value)) && !t2.format;
});
}
function createNode(value, tagName, ctx) {
var _a3, _b, _c;
if (isDocument2(value))
value = value.contents;
if (isNode2(value))
return value;
if (isPair(value)) {
const map4 = (_b = (_a3 = ctx.schema[MAP]).createNode) == null ? void 0 : _b.call(_a3, ctx.schema, null, ctx);
map4.items.push(value);
return map4;
}
if (value instanceof String || value instanceof Number || value instanceof Boolean || typeof BigInt !== "undefined" && value instanceof BigInt) {
value = value.valueOf();
}
const { aliasDuplicateObjects, onAnchor, onTagObj, schema: schema4, sourceObjects } = ctx;
let ref = void 0;
if (aliasDuplicateObjects && value && typeof value === "object") {
ref = sourceObjects.get(value);
if (ref) {
if (!ref.anchor)
ref.anchor = onAnchor(value);
return new Alias(ref.anchor);
} else {
ref = { anchor: null, node: null };
sourceObjects.set(value, ref);
}
}
if (tagName == null ? void 0 : tagName.startsWith("!!"))
tagName = defaultTagPrefix + tagName.slice(2);
let tagObj = findTagObject(value, tagName, schema4.tags);
if (!tagObj) {
if (value && typeof value.toJSON === "function") {
value = value.toJSON();
}
if (!value || typeof value !== "object") {
const node2 = new Scalar(value);
if (ref)
ref.node = node2;
return node2;
}
tagObj = value instanceof Map ? schema4[MAP] : Symbol.iterator in Object(value) ? schema4[SEQ] : schema4[MAP];
}
if (onTagObj) {
onTagObj(tagObj);
delete ctx.onTagObj;
}
const node = (tagObj == null ? void 0 : tagObj.createNode) ? tagObj.createNode(ctx.schema, value, ctx) : typeof ((_c = tagObj == null ? void 0 : tagObj.nodeClass) == null ? void 0 : _c.from) === "function" ? tagObj.nodeClass.from(ctx.schema, value, ctx) : new Scalar(value);
if (tagName)
node.tag = tagName;
else if (!tagObj.default)
node.tag = tagObj.tag;
if (ref)
ref.node = node;
return node;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/Collection.js
function collectionFromPath(schema4, path, value) {
let v = value;
for (let i = path.length - 1; i >= 0; --i) {
const k = path[i];
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
const a = [];
a[k] = v;
v = a;
} else {
v = /* @__PURE__ */ new Map([[k, v]]);
}
}
return createNode(v, void 0, {
aliasDuplicateObjects: false,
keepUndefined: false,
onAnchor: () => {
throw new Error("This should not happen, please report a bug.");
},
schema: schema4,
sourceObjects: /* @__PURE__ */ new Map()
});
}
var isEmptyPath = (path) => path == null || typeof path === "object" && !!path[Symbol.iterator]().next().done;
var Collection = class extends NodeBase {
constructor(type, schema4) {
super(type);
Object.defineProperty(this, "schema", {
value: schema4,
configurable: true,
enumerable: false,
writable: true
});
}
clone(schema4) {
const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
if (schema4)
copy.schema = schema4;
copy.items = copy.items.map((it) => isNode2(it) || isPair(it) ? it.clone(schema4) : it);
if (this.range)
copy.range = this.range.slice();
return copy;
}
addIn(path, value) {
if (isEmptyPath(path))
this.add(value);
else {
const [key, ...rest] = path;
const node = this.get(key, true);
if (isCollection(node))
node.addIn(rest, value);
else if (node === void 0 && this.schema)
this.set(key, collectionFromPath(this.schema, rest, value));
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
}
deleteIn(path) {
const [key, ...rest] = path;
if (rest.length === 0)
return this.delete(key);
const node = this.get(key, true);
if (isCollection(node))
return node.deleteIn(rest);
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
getIn(path, keepScalar) {
const [key, ...rest] = path;
const node = this.get(key, true);
if (rest.length === 0)
return !keepScalar && isScalar(node) ? node.value : node;
else
return isCollection(node) ? node.getIn(rest, keepScalar) : void 0;
}
hasAllNullValues(allowScalar) {
return this.items.every((node) => {
if (!isPair(node))
return false;
const n2 = node.value;
return n2 == null || allowScalar && isScalar(n2) && n2.value == null && !n2.commentBefore && !n2.comment && !n2.tag;
});
}
hasIn(path) {
const [key, ...rest] = path;
if (rest.length === 0)
return this.has(key);
const node = this.get(key, true);
return isCollection(node) ? node.hasIn(rest) : false;
}
setIn(path, value) {
const [key, ...rest] = path;
if (rest.length === 0) {
this.set(key, value);
} else {
const node = this.get(key, true);
if (isCollection(node))
node.setIn(rest, value);
else if (node === void 0 && this.schema)
this.set(key, collectionFromPath(this.schema, rest, value));
else
throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
}
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyComment.js
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
function indentComment(comment2, indent) {
if (/^\n+$/.test(comment2))
return comment2.substring(1);
return indent ? comment2.replace(/^(?! *$)/gm, indent) : comment2;
}
var lineComment = (str, indent, comment2) => str.endsWith("\n") ? indentComment(comment2, indent) : comment2.includes("\n") ? "\n" + indentComment(comment2, indent) : (str.endsWith(" ") ? "" : " ") + comment2;
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/foldFlowLines.js
var FOLD_FLOW = "flow";
var FOLD_BLOCK = "block";
var FOLD_QUOTED = "quoted";
function foldFlowLines(text5, indent, mode = "flow", { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
if (!lineWidth || lineWidth < 0)
return text5;
if (lineWidth < minContentWidth)
minContentWidth = 0;
const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
if (text5.length <= endStep)
return text5;
const folds = [];
const escapedFolds = {};
let end2 = lineWidth - indent.length;
if (typeof indentAtStart === "number") {
if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
folds.push(0);
else
end2 = lineWidth - indentAtStart;
}
let split = void 0;
let prev2 = void 0;
let overflow = false;
let i = -1;
let escStart = -1;
let escEnd = -1;
if (mode === FOLD_BLOCK) {
i = consumeMoreIndentedLines(text5, i, indent.length);
if (i !== -1)
end2 = i + endStep;
}
for (let ch; ch = text5[i += 1]; ) {
if (mode === FOLD_QUOTED && ch === "\\") {
escStart = i;
switch (text5[i + 1]) {
case "x":
i += 3;
break;
case "u":
i += 5;
break;
case "U":
i += 9;
break;
default:
i += 1;
}
escEnd = i;
}
if (ch === "\n") {
if (mode === FOLD_BLOCK)
i = consumeMoreIndentedLines(text5, i, indent.length);
end2 = i + indent.length + endStep;
split = void 0;
} else {
if (ch === " " && prev2 && prev2 !== " " && prev2 !== "\n" && prev2 !== " ") {
const next2 = text5[i + 1];
if (next2 && next2 !== " " && next2 !== "\n" && next2 !== " ")
split = i;
}
if (i >= end2) {
if (split) {
folds.push(split);
end2 = split + endStep;
split = void 0;
} else if (mode === FOLD_QUOTED) {
while (prev2 === " " || prev2 === " ") {
prev2 = ch;
ch = text5[i += 1];
overflow = true;
}
const j = i > escEnd + 1 ? i - 2 : escStart - 1;
if (escapedFolds[j])
return text5;
folds.push(j);
escapedFolds[j] = true;
end2 = j + endStep;
split = void 0;
} else {
overflow = true;
}
}
}
prev2 = ch;
}
if (overflow && onOverflow)
onOverflow();
if (folds.length === 0)
return text5;
if (onFold)
onFold();
let res = text5.slice(0, folds[0]);
for (let i2 = 0; i2 < folds.length; ++i2) {
const fold = folds[i2];
const end3 = folds[i2 + 1] || text5.length;
if (fold === 0)
res = `
${indent}${text5.slice(0, end3)}`;
else {
if (mode === FOLD_QUOTED && escapedFolds[fold])
res += `${text5[fold]}\\`;
res += `
${indent}${text5.slice(fold + 1, end3)}`;
}
}
return res;
}
function consumeMoreIndentedLines(text5, i, indent) {
let end2 = i;
let start = i + 1;
let ch = text5[start];
while (ch === " " || ch === " ") {
if (i < start + indent) {
ch = text5[++i];
} else {
do {
ch = text5[++i];
} while (ch && ch !== "\n");
end2 = i;
start = i + 1;
ch = text5[start];
}
}
return end2;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyString.js
var getFoldOptions = (ctx, isBlock2) => ({
indentAtStart: isBlock2 ? ctx.indent.length : ctx.indentAtStart,
lineWidth: ctx.options.lineWidth,
minContentWidth: ctx.options.minContentWidth
});
var containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
function lineLengthOverLimit(str, lineWidth, indentLength) {
if (!lineWidth || lineWidth < 0)
return false;
const limit = lineWidth - indentLength;
const strLen = str.length;
if (strLen <= limit)
return false;
for (let i = 0, start = 0; i < strLen; ++i) {
if (str[i] === "\n") {
if (i - start > limit)
return true;
start = i + 1;
if (strLen - start <= limit)
return false;
}
}
return true;
}
function doubleQuotedString(value, ctx) {
const json = JSON.stringify(value);
if (ctx.options.doubleQuotedAsJSON)
return json;
const { implicitKey } = ctx;
const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
let str = "";
let start = 0;
for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
if (ch === " " && json[i + 1] === "\\" && json[i + 2] === "n") {
str += json.slice(start, i) + "\\ ";
i += 1;
start = i;
ch = "\\";
}
if (ch === "\\")
switch (json[i + 1]) {
case "u":
{
str += json.slice(start, i);
const code2 = json.substr(i + 2, 4);
switch (code2) {
case "0000":
str += "\\0";
break;
case "0007":
str += "\\a";
break;
case "000b":
str += "\\v";
break;
case "001b":
str += "\\e";
break;
case "0085":
str += "\\N";
break;
case "00a0":
str += "\\_";
break;
case "2028":
str += "\\L";
break;
case "2029":
str += "\\P";
break;
default:
if (code2.substr(0, 2) === "00")
str += "\\x" + code2.substr(2);
else
str += json.substr(i, 6);
}
i += 5;
start = i + 1;
}
break;
case "n":
if (implicitKey || json[i + 2] === '"' || json.length < minMultiLineLength) {
i += 1;
} else {
str += json.slice(start, i) + "\n\n";
while (json[i + 2] === "\\" && json[i + 3] === "n" && json[i + 4] !== '"') {
str += "\n";
i += 2;
}
str += indent;
if (json[i + 2] === " ")
str += "\\";
i += 1;
start = i + 1;
}
break;
default:
i += 1;
}
}
str = start ? str + json.slice(start) : json;
return implicitKey ? str : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));
}
function singleQuotedString(value, ctx) {
if (ctx.options.singleQuote === false || ctx.implicitKey && value.includes("\n") || /[ \t]\n|\n[ \t]/.test(value))
return doubleQuotedString(value, ctx);
const indent = ctx.indent || (containsDocumentMarker(value) ? " " : "");
const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&
${indent}`) + "'";
return ctx.implicitKey ? res : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));
}
function quotedString(value, ctx) {
const { singleQuote } = ctx.options;
let qs;
if (singleQuote === false)
qs = doubleQuotedString;
else {
const hasDouble = value.includes('"');
const hasSingle = value.includes("'");
if (hasDouble && !hasSingle)
qs = singleQuotedString;
else if (hasSingle && !hasDouble)
qs = doubleQuotedString;
else
qs = singleQuote ? singleQuotedString : doubleQuotedString;
}
return qs(value, ctx);
}
var blockEndNewlines;
try {
blockEndNewlines = new RegExp("(^|(?\n";
let chomp;
let endStart;
for (endStart = value.length; endStart > 0; --endStart) {
const ch = value[endStart - 1];
if (ch !== "\n" && ch !== " " && ch !== " ")
break;
}
let end2 = value.substring(endStart);
const endNlPos = end2.indexOf("\n");
if (endNlPos === -1) {
chomp = "-";
} else if (value === end2 || endNlPos !== end2.length - 1) {
chomp = "+";
if (onChompKeep)
onChompKeep();
} else {
chomp = "";
}
if (end2) {
value = value.slice(0, -end2.length);
if (end2[end2.length - 1] === "\n")
end2 = end2.slice(0, -1);
end2 = end2.replace(blockEndNewlines, `$&${indent}`);
}
let startWithSpace = false;
let startEnd;
let startNlPos = -1;
for (startEnd = 0; startEnd < value.length; ++startEnd) {
const ch = value[startEnd];
if (ch === " ")
startWithSpace = true;
else if (ch === "\n")
startNlPos = startEnd;
else
break;
}
let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
if (start) {
value = value.substring(start.length);
start = start.replace(/\n+/g, `$&${indent}`);
}
const indentSize = indent ? "2" : "1";
let header = (startWithSpace ? indentSize : "") + chomp;
if (comment2) {
header += " " + commentString(comment2.replace(/ ?[\r\n]+/g, " "));
if (onComment)
onComment();
}
if (!literal) {
const foldedValue = value.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${indent}`);
let literalFallback = false;
const foldOptions = getFoldOptions(ctx, true);
if (blockQuote !== "folded" && type !== Scalar.BLOCK_FOLDED) {
foldOptions.onOverflow = () => {
literalFallback = true;
};
}
const body = foldFlowLines(`${start}${foldedValue}${end2}`, indent, FOLD_BLOCK, foldOptions);
if (!literalFallback)
return `>${header}
${indent}${body}`;
}
value = value.replace(/\n+/g, `$&${indent}`);
return `|${header}
${indent}${start}${value}${end2}`;
}
function plainString(item, ctx, onComment, onChompKeep) {
const { type, value } = item;
const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
if (implicitKey && value.includes("\n") || inFlow && /[[\]{},]/.test(value)) {
return quotedString(value, ctx);
}
if (!value || /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
return implicitKey || inFlow || !value.includes("\n") ? quotedString(value, ctx) : blockString(item, ctx, onComment, onChompKeep);
}
if (!implicitKey && !inFlow && type !== Scalar.PLAIN && value.includes("\n")) {
return blockString(item, ctx, onComment, onChompKeep);
}
if (containsDocumentMarker(value)) {
if (indent === "") {
ctx.forceBlockIndent = true;
return blockString(item, ctx, onComment, onChompKeep);
} else if (implicitKey && indent === indentStep) {
return quotedString(value, ctx);
}
}
const str = value.replace(/\n+/g, `$&
${indent}`);
if (actualString) {
const test2 = (tag) => {
var _a3;
return tag.default && tag.tag !== "tag:yaml.org,2002:str" && ((_a3 = tag.test) == null ? void 0 : _a3.test(str));
};
const { compat, tags } = ctx.doc.schema;
if (tags.some(test2) || (compat == null ? void 0 : compat.some(test2)))
return quotedString(value, ctx);
}
return implicitKey ? str : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));
}
function stringifyString(item, ctx, onComment, onChompKeep) {
const { implicitKey, inFlow } = ctx;
const ss = typeof item.value === "string" ? item : Object.assign({}, item, { value: String(item.value) });
let { type } = item;
if (type !== Scalar.QUOTE_DOUBLE) {
if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
type = Scalar.QUOTE_DOUBLE;
}
const _stringify = (_type) => {
switch (_type) {
case Scalar.BLOCK_FOLDED:
case Scalar.BLOCK_LITERAL:
return implicitKey || inFlow ? quotedString(ss.value, ctx) : blockString(ss, ctx, onComment, onChompKeep);
case Scalar.QUOTE_DOUBLE:
return doubleQuotedString(ss.value, ctx);
case Scalar.QUOTE_SINGLE:
return singleQuotedString(ss.value, ctx);
case Scalar.PLAIN:
return plainString(ss, ctx, onComment, onChompKeep);
default:
return null;
}
};
let res = _stringify(type);
if (res === null) {
const { defaultKeyType, defaultStringType } = ctx.options;
const t2 = implicitKey && defaultKeyType || defaultStringType;
res = _stringify(t2);
if (res === null)
throw new Error(`Unsupported default string type ${t2}`);
}
return res;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringify.js
function createStringifyContext(doc, options) {
const opt = Object.assign({
blockQuote: true,
commentString: stringifyComment,
defaultKeyType: null,
defaultStringType: "PLAIN",
directives: null,
doubleQuotedAsJSON: false,
doubleQuotedMinMultiLineLength: 40,
falseStr: "false",
flowCollectionPadding: true,
indentSeq: true,
lineWidth: 80,
minContentWidth: 20,
nullStr: "null",
simpleKeys: false,
singleQuote: null,
trueStr: "true",
verifyAliasOrder: true
}, doc.schema.toStringOptions, options);
let inFlow;
switch (opt.collectionStyle) {
case "block":
inFlow = false;
break;
case "flow":
inFlow = true;
break;
default:
inFlow = null;
}
return {
anchors: /* @__PURE__ */ new Set(),
doc,
flowCollectionPadding: opt.flowCollectionPadding ? " " : "",
indent: "",
indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ",
inFlow,
options: opt
};
}
function getTagObject(tags, item) {
var _a3, _b, _c, _d;
if (item.tag) {
const match3 = tags.filter((t2) => t2.tag === item.tag);
if (match3.length > 0)
return (_a3 = match3.find((t2) => t2.format === item.format)) != null ? _a3 : match3[0];
}
let tagObj = void 0;
let obj;
if (isScalar(item)) {
obj = item.value;
let match3 = tags.filter((t2) => {
var _a4;
return (_a4 = t2.identify) == null ? void 0 : _a4.call(t2, obj);
});
if (match3.length > 1) {
const testMatch = match3.filter((t2) => t2.test);
if (testMatch.length > 0)
match3 = testMatch;
}
tagObj = (_b = match3.find((t2) => t2.format === item.format)) != null ? _b : match3.find((t2) => !t2.format);
} else {
obj = item;
tagObj = tags.find((t2) => t2.nodeClass && obj instanceof t2.nodeClass);
}
if (!tagObj) {
const name2 = (_d = (_c = obj == null ? void 0 : obj.constructor) == null ? void 0 : _c.name) != null ? _d : typeof obj;
throw new Error(`Tag not resolved for ${name2} value`);
}
return tagObj;
}
function stringifyProps(node, tagObj, { anchors, doc }) {
if (!doc.directives)
return "";
const props = [];
const anchor = (isScalar(node) || isCollection(node)) && node.anchor;
if (anchor && anchorIsValid(anchor)) {
anchors.add(anchor);
props.push(`&${anchor}`);
}
const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
if (tag)
props.push(doc.directives.tagString(tag));
return props.join(" ");
}
function stringify2(item, ctx, onComment, onChompKeep) {
var _a3, _b;
if (isPair(item))
return item.toString(ctx, onComment, onChompKeep);
if (isAlias(item)) {
if (ctx.doc.directives)
return item.toString(ctx);
if ((_a3 = ctx.resolvedAliases) == null ? void 0 : _a3.has(item)) {
throw new TypeError(`Cannot stringify circular structure without alias nodes`);
} else {
if (ctx.resolvedAliases)
ctx.resolvedAliases.add(item);
else
ctx.resolvedAliases = /* @__PURE__ */ new Set([item]);
item = item.resolve(ctx.doc);
}
}
let tagObj = void 0;
const node = isNode2(item) ? item : ctx.doc.createNode(item, { onTagObj: (o) => tagObj = o });
if (!tagObj)
tagObj = getTagObject(ctx.doc.schema.tags, node);
const props = stringifyProps(node, tagObj, ctx);
if (props.length > 0)
ctx.indentAtStart = ((_b = ctx.indentAtStart) != null ? _b : 0) + props.length + 1;
const str = typeof tagObj.stringify === "function" ? tagObj.stringify(node, ctx, onComment, onChompKeep) : isScalar(node) ? stringifyString(node, ctx, onComment, onChompKeep) : node.toString(ctx, onComment, onChompKeep);
if (!props)
return str;
return isScalar(node) || str[0] === "{" || str[0] === "[" ? `${props} ${str}` : `${props}
${ctx.indent}${str}`;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyPair.js
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
var _a3, _b;
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
let keyComment = isNode2(key) && key.comment || null;
if (simpleKeys) {
if (keyComment) {
throw new Error("With simple keys, key nodes cannot have comments");
}
if (isCollection(key) || !isNode2(key) && typeof key === "object") {
const msg = "With simple keys, collection cannot be used as a key value";
throw new Error(msg);
}
}
let explicitKey = !simpleKeys && (!key || keyComment && value == null && !ctx.inFlow || isCollection(key) || (isScalar(key) ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL : typeof key === "object"));
ctx = Object.assign({}, ctx, {
allNullValues: false,
implicitKey: !explicitKey && (simpleKeys || !allNullValues),
indent: indent + indentStep
});
let keyCommentDone = false;
let chompKeep = false;
let str = stringify2(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
if (simpleKeys)
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
explicitKey = true;
}
if (ctx.inFlow) {
if (allNullValues || value == null) {
if (keyCommentDone && onComment)
onComment();
return str === "" ? "?" : explicitKey ? `? ${str}` : str;
}
} else if (allNullValues && !simpleKeys || value == null && explicitKey) {
str = `? ${str}`;
if (keyComment && !keyCommentDone) {
str += lineComment(str, ctx.indent, commentString(keyComment));
} else if (chompKeep && onChompKeep)
onChompKeep();
return str;
}
if (keyCommentDone)
keyComment = null;
if (explicitKey) {
if (keyComment)
str += lineComment(str, ctx.indent, commentString(keyComment));
str = `? ${str}
${indent}:`;
} else {
str = `${str}:`;
if (keyComment)
str += lineComment(str, ctx.indent, commentString(keyComment));
}
let vsb, vcb, valueComment;
if (isNode2(value)) {
vsb = !!value.spaceBefore;
vcb = value.commentBefore;
valueComment = value.comment;
} else {
vsb = false;
vcb = null;
valueComment = null;
if (value && typeof value === "object")
value = doc.createNode(value);
}
ctx.implicitKey = false;
if (!explicitKey && !keyComment && isScalar(value))
ctx.indentAtStart = str.length + 1;
chompKeep = false;
if (!indentSeq && indentStep.length >= 2 && !ctx.inFlow && !explicitKey && isSeq(value) && !value.flow && !value.tag && !value.anchor) {
ctx.indent = ctx.indent.substring(2);
}
let valueCommentDone = false;
const valueStr = stringify2(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
let ws = " ";
if (keyComment || vsb || vcb) {
ws = vsb ? "\n" : "";
if (vcb) {
const cs = commentString(vcb);
ws += `
${indentComment(cs, ctx.indent)}`;
}
if (valueStr === "" && !ctx.inFlow) {
if (ws === "\n")
ws = "\n\n";
} else {
ws += `
${ctx.indent}`;
}
} else if (!explicitKey && isCollection(value)) {
const vs0 = valueStr[0];
const nl0 = valueStr.indexOf("\n");
const hasNewline = nl0 !== -1;
const flow = (_b = (_a3 = ctx.inFlow) != null ? _a3 : value.flow) != null ? _b : value.items.length === 0;
if (hasNewline || !flow) {
let hasPropsLine = false;
if (hasNewline && (vs0 === "&" || vs0 === "!")) {
let sp0 = valueStr.indexOf(" ");
if (vs0 === "&" && sp0 !== -1 && sp0 < nl0 && valueStr[sp0 + 1] === "!") {
sp0 = valueStr.indexOf(" ", sp0 + 1);
}
if (sp0 === -1 || nl0 < sp0)
hasPropsLine = true;
}
if (!hasPropsLine)
ws = `
${ctx.indent}`;
}
} else if (valueStr === "" || valueStr[0] === "\n") {
ws = "";
}
str += ws + valueStr;
if (ctx.inFlow) {
if (valueCommentDone && onComment)
onComment();
} else if (valueComment && !valueCommentDone) {
str += lineComment(str, ctx.indent, commentString(valueComment));
} else if (chompKeep && onChompKeep) {
onChompKeep();
}
return str;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/log.js
function warn(logLevel, warning) {
if (logLevel === "debug" || logLevel === "warn") {
console.warn(warning);
}
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js
var MERGE_KEY = "<<";
var merge3 = {
identify: (value) => value === MERGE_KEY || typeof value === "symbol" && value.description === MERGE_KEY,
default: "key",
tag: "tag:yaml.org,2002:merge",
test: /^<<$/,
resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
addToJSMap: addMergeToJSMap
}),
stringify: () => MERGE_KEY
};
var isMergeKey = (ctx, key) => (merge3.identify(key) || isScalar(key) && (!key.type || key.type === Scalar.PLAIN) && merge3.identify(key.value)) && (ctx == null ? void 0 : ctx.doc.schema.tags.some((tag) => tag.tag === merge3.tag && tag.default));
function addMergeToJSMap(ctx, map4, value) {
value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
if (isSeq(value))
for (const it of value.items)
mergeValue(ctx, map4, it);
else if (Array.isArray(value))
for (const it of value)
mergeValue(ctx, map4, it);
else
mergeValue(ctx, map4, value);
}
function mergeValue(ctx, map4, value) {
const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
if (!isMap(source))
throw new Error("Merge sources must be maps or map aliases");
const srcMap = source.toJSON(null, ctx, Map);
for (const [key, value2] of srcMap) {
if (map4 instanceof Map) {
if (!map4.has(key))
map4.set(key, value2);
} else if (map4 instanceof Set) {
map4.add(key);
} else if (!Object.prototype.hasOwnProperty.call(map4, key)) {
Object.defineProperty(map4, key, {
value: value2,
writable: true,
enumerable: true,
configurable: true
});
}
}
return map4;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
function addPairToJSMap(ctx, map4, { key, value }) {
if (isNode2(key) && key.addToJSMap)
key.addToJSMap(ctx, map4, value);
else if (isMergeKey(ctx, key))
addMergeToJSMap(ctx, map4, value);
else {
const jsKey = toJS(key, "", ctx);
if (map4 instanceof Map) {
map4.set(jsKey, toJS(value, jsKey, ctx));
} else if (map4 instanceof Set) {
map4.add(jsKey);
} else {
const stringKey = stringifyKey(key, jsKey, ctx);
const jsValue = toJS(value, stringKey, ctx);
if (stringKey in map4)
Object.defineProperty(map4, stringKey, {
value: jsValue,
writable: true,
enumerable: true,
configurable: true
});
else
map4[stringKey] = jsValue;
}
}
return map4;
}
function stringifyKey(key, jsKey, ctx) {
if (jsKey === null)
return "";
if (typeof jsKey !== "object")
return String(jsKey);
if (isNode2(key) && (ctx == null ? void 0 : ctx.doc)) {
const strCtx = createStringifyContext(ctx.doc, {});
strCtx.anchors = /* @__PURE__ */ new Set();
for (const node of ctx.anchors.keys())
strCtx.anchors.add(node.anchor);
strCtx.inFlow = true;
strCtx.inStringifyKey = true;
const strKey = key.toString(strCtx);
if (!ctx.mapKeyWarned) {
let jsonStr = JSON.stringify(strKey);
if (jsonStr.length > 40)
jsonStr = jsonStr.substring(0, 36) + '..."';
warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
ctx.mapKeyWarned = true;
}
return strKey;
}
return JSON.stringify(jsKey);
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/Pair.js
function createPair(key, value, ctx) {
const k = createNode(key, void 0, ctx);
const v = createNode(value, void 0, ctx);
return new Pair(k, v);
}
var Pair = class {
constructor(key, value = null) {
Object.defineProperty(this, NODE_TYPE2, { value: PAIR });
this.key = key;
this.value = value;
}
clone(schema4) {
let { key, value } = this;
if (isNode2(key))
key = key.clone(schema4);
if (isNode2(value))
value = value.clone(schema4);
return new Pair(key, value);
}
toJSON(_, ctx) {
const pair = (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};
return addPairToJSMap(ctx, pair, this);
}
toString(ctx, onComment, onChompKeep) {
return (ctx == null ? void 0 : ctx.doc) ? stringifyPair(this, ctx, onComment, onChompKeep) : JSON.stringify(this);
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyCollection.js
function stringifyCollection(collection, ctx, options) {
var _a3;
const flow = (_a3 = ctx.inFlow) != null ? _a3 : collection.flow;
const stringify5 = flow ? stringifyFlowCollection : stringifyBlockCollection;
return stringify5(collection, ctx, options);
}
function stringifyBlockCollection({ comment: comment2, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
const { indent, options: { commentString } } = ctx;
const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
let chompKeep = false;
const lines = [];
for (let i = 0; i < items.length; ++i) {
const item = items[i];
let comment3 = null;
if (isNode2(item)) {
if (!chompKeep && item.spaceBefore)
lines.push("");
addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
if (item.comment)
comment3 = item.comment;
} else if (isPair(item)) {
const ik = isNode2(item.key) ? item.key : null;
if (ik) {
if (!chompKeep && ik.spaceBefore)
lines.push("");
addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
}
}
chompKeep = false;
let str2 = stringify2(item, itemCtx, () => comment3 = null, () => chompKeep = true);
if (comment3)
str2 += lineComment(str2, itemIndent, commentString(comment3));
if (chompKeep && comment3)
chompKeep = false;
lines.push(blockItemPrefix + str2);
}
let str;
if (lines.length === 0) {
str = flowChars.start + flowChars.end;
} else {
str = lines[0];
for (let i = 1; i < lines.length; ++i) {
const line = lines[i];
str += line ? `
${indent}${line}` : "\n";
}
}
if (comment2) {
str += "\n" + indentComment(commentString(comment2), indent);
if (onComment)
onComment();
} else if (chompKeep && onChompKeep)
onChompKeep();
return str;
}
function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
itemIndent += indentStep;
const itemCtx = Object.assign({}, ctx, {
indent: itemIndent,
inFlow: true,
type: null
});
let reqNewline = false;
let linesAtValue = 0;
const lines = [];
for (let i = 0; i < items.length; ++i) {
const item = items[i];
let comment2 = null;
if (isNode2(item)) {
if (item.spaceBefore)
lines.push("");
addCommentBefore(ctx, lines, item.commentBefore, false);
if (item.comment)
comment2 = item.comment;
} else if (isPair(item)) {
const ik = isNode2(item.key) ? item.key : null;
if (ik) {
if (ik.spaceBefore)
lines.push("");
addCommentBefore(ctx, lines, ik.commentBefore, false);
if (ik.comment)
reqNewline = true;
}
const iv = isNode2(item.value) ? item.value : null;
if (iv) {
if (iv.comment)
comment2 = iv.comment;
if (iv.commentBefore)
reqNewline = true;
} else if (item.value == null && (ik == null ? void 0 : ik.comment)) {
comment2 = ik.comment;
}
}
if (comment2)
reqNewline = true;
let str = stringify2(item, itemCtx, () => comment2 = null);
if (i < items.length - 1)
str += ",";
if (comment2)
str += lineComment(str, itemIndent, commentString(comment2));
if (!reqNewline && (lines.length > linesAtValue || str.includes("\n")))
reqNewline = true;
lines.push(str);
linesAtValue = lines.length;
}
const { start, end: end2 } = flowChars;
if (lines.length === 0) {
return start + end2;
} else {
if (!reqNewline) {
const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
}
if (reqNewline) {
let str = start;
for (const line of lines)
str += line ? `
${indentStep}${indent}${line}` : "\n";
return `${str}
${indent}${end2}`;
} else {
return `${start}${fcPadding}${lines.join(" ")}${fcPadding}${end2}`;
}
}
}
function addCommentBefore({ indent, options: { commentString } }, lines, comment2, chompKeep) {
if (comment2 && chompKeep)
comment2 = comment2.replace(/^\n+/, "");
if (comment2) {
const ic = indentComment(commentString(comment2), indent);
lines.push(ic.trimStart());
}
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/YAMLMap.js
function findPair(items, key) {
const k = isScalar(key) ? key.value : key;
for (const it of items) {
if (isPair(it)) {
if (it.key === key || it.key === k)
return it;
if (isScalar(it.key) && it.key.value === k)
return it;
}
}
return void 0;
}
var YAMLMap = class extends Collection {
static get tagName() {
return "tag:yaml.org,2002:map";
}
constructor(schema4) {
super(MAP, schema4);
this.items = [];
}
static from(schema4, obj, ctx) {
const { keepUndefined, replacer } = ctx;
const map4 = new this(schema4);
const add3 = (key, value) => {
if (typeof replacer === "function")
value = replacer.call(obj, key, value);
else if (Array.isArray(replacer) && !replacer.includes(key))
return;
if (value !== void 0 || keepUndefined)
map4.items.push(createPair(key, value, ctx));
};
if (obj instanceof Map) {
for (const [key, value] of obj)
add3(key, value);
} else if (obj && typeof obj === "object") {
for (const key of Object.keys(obj))
add3(key, obj[key]);
}
if (typeof schema4.sortMapEntries === "function") {
map4.items.sort(schema4.sortMapEntries);
}
return map4;
}
add(pair, overwrite) {
var _a3;
let _pair;
if (isPair(pair))
_pair = pair;
else if (!pair || typeof pair !== "object" || !("key" in pair)) {
_pair = new Pair(pair, pair == null ? void 0 : pair.value);
} else
_pair = new Pair(pair.key, pair.value);
const prev2 = findPair(this.items, _pair.key);
const sortEntries = (_a3 = this.schema) == null ? void 0 : _a3.sortMapEntries;
if (prev2) {
if (!overwrite)
throw new Error(`Key ${_pair.key} already set`);
if (isScalar(prev2.value) && isScalarValue(_pair.value))
prev2.value.value = _pair.value;
else
prev2.value = _pair.value;
} else if (sortEntries) {
const i = this.items.findIndex((item) => sortEntries(_pair, item) < 0);
if (i === -1)
this.items.push(_pair);
else
this.items.splice(i, 0, _pair);
} else {
this.items.push(_pair);
}
}
delete(key) {
const it = findPair(this.items, key);
if (!it)
return false;
const del = this.items.splice(this.items.indexOf(it), 1);
return del.length > 0;
}
get(key, keepScalar) {
var _a3;
const it = findPair(this.items, key);
const node = it == null ? void 0 : it.value;
return (_a3 = !keepScalar && isScalar(node) ? node.value : node) != null ? _a3 : void 0;
}
has(key) {
return !!findPair(this.items, key);
}
set(key, value) {
this.add(new Pair(key, value), true);
}
toJSON(_, ctx, Type) {
const map4 = Type ? new Type() : (ctx == null ? void 0 : ctx.mapAsMap) ? /* @__PURE__ */ new Map() : {};
if (ctx == null ? void 0 : ctx.onCreate)
ctx.onCreate(map4);
for (const item of this.items)
addPairToJSMap(ctx, map4, item);
return map4;
}
toString(ctx, onComment, onChompKeep) {
if (!ctx)
return JSON.stringify(this);
for (const item of this.items) {
if (!isPair(item))
throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
}
if (!ctx.allNullValues && this.hasAllNullValues(false))
ctx = Object.assign({}, ctx, { allNullValues: true });
return stringifyCollection(this, ctx, {
blockItemPrefix: "",
flowChars: { start: "{", end: "}" },
itemIndent: ctx.indent || "",
onChompKeep,
onComment
});
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/common/map.js
var map3 = {
collection: "map",
default: true,
nodeClass: YAMLMap,
tag: "tag:yaml.org,2002:map",
resolve(map4, onError) {
if (!isMap(map4))
onError("Expected a mapping for this tag");
return map4;
},
createNode: (schema4, obj, ctx) => YAMLMap.from(schema4, obj, ctx)
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/nodes/YAMLSeq.js
var YAMLSeq = class extends Collection {
static get tagName() {
return "tag:yaml.org,2002:seq";
}
constructor(schema4) {
super(SEQ, schema4);
this.items = [];
}
add(value) {
this.items.push(value);
}
delete(key) {
const idx = asItemIndex(key);
if (typeof idx !== "number")
return false;
const del = this.items.splice(idx, 1);
return del.length > 0;
}
get(key, keepScalar) {
const idx = asItemIndex(key);
if (typeof idx !== "number")
return void 0;
const it = this.items[idx];
return !keepScalar && isScalar(it) ? it.value : it;
}
has(key) {
const idx = asItemIndex(key);
return typeof idx === "number" && idx < this.items.length;
}
set(key, value) {
const idx = asItemIndex(key);
if (typeof idx !== "number")
throw new Error(`Expected a valid index, not ${key}.`);
const prev2 = this.items[idx];
if (isScalar(prev2) && isScalarValue(value))
prev2.value = value;
else
this.items[idx] = value;
}
toJSON(_, ctx) {
const seq2 = [];
if (ctx == null ? void 0 : ctx.onCreate)
ctx.onCreate(seq2);
let i = 0;
for (const item of this.items)
seq2.push(toJS(item, String(i++), ctx));
return seq2;
}
toString(ctx, onComment, onChompKeep) {
if (!ctx)
return JSON.stringify(this);
return stringifyCollection(this, ctx, {
blockItemPrefix: "- ",
flowChars: { start: "[", end: "]" },
itemIndent: (ctx.indent || "") + " ",
onChompKeep,
onComment
});
}
static from(schema4, obj, ctx) {
const { replacer } = ctx;
const seq2 = new this(schema4);
if (obj && Symbol.iterator in Object(obj)) {
let i = 0;
for (let it of obj) {
if (typeof replacer === "function") {
const key = obj instanceof Set ? it : String(i++);
it = replacer.call(obj, key, it);
}
seq2.items.push(createNode(it, void 0, ctx));
}
}
return seq2;
}
};
function asItemIndex(key) {
let idx = isScalar(key) ? key.value : key;
if (idx && typeof idx === "string")
idx = Number(idx);
return typeof idx === "number" && Number.isInteger(idx) && idx >= 0 ? idx : null;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/common/seq.js
var seq = {
collection: "seq",
default: true,
nodeClass: YAMLSeq,
tag: "tag:yaml.org,2002:seq",
resolve(seq2, onError) {
if (!isSeq(seq2))
onError("Expected a sequence for this tag");
return seq2;
},
createNode: (schema4, obj, ctx) => YAMLSeq.from(schema4, obj, ctx)
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/common/string.js
var string = {
identify: (value) => typeof value === "string",
default: true,
tag: "tag:yaml.org,2002:str",
resolve: (str) => str,
stringify(item, ctx, onComment, onChompKeep) {
ctx = Object.assign({ actualString: true }, ctx);
return stringifyString(item, ctx, onComment, onChompKeep);
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/common/null.js
var nullTag = {
identify: (value) => value == null,
createNode: () => new Scalar(null),
default: true,
tag: "tag:yaml.org,2002:null",
test: /^(?:~|[Nn]ull|NULL)?$/,
resolve: () => new Scalar(null),
stringify: ({ source }, ctx) => typeof source === "string" && nullTag.test.test(source) ? source : ctx.options.nullStr
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/core/bool.js
var boolTag = {
identify: (value) => typeof value === "boolean",
default: true,
tag: "tag:yaml.org,2002:bool",
test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
resolve: (str) => new Scalar(str[0] === "t" || str[0] === "T"),
stringify({ source, value }, ctx) {
if (source && boolTag.test.test(source)) {
const sv = source[0] === "t" || source[0] === "T";
if (value === sv)
return source;
}
return value ? ctx.options.trueStr : ctx.options.falseStr;
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyNumber.js
function stringifyNumber({ format: format2, minFractionDigits, tag, value }) {
if (typeof value === "bigint")
return String(value);
const num = typeof value === "number" ? value : Number(value);
if (!isFinite(num))
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
let n2 = JSON.stringify(value);
if (!format2 && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^\d/.test(n2)) {
let i = n2.indexOf(".");
if (i < 0) {
i = n2.length;
n2 += ".";
}
let d = minFractionDigits - (n2.length - i - 1);
while (d-- > 0)
n2 += "0";
}
return n2;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/core/float.js
var floatNaN = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
stringify: stringifyNumber
};
var floatExp = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
format: "EXP",
test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
resolve: (str) => parseFloat(str),
stringify(node) {
const num = Number(node.value);
return isFinite(num) ? num.toExponential() : stringifyNumber(node);
}
};
var float = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
resolve(str) {
const node = new Scalar(parseFloat(str));
const dot = str.indexOf(".");
if (dot !== -1 && str[str.length - 1] === "0")
node.minFractionDigits = str.length - dot - 1;
return node;
},
stringify: stringifyNumber
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/core/int.js
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
var intResolve = (str, offset2, radix, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str.substring(offset2), radix);
function intStringify(node, radix, prefix) {
const { value } = node;
if (intIdentify(value) && value >= 0)
return prefix + value.toString(radix);
return stringifyNumber(node);
}
var intOct = {
identify: (value) => intIdentify(value) && value >= 0,
default: true,
tag: "tag:yaml.org,2002:int",
format: "OCT",
test: /^0o[0-7]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 8, opt),
stringify: (node) => intStringify(node, 8, "0o")
};
var int2 = {
identify: intIdentify,
default: true,
tag: "tag:yaml.org,2002:int",
test: /^[-+]?[0-9]+$/,
resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
stringify: stringifyNumber
};
var intHex = {
identify: (value) => intIdentify(value) && value >= 0,
default: true,
tag: "tag:yaml.org,2002:int",
format: "HEX",
test: /^0x[0-9a-fA-F]+$/,
resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
stringify: (node) => intStringify(node, 16, "0x")
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/core/schema.js
var schema = [
map3,
seq,
string,
nullTag,
boolTag,
intOct,
int2,
intHex,
floatNaN,
floatExp,
float
];
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/json/schema.js
function intIdentify2(value) {
return typeof value === "bigint" || Number.isInteger(value);
}
var stringifyJSON = ({ value }) => JSON.stringify(value);
var jsonScalars = [
{
identify: (value) => typeof value === "string",
default: true,
tag: "tag:yaml.org,2002:str",
resolve: (str) => str,
stringify: stringifyJSON
},
{
identify: (value) => value == null,
createNode: () => new Scalar(null),
default: true,
tag: "tag:yaml.org,2002:null",
test: /^null$/,
resolve: () => null,
stringify: stringifyJSON
},
{
identify: (value) => typeof value === "boolean",
default: true,
tag: "tag:yaml.org,2002:bool",
test: /^true$|^false$/,
resolve: (str) => str === "true",
stringify: stringifyJSON
},
{
identify: intIdentify2,
default: true,
tag: "tag:yaml.org,2002:int",
test: /^-?(?:0|[1-9][0-9]*)$/,
resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
stringify: ({ value }) => intIdentify2(value) ? value.toString() : JSON.stringify(value)
},
{
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
resolve: (str) => parseFloat(str),
stringify: stringifyJSON
}
];
var jsonError = {
default: true,
tag: "",
test: /^/,
resolve(str, onError) {
onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
return str;
}
};
var schema2 = [map3, seq].concat(jsonScalars, jsonError);
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/binary.js
var binary = {
identify: (value) => value instanceof Uint8Array,
default: false,
tag: "tag:yaml.org,2002:binary",
resolve(src, onError) {
if (typeof atob === "function") {
const str = atob(src.replace(/[\n\r]/g, ""));
const buffer = new Uint8Array(str.length);
for (let i = 0; i < str.length; ++i)
buffer[i] = str.charCodeAt(i);
return buffer;
} else {
onError("This environment does not support reading binary tags; either Buffer or atob is required");
return src;
}
},
stringify({ comment: comment2, type, value }, ctx, onComment, onChompKeep) {
if (!value)
return "";
const buf = value;
let str;
if (typeof btoa === "function") {
let s2 = "";
for (let i = 0; i < buf.length; ++i)
s2 += String.fromCharCode(buf[i]);
str = btoa(s2);
} else {
throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");
}
if (!type)
type = Scalar.BLOCK_LITERAL;
if (type !== Scalar.QUOTE_DOUBLE) {
const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
const n2 = Math.ceil(str.length / lineWidth);
const lines = new Array(n2);
for (let i = 0, o = 0; i < n2; ++i, o += lineWidth) {
lines[i] = str.substr(o, lineWidth);
}
str = lines.join(type === Scalar.BLOCK_LITERAL ? "\n" : " ");
}
return stringifyString({ comment: comment2, type, value: str }, ctx, onComment, onChompKeep);
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
function resolvePairs(seq2, onError) {
var _a3;
if (isSeq(seq2)) {
for (let i = 0; i < seq2.items.length; ++i) {
let item = seq2.items[i];
if (isPair(item))
continue;
else if (isMap(item)) {
if (item.items.length > 1)
onError("Each pair must have its own sequence indicator");
const pair = item.items[0] || new Pair(new Scalar(null));
if (item.commentBefore)
pair.key.commentBefore = pair.key.commentBefore ? `${item.commentBefore}
${pair.key.commentBefore}` : item.commentBefore;
if (item.comment) {
const cn = (_a3 = pair.value) != null ? _a3 : pair.key;
cn.comment = cn.comment ? `${item.comment}
${cn.comment}` : item.comment;
}
item = pair;
}
seq2.items[i] = isPair(item) ? item : new Pair(item);
}
} else
onError("Expected a sequence for this tag");
return seq2;
}
function createPairs(schema4, iterable, ctx) {
const { replacer } = ctx;
const pairs2 = new YAMLSeq(schema4);
pairs2.tag = "tag:yaml.org,2002:pairs";
let i = 0;
if (iterable && Symbol.iterator in Object(iterable))
for (let it of iterable) {
if (typeof replacer === "function")
it = replacer.call(iterable, String(i++), it);
let key, value;
if (Array.isArray(it)) {
if (it.length === 2) {
key = it[0];
value = it[1];
} else
throw new TypeError(`Expected [key, value] tuple: ${it}`);
} else if (it && it instanceof Object) {
const keys = Object.keys(it);
if (keys.length === 1) {
key = keys[0];
value = it[key];
} else {
throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
}
} else {
key = it;
}
pairs2.items.push(createPair(key, value, ctx));
}
return pairs2;
}
var pairs = {
collection: "seq",
default: false,
tag: "tag:yaml.org,2002:pairs",
resolve: resolvePairs,
createNode: createPairs
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js
var YAMLOMap = class extends YAMLSeq {
constructor() {
super();
this.add = YAMLMap.prototype.add.bind(this);
this.delete = YAMLMap.prototype.delete.bind(this);
this.get = YAMLMap.prototype.get.bind(this);
this.has = YAMLMap.prototype.has.bind(this);
this.set = YAMLMap.prototype.set.bind(this);
this.tag = YAMLOMap.tag;
}
toJSON(_, ctx) {
if (!ctx)
return super.toJSON(_);
const map4 = /* @__PURE__ */ new Map();
if (ctx == null ? void 0 : ctx.onCreate)
ctx.onCreate(map4);
for (const pair of this.items) {
let key, value;
if (isPair(pair)) {
key = toJS(pair.key, "", ctx);
value = toJS(pair.value, key, ctx);
} else {
key = toJS(pair, "", ctx);
}
if (map4.has(key))
throw new Error("Ordered maps must not include duplicate keys");
map4.set(key, value);
}
return map4;
}
static from(schema4, iterable, ctx) {
const pairs2 = createPairs(schema4, iterable, ctx);
const omap2 = new this();
omap2.items = pairs2.items;
return omap2;
}
};
YAMLOMap.tag = "tag:yaml.org,2002:omap";
var omap = {
collection: "seq",
identify: (value) => value instanceof Map,
nodeClass: YAMLOMap,
default: false,
tag: "tag:yaml.org,2002:omap",
resolve(seq2, onError) {
const pairs2 = resolvePairs(seq2, onError);
const seenKeys = [];
for (const { key } of pairs2.items) {
if (isScalar(key)) {
if (seenKeys.includes(key.value)) {
onError(`Ordered maps must not include duplicate keys: ${key.value}`);
} else {
seenKeys.push(key.value);
}
}
}
return Object.assign(new YAMLOMap(), pairs2);
},
createNode: (schema4, iterable, ctx) => YAMLOMap.from(schema4, iterable, ctx)
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
function boolStringify({ value, source }, ctx) {
const boolObj = value ? trueTag : falseTag;
if (source && boolObj.test.test(source))
return source;
return value ? ctx.options.trueStr : ctx.options.falseStr;
}
var trueTag = {
identify: (value) => value === true,
default: true,
tag: "tag:yaml.org,2002:bool",
test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
resolve: () => new Scalar(true),
stringify: boolStringify
};
var falseTag = {
identify: (value) => value === false,
default: true,
tag: "tag:yaml.org,2002:bool",
test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
resolve: () => new Scalar(false),
stringify: boolStringify
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/float.js
var floatNaN2 = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
stringify: stringifyNumber
};
var floatExp2 = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
format: "EXP",
test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
resolve: (str) => parseFloat(str.replace(/_/g, "")),
stringify(node) {
const num = Number(node.value);
return isFinite(num) ? num.toExponential() : stringifyNumber(node);
}
};
var float2 = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
resolve(str) {
const node = new Scalar(parseFloat(str.replace(/_/g, "")));
const dot = str.indexOf(".");
if (dot !== -1) {
const f = str.substring(dot + 1).replace(/_/g, "");
if (f[f.length - 1] === "0")
node.minFractionDigits = f.length;
}
return node;
},
stringify: stringifyNumber
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/int.js
var intIdentify3 = (value) => typeof value === "bigint" || Number.isInteger(value);
function intResolve2(str, offset2, radix, { intAsBigInt }) {
const sign = str[0];
if (sign === "-" || sign === "+")
offset2 += 1;
str = str.substring(offset2).replace(/_/g, "");
if (intAsBigInt) {
switch (radix) {
case 2:
str = `0b${str}`;
break;
case 8:
str = `0o${str}`;
break;
case 16:
str = `0x${str}`;
break;
}
const n3 = BigInt(str);
return sign === "-" ? BigInt(-1) * n3 : n3;
}
const n2 = parseInt(str, radix);
return sign === "-" ? -1 * n2 : n2;
}
function intStringify2(node, radix, prefix) {
const { value } = node;
if (intIdentify3(value)) {
const str = value.toString(radix);
return value < 0 ? "-" + prefix + str.substr(1) : prefix + str;
}
return stringifyNumber(node);
}
var intBin = {
identify: intIdentify3,
default: true,
tag: "tag:yaml.org,2002:int",
format: "BIN",
test: /^[-+]?0b[0-1_]+$/,
resolve: (str, _onError, opt) => intResolve2(str, 2, 2, opt),
stringify: (node) => intStringify2(node, 2, "0b")
};
var intOct2 = {
identify: intIdentify3,
default: true,
tag: "tag:yaml.org,2002:int",
format: "OCT",
test: /^[-+]?0[0-7_]+$/,
resolve: (str, _onError, opt) => intResolve2(str, 1, 8, opt),
stringify: (node) => intStringify2(node, 8, "0")
};
var int3 = {
identify: intIdentify3,
default: true,
tag: "tag:yaml.org,2002:int",
test: /^[-+]?[0-9][0-9_]*$/,
resolve: (str, _onError, opt) => intResolve2(str, 0, 10, opt),
stringify: stringifyNumber
};
var intHex2 = {
identify: intIdentify3,
default: true,
tag: "tag:yaml.org,2002:int",
format: "HEX",
test: /^[-+]?0x[0-9a-fA-F_]+$/,
resolve: (str, _onError, opt) => intResolve2(str, 2, 16, opt),
stringify: (node) => intStringify2(node, 16, "0x")
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js
var YAMLSet = class extends YAMLMap {
constructor(schema4) {
super(schema4);
this.tag = YAMLSet.tag;
}
add(key) {
let pair;
if (isPair(key))
pair = key;
else if (key && typeof key === "object" && "key" in key && "value" in key && key.value === null)
pair = new Pair(key.key, null);
else
pair = new Pair(key, null);
const prev2 = findPair(this.items, pair.key);
if (!prev2)
this.items.push(pair);
}
get(key, keepPair) {
const pair = findPair(this.items, key);
return !keepPair && isPair(pair) ? isScalar(pair.key) ? pair.key.value : pair.key : pair;
}
set(key, value) {
if (typeof value !== "boolean")
throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
const prev2 = findPair(this.items, key);
if (prev2 && !value) {
this.items.splice(this.items.indexOf(prev2), 1);
} else if (!prev2 && value) {
this.items.push(new Pair(key));
}
}
toJSON(_, ctx) {
return super.toJSON(_, ctx, Set);
}
toString(ctx, onComment, onChompKeep) {
if (!ctx)
return JSON.stringify(this);
if (this.hasAllNullValues(true))
return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
else
throw new Error("Set items must all have null values");
}
static from(schema4, iterable, ctx) {
const { replacer } = ctx;
const set3 = new this(schema4);
if (iterable && Symbol.iterator in Object(iterable))
for (let value of iterable) {
if (typeof replacer === "function")
value = replacer.call(iterable, value, value);
set3.items.push(createPair(value, null, ctx));
}
return set3;
}
};
YAMLSet.tag = "tag:yaml.org,2002:set";
var set2 = {
collection: "map",
identify: (value) => value instanceof Set,
nodeClass: YAMLSet,
default: false,
tag: "tag:yaml.org,2002:set",
createNode: (schema4, iterable, ctx) => YAMLSet.from(schema4, iterable, ctx),
resolve(map4, onError) {
if (isMap(map4)) {
if (map4.hasAllNullValues(true))
return Object.assign(new YAMLSet(), map4);
else
onError("Set items must all have null values");
} else
onError("Expected a mapping for this tag");
return map4;
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
function parseSexagesimal(str, asBigInt) {
const sign = str[0];
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
const num = (n2) => asBigInt ? BigInt(n2) : Number(n2);
const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num(60) + num(p), num(0));
return sign === "-" ? num(-1) * res : res;
}
function stringifySexagesimal(node) {
let { value } = node;
let num = (n2) => n2;
if (typeof value === "bigint")
num = (n2) => BigInt(n2);
else if (isNaN(value) || !isFinite(value))
return stringifyNumber(node);
let sign = "";
if (value < 0) {
sign = "-";
value *= num(-1);
}
const _60 = num(60);
const parts = [value % _60];
if (value < 60) {
parts.unshift(0);
} else {
value = (value - parts[0]) / _60;
parts.unshift(value % _60);
if (value >= 60) {
value = (value - parts[0]) / _60;
parts.unshift(value);
}
}
return sign + parts.map((n2) => String(n2).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
}
var intTime = {
identify: (value) => typeof value === "bigint" || Number.isInteger(value),
default: true,
tag: "tag:yaml.org,2002:int",
format: "TIME",
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
stringify: stringifySexagesimal
};
var floatTime = {
identify: (value) => typeof value === "number",
default: true,
tag: "tag:yaml.org,2002:float",
format: "TIME",
test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
resolve: (str) => parseSexagesimal(str, false),
stringify: stringifySexagesimal
};
var timestamp = {
identify: (value) => value instanceof Date,
default: true,
tag: "tag:yaml.org,2002:timestamp",
test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
resolve(str) {
const match3 = str.match(timestamp.test);
if (!match3)
throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");
const [, year, month, day, hour, minute, second] = match3.map(Number);
const millisec = match3[7] ? Number((match3[7] + "00").substr(1, 3)) : 0;
let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
const tz = match3[8];
if (tz && tz !== "Z") {
let d = parseSexagesimal(tz, false);
if (Math.abs(d) < 30)
d *= 60;
date -= 6e4 * d;
}
return new Date(date);
},
stringify: ({ value }) => {
var _a3;
return (_a3 = value == null ? void 0 : value.toISOString().replace(/(T00:00:00)?\.000Z$/, "")) != null ? _a3 : "";
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/yaml-1.1/schema.js
var schema3 = [
map3,
seq,
string,
nullTag,
trueTag,
falseTag,
intBin,
intOct2,
int3,
intHex2,
floatNaN2,
floatExp2,
float2,
binary,
merge3,
omap,
pairs,
set2,
intTime,
floatTime,
timestamp
];
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/tags.js
var schemas = /* @__PURE__ */ new Map([
["core", schema],
["failsafe", [map3, seq, string]],
["json", schema2],
["yaml11", schema3],
["yaml-1.1", schema3]
]);
var tagsByName = {
binary,
bool: boolTag,
float,
floatExp,
floatNaN,
floatTime,
int: int2,
intHex,
intOct,
intTime,
map: map3,
merge: merge3,
null: nullTag,
omap,
pairs,
seq,
set: set2,
timestamp
};
var coreKnownTags = {
"tag:yaml.org,2002:binary": binary,
"tag:yaml.org,2002:merge": merge3,
"tag:yaml.org,2002:omap": omap,
"tag:yaml.org,2002:pairs": pairs,
"tag:yaml.org,2002:set": set2,
"tag:yaml.org,2002:timestamp": timestamp
};
function getTags(customTags, schemaName, addMergeTag) {
const schemaTags = schemas.get(schemaName);
if (schemaTags && !customTags) {
return addMergeTag && !schemaTags.includes(merge3) ? schemaTags.concat(merge3) : schemaTags.slice();
}
let tags = schemaTags;
if (!tags) {
if (Array.isArray(customTags))
tags = [];
else {
const keys = Array.from(schemas.keys()).filter((key) => key !== "yaml11").map((key) => JSON.stringify(key)).join(", ");
throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
}
}
if (Array.isArray(customTags)) {
for (const tag of customTags)
tags = tags.concat(tag);
} else if (typeof customTags === "function") {
tags = customTags(tags.slice());
}
if (addMergeTag)
tags = tags.concat(merge3);
return tags.reduce((tags2, tag) => {
const tagObj = typeof tag === "string" ? tagsByName[tag] : tag;
if (!tagObj) {
const tagName = JSON.stringify(tag);
const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
}
if (!tags2.includes(tagObj))
tags2.push(tagObj);
return tags2;
}, []);
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/schema/Schema.js
var sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
var Schema = class {
constructor({ compat, customTags, merge: merge4, resolveKnownTags, schema: schema4, sortMapEntries, toStringDefaults }) {
this.compat = Array.isArray(compat) ? getTags(compat, "compat") : compat ? getTags(null, compat) : null;
this.name = typeof schema4 === "string" && schema4 || "core";
this.knownTags = resolveKnownTags ? coreKnownTags : {};
this.tags = getTags(customTags, this.name, merge4);
this.toStringOptions = toStringDefaults != null ? toStringDefaults : null;
Object.defineProperty(this, MAP, { value: map3 });
Object.defineProperty(this, SCALAR, { value: string });
Object.defineProperty(this, SEQ, { value: seq });
this.sortMapEntries = typeof sortMapEntries === "function" ? sortMapEntries : sortMapEntries === true ? sortMapEntriesByKey : null;
}
clone() {
const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));
copy.tags = this.tags.slice();
return copy;
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/stringify/stringifyDocument.js
function stringifyDocument(doc, options) {
var _a3;
const lines = [];
let hasDirectives = options.directives === true;
if (options.directives !== false && doc.directives) {
const dir = doc.directives.toString(doc);
if (dir) {
lines.push(dir);
hasDirectives = true;
} else if (doc.directives.docStart)
hasDirectives = true;
}
if (hasDirectives)
lines.push("---");
const ctx = createStringifyContext(doc, options);
const { commentString } = ctx.options;
if (doc.commentBefore) {
if (lines.length !== 1)
lines.unshift("");
const cs = commentString(doc.commentBefore);
lines.unshift(indentComment(cs, ""));
}
let chompKeep = false;
let contentComment = null;
if (doc.contents) {
if (isNode2(doc.contents)) {
if (doc.contents.spaceBefore && hasDirectives)
lines.push("");
if (doc.contents.commentBefore) {
const cs = commentString(doc.contents.commentBefore);
lines.push(indentComment(cs, ""));
}
ctx.forceBlockIndent = !!doc.comment;
contentComment = doc.contents.comment;
}
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
let body = stringify2(doc.contents, ctx, () => contentComment = null, onChompKeep);
if (contentComment)
body += lineComment(body, "", commentString(contentComment));
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
lines[lines.length - 1] = `--- ${body}`;
} else
lines.push(body);
} else {
lines.push(stringify2(doc.contents, ctx));
}
if ((_a3 = doc.directives) == null ? void 0 : _a3.docEnd) {
if (doc.comment) {
const cs = commentString(doc.comment);
if (cs.includes("\n")) {
lines.push("...");
lines.push(indentComment(cs, ""));
} else {
lines.push(`... ${cs}`);
}
} else {
lines.push("...");
}
} else {
let dc = doc.comment;
if (dc && chompKeep)
dc = dc.replace(/^\n+/, "");
if (dc) {
if ((!chompKeep || contentComment) && lines[lines.length - 1] !== "")
lines.push("");
lines.push(indentComment(commentString(dc), ""));
}
}
return lines.join("\n") + "\n";
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/doc/Document.js
var Document2 = class {
constructor(value, replacer, options) {
this.commentBefore = null;
this.comment = null;
this.errors = [];
this.warnings = [];
Object.defineProperty(this, NODE_TYPE2, { value: DOC });
let _replacer = null;
if (typeof replacer === "function" || Array.isArray(replacer)) {
_replacer = replacer;
} else if (options === void 0 && replacer) {
options = replacer;
replacer = void 0;
}
const opt = Object.assign({
intAsBigInt: false,
keepSourceTokens: false,
logLevel: "warn",
prettyErrors: true,
strict: true,
stringKeys: false,
uniqueKeys: true,
version: "1.2"
}, options);
this.options = opt;
let { version } = opt;
if (options == null ? void 0 : options._directives) {
this.directives = options._directives.atDocument();
if (this.directives.yaml.explicit)
version = this.directives.yaml.version;
} else
this.directives = new Directives({ version });
this.setSchema(version, options);
this.contents = value === void 0 ? null : this.createNode(value, _replacer, options);
}
clone() {
const copy = Object.create(Document2.prototype, {
[NODE_TYPE2]: { value: DOC }
});
copy.commentBefore = this.commentBefore;
copy.comment = this.comment;
copy.errors = this.errors.slice();
copy.warnings = this.warnings.slice();
copy.options = Object.assign({}, this.options);
if (this.directives)
copy.directives = this.directives.clone();
copy.schema = this.schema.clone();
copy.contents = isNode2(this.contents) ? this.contents.clone(copy.schema) : this.contents;
if (this.range)
copy.range = this.range.slice();
return copy;
}
add(value) {
if (assertCollection(this.contents))
this.contents.add(value);
}
addIn(path, value) {
if (assertCollection(this.contents))
this.contents.addIn(path, value);
}
createAlias(node, name2) {
if (!node.anchor) {
const prev2 = anchorNames(this);
node.anchor = !name2 || prev2.has(name2) ? findNewAnchor(name2 || "a", prev2) : name2;
}
return new Alias(node.anchor);
}
createNode(value, replacer, options) {
let _replacer = void 0;
if (typeof replacer === "function") {
value = replacer.call({ "": value }, "", value);
_replacer = replacer;
} else if (Array.isArray(replacer)) {
const keyToStr = (v) => typeof v === "number" || v instanceof String || v instanceof Number;
const asStr = replacer.filter(keyToStr).map(String);
if (asStr.length > 0)
replacer = replacer.concat(asStr);
_replacer = replacer;
} else if (options === void 0 && replacer) {
options = replacer;
replacer = void 0;
}
const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options != null ? options : {};
const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(
this,
anchorPrefix || "a"
);
const ctx = {
aliasDuplicateObjects: aliasDuplicateObjects != null ? aliasDuplicateObjects : true,
keepUndefined: keepUndefined != null ? keepUndefined : false,
onAnchor,
onTagObj,
replacer: _replacer,
schema: this.schema,
sourceObjects
};
const node = createNode(value, tag, ctx);
if (flow && isCollection(node))
node.flow = true;
setAnchors();
return node;
}
createPair(key, value, options = {}) {
const k = this.createNode(key, null, options);
const v = this.createNode(value, null, options);
return new Pair(k, v);
}
delete(key) {
return assertCollection(this.contents) ? this.contents.delete(key) : false;
}
deleteIn(path) {
if (isEmptyPath(path)) {
if (this.contents == null)
return false;
this.contents = null;
return true;
}
return assertCollection(this.contents) ? this.contents.deleteIn(path) : false;
}
get(key, keepScalar) {
return isCollection(this.contents) ? this.contents.get(key, keepScalar) : void 0;
}
getIn(path, keepScalar) {
if (isEmptyPath(path))
return !keepScalar && isScalar(this.contents) ? this.contents.value : this.contents;
return isCollection(this.contents) ? this.contents.getIn(path, keepScalar) : void 0;
}
has(key) {
return isCollection(this.contents) ? this.contents.has(key) : false;
}
hasIn(path) {
if (isEmptyPath(path))
return this.contents !== void 0;
return isCollection(this.contents) ? this.contents.hasIn(path) : false;
}
set(key, value) {
if (this.contents == null) {
this.contents = collectionFromPath(this.schema, [key], value);
} else if (assertCollection(this.contents)) {
this.contents.set(key, value);
}
}
setIn(path, value) {
if (isEmptyPath(path)) {
this.contents = value;
} else if (this.contents == null) {
this.contents = collectionFromPath(this.schema, Array.from(path), value);
} else if (assertCollection(this.contents)) {
this.contents.setIn(path, value);
}
}
setSchema(version, options = {}) {
if (typeof version === "number")
version = String(version);
let opt;
switch (version) {
case "1.1":
if (this.directives)
this.directives.yaml.version = "1.1";
else
this.directives = new Directives({ version: "1.1" });
opt = { resolveKnownTags: false, schema: "yaml-1.1" };
break;
case "1.2":
case "next":
if (this.directives)
this.directives.yaml.version = version;
else
this.directives = new Directives({ version });
opt = { resolveKnownTags: true, schema: "core" };
break;
case null:
if (this.directives)
delete this.directives;
opt = null;
break;
default: {
const sv = JSON.stringify(version);
throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
}
}
if (options.schema instanceof Object)
this.schema = options.schema;
else if (opt)
this.schema = new Schema(Object.assign(opt, options));
else
throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
}
toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
const ctx = {
anchors: /* @__PURE__ */ new Map(),
doc: this,
keep: !json,
mapAsMap: mapAsMap === true,
mapKeyWarned: false,
maxAliasCount: typeof maxAliasCount === "number" ? maxAliasCount : 100
};
const res = toJS(this.contents, jsonArg != null ? jsonArg : "", ctx);
if (typeof onAnchor === "function")
for (const { count, res: res2 } of ctx.anchors.values())
onAnchor(res2, count);
return typeof reviver === "function" ? applyReviver(reviver, { "": res }, "", res) : res;
}
toJSON(jsonArg, onAnchor) {
return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
}
toString(options = {}) {
if (this.errors.length > 0)
throw new Error("Document with errors cannot be stringified");
if ("indent" in options && (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {
const s2 = JSON.stringify(options.indent);
throw new Error(`"indent" option must be a positive integer, not ${s2}`);
}
return stringifyDocument(this, options);
}
};
function assertCollection(contents2) {
if (isCollection(contents2))
return true;
throw new Error("Expected a YAML collection as document contents");
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/errors.js
var YAMLError = class extends Error {
constructor(name2, pos, code2, message) {
super();
this.name = name2;
this.code = code2;
this.message = message;
this.pos = pos;
}
};
var YAMLParseError = class extends YAMLError {
constructor(pos, code2, message) {
super("YAMLParseError", pos, code2, message);
}
};
var YAMLWarning = class extends YAMLError {
constructor(pos, code2, message) {
super("YAMLWarning", pos, code2, message);
}
};
var prettifyError = (src, lc) => (error2) => {
if (error2.pos[0] === -1)
return;
error2.linePos = error2.pos.map((pos) => lc.linePos(pos));
const { line, col } = error2.linePos[0];
error2.message += ` at line ${line}, column ${col}`;
let ci = col - 1;
let lineStr = src.substring(lc.lineStarts[line - 1], lc.lineStarts[line]).replace(/[\n\r]+$/, "");
if (ci >= 60 && lineStr.length > 80) {
const trimStart = Math.min(ci - 39, lineStr.length - 79);
lineStr = "\u2026" + lineStr.substring(trimStart);
ci -= trimStart - 1;
}
if (lineStr.length > 80)
lineStr = lineStr.substring(0, 79) + "\u2026";
if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
let prev2 = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
if (prev2.length > 80)
prev2 = prev2.substring(0, 79) + "\u2026\n";
lineStr = prev2 + lineStr;
}
if (/[^ ]/.test(lineStr)) {
let count = 1;
const end2 = error2.linePos[1];
if (end2 && end2.line === line && end2.col > col) {
count = Math.max(1, Math.min(end2.col - col, 80 - ci));
}
const pointer = " ".repeat(ci) + "^".repeat(count);
error2.message += `:
${lineStr}
${pointer}
`;
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-props.js
function resolveProps(tokens, { flow, indicator, next: next2, offset: offset2, onError, parentIndent, startOnNewline }) {
let spaceBefore = false;
let atNewline = startOnNewline;
let hasSpace = startOnNewline;
let comment2 = "";
let commentSep = "";
let hasNewline = false;
let reqSpace = false;
let tab = null;
let anchor = null;
let tag = null;
let newlineAfterProp = null;
let comma = null;
let found = null;
let start = null;
for (const token of tokens) {
if (reqSpace) {
if (token.type !== "space" && token.type !== "newline" && token.type !== "comma")
onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
reqSpace = false;
}
if (tab) {
if (atNewline && token.type !== "comment" && token.type !== "newline") {
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
}
tab = null;
}
switch (token.type) {
case "space":
if (!flow && (indicator !== "doc-start" || (next2 == null ? void 0 : next2.type) !== "flow-collection") && token.source.includes(" ")) {
tab = token;
}
hasSpace = true;
break;
case "comment": {
if (!hasSpace)
onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
const cb = token.source.substring(1) || " ";
if (!comment2)
comment2 = cb;
else
comment2 += commentSep + cb;
commentSep = "";
atNewline = false;
break;
}
case "newline":
if (atNewline) {
if (comment2)
comment2 += token.source;
else if (!found || indicator !== "seq-item-ind")
spaceBefore = true;
} else
commentSep += token.source;
atNewline = true;
hasNewline = true;
if (anchor || tag)
newlineAfterProp = token;
hasSpace = true;
break;
case "anchor":
if (anchor)
onError(token, "MULTIPLE_ANCHORS", "A node can have at most one anchor");
if (token.source.endsWith(":"))
onError(token.offset + token.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", true);
anchor = token;
if (start === null)
start = token.offset;
atNewline = false;
hasSpace = false;
reqSpace = true;
break;
case "tag": {
if (tag)
onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
tag = token;
if (start === null)
start = token.offset;
atNewline = false;
hasSpace = false;
reqSpace = true;
break;
}
case indicator:
if (anchor || tag)
onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
if (found)
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow != null ? flow : "collection"}`);
found = token;
atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
hasSpace = false;
break;
case "comma":
if (flow) {
if (comma)
onError(token, "UNEXPECTED_TOKEN", `Unexpected , in ${flow}`);
comma = token;
atNewline = false;
hasSpace = false;
break;
}
default:
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.type} token`);
atNewline = false;
hasSpace = false;
}
}
const last2 = tokens[tokens.length - 1];
const end2 = last2 ? last2.offset + last2.source.length : offset2;
if (reqSpace && next2 && next2.type !== "space" && next2.type !== "newline" && next2.type !== "comma" && (next2.type !== "scalar" || next2.source !== "")) {
onError(next2.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
}
if (tab && (atNewline && tab.indent <= parentIndent || (next2 == null ? void 0 : next2.type) === "block-map" || (next2 == null ? void 0 : next2.type) === "block-seq"))
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
return {
comma,
found,
spaceBefore,
comment: comment2,
hasNewline,
anchor,
tag,
newlineAfterProp,
end: end2,
start: start != null ? start : end2
};
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/util-contains-newline.js
function containsNewline(key) {
if (!key)
return null;
switch (key.type) {
case "alias":
case "scalar":
case "double-quoted-scalar":
case "single-quoted-scalar":
if (key.source.includes("\n"))
return true;
if (key.end) {
for (const st of key.end)
if (st.type === "newline")
return true;
}
return false;
case "flow-collection":
for (const it of key.items) {
for (const st of it.start)
if (st.type === "newline")
return true;
if (it.sep) {
for (const st of it.sep)
if (st.type === "newline")
return true;
}
if (containsNewline(it.key) || containsNewline(it.value))
return true;
}
return false;
default:
return true;
}
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
function flowIndentCheck(indent, fc, onError) {
if ((fc == null ? void 0 : fc.type) === "flow-collection") {
const end2 = fc.end[0];
if (end2.indent === indent && (end2.source === "]" || end2.source === "}") && containsNewline(fc)) {
const msg = "Flow end indicator should be more indented than parent";
onError(end2, "BAD_INDENT", msg, true);
}
}
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/util-map-includes.js
function mapIncludes(ctx, items, search) {
const { uniqueKeys } = ctx.options;
if (uniqueKeys === false)
return false;
const isEqual = typeof uniqueKeys === "function" ? uniqueKeys : (a, b) => a === b || isScalar(a) && isScalar(b) && a.value === b.value;
return items.some((pair) => isEqual(pair.key, search));
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-block-map.js
var startColMsg = "All mapping items must start at the same column";
function resolveBlockMap({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bm, onError, tag) {
var _a3, _b;
const NodeClass = (_a3 = tag == null ? void 0 : tag.nodeClass) != null ? _a3 : YAMLMap;
const map4 = new NodeClass(ctx.schema);
if (ctx.atRoot)
ctx.atRoot = false;
let offset2 = bm.offset;
let commentEnd = null;
for (const collItem of bm.items) {
const { start, key, sep, value } = collItem;
const keyProps = resolveProps(start, {
indicator: "explicit-key-ind",
next: key != null ? key : sep == null ? void 0 : sep[0],
offset: offset2,
onError,
parentIndent: bm.indent,
startOnNewline: true
});
const implicitKey = !keyProps.found;
if (implicitKey) {
if (key) {
if (key.type === "block-seq")
onError(offset2, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key");
else if ("indent" in key && key.indent !== bm.indent)
onError(offset2, "BAD_INDENT", startColMsg);
}
if (!keyProps.anchor && !keyProps.tag && !sep) {
commentEnd = keyProps.end;
if (keyProps.comment) {
if (map4.comment)
map4.comment += "\n" + keyProps.comment;
else
map4.comment = keyProps.comment;
}
continue;
}
if (keyProps.newlineAfterProp || containsNewline(key)) {
onError(key != null ? key : start[start.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
}
} else if (((_b = keyProps.found) == null ? void 0 : _b.indent) !== bm.indent) {
onError(offset2, "BAD_INDENT", startColMsg);
}
ctx.atKey = true;
const keyStart = keyProps.end;
const keyNode = key ? composeNode2(ctx, key, keyProps, onError) : composeEmptyNode2(ctx, keyStart, start, null, keyProps, onError);
if (ctx.schema.compat)
flowIndentCheck(bm.indent, key, onError);
ctx.atKey = false;
if (mapIncludes(ctx, map4.items, keyNode))
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
const valueProps = resolveProps(sep != null ? sep : [], {
indicator: "map-value-ind",
next: value,
offset: keyNode.range[2],
onError,
parentIndent: bm.indent,
startOnNewline: !key || key.type === "block-scalar"
});
offset2 = valueProps.end;
if (valueProps.found) {
if (implicitKey) {
if ((value == null ? void 0 : value.type) === "block-map" && !valueProps.hasNewline)
onError(offset2, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings");
if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
}
const valueNode = value ? composeNode2(ctx, value, valueProps, onError) : composeEmptyNode2(ctx, offset2, sep, null, valueProps, onError);
if (ctx.schema.compat)
flowIndentCheck(bm.indent, value, onError);
offset2 = valueNode.range[2];
const pair = new Pair(keyNode, valueNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
map4.items.push(pair);
} else {
if (implicitKey)
onError(keyNode.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values");
if (valueProps.comment) {
if (keyNode.comment)
keyNode.comment += "\n" + valueProps.comment;
else
keyNode.comment = valueProps.comment;
}
const pair = new Pair(keyNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
map4.items.push(pair);
}
}
if (commentEnd && commentEnd < offset2)
onError(commentEnd, "IMPOSSIBLE", "Map comment with trailing content");
map4.range = [bm.offset, offset2, commentEnd != null ? commentEnd : offset2];
return map4;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-block-seq.js
function resolveBlockSeq({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, bs, onError, tag) {
var _a3;
const NodeClass = (_a3 = tag == null ? void 0 : tag.nodeClass) != null ? _a3 : YAMLSeq;
const seq2 = new NodeClass(ctx.schema);
if (ctx.atRoot)
ctx.atRoot = false;
if (ctx.atKey)
ctx.atKey = false;
let offset2 = bs.offset;
let commentEnd = null;
for (const { start, value } of bs.items) {
const props = resolveProps(start, {
indicator: "seq-item-ind",
next: value,
offset: offset2,
onError,
parentIndent: bs.indent,
startOnNewline: true
});
if (!props.found) {
if (props.anchor || props.tag || value) {
if (value && value.type === "block-seq")
onError(props.end, "BAD_INDENT", "All sequence items must start at the same column");
else
onError(offset2, "MISSING_CHAR", "Sequence item without - indicator");
} else {
commentEnd = props.end;
if (props.comment)
seq2.comment = props.comment;
continue;
}
}
const node = value ? composeNode2(ctx, value, props, onError) : composeEmptyNode2(ctx, props.end, start, null, props, onError);
if (ctx.schema.compat)
flowIndentCheck(bs.indent, value, onError);
offset2 = node.range[2];
seq2.items.push(node);
}
seq2.range = [bs.offset, offset2, commentEnd != null ? commentEnd : offset2];
return seq2;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-end.js
function resolveEnd(end2, offset2, reqSpace, onError) {
let comment2 = "";
if (end2) {
let hasSpace = false;
let sep = "";
for (const token of end2) {
const { source, type } = token;
switch (type) {
case "space":
hasSpace = true;
break;
case "comment": {
if (reqSpace && !hasSpace)
onError(token, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
const cb = source.substring(1) || " ";
if (!comment2)
comment2 = cb;
else
comment2 += sep + cb;
sep = "";
break;
}
case "newline":
if (comment2)
sep += source;
hasSpace = true;
break;
default:
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${type} at node end`);
}
offset2 += source.length;
}
}
return { comment: comment2, offset: offset2 };
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
var blockMsg = "Block collections are not allowed within flow collections";
var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq");
function resolveFlowCollection({ composeNode: composeNode2, composeEmptyNode: composeEmptyNode2 }, ctx, fc, onError, tag) {
var _a3, _b;
const isMap2 = fc.start.source === "{";
const fcName = isMap2 ? "flow map" : "flow sequence";
const NodeClass = (_a3 = tag == null ? void 0 : tag.nodeClass) != null ? _a3 : isMap2 ? YAMLMap : YAMLSeq;
const coll = new NodeClass(ctx.schema);
coll.flow = true;
const atRoot = ctx.atRoot;
if (atRoot)
ctx.atRoot = false;
if (ctx.atKey)
ctx.atKey = false;
let offset2 = fc.offset + fc.start.source.length;
for (let i = 0; i < fc.items.length; ++i) {
const collItem = fc.items[i];
const { start, key, sep, value } = collItem;
const props = resolveProps(start, {
flow: fcName,
indicator: "explicit-key-ind",
next: key != null ? key : sep == null ? void 0 : sep[0],
offset: offset2,
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (!props.found) {
if (!props.anchor && !props.tag && !sep && !value) {
if (i === 0 && props.comma)
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
else if (i < fc.items.length - 1)
onError(props.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${fcName}`);
if (props.comment) {
if (coll.comment)
coll.comment += "\n" + props.comment;
else
coll.comment = props.comment;
}
offset2 = props.end;
continue;
}
if (!isMap2 && ctx.options.strict && containsNewline(key))
onError(
key,
"MULTILINE_IMPLICIT_KEY",
"Implicit keys of flow sequence pairs need to be on a single line"
);
}
if (i === 0) {
if (props.comma)
onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
} else {
if (!props.comma)
onError(props.start, "MISSING_CHAR", `Missing , between ${fcName} items`);
if (props.comment) {
let prevItemComment = "";
loop:
for (const st of start) {
switch (st.type) {
case "comma":
case "space":
break;
case "comment":
prevItemComment = st.source.substring(1);
break loop;
default:
break loop;
}
}
if (prevItemComment) {
let prev2 = coll.items[coll.items.length - 1];
if (isPair(prev2))
prev2 = (_b = prev2.value) != null ? _b : prev2.key;
if (prev2.comment)
prev2.comment += "\n" + prevItemComment;
else
prev2.comment = prevItemComment;
props.comment = props.comment.substring(prevItemComment.length + 1);
}
}
}
if (!isMap2 && !sep && !props.found) {
const valueNode = value ? composeNode2(ctx, value, props, onError) : composeEmptyNode2(ctx, props.end, sep, null, props, onError);
coll.items.push(valueNode);
offset2 = valueNode.range[2];
if (isBlock(value))
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
} else {
ctx.atKey = true;
const keyStart = props.end;
const keyNode = key ? composeNode2(ctx, key, props, onError) : composeEmptyNode2(ctx, keyStart, start, null, props, onError);
if (isBlock(key))
onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
ctx.atKey = false;
const valueProps = resolveProps(sep != null ? sep : [], {
flow: fcName,
indicator: "map-value-ind",
next: value,
offset: keyNode.range[2],
onError,
parentIndent: fc.indent,
startOnNewline: false
});
if (valueProps.found) {
if (!isMap2 && !props.found && ctx.options.strict) {
if (sep)
for (const st of sep) {
if (st === valueProps.found)
break;
if (st.type === "newline") {
onError(st, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
break;
}
}
if (props.start < valueProps.found.offset - 1024)
onError(valueProps.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
}
} else if (value) {
if ("source" in value && value.source && value.source[0] === ":")
onError(value, "MISSING_CHAR", `Missing space after : in ${fcName}`);
else
onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
}
const valueNode = value ? composeNode2(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode2(ctx, valueProps.end, sep, null, valueProps, onError) : null;
if (valueNode) {
if (isBlock(value))
onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
} else if (valueProps.comment) {
if (keyNode.comment)
keyNode.comment += "\n" + valueProps.comment;
else
keyNode.comment = valueProps.comment;
}
const pair = new Pair(keyNode, valueNode);
if (ctx.options.keepSourceTokens)
pair.srcToken = collItem;
if (isMap2) {
const map4 = coll;
if (mapIncludes(ctx, map4.items, keyNode))
onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
map4.items.push(pair);
} else {
const map4 = new YAMLMap(ctx.schema);
map4.flow = true;
map4.items.push(pair);
const endRange = (valueNode != null ? valueNode : keyNode).range;
map4.range = [keyNode.range[0], endRange[1], endRange[2]];
coll.items.push(map4);
}
offset2 = valueNode ? valueNode.range[2] : valueProps.end;
}
}
const expectedEnd = isMap2 ? "}" : "]";
const [ce, ...ee] = fc.end;
let cePos = offset2;
if (ce && ce.source === expectedEnd)
cePos = ce.offset + ce.source.length;
else {
const name2 = fcName[0].toUpperCase() + fcName.substring(1);
const msg = atRoot ? `${name2} must end with a ${expectedEnd}` : `${name2} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
onError(offset2, atRoot ? "MISSING_CHAR" : "BAD_INDENT", msg);
if (ce && ce.source.length !== 1)
ee.unshift(ce);
}
if (ee.length > 0) {
const end2 = resolveEnd(ee, cePos, ctx.options.strict, onError);
if (end2.comment) {
if (coll.comment)
coll.comment += "\n" + end2.comment;
else
coll.comment = end2.comment;
}
coll.range = [fc.offset, cePos, end2.offset];
} else {
coll.range = [fc.offset, cePos, cePos];
}
return coll;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/compose-collection.js
function resolveCollection(CN2, ctx, token, onError, tagName, tag) {
const coll = token.type === "block-map" ? resolveBlockMap(CN2, ctx, token, onError, tag) : token.type === "block-seq" ? resolveBlockSeq(CN2, ctx, token, onError, tag) : resolveFlowCollection(CN2, ctx, token, onError, tag);
const Coll = coll.constructor;
if (tagName === "!" || tagName === Coll.tagName) {
coll.tag = Coll.tagName;
return coll;
}
if (tagName)
coll.tag = tagName;
return coll;
}
function composeCollection(CN2, ctx, token, props, onError) {
var _a3, _b, _c;
const tagToken = props.tag;
const tagName = !tagToken ? null : ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg));
if (token.type === "block-seq") {
const { anchor, newlineAfterProp: nl } = props;
const lastProp = anchor && tagToken ? anchor.offset > tagToken.offset ? anchor : tagToken : anchor != null ? anchor : tagToken;
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
const message = "Missing newline after block sequence props";
onError(lastProp, "MISSING_CHAR", message);
}
}
const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.tagName && expType === "seq") {
return resolveCollection(CN2, ctx, token, onError, tagName);
}
let tag = ctx.schema.tags.find((t2) => t2.tag === tagName && t2.collection === expType);
if (!tag) {
const kt = ctx.schema.knownTags[tagName];
if (kt && kt.collection === expType) {
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
tag = kt;
} else {
if (kt) {
onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${(_a3 = kt.collection) != null ? _a3 : "scalar"}`, true);
} else {
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, true);
}
return resolveCollection(CN2, ctx, token, onError, tagName);
}
}
const coll = resolveCollection(CN2, ctx, token, onError, tagName, tag);
const res = (_c = (_b = tag.resolve) == null ? void 0 : _b.call(tag, coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options)) != null ? _c : coll;
const node = isNode2(res) ? res : new Scalar(res);
node.range = coll.range;
node.tag = tagName;
if (tag == null ? void 0 : tag.format)
node.format = tag.format;
return node;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
function resolveBlockScalar(ctx, scalar, onError) {
const start = scalar.offset;
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
if (!header)
return { value: "", type: null, comment: "", range: [start, start, start] };
const type = header.mode === ">" ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;
const lines = scalar.source ? splitLines(scalar.source) : [];
let chompStart = lines.length;
for (let i = lines.length - 1; i >= 0; --i) {
const content = lines[i][1];
if (content === "" || content === "\r")
chompStart = i;
else
break;
}
if (chompStart === 0) {
const value2 = header.chomp === "+" && lines.length > 0 ? "\n".repeat(Math.max(1, lines.length - 1)) : "";
let end3 = start + header.length;
if (scalar.source)
end3 += scalar.source.length;
return { value: value2, type, comment: header.comment, range: [start, end3, end3] };
}
let trimIndent = scalar.indent + header.indent;
let offset2 = scalar.offset + header.length;
let contentStart = 0;
for (let i = 0; i < chompStart; ++i) {
const [indent, content] = lines[i];
if (content === "" || content === "\r") {
if (header.indent === 0 && indent.length > trimIndent)
trimIndent = indent.length;
} else {
if (indent.length < trimIndent) {
const message = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
onError(offset2 + indent.length, "MISSING_CHAR", message);
}
if (header.indent === 0)
trimIndent = indent.length;
contentStart = i;
if (trimIndent === 0 && !ctx.atRoot) {
const message = "Block scalar values in collections must be indented";
onError(offset2, "BAD_INDENT", message);
}
break;
}
offset2 += indent.length + content.length + 1;
}
for (let i = lines.length - 1; i >= chompStart; --i) {
if (lines[i][0].length > trimIndent)
chompStart = i + 1;
}
let value = "";
let sep = "";
let prevMoreIndented = false;
for (let i = 0; i < contentStart; ++i)
value += lines[i][0].slice(trimIndent) + "\n";
for (let i = contentStart; i < chompStart; ++i) {
let [indent, content] = lines[i];
offset2 += indent.length + content.length + 1;
const crlf = content[content.length - 1] === "\r";
if (crlf)
content = content.slice(0, -1);
if (content && indent.length < trimIndent) {
const src = header.indent ? "explicit indentation indicator" : "first line";
const message = `Block scalar lines must not be less indented than their ${src}`;
onError(offset2 - content.length - (crlf ? 2 : 1), "BAD_INDENT", message);
indent = "";
}
if (type === Scalar.BLOCK_LITERAL) {
value += sep + indent.slice(trimIndent) + content;
sep = "\n";
} else if (indent.length > trimIndent || content[0] === " ") {
if (sep === " ")
sep = "\n";
else if (!prevMoreIndented && sep === "\n")
sep = "\n\n";
value += sep + indent.slice(trimIndent) + content;
sep = "\n";
prevMoreIndented = true;
} else if (content === "") {
if (sep === "\n")
value += "\n";
else
sep = "\n";
} else {
value += sep + content;
sep = " ";
prevMoreIndented = false;
}
}
switch (header.chomp) {
case "-":
break;
case "+":
for (let i = chompStart; i < lines.length; ++i)
value += "\n" + lines[i][0].slice(trimIndent);
if (value[value.length - 1] !== "\n")
value += "\n";
break;
default:
value += "\n";
}
const end2 = start + header.length + scalar.source.length;
return { value, type, comment: header.comment, range: [start, end2, end2] };
}
function parseBlockScalarHeader({ offset: offset2, props }, strict, onError) {
if (props[0].type !== "block-scalar-header") {
onError(props[0], "IMPOSSIBLE", "Block scalar header not found");
return null;
}
const { source } = props[0];
const mode = source[0];
let indent = 0;
let chomp = "";
let error2 = -1;
for (let i = 1; i < source.length; ++i) {
const ch = source[i];
if (!chomp && (ch === "-" || ch === "+"))
chomp = ch;
else {
const n2 = Number(ch);
if (!indent && n2)
indent = n2;
else if (error2 === -1)
error2 = offset2 + i;
}
}
if (error2 !== -1)
onError(error2, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${source}`);
let hasSpace = false;
let comment2 = "";
let length = source.length;
for (let i = 1; i < props.length; ++i) {
const token = props[i];
switch (token.type) {
case "space":
hasSpace = true;
case "newline":
length += token.source.length;
break;
case "comment":
if (strict && !hasSpace) {
const message = "Comments must be separated from other tokens by white space characters";
onError(token, "MISSING_CHAR", message);
}
length += token.source.length;
comment2 = token.source.substring(1);
break;
case "error":
onError(token, "UNEXPECTED_TOKEN", token.message);
length += token.source.length;
break;
default: {
const message = `Unexpected token in block scalar header: ${token.type}`;
onError(token, "UNEXPECTED_TOKEN", message);
const ts = token.source;
if (ts && typeof ts === "string")
length += ts.length;
}
}
}
return { mode, indent, chomp, comment: comment2, length };
}
function splitLines(source) {
const split = source.split(/\n( *)/);
const first2 = split[0];
const m = first2.match(/^( *)/);
const line0 = (m == null ? void 0 : m[1]) ? [m[1], first2.slice(m[1].length)] : ["", first2];
const lines = [line0];
for (let i = 1; i < split.length; i += 2)
lines.push([split[i], split[i + 1]]);
return lines;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
function resolveFlowScalar(scalar, strict, onError) {
const { offset: offset2, type, source, end: end2 } = scalar;
let _type;
let value;
const _onError = (rel, code2, msg) => onError(offset2 + rel, code2, msg);
switch (type) {
case "scalar":
_type = Scalar.PLAIN;
value = plainValue(source, _onError);
break;
case "single-quoted-scalar":
_type = Scalar.QUOTE_SINGLE;
value = singleQuotedValue(source, _onError);
break;
case "double-quoted-scalar":
_type = Scalar.QUOTE_DOUBLE;
value = doubleQuotedValue(source, _onError);
break;
default:
onError(scalar, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${type}`);
return {
value: "",
type: null,
comment: "",
range: [offset2, offset2 + source.length, offset2 + source.length]
};
}
const valueEnd = offset2 + source.length;
const re = resolveEnd(end2, valueEnd, strict, onError);
return {
value,
type: _type,
comment: re.comment,
range: [offset2, valueEnd, re.offset]
};
}
function plainValue(source, onError) {
let badChar = "";
switch (source[0]) {
case " ":
badChar = "a tab character";
break;
case ",":
badChar = "flow indicator character ,";
break;
case "%":
badChar = "directive indicator character %";
break;
case "|":
case ">": {
badChar = `block scalar indicator ${source[0]}`;
break;
}
case "@":
case "`": {
badChar = `reserved character ${source[0]}`;
break;
}
}
if (badChar)
onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
return foldLines(source);
}
function singleQuotedValue(source, onError) {
if (source[source.length - 1] !== "'" || source.length === 1)
onError(source.length, "MISSING_CHAR", "Missing closing 'quote");
return foldLines(source.slice(1, -1)).replace(/''/g, "'");
}
function foldLines(source) {
var _a3;
let first2, line;
try {
first2 = new RegExp("(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch;
} else {
res += ch;
}
}
if (source[source.length - 1] !== '"' || source.length === 1)
onError(source.length, "MISSING_CHAR", 'Missing closing "quote');
return res;
}
function foldNewline(source, offset2) {
let fold = "";
let ch = source[offset2 + 1];
while (ch === " " || ch === " " || ch === "\n" || ch === "\r") {
if (ch === "\r" && source[offset2 + 2] !== "\n")
break;
if (ch === "\n")
fold += "\n";
offset2 += 1;
ch = source[offset2 + 1];
}
if (!fold)
fold = " ";
return { fold, offset: offset2 };
}
var escapeCodes = {
"0": "\0",
a: "\x07",
b: "\b",
e: "\x1B",
f: "\f",
n: "\n",
r: "\r",
t: " ",
v: "\v",
N: "\x85",
_: "\xA0",
L: "\u2028",
P: "\u2029",
" ": " ",
'"': '"',
"/": "/",
"\\": "\\",
" ": " "
};
function parseCharCode(source, offset2, length, onError) {
const cc = source.substr(offset2, length);
const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
const code2 = ok ? parseInt(cc, 16) : NaN;
if (isNaN(code2)) {
const raw = source.substr(offset2 - 2, length + 2);
onError(offset2 - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${raw}`);
return raw;
}
return String.fromCodePoint(code2);
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/compose-scalar.js
function composeScalar(ctx, token, tagToken, onError) {
const { value, type, comment: comment2, range } = token.type === "block-scalar" ? resolveBlockScalar(ctx, token, onError) : resolveFlowScalar(token, ctx.options.strict, onError);
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
let tag;
if (ctx.options.stringKeys && ctx.atKey) {
tag = ctx.schema[SCALAR];
} else if (tagName)
tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
else if (token.type === "scalar")
tag = findScalarTagByTest(ctx, value, token, onError);
else
tag = ctx.schema[SCALAR];
let scalar;
try {
const res = tag.resolve(value, (msg) => onError(tagToken != null ? tagToken : token, "TAG_RESOLVE_FAILED", msg), ctx.options);
scalar = isScalar(res) ? res : new Scalar(res);
} catch (error2) {
const msg = error2 instanceof Error ? error2.message : String(error2);
onError(tagToken != null ? tagToken : token, "TAG_RESOLVE_FAILED", msg);
scalar = new Scalar(value);
}
scalar.range = range;
scalar.source = value;
if (type)
scalar.type = type;
if (tagName)
scalar.tag = tagName;
if (tag.format)
scalar.format = tag.format;
if (comment2)
scalar.comment = comment2;
return scalar;
}
function findScalarTagByName(schema4, value, tagName, tagToken, onError) {
var _a3;
if (tagName === "!")
return schema4[SCALAR];
const matchWithTest = [];
for (const tag of schema4.tags) {
if (!tag.collection && tag.tag === tagName) {
if (tag.default && tag.test)
matchWithTest.push(tag);
else
return tag;
}
}
for (const tag of matchWithTest)
if ((_a3 = tag.test) == null ? void 0 : _a3.test(value))
return tag;
const kt = schema4.knownTags[tagName];
if (kt && !kt.collection) {
schema4.tags.push(Object.assign({}, kt, { default: false, test: void 0 }));
return kt;
}
onError(tagToken, "TAG_RESOLVE_FAILED", `Unresolved tag: ${tagName}`, tagName !== "tag:yaml.org,2002:str");
return schema4[SCALAR];
}
function findScalarTagByTest({ atKey, directives, schema: schema4 }, value, token, onError) {
var _a3;
const tag = schema4.tags.find((tag2) => {
var _a4;
return (tag2.default === true || atKey && tag2.default === "key") && ((_a4 = tag2.test) == null ? void 0 : _a4.test(value));
}) || schema4[SCALAR];
if (schema4.compat) {
const compat = (_a3 = schema4.compat.find((tag2) => {
var _a4;
return tag2.default && ((_a4 = tag2.test) == null ? void 0 : _a4.test(value));
})) != null ? _a3 : schema4[SCALAR];
if (tag.tag !== compat.tag) {
const ts = directives.tagString(tag.tag);
const cs = directives.tagString(compat.tag);
const msg = `Value may be parsed as either ${ts} or ${cs}`;
onError(token, "TAG_RESOLVE_FAILED", msg, true);
}
}
return tag;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
function emptyScalarPosition(offset2, before2, pos) {
if (before2) {
if (pos === null)
pos = before2.length;
for (let i = pos - 1; i >= 0; --i) {
let st = before2[i];
switch (st.type) {
case "space":
case "comment":
case "newline":
offset2 -= st.source.length;
continue;
}
st = before2[++i];
while ((st == null ? void 0 : st.type) === "space") {
offset2 += st.source.length;
st = before2[++i];
}
break;
}
}
return offset2;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/compose-node.js
var CN = { composeNode, composeEmptyNode };
function composeNode(ctx, token, props, onError) {
const atKey = ctx.atKey;
const { spaceBefore, comment: comment2, anchor, tag } = props;
let node;
let isSrcToken = true;
switch (token.type) {
case "alias":
node = composeAlias(ctx, token, onError);
if (anchor || tag)
onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
break;
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar":
case "block-scalar":
node = composeScalar(ctx, token, tag, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
case "block-map":
case "block-seq":
case "flow-collection":
node = composeCollection(CN, ctx, token, props, onError);
if (anchor)
node.anchor = anchor.source.substring(1);
break;
default: {
const message = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
onError(token, "UNEXPECTED_TOKEN", message);
node = composeEmptyNode(ctx, token.offset, void 0, null, props, onError);
isSrcToken = false;
}
}
if (anchor && node.anchor === "")
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
if (atKey && ctx.options.stringKeys && (!isScalar(node) || typeof node.value !== "string" || node.tag && node.tag !== "tag:yaml.org,2002:str")) {
const msg = "With stringKeys, all keys must be strings";
onError(tag != null ? tag : token, "NON_STRING_KEY", msg);
}
if (spaceBefore)
node.spaceBefore = true;
if (comment2) {
if (token.type === "scalar" && token.source === "")
node.comment = comment2;
else
node.commentBefore = comment2;
}
if (ctx.options.keepSourceTokens && isSrcToken)
node.srcToken = token;
return node;
}
function composeEmptyNode(ctx, offset2, before2, pos, { spaceBefore, comment: comment2, anchor, tag, end: end2 }, onError) {
const token = {
type: "scalar",
offset: emptyScalarPosition(offset2, before2, pos),
indent: -1,
source: ""
};
const node = composeScalar(ctx, token, tag, onError);
if (anchor) {
node.anchor = anchor.source.substring(1);
if (node.anchor === "")
onError(anchor, "BAD_ALIAS", "Anchor cannot be an empty string");
}
if (spaceBefore)
node.spaceBefore = true;
if (comment2) {
node.comment = comment2;
node.range[2] = end2;
}
return node;
}
function composeAlias({ options }, { offset: offset2, source, end: end2 }, onError) {
const alias = new Alias(source.substring(1));
if (alias.source === "")
onError(offset2, "BAD_ALIAS", "Alias cannot be an empty string");
if (alias.source.endsWith(":"))
onError(offset2 + source.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", true);
const valueEnd = offset2 + source.length;
const re = resolveEnd(end2, valueEnd, options.strict, onError);
alias.range = [offset2, valueEnd, re.offset];
if (re.comment)
alias.comment = re.comment;
return alias;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/compose-doc.js
function composeDoc(options, directives, { offset: offset2, start, value, end: end2 }, onError) {
const opts = Object.assign({ _directives: directives }, options);
const doc = new Document2(void 0, opts);
const ctx = {
atKey: false,
atRoot: true,
directives: doc.directives,
options: doc.options,
schema: doc.schema
};
const props = resolveProps(start, {
indicator: "doc-start",
next: value != null ? value : end2 == null ? void 0 : end2[0],
offset: offset2,
onError,
parentIndent: 0,
startOnNewline: true
});
if (props.found) {
doc.directives.docStart = true;
if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
}
doc.contents = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, start, null, props, onError);
const contentEnd = doc.contents.range[2];
const re = resolveEnd(end2, contentEnd, false, onError);
if (re.comment)
doc.comment = re.comment;
doc.range = [offset2, contentEnd, re.offset];
return doc;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/compose/composer.js
function getErrorPos(src) {
if (typeof src === "number")
return [src, src + 1];
if (Array.isArray(src))
return src.length === 2 ? src : [src[0], src[1]];
const { offset: offset2, source } = src;
return [offset2, offset2 + (typeof source === "string" ? source.length : 1)];
}
function parsePrelude(prelude) {
var _a3;
let comment2 = "";
let atComment = false;
let afterEmptyLine = false;
for (let i = 0; i < prelude.length; ++i) {
const source = prelude[i];
switch (source[0]) {
case "#":
comment2 += (comment2 === "" ? "" : afterEmptyLine ? "\n\n" : "\n") + (source.substring(1) || " ");
atComment = true;
afterEmptyLine = false;
break;
case "%":
if (((_a3 = prelude[i + 1]) == null ? void 0 : _a3[0]) !== "#")
i += 1;
atComment = false;
break;
default:
if (!atComment)
afterEmptyLine = true;
atComment = false;
}
}
return { comment: comment2, afterEmptyLine };
}
var Composer = class {
constructor(options = {}) {
this.doc = null;
this.atDirectives = false;
this.prelude = [];
this.errors = [];
this.warnings = [];
this.onError = (source, code2, message, warning) => {
const pos = getErrorPos(source);
if (warning)
this.warnings.push(new YAMLWarning(pos, code2, message));
else
this.errors.push(new YAMLParseError(pos, code2, message));
};
this.directives = new Directives({ version: options.version || "1.2" });
this.options = options;
}
decorate(doc, afterDoc) {
const { comment: comment2, afterEmptyLine } = parsePrelude(this.prelude);
if (comment2) {
const dc = doc.contents;
if (afterDoc) {
doc.comment = doc.comment ? `${doc.comment}
${comment2}` : comment2;
} else if (afterEmptyLine || doc.directives.docStart || !dc) {
doc.commentBefore = comment2;
} else if (isCollection(dc) && !dc.flow && dc.items.length > 0) {
let it = dc.items[0];
if (isPair(it))
it = it.key;
const cb = it.commentBefore;
it.commentBefore = cb ? `${comment2}
${cb}` : comment2;
} else {
const cb = dc.commentBefore;
dc.commentBefore = cb ? `${comment2}
${cb}` : comment2;
}
}
if (afterDoc) {
Array.prototype.push.apply(doc.errors, this.errors);
Array.prototype.push.apply(doc.warnings, this.warnings);
} else {
doc.errors = this.errors;
doc.warnings = this.warnings;
}
this.prelude = [];
this.errors = [];
this.warnings = [];
}
streamInfo() {
return {
comment: parsePrelude(this.prelude).comment,
directives: this.directives,
errors: this.errors,
warnings: this.warnings
};
}
*compose(tokens, forceDoc = false, endOffset = -1) {
for (const token of tokens)
yield* this.next(token);
yield* this.end(forceDoc, endOffset);
}
*next(token) {
switch (token.type) {
case "directive":
this.directives.add(token.source, (offset2, message, warning) => {
const pos = getErrorPos(token);
pos[0] += offset2;
this.onError(pos, "BAD_DIRECTIVE", message, warning);
});
this.prelude.push(token.source);
this.atDirectives = true;
break;
case "document": {
const doc = composeDoc(this.options, this.directives, token, this.onError);
if (this.atDirectives && !doc.directives.docStart)
this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line");
this.decorate(doc, false);
if (this.doc)
yield this.doc;
this.doc = doc;
this.atDirectives = false;
break;
}
case "byte-order-mark":
case "space":
break;
case "comment":
case "newline":
this.prelude.push(token.source);
break;
case "error": {
const msg = token.source ? `${token.message}: ${JSON.stringify(token.source)}` : token.message;
const error2 = new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg);
if (this.atDirectives || !this.doc)
this.errors.push(error2);
else
this.doc.errors.push(error2);
break;
}
case "doc-end": {
if (!this.doc) {
const msg = "Unexpected doc-end without preceding document";
this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", msg));
break;
}
this.doc.directives.docEnd = true;
const end2 = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
this.decorate(this.doc, true);
if (end2.comment) {
const dc = this.doc.comment;
this.doc.comment = dc ? `${dc}
${end2.comment}` : end2.comment;
}
this.doc.range[2] = end2.offset;
break;
}
default:
this.errors.push(new YAMLParseError(getErrorPos(token), "UNEXPECTED_TOKEN", `Unsupported token ${token.type}`));
}
}
*end(forceDoc = false, endOffset = -1) {
if (this.doc) {
this.decorate(this.doc, true);
yield this.doc;
this.doc = null;
} else if (forceDoc) {
const opts = Object.assign({ _directives: this.directives }, this.options);
const doc = new Document2(void 0, opts);
if (this.atDirectives)
this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
doc.range = [0, endOffset, endOffset];
this.decorate(doc, false);
yield doc;
}
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/parse/cst-visit.js
var BREAK2 = Symbol("break visit");
var SKIP2 = Symbol("skip children");
var REMOVE2 = Symbol("remove item");
function visit2(cst, visitor) {
if ("type" in cst && cst.type === "document")
cst = { start: cst.start, value: cst.value };
_visit(Object.freeze([]), cst, visitor);
}
visit2.BREAK = BREAK2;
visit2.SKIP = SKIP2;
visit2.REMOVE = REMOVE2;
visit2.itemAtPath = (cst, path) => {
let item = cst;
for (const [field, index2] of path) {
const tok = item == null ? void 0 : item[field];
if (tok && "items" in tok) {
item = tok.items[index2];
} else
return void 0;
}
return item;
};
visit2.parentCollection = (cst, path) => {
const parent2 = visit2.itemAtPath(cst, path.slice(0, -1));
const field = path[path.length - 1][0];
const coll = parent2 == null ? void 0 : parent2[field];
if (coll && "items" in coll)
return coll;
throw new Error("Parent collection not found");
};
function _visit(path, item, visitor) {
let ctrl = visitor(item, path);
if (typeof ctrl === "symbol")
return ctrl;
for (const field of ["key", "value"]) {
const token = item[field];
if (token && "items" in token) {
for (let i = 0; i < token.items.length; ++i) {
const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
if (typeof ci === "number")
i = ci - 1;
else if (ci === BREAK2)
return BREAK2;
else if (ci === REMOVE2) {
token.items.splice(i, 1);
i -= 1;
}
}
if (typeof ctrl === "function" && field === "key")
ctrl = ctrl(item, path);
}
}
return typeof ctrl === "function" ? ctrl(item, path) : ctrl;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/parse/cst.js
var BOM = "\uFEFF";
var DOCUMENT = "";
var FLOW_END = "";
var SCALAR2 = "";
function tokenType(source) {
switch (source) {
case BOM:
return "byte-order-mark";
case DOCUMENT:
return "doc-mode";
case FLOW_END:
return "flow-error-end";
case SCALAR2:
return "scalar";
case "---":
return "doc-start";
case "...":
return "doc-end";
case "":
case "\n":
case "\r\n":
return "newline";
case "-":
return "seq-item-ind";
case "?":
return "explicit-key-ind";
case ":":
return "map-value-ind";
case "{":
return "flow-map-start";
case "}":
return "flow-map-end";
case "[":
return "flow-seq-start";
case "]":
return "flow-seq-end";
case ",":
return "comma";
}
switch (source[0]) {
case " ":
case " ":
return "space";
case "#":
return "comment";
case "%":
return "directive-line";
case "*":
return "alias";
case "&":
return "anchor";
case "!":
return "tag";
case "'":
return "single-quoted-scalar";
case '"':
return "double-quoted-scalar";
case "|":
case ">":
return "block-scalar-header";
}
return null;
}
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/parse/lexer.js
function isEmpty2(ch) {
switch (ch) {
case void 0:
case " ":
case "\n":
case "\r":
case " ":
return true;
default:
return false;
}
}
var hexDigits = new Set("0123456789ABCDEFabcdef");
var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
var flowIndicatorChars = new Set(",[]{}");
var invalidAnchorChars = new Set(" ,[]{}\n\r ");
var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
var Lexer = class {
constructor() {
this.atEnd = false;
this.blockScalarIndent = -1;
this.blockScalarKeep = false;
this.buffer = "";
this.flowKey = false;
this.flowLevel = 0;
this.indentNext = 0;
this.indentValue = 0;
this.lineEndPos = null;
this.next = null;
this.pos = 0;
}
*lex(source, incomplete = false) {
var _a3;
if (source) {
if (typeof source !== "string")
throw TypeError("source is not a string");
this.buffer = this.buffer ? this.buffer + source : source;
this.lineEndPos = null;
}
this.atEnd = !incomplete;
let next2 = (_a3 = this.next) != null ? _a3 : "stream";
while (next2 && (incomplete || this.hasChars(1)))
next2 = yield* this.parseNext(next2);
}
atLineEnd() {
let i = this.pos;
let ch = this.buffer[i];
while (ch === " " || ch === " ")
ch = this.buffer[++i];
if (!ch || ch === "#" || ch === "\n")
return true;
if (ch === "\r")
return this.buffer[i + 1] === "\n";
return false;
}
charAt(n2) {
return this.buffer[this.pos + n2];
}
continueScalar(offset2) {
let ch = this.buffer[offset2];
if (this.indentNext > 0) {
let indent = 0;
while (ch === " ")
ch = this.buffer[++indent + offset2];
if (ch === "\r") {
const next2 = this.buffer[indent + offset2 + 1];
if (next2 === "\n" || !next2 && !this.atEnd)
return offset2 + indent + 1;
}
return ch === "\n" || indent >= this.indentNext || !ch && !this.atEnd ? offset2 + indent : -1;
}
if (ch === "-" || ch === ".") {
const dt = this.buffer.substr(offset2, 3);
if ((dt === "---" || dt === "...") && isEmpty2(this.buffer[offset2 + 3]))
return -1;
}
return offset2;
}
getLine() {
let end2 = this.lineEndPos;
if (typeof end2 !== "number" || end2 !== -1 && end2 < this.pos) {
end2 = this.buffer.indexOf("\n", this.pos);
this.lineEndPos = end2;
}
if (end2 === -1)
return this.atEnd ? this.buffer.substring(this.pos) : null;
if (this.buffer[end2 - 1] === "\r")
end2 -= 1;
return this.buffer.substring(this.pos, end2);
}
hasChars(n2) {
return this.pos + n2 <= this.buffer.length;
}
setNext(state) {
this.buffer = this.buffer.substring(this.pos);
this.pos = 0;
this.lineEndPos = null;
this.next = state;
return null;
}
peek(n2) {
return this.buffer.substr(this.pos, n2);
}
*parseNext(next2) {
switch (next2) {
case "stream":
return yield* this.parseStream();
case "line-start":
return yield* this.parseLineStart();
case "block-start":
return yield* this.parseBlockStart();
case "doc":
return yield* this.parseDocument();
case "flow":
return yield* this.parseFlowCollection();
case "quoted-scalar":
return yield* this.parseQuotedScalar();
case "block-scalar":
return yield* this.parseBlockScalar();
case "plain-scalar":
return yield* this.parsePlainScalar();
}
}
*parseStream() {
let line = this.getLine();
if (line === null)
return this.setNext("stream");
if (line[0] === BOM) {
yield* this.pushCount(1);
line = line.substring(1);
}
if (line[0] === "%") {
let dirEnd = line.length;
let cs = line.indexOf("#");
while (cs !== -1) {
const ch = line[cs - 1];
if (ch === " " || ch === " ") {
dirEnd = cs - 1;
break;
} else {
cs = line.indexOf("#", cs + 1);
}
}
while (true) {
const ch = line[dirEnd - 1];
if (ch === " " || ch === " ")
dirEnd -= 1;
else
break;
}
const n2 = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
yield* this.pushCount(line.length - n2);
this.pushNewline();
return "stream";
}
if (this.atLineEnd()) {
const sp = yield* this.pushSpaces(true);
yield* this.pushCount(line.length - sp);
yield* this.pushNewline();
return "stream";
}
yield DOCUMENT;
return yield* this.parseLineStart();
}
*parseLineStart() {
const ch = this.charAt(0);
if (!ch && !this.atEnd)
return this.setNext("line-start");
if (ch === "-" || ch === ".") {
if (!this.atEnd && !this.hasChars(4))
return this.setNext("line-start");
const s2 = this.peek(3);
if ((s2 === "---" || s2 === "...") && isEmpty2(this.charAt(3))) {
yield* this.pushCount(3);
this.indentValue = 0;
this.indentNext = 0;
return s2 === "---" ? "doc" : "stream";
}
}
this.indentValue = yield* this.pushSpaces(false);
if (this.indentNext > this.indentValue && !isEmpty2(this.charAt(1)))
this.indentNext = this.indentValue;
return yield* this.parseBlockStart();
}
*parseBlockStart() {
const [ch0, ch1] = this.peek(2);
if (!ch1 && !this.atEnd)
return this.setNext("block-start");
if ((ch0 === "-" || ch0 === "?" || ch0 === ":") && isEmpty2(ch1)) {
const n2 = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
this.indentNext = this.indentValue + 1;
this.indentValue += n2;
return yield* this.parseBlockStart();
}
return "doc";
}
*parseDocument() {
yield* this.pushSpaces(true);
const line = this.getLine();
if (line === null)
return this.setNext("doc");
let n2 = yield* this.pushIndicators();
switch (line[n2]) {
case "#":
yield* this.pushCount(line.length - n2);
case void 0:
yield* this.pushNewline();
return yield* this.parseLineStart();
case "{":
case "[":
yield* this.pushCount(1);
this.flowKey = false;
this.flowLevel = 1;
return "flow";
case "}":
case "]":
yield* this.pushCount(1);
return "doc";
case "*":
yield* this.pushUntil(isNotAnchorChar);
return "doc";
case '"':
case "'":
return yield* this.parseQuotedScalar();
case "|":
case ">":
n2 += yield* this.parseBlockScalarHeader();
n2 += yield* this.pushSpaces(true);
yield* this.pushCount(line.length - n2);
yield* this.pushNewline();
return yield* this.parseBlockScalar();
default:
return yield* this.parsePlainScalar();
}
}
*parseFlowCollection() {
let nl, sp;
let indent = -1;
do {
nl = yield* this.pushNewline();
if (nl > 0) {
sp = yield* this.pushSpaces(false);
this.indentValue = indent = sp;
} else {
sp = 0;
}
sp += yield* this.pushSpaces(true);
} while (nl + sp > 0);
const line = this.getLine();
if (line === null)
return this.setNext("flow");
if (indent !== -1 && indent < this.indentNext && line[0] !== "#" || indent === 0 && (line.startsWith("---") || line.startsWith("...")) && isEmpty2(line[3])) {
const atFlowEndMarker = indent === this.indentNext - 1 && this.flowLevel === 1 && (line[0] === "]" || line[0] === "}");
if (!atFlowEndMarker) {
this.flowLevel = 0;
yield FLOW_END;
return yield* this.parseLineStart();
}
}
let n2 = 0;
while (line[n2] === ",") {
n2 += yield* this.pushCount(1);
n2 += yield* this.pushSpaces(true);
this.flowKey = false;
}
n2 += yield* this.pushIndicators();
switch (line[n2]) {
case void 0:
return "flow";
case "#":
yield* this.pushCount(line.length - n2);
return "flow";
case "{":
case "[":
yield* this.pushCount(1);
this.flowKey = false;
this.flowLevel += 1;
return "flow";
case "}":
case "]":
yield* this.pushCount(1);
this.flowKey = true;
this.flowLevel -= 1;
return this.flowLevel ? "flow" : "doc";
case "*":
yield* this.pushUntil(isNotAnchorChar);
return "flow";
case '"':
case "'":
this.flowKey = true;
return yield* this.parseQuotedScalar();
case ":": {
const next2 = this.charAt(1);
if (this.flowKey || isEmpty2(next2) || next2 === ",") {
this.flowKey = false;
yield* this.pushCount(1);
yield* this.pushSpaces(true);
return "flow";
}
}
default:
this.flowKey = false;
return yield* this.parsePlainScalar();
}
}
*parseQuotedScalar() {
const quote = this.charAt(0);
let end2 = this.buffer.indexOf(quote, this.pos + 1);
if (quote === "'") {
while (end2 !== -1 && this.buffer[end2 + 1] === "'")
end2 = this.buffer.indexOf("'", end2 + 2);
} else {
while (end2 !== -1) {
let n2 = 0;
while (this.buffer[end2 - 1 - n2] === "\\")
n2 += 1;
if (n2 % 2 === 0)
break;
end2 = this.buffer.indexOf('"', end2 + 1);
}
}
const qb = this.buffer.substring(0, end2);
let nl = qb.indexOf("\n", this.pos);
if (nl !== -1) {
while (nl !== -1) {
const cs = this.continueScalar(nl + 1);
if (cs === -1)
break;
nl = qb.indexOf("\n", cs);
}
if (nl !== -1) {
end2 = nl - (qb[nl - 1] === "\r" ? 2 : 1);
}
}
if (end2 === -1) {
if (!this.atEnd)
return this.setNext("quoted-scalar");
end2 = this.buffer.length;
}
yield* this.pushToIndex(end2 + 1, false);
return this.flowLevel ? "flow" : "doc";
}
*parseBlockScalarHeader() {
this.blockScalarIndent = -1;
this.blockScalarKeep = false;
let i = this.pos;
while (true) {
const ch = this.buffer[++i];
if (ch === "+")
this.blockScalarKeep = true;
else if (ch > "0" && ch <= "9")
this.blockScalarIndent = Number(ch) - 1;
else if (ch !== "-")
break;
}
return yield* this.pushUntil((ch) => isEmpty2(ch) || ch === "#");
}
*parseBlockScalar() {
let nl = this.pos - 1;
let indent = 0;
let ch;
loop:
for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {
switch (ch) {
case " ":
indent += 1;
break;
case "\n":
nl = i2;
indent = 0;
break;
case "\r": {
const next2 = this.buffer[i2 + 1];
if (!next2 && !this.atEnd)
return this.setNext("block-scalar");
if (next2 === "\n")
break;
}
default:
break loop;
}
}
if (!ch && !this.atEnd)
return this.setNext("block-scalar");
if (indent >= this.indentNext) {
if (this.blockScalarIndent === -1)
this.indentNext = indent;
else {
this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
}
do {
const cs = this.continueScalar(nl + 1);
if (cs === -1)
break;
nl = this.buffer.indexOf("\n", cs);
} while (nl !== -1);
if (nl === -1) {
if (!this.atEnd)
return this.setNext("block-scalar");
nl = this.buffer.length;
}
}
let i = nl + 1;
ch = this.buffer[i];
while (ch === " ")
ch = this.buffer[++i];
if (ch === " ") {
while (ch === " " || ch === " " || ch === "\r" || ch === "\n")
ch = this.buffer[++i];
nl = i - 1;
} else if (!this.blockScalarKeep) {
do {
let i2 = nl - 1;
let ch2 = this.buffer[i2];
if (ch2 === "\r")
ch2 = this.buffer[--i2];
const lastChar = i2;
while (ch2 === " ")
ch2 = this.buffer[--i2];
if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar)
nl = i2;
else
break;
} while (true);
}
yield SCALAR2;
yield* this.pushToIndex(nl + 1, true);
return yield* this.parseLineStart();
}
*parsePlainScalar() {
const inFlow = this.flowLevel > 0;
let end2 = this.pos - 1;
let i = this.pos - 1;
let ch;
while (ch = this.buffer[++i]) {
if (ch === ":") {
const next2 = this.buffer[i + 1];
if (isEmpty2(next2) || inFlow && flowIndicatorChars.has(next2))
break;
end2 = i;
} else if (isEmpty2(ch)) {
let next2 = this.buffer[i + 1];
if (ch === "\r") {
if (next2 === "\n") {
i += 1;
ch = "\n";
next2 = this.buffer[i + 1];
} else
end2 = i;
}
if (next2 === "#" || inFlow && flowIndicatorChars.has(next2))
break;
if (ch === "\n") {
const cs = this.continueScalar(i + 1);
if (cs === -1)
break;
i = Math.max(i, cs - 2);
}
} else {
if (inFlow && flowIndicatorChars.has(ch))
break;
end2 = i;
}
}
if (!ch && !this.atEnd)
return this.setNext("plain-scalar");
yield SCALAR2;
yield* this.pushToIndex(end2 + 1, true);
return inFlow ? "flow" : "doc";
}
*pushCount(n2) {
if (n2 > 0) {
yield this.buffer.substr(this.pos, n2);
this.pos += n2;
return n2;
}
return 0;
}
*pushToIndex(i, allowEmpty) {
const s2 = this.buffer.slice(this.pos, i);
if (s2) {
yield s2;
this.pos += s2.length;
return s2.length;
} else if (allowEmpty)
yield "";
return 0;
}
*pushIndicators() {
switch (this.charAt(0)) {
case "!":
return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
case "&":
return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
case "-":
case "?":
case ":": {
const inFlow = this.flowLevel > 0;
const ch1 = this.charAt(1);
if (isEmpty2(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
if (!inFlow)
this.indentNext = this.indentValue + 1;
else if (this.flowKey)
this.flowKey = false;
return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
}
}
}
return 0;
}
*pushTag() {
if (this.charAt(1) === "<") {
let i = this.pos + 2;
let ch = this.buffer[i];
while (!isEmpty2(ch) && ch !== ">")
ch = this.buffer[++i];
return yield* this.pushToIndex(ch === ">" ? i + 1 : i, false);
} else {
let i = this.pos + 1;
let ch = this.buffer[i];
while (ch) {
if (tagChars.has(ch))
ch = this.buffer[++i];
else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) {
ch = this.buffer[i += 3];
} else
break;
}
return yield* this.pushToIndex(i, false);
}
}
*pushNewline() {
const ch = this.buffer[this.pos];
if (ch === "\n")
return yield* this.pushCount(1);
else if (ch === "\r" && this.charAt(1) === "\n")
return yield* this.pushCount(2);
else
return 0;
}
*pushSpaces(allowTabs) {
let i = this.pos - 1;
let ch;
do {
ch = this.buffer[++i];
} while (ch === " " || allowTabs && ch === " ");
const n2 = i - this.pos;
if (n2 > 0) {
yield this.buffer.substr(this.pos, n2);
this.pos = i;
}
return n2;
}
*pushUntil(test2) {
let i = this.pos;
let ch = this.buffer[i];
while (!test2(ch))
ch = this.buffer[++i];
return yield* this.pushToIndex(i, false);
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/parse/line-counter.js
var LineCounter = class {
constructor() {
this.lineStarts = [];
this.addNewLine = (offset2) => this.lineStarts.push(offset2);
this.linePos = (offset2) => {
let low = 0;
let high = this.lineStarts.length;
while (low < high) {
const mid = low + high >> 1;
if (this.lineStarts[mid] < offset2)
low = mid + 1;
else
high = mid;
}
if (this.lineStarts[low] === offset2)
return { line: low + 1, col: 1 };
if (low === 0)
return { line: 0, col: offset2 };
const start = this.lineStarts[low - 1];
return { line: low, col: offset2 - start + 1 };
};
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/parse/parser.js
function includesToken(list2, type) {
for (let i = 0; i < list2.length; ++i)
if (list2[i].type === type)
return true;
return false;
}
function findNonEmptyIndex(list2) {
for (let i = 0; i < list2.length; ++i) {
switch (list2[i].type) {
case "space":
case "comment":
case "newline":
break;
default:
return i;
}
}
return -1;
}
function isFlowToken(token) {
switch (token == null ? void 0 : token.type) {
case "alias":
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar":
case "flow-collection":
return true;
default:
return false;
}
}
function getPrevProps(parent2) {
var _a3;
switch (parent2.type) {
case "document":
return parent2.start;
case "block-map": {
const it = parent2.items[parent2.items.length - 1];
return (_a3 = it.sep) != null ? _a3 : it.start;
}
case "block-seq":
return parent2.items[parent2.items.length - 1].start;
default:
return [];
}
}
function getFirstKeyStartProps(prev2) {
var _a3;
if (prev2.length === 0)
return [];
let i = prev2.length;
loop:
while (--i >= 0) {
switch (prev2[i].type) {
case "doc-start":
case "explicit-key-ind":
case "map-value-ind":
case "seq-item-ind":
case "newline":
break loop;
}
}
while (((_a3 = prev2[++i]) == null ? void 0 : _a3.type) === "space") {
}
return prev2.splice(i, prev2.length);
}
function fixFlowSeqItems(fc) {
if (fc.start.type === "flow-seq-start") {
for (const it of fc.items) {
if (it.sep && !it.value && !includesToken(it.start, "explicit-key-ind") && !includesToken(it.sep, "map-value-ind")) {
if (it.key)
it.value = it.key;
delete it.key;
if (isFlowToken(it.value)) {
if (it.value.end)
Array.prototype.push.apply(it.value.end, it.sep);
else
it.value.end = it.sep;
} else
Array.prototype.push.apply(it.start, it.sep);
delete it.sep;
}
}
}
}
var Parser3 = class {
constructor(onNewLine) {
this.atNewLine = true;
this.atScalar = false;
this.indent = 0;
this.offset = 0;
this.onKeyLine = false;
this.stack = [];
this.source = "";
this.type = "";
this.lexer = new Lexer();
this.onNewLine = onNewLine;
}
*parse(source, incomplete = false) {
if (this.onNewLine && this.offset === 0)
this.onNewLine(0);
for (const lexeme of this.lexer.lex(source, incomplete))
yield* this.next(lexeme);
if (!incomplete)
yield* this.end();
}
*next(source) {
this.source = source;
if (this.atScalar) {
this.atScalar = false;
yield* this.step();
this.offset += source.length;
return;
}
const type = tokenType(source);
if (!type) {
const message = `Not a YAML token: ${source}`;
yield* this.pop({ type: "error", offset: this.offset, message, source });
this.offset += source.length;
} else if (type === "scalar") {
this.atNewLine = false;
this.atScalar = true;
this.type = "scalar";
} else {
this.type = type;
yield* this.step();
switch (type) {
case "newline":
this.atNewLine = true;
this.indent = 0;
if (this.onNewLine)
this.onNewLine(this.offset + source.length);
break;
case "space":
if (this.atNewLine && source[0] === " ")
this.indent += source.length;
break;
case "explicit-key-ind":
case "map-value-ind":
case "seq-item-ind":
if (this.atNewLine)
this.indent += source.length;
break;
case "doc-mode":
case "flow-error-end":
return;
default:
this.atNewLine = false;
}
this.offset += source.length;
}
}
*end() {
while (this.stack.length > 0)
yield* this.pop();
}
get sourceToken() {
const st = {
type: this.type,
offset: this.offset,
indent: this.indent,
source: this.source
};
return st;
}
*step() {
const top = this.peek(1);
if (this.type === "doc-end" && (!top || top.type !== "doc-end")) {
while (this.stack.length > 0)
yield* this.pop();
this.stack.push({
type: "doc-end",
offset: this.offset,
source: this.source
});
return;
}
if (!top)
return yield* this.stream();
switch (top.type) {
case "document":
return yield* this.document(top);
case "alias":
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar":
return yield* this.scalar(top);
case "block-scalar":
return yield* this.blockScalar(top);
case "block-map":
return yield* this.blockMap(top);
case "block-seq":
return yield* this.blockSequence(top);
case "flow-collection":
return yield* this.flowCollection(top);
case "doc-end":
return yield* this.documentEnd(top);
}
yield* this.pop();
}
peek(n2) {
return this.stack[this.stack.length - n2];
}
*pop(error2) {
const token = error2 != null ? error2 : this.stack.pop();
if (!token) {
const message = "Tried to pop an empty stack";
yield { type: "error", offset: this.offset, source: "", message };
} else if (this.stack.length === 0) {
yield token;
} else {
const top = this.peek(1);
if (token.type === "block-scalar") {
token.indent = "indent" in top ? top.indent : 0;
} else if (token.type === "flow-collection" && top.type === "document") {
token.indent = 0;
}
if (token.type === "flow-collection")
fixFlowSeqItems(token);
switch (top.type) {
case "document":
top.value = token;
break;
case "block-scalar":
top.props.push(token);
break;
case "block-map": {
const it = top.items[top.items.length - 1];
if (it.value) {
top.items.push({ start: [], key: token, sep: [] });
this.onKeyLine = true;
return;
} else if (it.sep) {
it.value = token;
} else {
Object.assign(it, { key: token, sep: [] });
this.onKeyLine = !it.explicitKey;
return;
}
break;
}
case "block-seq": {
const it = top.items[top.items.length - 1];
if (it.value)
top.items.push({ start: [], value: token });
else
it.value = token;
break;
}
case "flow-collection": {
const it = top.items[top.items.length - 1];
if (!it || it.value)
top.items.push({ start: [], key: token, sep: [] });
else if (it.sep)
it.value = token;
else
Object.assign(it, { key: token, sep: [] });
return;
}
default:
yield* this.pop();
yield* this.pop(token);
}
if ((top.type === "document" || top.type === "block-map" || top.type === "block-seq") && (token.type === "block-map" || token.type === "block-seq")) {
const last2 = token.items[token.items.length - 1];
if (last2 && !last2.sep && !last2.value && last2.start.length > 0 && findNonEmptyIndex(last2.start) === -1 && (token.indent === 0 || last2.start.every((st) => st.type !== "comment" || st.indent < token.indent))) {
if (top.type === "document")
top.end = last2.start;
else
top.items.push({ start: last2.start });
token.items.splice(-1, 1);
}
}
}
}
*stream() {
switch (this.type) {
case "directive-line":
yield { type: "directive", offset: this.offset, source: this.source };
return;
case "byte-order-mark":
case "space":
case "comment":
case "newline":
yield this.sourceToken;
return;
case "doc-mode":
case "doc-start": {
const doc = {
type: "document",
offset: this.offset,
start: []
};
if (this.type === "doc-start")
doc.start.push(this.sourceToken);
this.stack.push(doc);
return;
}
}
yield {
type: "error",
offset: this.offset,
message: `Unexpected ${this.type} token in YAML stream`,
source: this.source
};
}
*document(doc) {
if (doc.value)
return yield* this.lineEnd(doc);
switch (this.type) {
case "doc-start": {
if (findNonEmptyIndex(doc.start) !== -1) {
yield* this.pop();
yield* this.step();
} else
doc.start.push(this.sourceToken);
return;
}
case "anchor":
case "tag":
case "space":
case "comment":
case "newline":
doc.start.push(this.sourceToken);
return;
}
const bv = this.startBlockValue(doc);
if (bv)
this.stack.push(bv);
else {
yield {
type: "error",
offset: this.offset,
message: `Unexpected ${this.type} token in YAML document`,
source: this.source
};
}
}
*scalar(scalar) {
if (this.type === "map-value-ind") {
const prev2 = getPrevProps(this.peek(2));
const start = getFirstKeyStartProps(prev2);
let sep;
if (scalar.end) {
sep = scalar.end;
sep.push(this.sourceToken);
delete scalar.end;
} else
sep = [this.sourceToken];
const map4 = {
type: "block-map",
offset: scalar.offset,
indent: scalar.indent,
items: [{ start, key: scalar, sep }]
};
this.onKeyLine = true;
this.stack[this.stack.length - 1] = map4;
} else
yield* this.lineEnd(scalar);
}
*blockScalar(scalar) {
switch (this.type) {
case "space":
case "comment":
case "newline":
scalar.props.push(this.sourceToken);
return;
case "scalar":
scalar.source = this.source;
this.atNewLine = true;
this.indent = 0;
if (this.onNewLine) {
let nl = this.source.indexOf("\n") + 1;
while (nl !== 0) {
this.onNewLine(this.offset + nl);
nl = this.source.indexOf("\n", nl) + 1;
}
}
yield* this.pop();
break;
default:
yield* this.pop();
yield* this.step();
}
}
*blockMap(map4) {
var _a3;
const it = map4.items[map4.items.length - 1];
switch (this.type) {
case "newline":
this.onKeyLine = false;
if (it.value) {
const end2 = "end" in it.value ? it.value.end : void 0;
const last2 = Array.isArray(end2) ? end2[end2.length - 1] : void 0;
if ((last2 == null ? void 0 : last2.type) === "comment")
end2 == null ? void 0 : end2.push(this.sourceToken);
else
map4.items.push({ start: [this.sourceToken] });
} else if (it.sep) {
it.sep.push(this.sourceToken);
} else {
it.start.push(this.sourceToken);
}
return;
case "space":
case "comment":
if (it.value) {
map4.items.push({ start: [this.sourceToken] });
} else if (it.sep) {
it.sep.push(this.sourceToken);
} else {
if (this.atIndentedComment(it.start, map4.indent)) {
const prev2 = map4.items[map4.items.length - 2];
const end2 = (_a3 = prev2 == null ? void 0 : prev2.value) == null ? void 0 : _a3.end;
if (Array.isArray(end2)) {
Array.prototype.push.apply(end2, it.start);
end2.push(this.sourceToken);
map4.items.pop();
return;
}
}
it.start.push(this.sourceToken);
}
return;
}
if (this.indent >= map4.indent) {
const atMapIndent = !this.onKeyLine && this.indent === map4.indent;
const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
let start = [];
if (atNextItem && it.sep && !it.value) {
const nl = [];
for (let i = 0; i < it.sep.length; ++i) {
const st = it.sep[i];
switch (st.type) {
case "newline":
nl.push(i);
break;
case "space":
break;
case "comment":
if (st.indent > map4.indent)
nl.length = 0;
break;
default:
nl.length = 0;
}
}
if (nl.length >= 2)
start = it.sep.splice(nl[1]);
}
switch (this.type) {
case "anchor":
case "tag":
if (atNextItem || it.value) {
start.push(this.sourceToken);
map4.items.push({ start });
this.onKeyLine = true;
} else if (it.sep) {
it.sep.push(this.sourceToken);
} else {
it.start.push(this.sourceToken);
}
return;
case "explicit-key-ind":
if (!it.sep && !it.explicitKey) {
it.start.push(this.sourceToken);
it.explicitKey = true;
} else if (atNextItem || it.value) {
start.push(this.sourceToken);
map4.items.push({ start, explicitKey: true });
} else {
this.stack.push({
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start: [this.sourceToken], explicitKey: true }]
});
}
this.onKeyLine = true;
return;
case "map-value-ind":
if (it.explicitKey) {
if (!it.sep) {
if (includesToken(it.start, "newline")) {
Object.assign(it, { key: null, sep: [this.sourceToken] });
} else {
const start2 = getFirstKeyStartProps(it.start);
this.stack.push({
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start: start2, key: null, sep: [this.sourceToken] }]
});
}
} else if (it.value) {
map4.items.push({ start: [], key: null, sep: [this.sourceToken] });
} else if (includesToken(it.sep, "map-value-ind")) {
this.stack.push({
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start, key: null, sep: [this.sourceToken] }]
});
} else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
const start2 = getFirstKeyStartProps(it.start);
const key = it.key;
const sep = it.sep;
sep.push(this.sourceToken);
delete it.key;
delete it.sep;
this.stack.push({
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start: start2, key, sep }]
});
} else if (start.length > 0) {
it.sep = it.sep.concat(start, this.sourceToken);
} else {
it.sep.push(this.sourceToken);
}
} else {
if (!it.sep) {
Object.assign(it, { key: null, sep: [this.sourceToken] });
} else if (it.value || atNextItem) {
map4.items.push({ start, key: null, sep: [this.sourceToken] });
} else if (includesToken(it.sep, "map-value-ind")) {
this.stack.push({
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start: [], key: null, sep: [this.sourceToken] }]
});
} else {
it.sep.push(this.sourceToken);
}
}
this.onKeyLine = true;
return;
case "alias":
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar": {
const fs = this.flowScalar(this.type);
if (atNextItem || it.value) {
map4.items.push({ start, key: fs, sep: [] });
this.onKeyLine = true;
} else if (it.sep) {
this.stack.push(fs);
} else {
Object.assign(it, { key: fs, sep: [] });
this.onKeyLine = true;
}
return;
}
default: {
const bv = this.startBlockValue(map4);
if (bv) {
if (bv.type === "block-seq") {
if (!it.explicitKey && it.sep && !includesToken(it.sep, "newline")) {
yield* this.pop({
type: "error",
offset: this.offset,
message: "Unexpected block-seq-ind on same line with key",
source: this.source
});
return;
}
} else if (atMapIndent) {
map4.items.push({ start });
}
this.stack.push(bv);
return;
}
}
}
}
yield* this.pop();
yield* this.step();
}
*blockSequence(seq2) {
var _a3;
const it = seq2.items[seq2.items.length - 1];
switch (this.type) {
case "newline":
if (it.value) {
const end2 = "end" in it.value ? it.value.end : void 0;
const last2 = Array.isArray(end2) ? end2[end2.length - 1] : void 0;
if ((last2 == null ? void 0 : last2.type) === "comment")
end2 == null ? void 0 : end2.push(this.sourceToken);
else
seq2.items.push({ start: [this.sourceToken] });
} else
it.start.push(this.sourceToken);
return;
case "space":
case "comment":
if (it.value)
seq2.items.push({ start: [this.sourceToken] });
else {
if (this.atIndentedComment(it.start, seq2.indent)) {
const prev2 = seq2.items[seq2.items.length - 2];
const end2 = (_a3 = prev2 == null ? void 0 : prev2.value) == null ? void 0 : _a3.end;
if (Array.isArray(end2)) {
Array.prototype.push.apply(end2, it.start);
end2.push(this.sourceToken);
seq2.items.pop();
return;
}
}
it.start.push(this.sourceToken);
}
return;
case "anchor":
case "tag":
if (it.value || this.indent <= seq2.indent)
break;
it.start.push(this.sourceToken);
return;
case "seq-item-ind":
if (this.indent !== seq2.indent)
break;
if (it.value || includesToken(it.start, "seq-item-ind"))
seq2.items.push({ start: [this.sourceToken] });
else
it.start.push(this.sourceToken);
return;
}
if (this.indent > seq2.indent) {
const bv = this.startBlockValue(seq2);
if (bv) {
this.stack.push(bv);
return;
}
}
yield* this.pop();
yield* this.step();
}
*flowCollection(fc) {
const it = fc.items[fc.items.length - 1];
if (this.type === "flow-error-end") {
let top;
do {
yield* this.pop();
top = this.peek(1);
} while (top && top.type === "flow-collection");
} else if (fc.end.length === 0) {
switch (this.type) {
case "comma":
case "explicit-key-ind":
if (!it || it.sep)
fc.items.push({ start: [this.sourceToken] });
else
it.start.push(this.sourceToken);
return;
case "map-value-ind":
if (!it || it.value)
fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
else if (it.sep)
it.sep.push(this.sourceToken);
else
Object.assign(it, { key: null, sep: [this.sourceToken] });
return;
case "space":
case "comment":
case "newline":
case "anchor":
case "tag":
if (!it || it.value)
fc.items.push({ start: [this.sourceToken] });
else if (it.sep)
it.sep.push(this.sourceToken);
else
it.start.push(this.sourceToken);
return;
case "alias":
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar": {
const fs = this.flowScalar(this.type);
if (!it || it.value)
fc.items.push({ start: [], key: fs, sep: [] });
else if (it.sep)
this.stack.push(fs);
else
Object.assign(it, { key: fs, sep: [] });
return;
}
case "flow-map-end":
case "flow-seq-end":
fc.end.push(this.sourceToken);
return;
}
const bv = this.startBlockValue(fc);
if (bv)
this.stack.push(bv);
else {
yield* this.pop();
yield* this.step();
}
} else {
const parent2 = this.peek(2);
if (parent2.type === "block-map" && (this.type === "map-value-ind" && parent2.indent === fc.indent || this.type === "newline" && !parent2.items[parent2.items.length - 1].sep)) {
yield* this.pop();
yield* this.step();
} else if (this.type === "map-value-ind" && parent2.type !== "flow-collection") {
const prev2 = getPrevProps(parent2);
const start = getFirstKeyStartProps(prev2);
fixFlowSeqItems(fc);
const sep = fc.end.splice(1, fc.end.length);
sep.push(this.sourceToken);
const map4 = {
type: "block-map",
offset: fc.offset,
indent: fc.indent,
items: [{ start, key: fc, sep }]
};
this.onKeyLine = true;
this.stack[this.stack.length - 1] = map4;
} else {
yield* this.lineEnd(fc);
}
}
}
flowScalar(type) {
if (this.onNewLine) {
let nl = this.source.indexOf("\n") + 1;
while (nl !== 0) {
this.onNewLine(this.offset + nl);
nl = this.source.indexOf("\n", nl) + 1;
}
}
return {
type,
offset: this.offset,
indent: this.indent,
source: this.source
};
}
startBlockValue(parent2) {
switch (this.type) {
case "alias":
case "scalar":
case "single-quoted-scalar":
case "double-quoted-scalar":
return this.flowScalar(this.type);
case "block-scalar-header":
return {
type: "block-scalar",
offset: this.offset,
indent: this.indent,
props: [this.sourceToken],
source: ""
};
case "flow-map-start":
case "flow-seq-start":
return {
type: "flow-collection",
offset: this.offset,
indent: this.indent,
start: this.sourceToken,
items: [],
end: []
};
case "seq-item-ind":
return {
type: "block-seq",
offset: this.offset,
indent: this.indent,
items: [{ start: [this.sourceToken] }]
};
case "explicit-key-ind": {
this.onKeyLine = true;
const prev2 = getPrevProps(parent2);
const start = getFirstKeyStartProps(prev2);
start.push(this.sourceToken);
return {
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start, explicitKey: true }]
};
}
case "map-value-ind": {
this.onKeyLine = true;
const prev2 = getPrevProps(parent2);
const start = getFirstKeyStartProps(prev2);
return {
type: "block-map",
offset: this.offset,
indent: this.indent,
items: [{ start, key: null, sep: [this.sourceToken] }]
};
}
}
return null;
}
atIndentedComment(start, indent) {
if (this.type !== "comment")
return false;
if (this.indent <= indent)
return false;
return start.every((st) => st.type === "newline" || st.type === "space");
}
*documentEnd(docEnd) {
if (this.type !== "doc-mode") {
if (docEnd.end)
docEnd.end.push(this.sourceToken);
else
docEnd.end = [this.sourceToken];
if (this.type === "newline")
yield* this.pop();
}
}
*lineEnd(token) {
switch (this.type) {
case "comma":
case "doc-start":
case "doc-end":
case "flow-seq-end":
case "flow-map-end":
case "map-value-ind":
yield* this.pop();
yield* this.step();
break;
case "newline":
this.onKeyLine = false;
case "space":
case "comment":
default:
if (token.end)
token.end.push(this.sourceToken);
else
token.end = [this.sourceToken];
if (this.type === "newline")
yield* this.pop();
}
}
};
// ../../node_modules/.pnpm/yaml@2.7.1/node_modules/yaml/browser/dist/public-api.js
function parseOptions(options) {
const prettyErrors = options.prettyErrors !== false;
const lineCounter = options.lineCounter || prettyErrors && new LineCounter() || null;
return { lineCounter, prettyErrors };
}
function parseDocument2(source, options = {}) {
const { lineCounter, prettyErrors } = parseOptions(options);
const parser = new Parser3(lineCounter == null ? void 0 : lineCounter.addNewLine);
const composer = new Composer(options);
let doc = null;
for (const _doc of composer.compose(parser.parse(source), true, source.length)) {
if (!doc)
doc = _doc;
else if (doc.options.logLevel !== "silent") {
doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
break;
}
}
if (prettyErrors && lineCounter) {
doc.errors.forEach(prettifyError(source, lineCounter));
doc.warnings.forEach(prettifyError(source, lineCounter));
}
return doc;
}
function parse7(src, reviver, options) {
let _reviver = void 0;
if (typeof reviver === "function") {
_reviver = reviver;
} else if (options === void 0 && reviver && typeof reviver === "object") {
options = reviver;
}
const doc = parseDocument2(src, options);
if (!doc)
return null;
doc.warnings.forEach((warning) => warn(doc.options.logLevel, warning));
if (doc.errors.length > 0) {
if (doc.options.logLevel !== "silent")
throw doc.errors[0];
else
doc.errors = [];
}
return doc.toJS(Object.assign({ reviver: _reviver }, options));
}
// ../../node_modules/.pnpm/markmap-lib@0.17.2_markmap-common@0.18.9/node_modules/markmap-lib/dist/browser/index.mjs
var import_markdown_it_katex = __toESM(require_markdown_it_katex(), 1);
function initializeMarkdownIt() {
const md = lib_default({
html: true,
breaks: true
});
md.use(ins_plugin).use(ins_plugin2).use(sub_plugin).use(sup_plugin);
return md;
}
function createTransformHooks(transformer2) {
return {
transformer: transformer2,
parser: new Hook(),
beforeParse: new Hook(),
afterParse: new Hook(),
retransform: new Hook()
};
}
function definePlugin(plugin2) {
return plugin2;
}
var svgMarked = '\n';
var svgUnmarked = '\n';
var name$5 = "checkbox";
var images = {
" ": svgUnmarked.trim(),
x: svgMarked.trim()
};
var plugin$3 = definePlugin({
name: name$5,
transform(transformHooks) {
transformHooks.parser.tap((md) => {
md.core.ruler.before("inline", "checkbox", (state) => {
for (let i = 2; i < state.tokens.length; i += 1) {
const token = state.tokens[i];
if (token.type === "inline" && token.content) {
const prevType = state.tokens[i - 1].type;
const prevPrevType = state.tokens[i - 2].type;
if (prevType === "heading_open" || prevType === "paragraph_open" && prevPrevType === "list_item_open") {
token.content = token.content.replace(
/^\[(.)\] /,
(m, g) => images[g] ? `${images[g]} ` : m
);
}
}
}
return false;
});
});
return {};
}
});
var pluginCheckbox = plugin$3;
var name$4 = "frontmatter";
var pluginFrontmatter = definePlugin({
name: name$4,
transform(transformHooks) {
transformHooks.beforeParse.tap((_md, context) => {
var _a3;
const { content } = context;
if (!/^---\r?\n/.test(content))
return;
const match3 = /\n---\r?\n/.exec(content);
if (!match3)
return;
const raw = content.slice(4, match3.index).trimEnd();
let frontmatter;
try {
frontmatter = parse7(raw.replace(/\r?\n|\r/g, "\n"));
if (frontmatter == null ? void 0 : frontmatter.markmap) {
frontmatter.markmap = normalizeMarkmapJsonOptions(
frontmatter.markmap
);
}
} catch (e) {
return;
}
context.frontmatter = frontmatter;
context.parserOptions = {
...context.parserOptions,
...(_a3 = frontmatter == null ? void 0 : frontmatter.markmap) == null ? void 0 : _a3.htmlParser
};
context.content = content.slice(match3.index + match3[0].length);
context.contentLineOffset = content.slice(0, match3.index).split("\n").length + 1;
});
return {};
}
});
function normalizeMarkmapJsonOptions(options) {
if (!options)
return;
["color", "extraJs", "extraCss"].forEach((key) => {
if (options[key] != null)
options[key] = normalizeStringArray(options[key]);
});
["duration", "maxWidth", "initialExpandLevel"].forEach((key) => {
if (options[key] != null)
options[key] = normalizeNumber(options[key]);
});
return options;
}
function normalizeStringArray(value) {
let result;
if (typeof value === "string")
result = [value];
else if (Array.isArray(value))
result = value.filter((item) => item && typeof item === "string");
return (result == null ? void 0 : result.length) ? result : void 0;
}
function normalizeNumber(value) {
if (isNaN(+value))
return;
return +value;
}
function patchJSItem(urlBuilder2, item) {
if (item.type === "script" && item.data.src) {
return {
...item,
data: {
...item.data,
src: urlBuilder2.getFullUrl(item.data.src)
}
};
}
return item;
}
function patchCSSItem(urlBuilder2, item) {
if (item.type === "stylesheet" && item.data.href) {
return {
...item,
data: {
...item.data,
href: urlBuilder2.getFullUrl(item.data.href)
}
};
}
return item;
}
var name$3 = "hljs";
var preloadScripts$1 = [
`@highlightjs/cdn-assets@${"11.8.0"}/highlight.min.js`
].map((path) => buildJSItem(path));
var styles$1 = [
`@highlightjs/cdn-assets@${"11.8.0"}/styles/default.min.css`
].map((path) => buildCSSItem(path));
var config$1 = {
versions: {
hljs: "11.8.0"
},
preloadScripts: preloadScripts$1,
styles: styles$1
};
var plugin$2 = definePlugin({
name: name$3,
config: config$1,
transform(transformHooks) {
var _a3, _b, _c;
let loading;
const preloadScripts2 = ((_b = (_a3 = plugin$2.config) == null ? void 0 : _a3.preloadScripts) == null ? void 0 : _b.map(
(item) => patchJSItem(transformHooks.transformer.urlBuilder, item)
)) || [];
const autoload = () => {
loading || (loading = loadJS(preloadScripts2));
return loading;
};
let enableFeature = noop;
transformHooks.parser.tap((md) => {
md.set({
highlight: (str, language) => {
enableFeature();
const { hljs } = window;
if (hljs) {
return hljs.highlightAuto(str, language ? [language] : void 0).value;
}
autoload().then(() => {
transformHooks.retransform.call();
});
return str;
}
});
});
transformHooks.beforeParse.tap((_, context) => {
enableFeature = () => {
context.features[name$3] = true;
};
});
return {
styles: (_c = plugin$2.config) == null ? void 0 : _c.styles
};
}
});
var pluginHljs = plugin$2;
function addDefaultVersions(paths, name2, version) {
return paths.map((path) => {
if (typeof path === "string" && !path.includes("://")) {
if (!path.startsWith("npm:")) {
path = `npm:${path}`;
}
const prefixLength = 4 + name2.length;
if (path.startsWith(`npm:${name2}/`)) {
path = `${path.slice(0, prefixLength)}@${version}${path.slice(
prefixLength
)}`;
}
}
return path;
});
}
var name$2 = "katex";
var preloadScripts = [
`katex@${"0.16.8"}/dist/katex.min.js`
].map((path) => buildJSItem(path));
var webfontloader = buildJSItem(
`webfontloader@${"1.6.28"}/webfontloader.js`
);
webfontloader.data.defer = true;
var styles = [`katex@${"0.16.8"}/dist/katex.min.css`].map(
(path) => buildCSSItem(path)
);
var config2 = {
versions: {
katex: "0.16.8",
webfontloader: "1.6.28"
},
preloadScripts,
scripts: [
{
type: "iife",
data: {
fn: (getMarkmap) => {
window.WebFontConfig = {
custom: {
families: [
"KaTeX_AMS",
"KaTeX_Caligraphic:n4,n7",
"KaTeX_Fraktur:n4,n7",
"KaTeX_Main:n4,n7,i4,i7",
"KaTeX_Math:i4,i7",
"KaTeX_Script",
"KaTeX_SansSerif:n4,n7,i4",
"KaTeX_Size1",
"KaTeX_Size2",
"KaTeX_Size3",
"KaTeX_Size4",
"KaTeX_Typewriter"
]
},
active: () => {
getMarkmap().refreshHook.call();
}
};
},
getParams({ getMarkmap }) {
return [getMarkmap];
}
}
},
webfontloader
],
styles
};
var plugin$1 = definePlugin({
name: name$2,
config: config2,
transform(transformHooks) {
var _a3, _b, _c, _d;
let loading;
const preloadScripts2 = ((_b = (_a3 = plugin$1.config) == null ? void 0 : _a3.preloadScripts) == null ? void 0 : _b.map(
(item) => patchJSItem(transformHooks.transformer.urlBuilder, item)
)) || [];
const autoload = () => {
loading || (loading = loadJS(preloadScripts2));
return loading;
};
const renderKatex = (source, displayMode) => {
const { katex } = window;
if (katex) {
return katex.renderToString(source, {
displayMode,
throwOnError: false
});
}
autoload().then(() => {
transformHooks.retransform.call();
});
return source;
};
let enableFeature = noop;
transformHooks.parser.tap((md) => {
md.use(import_markdown_it_katex.default);
["math_block", "math_inline"].forEach((key) => {
const fn = (tokens, idx) => {
enableFeature();
const result = renderKatex(tokens[idx].content, !!tokens[idx].block);
return result;
};
md.renderer.rules[key] = fn;
});
});
transformHooks.beforeParse.tap((_, context) => {
enableFeature = () => {
context.features[name$2] = true;
};
});
transformHooks.afterParse.tap((_, context) => {
var _a22;
const markmap = (_a22 = context.frontmatter) == null ? void 0 : _a22.markmap;
if (markmap) {
["extraJs", "extraCss"].forEach((key) => {
var _a32, _b2;
const value = markmap[key];
if (value) {
markmap[key] = addDefaultVersions(
value,
name$2,
((_b2 = (_a32 = plugin$1.config) == null ? void 0 : _a32.versions) == null ? void 0 : _b2.katex) || ""
);
}
});
}
});
return {
styles: (_c = plugin$1.config) == null ? void 0 : _c.styles,
scripts: (_d = plugin$1.config) == null ? void 0 : _d.scripts
};
}
});
var pluginKatex = plugin$1;
var name$1 = "npmUrl";
var pluginNpmUrl = definePlugin({
name: name$1,
transform(transformHooks) {
transformHooks.afterParse.tap((_, context) => {
const { frontmatter } = context;
const markmap = frontmatter == null ? void 0 : frontmatter.markmap;
if (markmap) {
["extraJs", "extraCss"].forEach((key) => {
const value = markmap[key];
if (value) {
markmap[key] = value.map((path) => {
if (path.startsWith("npm:")) {
return transformHooks.transformer.urlBuilder.getFullUrl(
path.slice(4)
);
}
return path;
});
}
});
}
});
return {};
}
});
var name = "sourceLines";
var plugin = definePlugin({
name,
transform(transformHooks) {
transformHooks.parser.tap((md) => {
md.renderer.renderAttrs = wrapFunction(
md.renderer.renderAttrs,
(renderAttrs2, token) => {
let attrs = renderAttrs2(token);
if (token.block && token.map) {
attrs += ` data-lines=${token.map.join(",")}`;
}
return attrs;
}
);
});
return {};
}
});
var pluginSourceLines = plugin;
var plugins = [
pluginFrontmatter,
pluginKatex,
pluginHljs,
pluginNpmUrl,
pluginCheckbox,
pluginSourceLines
];
var builtInPlugins = plugins;
function cleanNode(node) {
while (!node.content && node.children.length === 1) {
node = node.children[0];
}
while (node.children.length === 1 && !node.children[0].content) {
node = {
...node,
children: node.children[0].children
};
}
return {
...node,
children: node.children.map(cleanNode)
};
}
var Transformer = class {
constructor(plugins2 = builtInPlugins) {
this.assetsMap = {};
this.urlBuilder = new UrlBuilder();
this.hooks = createTransformHooks(this);
this.plugins = plugins2.map(
(plugin2) => typeof plugin2 === "function" ? plugin2() : plugin2
);
const assetsMap = {};
for (const { name: name2, transform } of this.plugins) {
assetsMap[name2] = transform(this.hooks);
}
this.assetsMap = assetsMap;
const md = initializeMarkdownIt();
this.md = md;
this.hooks.parser.call(md);
}
transform(content, fallbackParserOptions) {
var _a3;
const context = {
content,
features: {},
contentLineOffset: 0,
parserOptions: fallbackParserOptions
};
this.hooks.beforeParse.call(this.md, context);
const html4 = this.md.render(context.content, {});
this.hooks.afterParse.call(this.md, context);
const root3 = cleanNode(buildTree(html4, context.parserOptions));
root3.content || (root3.content = `${((_a3 = context.frontmatter) == null ? void 0 : _a3.title) || ""}`);
return { ...context, root: root3 };
}
getAssets(keys) {
const styles2 = [];
const scripts = [];
keys != null ? keys : keys = this.plugins.map((plugin2) => plugin2.name);
for (const assets of keys.map((key) => this.assetsMap[key])) {
if (assets) {
if (assets.styles)
styles2.push(...assets.styles);
if (assets.scripts)
scripts.push(...assets.scripts);
}
}
return {
styles: styles2.map((item) => patchCSSItem(this.urlBuilder, item)),
scripts: scripts.map((item) => patchJSItem(this.urlBuilder, item))
};
}
getUsedAssets(features) {
const keys = this.plugins.map((plugin2) => plugin2.name).filter((name2) => features[name2]);
return this.getAssets(keys);
}
};
// ../ABConverter/converter/abc_markmap.ts
var transformer = new Transformer();
var _abc_list2mindmap2 = ABConvert.factory({
id: "list2markmap",
name: "\u5217\u8868\u5230\u8111\u56FE (markmap)",
process_param: "string" /* text */,
process_return: "HTMLElement" /* el */,
process: (el, header, content) => {
var _a3, _b;
list2markmap(content, el);
(_b = (_a3 = ABCSetting.obsidian).markmap_event) == null ? void 0 : _b.call(_a3, el);
return el;
}
});
function list2markmap(markdown, div) {
const { root: root3, features } = transformer.transform(markdown.trim());
const assets = transformer.getUsedAssets(features);
if (ABCSetting.env.startsWith("obsidian")) {
let height_adapt = 30 + markdown.split("\n").length * 15;
if (height_adapt > 1e3)
height_adapt = 1e3;
const id = Math.random().toString(36).substring(2);
const svg_div = document.createElement("div");
div.appendChild(svg_div);
svg_div.classList.add("ab-markmap-div");
svg_div.id = "ab-markmap-div-" + id;
const html_str = ``;
svg_div.innerHTML = purify.sanitize(html_str, {
USE_PROFILES: { svg: true }
});
} else {
div.classList.add("ab-raw");
div.innerHTML = purify.sanitize(``);
}
{
}
{
}
{
}
return div;
}
async function markmap_event(d) {
var _a3;
if (ABCSetting.env == "obsidian-min")
return;
if (d.querySelector(".ab-markmap-svg")) {
console.log(" - markmap_event");
let script_el = document.querySelector('script[script-id="ab-markmap-script"]');
if (script_el)
script_el.remove();
const divEl = d;
let markmapId = "";
if (divEl.tagName === "DIV") {
markmapId = ((_a3 = divEl.querySelector(".ab-markmap-svg")) == null ? void 0 : _a3.id) || "";
}
script_el = document.createElement("script");
document.head.appendChild(script_el);
script_el.type = "module";
script_el.setAttribute("script-id", "ab-markmap-script");
script_el.textContent = `
import { Markmap, } from 'https://jspm.dev/markmap-view';
const markmapId = "${markmapId || ""}";
let mindmaps;
if (markmapId) {
mindmaps = document.querySelectorAll('#' + markmapId);
} else {
mindmaps = document.querySelectorAll('.ab-markmap-svg'); // \u6CE8\u610F\u4E00\u4E0B\u8FD9\u91CC\u7684\u9009\u62E9\u5668
}
for(const mindmap of mindmaps) {
mindmap.innerHTML = "";
Markmap.create(mindmap,null,JSON.parse(mindmap.getAttribute('data-json')));
}`;
}
}
ABCSetting.obsidian.markmap_event = markmap_event;
// ../ABConverter/index.ts
ABCSetting.env = "obsidian";
// ab_manager/abm_code/ABReplacer_CodeBlock.ts
var import_obsidian2 = require("obsidian");
// ../ABConverter/ABConvertEvent.ts
function abConvertEvent(d, isCycle = false) {
var _a3, _b, _c;
if (d.querySelector(".ab-super-width")) {
const els_note = d.querySelectorAll(".ab-note");
for (const el_note of els_note) {
if (el_note.classList.contains("ab-super-width") || el_note.querySelector(".ab-super-width")) {
const el_replace = el_note.parentNode;
if (el_replace && el_replace.classList.contains("ab-replace")) {
el_replace.classList.add("ab-super-width-p");
}
}
}
const els_view = document.querySelectorAll(".app-container .workspace-leaf");
for (const el_view of els_view) {
el_view.style.setProperty("--ab-width-outer", (el_view.offsetWidth - 40).toString() + "px");
}
}
if (d.querySelector(".ab-nodes-node")) {
const els_min = document.querySelectorAll(".ab-nodes.min .ab-nodes-node");
const list_children = d.querySelectorAll(".ab-nodes-node");
for (const children2 of list_children) {
const el_content = children2.querySelector(".ab-nodes-content");
if (!el_content)
continue;
const el_child = children2.querySelector(".ab-nodes-children");
if (!el_child)
continue;
const el_bracket = el_child.querySelector(".ab-nodes-bracket");
if (!el_bracket)
continue;
const el_bracket2 = el_child.querySelector(".ab-nodes-bracket2");
if (!el_bracket2)
continue;
const els_child = el_child.childNodes;
if (els_child.length < 3) {
el_bracket.style.setProperty("display", "none");
el_bracket2.style.setProperty("display", "none");
continue;
}
const el_child_first = els_child[2];
const el_child_last = els_child[els_child.length - 1];
const el_child_first_content = el_child_first.querySelector(".ab-nodes-content");
const el_child_last_content = el_child_last.querySelector(".ab-nodes-content");
let height = 0;
let heightToReduce = (el_child_first.offsetHeight + el_child_last.offsetHeight) / 2;
if (els_child.length == 3) {
height = el_child_first_content.offsetHeight - 20 > 20 ? el_child_first_content.offsetHeight - 20 : 20;
el_bracket2.style.cssText = `
height: ${height}px;
top: calc(50% - ${height / 2}px);
`;
} else {
el_bracket2.style.cssText = `
height: calc(100% - ${heightToReduce}px);
top: ${el_child_first.offsetHeight / 2}px;
`;
}
if (Array.prototype.includes.call(els_min, children2)) {
if (els_child.length == 3) {
el_bracket.style.cssText = `
display: block;
top: calc(50% + ${el_content.offsetHeight / 2}px - 3px);
clip-path: circle(40% at 50% 40%);
`;
} else {
el_bracket.setAttribute("display", "none");
}
if (els_child.length == 3 && el_content.offsetHeight == el_child_first_content.offsetHeight) {
el_bracket2.style.cssText = `
height: 1px;
top: calc(50% + ${el_content.offsetHeight / 2}px - 1px);
width: 18px; /* \u53EF\u4EE5\u6EA2\u51FA\u70B9 */
border-radius: 0;
border: none;
border-bottom: 1px solid var(--node-color);
`;
} else {
if (els_child.length == 3) {
height = el_child_last_content.offsetHeight / 2 - el_content.offsetHeight / 2;
el_bracket2.style.setProperty("height", `${height}px`);
el_bracket2.style.setProperty("top", `calc(50% + ${el_content.offsetHeight / 2}px)`);
el_bracket2.style.setProperty("border-radius", `0 0 0 10px`);
el_bracket2.style.setProperty("border-top", `0`);
} else {
heightToReduce = el_child_first.offsetHeight / 2 + el_child_first_content.offsetHeight / 2 + el_child_last.offsetHeight / 2 - el_child_last_content.offsetHeight / 2;
el_bracket2.style.setProperty("height", `calc(100% - ${heightToReduce}px + 1px)`);
el_bracket2.style.setProperty("top", `${el_child_first.offsetHeight / 2 + el_child_first_content.offsetHeight / 2 - 1}px`);
}
el_bracket2.style.setProperty("width", "20px");
}
}
}
}
if (d.querySelector(".ab-items.ab-lay-vfall:not(.js-waterfall):not(.ab-lay-hfall):not(.ab-lay-grid)")) {
const root_el_list = d.querySelectorAll(".ab-items.ab-lay-vfall:not(.js-waterfall):not(.ab-lay-hfall):not(.ab-lay-grid)");
for (const root_el of root_el_list) {
root_el.classList.add("js-waterfall");
const list_children = root_el.querySelectorAll(".ab-items-item");
const columnCountTmp = parseInt(window.getComputedStyle(root_el).getPropertyValue("column-count"));
let columnCount;
if (columnCountTmp && !isNaN(columnCountTmp) && columnCountTmp > 0) {
columnCount = columnCountTmp;
} else if (root_el.classList.contains("ab-col-auto") && list_children.length <= 4) {
columnCount = list_children.length;
root_el.classList.add("ab-col" + columnCount);
} else {
columnCount = 4;
root_el.classList.add("ab-col" + columnCount);
}
const height_cache = [];
const el_cache = [];
for (let i = 0; i < columnCount; i++) {
height_cache.push(0);
el_cache.push([]);
}
for (const children2 of list_children) {
const minValue = Math.min.apply(null, height_cache);
const minIndex = height_cache.indexOf(minValue);
const heightTmp = parseInt(window.getComputedStyle(children2).getPropertyValue("height"));
height_cache[minIndex] += heightTmp && !isNaN(heightTmp) && heightTmp > 0 ? heightTmp : 10;
el_cache[minIndex].push(children2);
}
const fillNumber = columnCount - list_children.length % columnCount;
if (fillNumber != 4) {
for (let i = 0; i < fillNumber; i++) {
const children2 = document.createElement("div");
children2.classList.add(".ab-items-item.placeholder");
children2.setAttribute("style", "height: 20px");
const minValue = Math.min.apply(null, height_cache);
const minIndex = height_cache.indexOf(minValue);
height_cache[minIndex] += 20;
el_cache[minIndex].push(children2);
}
}
root_el.innerHTML = "";
for (let i = 0; i < columnCount; i++) {
for (const j of el_cache[i]) {
root_el.appendChild(j);
}
}
}
}
if (!isCycle && d.querySelector(".ab-markmap-div")) {
const divEl = d;
let markmapId = "";
if (divEl.tagName === "DIV") {
markmapId = ((_a3 = divEl.querySelector(".ab-markmap-div")) == null ? void 0 : _a3.id) || "";
}
let mindmaps;
if (markmapId) {
mindmaps = document.querySelectorAll("#" + markmapId);
} else {
mindmaps = document.querySelectorAll(".ab-markmap-div");
}
for (const el_div of mindmaps) {
const el_svg = el_div.querySelector("svg");
const el_g = el_svg == null ? void 0 : el_svg.querySelector("g");
if (el_svg && el_g) {
const scale_new = el_g.getBBox().height / el_div.offsetWidth;
el_svg.setAttribute("style", `height:${el_g.getBBox().height * scale_new + 40}px`);
(_c = (_b = ABCSetting.obsidian).markmap_event) == null ? void 0 : _c.call(_b, d);
}
}
}
}
// ab_manager/abm_cm/ABReplacer_Widget.ts
var import_obsidian = require("obsidian");
var import_view = require("@codemirror/view");
var _ABReplacer_Widget = class extends import_view.WidgetType {
constructor(rangeSpec, editor, customData) {
super();
this.customData = customData;
this.content_withPrefix_length = 0;
this.lastFromPos = null;
this.content_withPrefix_length = rangeSpec.to_ch - rangeSpec.from_ch;
this.rangeSpec = rangeSpec;
this.global_editor = editor;
}
toDOM(view) {
this.div = document.createElement("div");
this.div.setAttribute("type_header", this.rangeSpec.header);
this.div.addClasses(["ab-replace", "cm-embed-block"]);
if (ABCSetting.is_debug) {
const id = `${Date.now()}`.replace(/(\d{3})$/, ".$1");
this.div.setAttribute("id", id);
const el_id = document.createElement("div");
this.div.appendChild(el_id);
el_id.className = "ab-id";
el_id.textContent = id;
}
if (this.rangeSpec.selector == "callout")
this.div.setAttribute("selector", "callout");
const getPos = () => {
let fromPos;
try {
fromPos = view.posAtDOM(this.div, 0);
} catch (_) {
console.warn("get cursor pos failed:", this.div);
return null;
}
const pos = {
fromPos,
toPos: fromPos + this.content_withPrefix_length
};
return pos;
};
const save = (str_with_prefix, force_refresh = false) => {
let pos = getPos();
if (!pos) {
if (this.lastFromPos == null)
return Promise.resolve();
else
pos = {
fromPos: this.lastFromPos,
toPos: this.lastFromPos + this.content_withPrefix_length
};
} else {
this.lastFromPos = pos.fromPos;
}
this.content_withPrefix_length = str_with_prefix.length;
if (force_refresh) {
this.customData.updateMode = pos.fromPos;
}
const new_state = view.state;
const transaction = new_state.update({
changes: {
from: pos.fromPos,
to: pos.toPos,
insert: str_with_prefix
},
userEvent: "input"
});
view.dispatch(transaction);
return Promise.resolve();
};
let dom_note = document.createElement("div");
this.div.appendChild(dom_note);
dom_note.classList.add("ab-note", "drop-shadow");
ABConvertManager.autoABConvert(
dom_note,
this.rangeSpec.header,
this.rangeSpec.content,
this.rangeSpec.selector,
ABCSetting.env != "obsidian-pro" ? void 0 : {
save,
rangeSpec: {
type: "anyblock",
text_content: this.rangeSpec.content,
fromPos: this.rangeSpec.from_ch,
toPos: this.rangeSpec.to_ch,
header: this.rangeSpec.header,
selector: this.rangeSpec.selector,
parent_prefix: this.rangeSpec.prefix
},
setting: {},
ctx: ABCSetting.obsidian.global_ctx,
app: ABCSetting.obsidian.global_app
}
);
if (!this.global_editor)
return this.div;
const btn_edit = this.div.createEl("div", {
cls: ["ab-button", "ab-button-1", "edit-block-button"],
attr: { "aria-label": "Edit the block - " + this.rangeSpec.header }
});
if (import_obsidian.Platform.isMobileApp || import_obsidian.Platform.isPhone || import_obsidian.Platform.isTablet) {
btn_edit.classList.remove("edit-block-button");
}
btn_edit.empty();
btn_edit.appendChild((0, import_obsidian.sanitizeHTMLToDom)(_ABReplacer_Widget.STR_ICON_CODE2));
btn_edit.onclick = () => {
switch_more(false);
this.moveCursor();
};
const btn_copy = this.div.createEl("div", {
cls: ["ab-button", "ab-button-3", "edit-block-button"],
attr: { "aria-label": "Copy source content" }
});
btn_copy.empty();
btn_copy.appendChild((0, import_obsidian.sanitizeHTMLToDom)(_ABReplacer_Widget.STR_ICON_COPY));
btn_copy.onclick = () => {
if (!this.global_editor)
return;
switch_more(false);
let content = this.global_editor.getRange(
this.global_editor.offsetToPos(this.rangeSpec.from_ch),
this.global_editor.offsetToPos(this.rangeSpec.to_ch)
);
if (this.rangeSpec.prefix.length > 0) {
content = content.replaceAll("\n" + this.rangeSpec.prefix, "\n");
}
if (!content.endsWith("\n"))
content += "\n";
navigator.clipboard.writeText(content);
new import_obsidian.Notice("Copied to clipboard");
};
const btn_wider = this.div.createEl("div", {
cls: ["ab-button", "ab-button-4", "edit-block-button"],
attr: { "aria-label": "Make the block wider" }
});
btn_wider.empty();
btn_wider.appendChild((0, import_obsidian.sanitizeHTMLToDom)(_ABReplacer_Widget.STR_ICON_WIDER));
btn_wider.onclick = () => {
if (dom_note.classList.contains("ab-super-width")) {
dom_note.classList.remove("ab-super-width");
this.div.classList.remove("ab-super-width-p");
} else {
dom_note.classList.add("ab-super-width");
this.div.classList.add("ab-super-width-p");
}
};
const btn_refresh = this.div.createEl("div", {
cls: ["ab-button", "ab-button-5", "edit-block-button"],
attr: { "aria-label": "Refresh the block" }
});
btn_refresh.empty();
btn_refresh.appendChild((0, import_obsidian.sanitizeHTMLToDom)(_ABReplacer_Widget.STR_ICON_REFRESH));
btn_refresh.onclick = () => {
switch_more(false);
abConvertEvent(this.div);
this.moveCursor(-1);
};
const btn_more = this.div.createEl("div", {
cls: ["ab-button", "ab-button-2", "edit-block-button"],
attr: { "aria-label": "More option" }
});
btn_more.empty();
btn_more.appendChild((0, import_obsidian.sanitizeHTMLToDom)(_ABReplacer_Widget.STR_ICON_ELLIPSIS));
let is_show = false;
switch_more(false);
btn_more.onclick = () => switch_more();
function switch_more(_is_show) {
if (_is_show !== void 0)
is_show = _is_show;
else
is_show = !is_show;
if (is_show) {
btn_copy.classList.remove("ab-hide");
btn_refresh.classList.remove("ab-hide");
btn_wider.classList.remove("ab-hide");
} else {
btn_copy.classList.add("ab-hide");
btn_refresh.classList.add("ab-hide");
btn_wider.classList.add("ab-hide");
}
}
return this.div;
}
moveCursor(line_offset = 0) {
if (this.global_editor) {
const editor = this.global_editor;
let pos = getCursorPos(editor, this.rangeSpec.from_ch);
if (pos) {
pos.line += line_offset;
if (line_offset < 0) {
pos.ch = 0;
editor.setCursor(pos);
} else {
editor.setCursor(pos);
editor.replaceRange("OF", pos);
editor.replaceRange("", pos, { line: pos.line, ch: pos.ch + 2 });
}
}
}
return;
function getCursorPos(editor, total_ch) {
let count_ch = 0;
let list_text = editor.getValue().split("\n");
for (let i = 0; i < list_text.length; i++) {
if (count_ch + list_text[i].length >= total_ch)
return { line: i, ch: total_ch - count_ch };
count_ch = count_ch + list_text[i].length + 1;
}
return null;
}
}
};
var ABReplacer_Widget = _ABReplacer_Widget;
ABReplacer_Widget.STR_ICON_CODE2 = ``;
ABReplacer_Widget.STR_ICON_REFRESH = ``;
ABReplacer_Widget.STR_ICON_COPY = ``;
ABReplacer_Widget.STR_ICON_WIDER = `
`;
ABReplacer_Widget.STR_ICON_ELLIPSIS = ``;
// ab_manager/abm_code/ABReplacer_CodeBlock.ts
var ABReplacer_CodeBlock = class {
static processor(src, blockEl, ctx) {
ABCSetting.obsidian.global_ctx = ctx;
const root_div = document.createElement("div");
blockEl.appendChild(root_div);
root_div.classList.add("ab-replace");
const list_src = src.split("\n");
let header = "";
let header_indent_prefix = "";
if (list_src.length) {
const match3 = list_src[0].match(ABReg.reg_header_noprefix);
if (match3 && match3[5]) {
header = match3[5];
header_indent_prefix = match3[1];
}
}
const src_without_indent = list_src.slice(1).map(
(line) => line.startsWith(header_indent_prefix) ? line.substring(header_indent_prefix.length) : line
).join("\n");
const calc_margin = header_indent_prefix.replace(/\t/g, " ").length;
root_div.setAttribute("style", "margin-left: " + calc_margin * 0.5 + "rem;");
const dom_note = root_div.createDiv({
cls: ["ab-note", "drop-shadow"]
});
let dom_replaceEl = dom_note.createDiv({
cls: ["ab-replaceEl"]
});
if (header != "") {
ABConvertManager.autoABConvert(dom_replaceEl, header, src_without_indent);
} else {
ABConvertManager.getInstance().m_renderMarkdownFn(src, dom_replaceEl, ctx);
}
let dom_edit = root_div.createEl("div", {
cls: ["ab-button", "ab-button-2", "edit-block-button"],
attr: { "aria-label": "Refresh the block" }
});
dom_edit.empty();
dom_edit.appendChild((0, import_obsidian2.sanitizeHTMLToDom)(ABReplacer_Widget.STR_ICON_REFRESH));
dom_edit.onclick = () => {
abConvertEvent(root_div);
};
const button_show = () => {
dom_edit.show();
};
const button_hide = () => {
dom_edit.hide();
};
button_hide();
dom_note.onmouseover = button_show;
dom_note.onmouseout = button_hide;
dom_edit.onmouseover = button_show;
dom_edit.onmouseout = button_hide;
}
};
// ab_manager/abm_cm/ABStateManager.ts
var import_view2 = require("@codemirror/view");
var import_state = require("@codemirror/state");
var import_obsidian4 = require("obsidian");
// config/ABSettingTab.ts
var import_obsidian3 = require("obsidian");
// ../CodeMirror2/ABSelector_Md.ts
function autoMdSelector(mdText = "") {
let list_mdSelectorRangeSpec = [];
let list_text = mdText.split("\n");
let codeBlockFlag = "";
let map_line_ch = [0];
let count_ch = 0;
for (let line of list_text) {
count_ch = count_ch + line.length + 1;
map_line_ch.push(count_ch);
}
for (let i = 0; i < list_text.length; i++) {
const line = list_text[i];
if (codeBlockFlag == "") {
const match3 = line.match(ABReg.reg_code);
if (match3 && match3[3]) {
codeBlockFlag = match3[1] + match3[3];
}
} else {
if (line.indexOf(codeBlockFlag) == 0) {
codeBlockFlag = "";
}
continue;
}
for (let selecotr of list_mdSelector) {
if (selecotr.match.test(line)) {
let sim = selecotr.selector(list_text, i);
if (!sim)
continue;
list_mdSelectorRangeSpec.push({
from_ch: map_line_ch[sim.from_line],
to_ch: map_line_ch[sim.to_line] - 1,
header: sim.header,
selector: sim.selector,
content: sim.content,
prefix: sim.prefix
});
i = sim.to_line - 1;
codeBlockFlag = "";
break;
}
}
}
return list_mdSelectorRangeSpec;
}
function generateSelectorInfoTable(el) {
const table_p = el.createEl("div", {
cls: ["ab-setting", "md-table-fig1"]
});
const table2 = table_p.createEl("table", {
cls: ["ab-setting", "md-table-fig2"]
});
{
const thead = table2.createEl("thead");
const tr = thead.createEl("tr");
tr.createEl("th", { text: "Selector Name" });
tr.createEl("th", { text: "First-line Regular" });
tr.createEl("th", { text: "Enable" });
}
const tbody = table2.createEl("tbody");
for (let item of list_mdSelector) {
const tr = tbody.createEl("tr");
tr.createEl("td", { text: item.name });
tr.createEl("td", { text: String(item.match) });
tr.createEl("td", { text: item.is_disable ? "No" : "Yes" });
}
return table_p;
}
var list_mdSelector = [];
function registerMdSelector(simp) {
var _a3;
list_mdSelector.push({
id: simp.id,
name: simp.name,
match: simp.match,
detail: (_a3 = simp.detail) != null ? _a3 : "",
selector: simp.selector,
is_disable: false
});
}
// ../CodeMirror2/ABSelector_MdBase.ts
function easySelector(list_text, from_line, selector, frist_reg) {
let mdRange = {
from_line: from_line - 1,
to_line: from_line + 1,
header: "",
selector,
levelFlag: "",
content: "",
prefix: ""
};
if (from_line <= 0)
return null;
const first_line_match = list_text[from_line].match(frist_reg);
if (!first_line_match)
return null;
mdRange.prefix = first_line_match[1];
mdRange.levelFlag = first_line_match[3];
let header_line_match;
if (list_text[from_line - 1].indexOf(mdRange.prefix) == 0 && ABReg.reg_emptyline_noprefix.test(list_text[from_line - 1]) && from_line > 1) {
mdRange.from_line = from_line - 2;
}
header_line_match = list_text[mdRange.from_line].match(ABReg.reg_header);
if (!header_line_match)
return null;
if (header_line_match[1] != mdRange.prefix)
return null;
mdRange.header = header_line_match[5];
return mdRange;
}
function easySelector_headtail(list_text, from_line, selector, frist_reg) {
let mdRange = {
from_line,
to_line: from_line + 1,
header: "",
selector,
levelFlag: "",
content: "",
prefix: ""
};
if (from_line < 0)
return null;
const first_line_match = list_text[from_line].match(frist_reg);
if (!first_line_match)
return null;
mdRange.prefix = first_line_match[1];
mdRange.levelFlag = first_line_match[3];
mdRange.header = first_line_match[4];
return mdRange;
}
var mdSelector_headtail = {
id: "mdit",
name: "mdit:::\u5934\u5C3E\u9009\u62E9\u5668",
detail: "\u4EE5`:::`\u5F00\u5934\u548C\u7ED3\u5C3E\uFF0C\u5904\u7406\u5668\u540D\u5199\u5728\u7B2C\u4E00\u4E2A`:::`\u7684\u540E\u9762\uFF0C\u4E0D\u9700\u8981\u52A0`[]`\u3002\u5176\u5B9E\u5C31\u548C\u4EE3\u7801\u5757\u5DEE\u4E0D\u591A\uFF0C\u8FD9\u4E5F\u662FVuePress\u7684\u4E00\u4E2Amd\u6269\u5C55\u8BED\u6CD5",
match: ABReg.reg_mdit_head,
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector_headtail(list_text, from_line, "mdit", ABReg.reg_mdit_head);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
let codeBlockFlag = "";
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (codeBlockFlag == "") {
const match3 = line.match(ABReg.reg_code);
if (match3 && match3[3]) {
codeBlockFlag = match3[1] + match3[3];
continue;
}
} else {
if (line.indexOf(codeBlockFlag) == 0)
codeBlockFlag = "";
last_nonempty = i;
continue;
}
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_emptyline_noprefix.test(line2)) {
continue;
}
last_nonempty = i;
if (line2.indexOf(mdRange.levelFlag) == 0) {
last_nonempty = i;
break;
}
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line + 1, mdRange.to_line - 1).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_headtail);
var mdSelector_list = {
id: "list",
name: "\u5217\u8868\u9009\u62E9\u5668",
match: ABReg.reg_list,
detail: "\u5728\u5217\u8868\u7684\u4E0A\u4E00/\u4E24\u884C\u52A0\u4E0A`[\u5904\u7406\u5668\u540D]`\u7684header\uFF0C\u6CE8\u610Fheader\u5FC5\u987B\u548C\u5217\u8868\u9996\u884C\u4F4D\u4E8E\u540C\u4E00\u5C42\u6B21",
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector(list_text, from_line, "list", ABReg.reg_list);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_list_noprefix.test(line2)) {
last_nonempty = i;
continue;
}
if (ABReg.reg_indentline_noprefix.test(line2)) {
last_nonempty = i;
continue;
}
if (ABReg.reg_emptyline_noprefix.test(line2)) {
continue;
}
break;
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line, mdRange.to_line).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_list);
var mdSelector_code = {
id: "code",
name: "\u4EE3\u7801\u9009\u62E9\u5668",
match: ABReg.reg_code,
detail: "\u5728\u4EE3\u7801\u5757\u7684\u4E0A\u4E00/\u4E24\u884C\u52A0\u4E0A`[\u5904\u7406\u5668\u540D]`\u7684header\uFF0C\u6CE8\u610Fheader\u5FC5\u987B\u548C\u4EE3\u7801\u5757\u9996\u884C\u4F4D\u4E8E\u540C\u4E00\u5C42\u6B21",
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector(list_text, from_line, "code", ABReg.reg_code);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_emptyline_noprefix.test(line2)) {
continue;
}
last_nonempty = i;
if (line2.indexOf(mdRange.levelFlag) == 0) {
last_nonempty = i;
break;
}
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line, mdRange.to_line).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_code);
var mdSelector_quote = {
id: "quote",
name: "\u5F15\u7528\u5757\u9009\u62E9\u5668",
match: ABReg.reg_quote,
detail: "\u5728\u5F15\u7528\u5757\u7684\u4E0A\u4E00/\u4E24\u884C\u52A0\u4E0A`[\u5904\u7406\u5668\u540D]`\u7684header\uFF0C\u6CE8\u610Fheader\u5FC5\u987B\u548C\u5F15\u7528\u5757\u9996\u884C\u4F4D\u4E8E\u540C\u4E00\u5C42\u6B21",
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector(list_text, from_line, "quote", ABReg.reg_quote);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_quote_noprefix.test(line2)) {
last_nonempty = i;
continue;
}
break;
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line, mdRange.to_line).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_quote);
var mdSelector_table = {
id: "table",
name: "\u8868\u683C\u9009\u62E9\u5668",
match: ABReg.reg_table,
detail: "\u5728\u8868\u683C\u7684\u4E0A\u4E00/\u4E24\u884C\u52A0\u4E0A`[\u5904\u7406\u5668\u540D]`\u7684header\uFF0C\u6CE8\u610Fheader\u5FC5\u987B\u548C\u8868\u683C\u9996\u884C\u4F4D\u4E8E\u540C\u4E00\u5C42\u6B21",
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector(list_text, from_line, "table", ABReg.reg_table);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_table_noprefix.test(line2)) {
last_nonempty = i;
continue;
}
break;
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line, mdRange.to_line).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_table);
var mdSelector_heading = {
id: "heading",
name: "\u6807\u9898\u9009\u62E9\u5668",
match: ABReg.reg_heading,
detail: "\u5728\u6807\u9898\u7684\u4E0A\u4E00/\u4E24\u884C\u52A0\u4E0A`[\u5904\u7406\u5668\u540D]`\u7684header\uFF0C\u6CE8\u610Fheader\u5FC5\u987B\u548C\u6807\u9898\u9996\u884C\u4F4D\u4E8E\u540C\u4E00\u5C42\u6B21",
selector: (list_text, from_line) => {
let mdRangeTmp = easySelector(list_text, from_line, "heading", ABReg.reg_heading);
if (!mdRangeTmp)
return null;
const mdRange = mdRangeTmp;
let last_nonempty = from_line;
let codeBlockFlag = "";
for (let i = from_line + 1; i < list_text.length; i++) {
const line = list_text[i];
if (codeBlockFlag == "") {
const match4 = line.match(ABReg.reg_code);
if (match4 && match4[3]) {
codeBlockFlag = match4[1] + match4[3];
continue;
}
} else {
if (line.indexOf(codeBlockFlag) == 0)
codeBlockFlag = "";
last_nonempty = i;
continue;
}
if (line.indexOf(mdRange.prefix) != 0)
break;
const line2 = line.replace(mdRange.prefix, "");
if (ABReg.reg_emptyline_noprefix.test(line2)) {
continue;
}
const match3 = line2.match(ABReg.reg_heading_noprefix);
if (!match3) {
last_nonempty = i;
continue;
}
if (match3[3].length < mdRange.levelFlag.length) {
break;
}
last_nonempty = i;
}
mdRange.to_line = last_nonempty + 1;
mdRange.content = list_text.slice(from_line, mdRange.to_line).map((line) => {
return line.replace(mdRange.prefix, "");
}).join("\n");
return mdRange;
}
};
registerMdSelector(mdSelector_heading);
// ../ABConverter/locales/en.ts
var en_default = {
"any-block-rebuild-view": "Refresh/rebuild current view",
"any-block-rebuild-view-btn": "Rebuild View",
"any-block-to-codeblock": "Convert anyblock section into codeblock format",
"any-block-to-codeblock-success": "Convert success! Generated to ",
"any-block-to-codeblock-fail": "Convert failed, please check the console for details",
"any-block-delete-ab-header": "Delete AnyBlock header",
"any-block-switch-disable": "Toggle AnyBlock enable/disable",
"Mini docs": `Mini docs`,
"see website for detail": `See
website
/
github
for more details | Author: LincZero`,
"Mini docs menu": `How to visualize the creation of AnyBlock?`,
"Mini docs menu2": `It is recommended to use
AnyMenu
plugin (developed by the same author) to quickly enter AnyBlock templates using the menu panel or search box.`,
"Selector manager": "Selector",
"Selector manager2": "This section is for query only and cannot be edited",
"AliasSystem manager": "Alias system",
"AliasSystem manager2": "It can be viewed in the main page using the `[info_alias]` processor",
"AliasSystem manager3": "This section can also be modified by opening the `data.json` file in the plugin folder",
"AliasSystem manager4": "Add a new registration instruction",
"AliasSystem manager5": "Add a new registration instructionAdd a new registration instruction (old, will not be used)",
"Convertor manager": "Convertor",
"Convertor manager2": "It can be viewed in the main page using the `[info_converter]` processor",
"Convertor manager3": "This section is for query only and cannot be edited",
"Custom alias": "Custom alias",
"Custom alias2": "Alias matching rule",
"Custom alias3": "If `/` is used to enclose it, it indicates a regular expression.",
"Custom alias4": "Alias replacement",
"Custom alias5": "The parameter-based replacement function is currently not available. It will be enabled only when there is a need for multiple users.",
"Custom processor": "Custom processor - deprecated",
"Custom processor2": "Processor id",
"Custom processor3": "Without conflicting with other processors",
"Custom processor4": "Processor name",
"Custom processor5": "You can fill it in freely. It's for your own reference",
"Custom processor6": "Processor matching rule",
"Custom processor7": "Using `/` including it indicates a regular expression",
"Custom processor8": "Processor replacement",
"Custom processor9": "Using `/` including it indicates a regular expression",
"Pro": "Pro",
"Pro2": "Pro version enhanced settings",
"Pro disable": "Disable pro feat",
"Pro disable2": "(The modification requires restarting the plugin) Disable the Pro version features. Once enabled, they will be equivalent to the non-Pro version functions. This is convenient for debugging bugs or checking whether the function is generated by this module.",
"Pro editableblock render": "EditableBlock default render",
"Pro editableblock render2": "EditableBlock default render mode",
"Pro editableblock render21": "- Read mode: you need to press the middle key to enter the editing mode. Press the middle key / Esc / move the cursor outside to complete the editing.",
"Pro editableblock render22": "- Teal time: allows for direct editing but requires more performance.",
"Pro editableblock render23": "- Simple text area: Display as plain text, suitable for cases where the sub-block does not contain complex markdown.",
"Pro editableblock render24": "- Only take over during editing (developing)",
"Pro editableblock render3": "Read mode",
"Pro editableblock render4": "Real mode",
"Pro editableblock render5": "Simple text area",
"Pro alias override": "Pro alias override",
"Pro alias override2": "(The modification requires restarting the plugin) Replace the original processor behavior with the corresponding Pro processor behavior. If disabled, the editable version and the original version will use different processor names.",
"Pro callout": "Callout selector",
"Pro callout2": "Use the Callout selector and enable editable Callout",
"License": "License",
"License2": "This is a license for the Pro version. The display of expiration time needs to be updated by reopening the settings panel.\nBy adopting a dual-licensing mechanism, a certain period of default free licenses (coexisting with the user licenses) will be provided with each update.",
"License key": "License key",
"License Expiry": "License Expiry. The display of expiration time needs to be updated by reopening the settings panel.",
"Submit": "Submit",
"Edit": "Edit",
"Refresh": "Refresh",
"Delete": "Delete",
"Save": "Save",
"Cancel": "Cancel",
"Close": "Close"
};
// ../ABConverter/locales/zh-cn.ts
var zh_cn_default = {
"any-block-rebuild-view": "\u5237\u65B0/\u91CD\u5EFA\u5F53\u524D\u89C6\u56FE",
"any-block-rebuild-view-btn": "\u5237\u65B0\u89C6\u56FE",
"any-block-to-codeblock": "\u5C06 anyblock \u533A\u5757\u8F6C\u6362\u4E3A\u4EE3\u7801\u5757\u683C\u5F0F",
"any-block-to-codeblock-success": "\u8F6C\u6362\u6210\u529F! \u5DF2\u751F\u6210\u5230 ",
"any-block-to-codeblock-fail": "\u8F6C\u6362\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u63A7\u5236\u53F0\u4EE5\u83B7\u53D6\u8BE6\u7EC6\u4FE1\u606F",
"any-block-delete-ab-header": "\u5220\u9664 AnyBlock \u65B9\u62EC\u53F7\u5934\u90E8",
"any-block-switch-disable": "\u5207\u6362 AnyBlock \u542F\u7528/\u7981\u7528",
"Mini docs": `mini\u6587\u6863`,
"see website for detail": `\u67E5\u770B
website
/
github
\u6587\u6863\u4EE5\u83B7\u53D6\u66F4\u591A\u7EC6\u8282 | \u4F5C\u8005: LincZero`,
"Mini docs menu": `\u5982\u4F55\u53EF\u89C6\u5316\u521B\u5EFAAnyBlock?`,
"Mini docs menu2": `\u63A8\u8350\u4F7F\u7528
AnyMenu
\u63D2\u4EF6 (\u540C\u4F5C\u8005\u5F00\u53D1)\uFF0C\u4EE5\u4F7F\u7528\u83DC\u5355\u9762\u677F\u6216\u641C\u7D22\u6846\u5FEB\u901F\u8F93\u5165 AnyBlock \u6A21\u677F`,
"Selector manager": "\u9009\u62E9\u5668",
"Selector manager2": "\u8FD9\u4E00\u90E8\u5206\u4EC5\u4F9B\u67E5\u8BE2\u4E0D\u53EF\u7F16\u8F91",
"AliasSystem manager": "\u522B\u540D\u7CFB\u7EDF",
"AliasSystem manager2": "\u8FD9\u90E8\u5206\u5185\u5BB9\u53EF\u4EE5\u4F7F\u7528 `[info_alias]` \u5904\u7406\u5668\u5728\u4E3B\u9875\u9762\u4E2D\u67E5\u770B",
"AliasSystem manager3": "\u8FD9\u90E8\u5206\u4E5F\u53EF\u4EE5\u6253\u5F00\u63D2\u4EF6\u6587\u4EF6\u5939\u4E2D\u7684 `data.json` \u6587\u4EF6\u4FEE\u6539",
"AliasSystem manager4": "\u6DFB\u52A0\u65B0\u7684\u6CE8\u518C\u6307\u4EE4",
"AliasSystem manager5": "\u6DFB\u52A0\u65B0\u7684\u6CE8\u518C\u6307\u4EE4 - \u65E7\u7248\uFF0C\u5C06\u5F03\u7528",
"Convertor manager": "\u8F6C\u6362\u5668/\u5904\u7406\u5668",
"Convertor manager2": "\u8FD9\u90E8\u5206\u5185\u5BB9\u53EF\u4EE5\u4F7F\u7528 `[info_converter]` \u5904\u7406\u5668\u5728\u4E3B\u9875\u9762\u4E2D\u67E5\u770B",
"Convertor manager3": "\u8FD9\u4E00\u90E8\u5206\u4EC5\u4F9B\u67E5\u8BE2\u4E0D\u53EF\u7F16\u8F91",
"Custom alias": "\u81EA\u5B9A\u4E49\u522B\u540D",
"Custom alias2": "\u522B\u540D\u5339\u914D\u89C4\u5219",
"Custom alias3": "\u82E5\u7528`/`\u5305\u62EC\u8D77\u6765\u5219\u8868\u793A\u6B63\u5219",
"Custom alias4": "\u522B\u540D\u66FF\u6362\u4E3A",
"Custom alias5": "\u6682\u4E0D\u5F00\u653E\u5E26\u53C2\u6570\u7684\u66FF\u6362\u529F\u80FD\uFF0C\u5982\u591A\u4EBA\u9700\u8981\u624D\u5F00\u653E",
"Custom processor": "\u81EA\u5B9A\u4E49\u5904\u7406\u5668 - \u5C06\u5E9F\u5F03",
"Custom processor2": "\u5904\u7406\u5668\u552F\u4E00id",
"Custom processor3": "\u4E0D\u4E0E\u5176\u4ED6\u5904\u7406\u5668\u51B2\u7A81\u5373\u53EF",
"Custom processor4": "\u6CE8\u518C\u5668\u540D",
"Custom processor5": "\u53EF\u4EE5\u968F\u4FBF\u586B\uFF0C\u7ED9\u81EA\u5DF1\u770B\u7684",
"Custom processor6": "\u6CE8\u518C\u5668\u5339\u914D\u540D",
"Custom processor7": "\u7528 `/` \u5305\u62EC\u8D77\u6765\u5219\u8868\u793A\u6B63\u5219",
"Custom processor8": "\u6CE8\u518C\u5668\u66FF\u6362\u4E3A",
"Custom processor9": "\u7528 `/` \u5305\u62EC\u8D77\u6765\u5219\u8868\u793A\u6B63\u5219",
"Pro": "Pro",
"Pro2": "Pro \u7248\u589E\u5F3A\u9009\u9879",
"Pro disable": "\u7981\u7528 Pro \u7248\u529F\u80FD",
"Pro disable2": "(\u4FEE\u6539\u540E\u9700\u8981\u91CD\u542F\u63D2\u4EF6) \u7981\u7528 Pro \u7248\u529F\u80FD\uFF0C\u5F00\u542F\u540E\u7B49\u540C\u4E8E\u975E Pro \u7248\u529F\u80FD\uFF0C\u4FBF\u4E8E\u8C03\u8BD5 bug \u6216\u529F\u80FD\u662F\u5426\u8BE5\u6A21\u5757\u4EA7\u751F\u7684",
"Pro editableblock render": "\u53EF\u7F16\u8F91\u5757\u7684\u9ED8\u8BA4\u6E32\u67D3",
"Pro editableblock render2": "\u53EF\u7F16\u8F91\u5757\u7684\u9ED8\u8BA4\u6E32\u67D3\u6A21\u5F0F",
"Pro editableblock render21": "- \u9605\u8BFB\u6A21\u5F0F: \u9700\u8981\u4F7F\u7528\u4E2D\u952E\u8FDB\u5165\u7F16\u8F91\uFF0C\u4E2D\u952E/Esc/\u5149\u6807\u5916\u90E8\u805A\u7126\u5B8C\u6210\u7F16\u8F91",
"Pro editableblock render22": "- \u5B9E\u65F6\u6A21\u5F0F: \u53EF\u76F4\u63A5\u7F16\u8F91\u4F46\u4F1A\u66F4\u5403\u6027\u80FD",
"Pro editableblock render23": "- \u7B80\u6613\u6587\u672C\u6846: \u663E\u793A\u4E3A\u7EAF\u6587\u672C\uFF0C\u9002\u5408\u5B50\u5757\u4E0D\u5305\u542B\u590D\u6742md\u7684\u60C5\u51B5",
"Pro editableblock render24": "- \u4EC5\u7F16\u8F91\u65F6\u63A5\u7BA1 (\u5F00\u53D1\u4E2D): \u4E0D\u4FEE\u6539\u9ED8\u8BA4\u6E32\u67D3\u903B\u8F91\uFF0C\u4EC5\u4E2D\u952E\u5C06\u5176\u4FEE\u6539\u4E3A\u53EF\u7F16\u8F91\u72B6\u6001",
"Pro editableblock render3": "\u9605\u8BFB\u6A21\u5F0F",
"Pro editableblock render4": "\u5B9E\u65F6\u6A21\u5F0F",
"Pro editableblock render5": "\u7B80\u6613\u6587\u672C\u6846",
"Pro alias override": "Pro \u522B\u540D\u8986\u76D6",
"Pro alias override2": "(\u91CD\u542F\u63D2\u4EF6\u751F\u6548) \u5C06\u539F\u5904\u7406\u5668\u884C\u4E3A\u66FF\u6362\u4E3A pro \u5BF9\u5E94\u5904\u7406\u5668\u7684\u884C\u4E3A\u3002\u82E5\u5173\u95ED\u5219\u53EF\u7F16\u8F91\u7248\u672C\u4E0E\u539F\u7248\u672C\u5206\u522B\u4F7F\u7528\u4E0D\u540C\u7684\u5904\u7406\u5668\u540D",
"Pro callout": "Callout \u9009\u62E9\u5668",
"Pro callout2": "\u4F7F\u7528 Callout \u9009\u62E9\u5668\uFF0C\u5E76\u542F\u7528\u53EF\u7F16\u8F91 Callout",
"License": "\u8BB8\u53EF\u8BC1",
"License2": "\u8FD9\u662FPro\u7248\u7684\u8BB8\u53EF\u8BC1\uFF0C\u5230\u671F\u65F6\u95F4\u7684\u663E\u793A\u9700\u8981\u91CD\u65B0\u6253\u5F00\u8BBE\u7F6E\u9762\u677F\u6765\u66F4\u65B0\n\u91C7\u7528\u53CC\u8BB8\u53EF\u8BC1\u673A\u5236\uFF0C\u6BCF\u6B21\u66F4\u65B0\u90FD\u4F1A\u7ED9\u4E00\u5B9A\u65F6\u957F\u7684\u9ED8\u8BA4\u514D\u8D39\u8BB8\u53EF\u8BC1 (\u4E0E\u7528\u6237\u8BB8\u53EF\u8BC1\u5E76\u5B58)",
"License key": "\u8BB8\u53EF\u8BC1\u5BC6\u94A5",
"License Expiry": "\u8BB8\u53EF\u8BC1\u5230\u671F\u65F6\u95F4\uFF0C\u5230\u671F\u65F6\u95F4\u7684\u663E\u793A\u9700\u8981\u91CD\u65B0\u6253\u5F00\u8BBE\u7F6E\u9762\u677F\u6765\u66F4\u65B0",
"Submit": "\u63D0\u4EA4",
"Edit": "\u7F16\u8F91",
"Refresh": "\u5237\u65B0",
"Delete": "\u5220\u9664",
"Save": "\u4FDD\u5B58",
"Cancel": "\u53D6\u6D88",
"Close": "\u5173\u95ED"
};
// ../ABConverter/locales/helper.ts
var localeMap = {
en: en_default,
"zh": zh_cn_default,
"zh-TW": zh_cn_default
};
var locale;
function t(str) {
if (locale == void 0) {
if (ABCSetting.state.language == "English")
ABCSetting.state.language = "en";
else if (ABCSetting.state.language == "\u4E2D\u6587")
ABCSetting.state.language = "zh";
locale = localeMap[ABCSetting.state.language];
}
return locale && locale[str] || en_default[str];
}
// config/ABSettingTab.ts
var AB_SETTINGS = {
select_list: "ifhead" /* ifhead */,
select_quote: "ifhead" /* ifhead */,
select_code: "ifhead" /* ifhead */,
select_heading: "ifhead" /* ifhead */,
select_brace: "yes" /* yes */,
decoration_source: "none" /* none */,
decoration_live: "block" /* block */,
decoration_render: "block" /* block */,
is_neg_level: false,
alias_use_default: true,
alias_user: [
{
"regex": "|alias_demo|",
"replacement": "|addClass(ab-custom-text-red)|addClass(ab-custom-bg-blue)|"
},
{
"regex": "/\\|alias_reg_demo\\|/",
"replacement": "|addClass(ab-custom-text-red)|addClass(ab-custom-bg-blue)|"
}
],
user_processor: [{
"id": "alias2_demo",
"name": "alias2_demo",
"match": "alias2_demo",
"process_alias": "|addClass(ab-custom-text-blue)|addClass(ab-custom-bg-red)|"
}],
is_debug: false,
enhance_refresh_time: 2e3,
reg_header: ABReg.reg_header.toString(),
reg_header_noprefix: ABReg.reg_header_noprefix.toString(),
inline_split: ABReg.inline_split.toString(),
pro: {
license_key: "",
disable: false,
enable_callout_selector: true,
enable_alias_override: true,
editableblock_defaultRender: "readmode"
}
};
var expiry = {
expiry: -1
};
var ABSettingTab = class extends import_obsidian3.PluginSettingTab {
constructor(app2, plugin2) {
super(app2, plugin2);
this.plugin = plugin2;
ABCSetting.is_debug = this.plugin.settings.is_debug;
ABReg.inline_split = new RegExp(this.plugin.settings.inline_split.slice(1, -1));
if (!plugin2.settings.alias_use_default) {
ABAlias_user.length = 0;
}
for (let item of plugin2.settings.alias_user) {
let newReg;
if (/^\/.*\/$/.test(item.regex)) {
newReg = new RegExp(item.regex.slice(1, -1));
} else {
newReg = item.regex;
}
ABAlias_user.push({
regex: newReg,
replacement: item.replacement
});
}
for (let item of plugin2.settings.user_processor) {
ABConvert.factory(item);
}
}
display() {
const { containerEl } = this;
containerEl.empty();
let settings = this.plugin.settings;
const el_note = containerEl.createEl("div", { cls: "ab-note" });
const el_tab = el_note.createEl("div", { cls: "ab-tab-root" });
const el_tab_nav = el_tab.createEl("div", { cls: "ab-tab-nav" });
const el_tab_content = el_tab.createEl("div", { cls: "ab-tab-content" });
let ab_tab_nav_item;
let ab_tab_content_item;
let ab_tab_div_html;
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("Mini docs") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Mini docs")).setHeading();
ab_tab_div_html = ab_tab_content_item.createEl("div");
ab_tab_div_html.appendChild((0, import_obsidian3.sanitizeHTMLToDom)(t("see website for detail")));
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Mini docs menu")).setHeading();
ab_tab_div_html = ab_tab_content_item.createEl("div");
ab_tab_div_html.appendChild((0, import_obsidian3.sanitizeHTMLToDom)(t("Mini docs menu2")));
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("Selector manager") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Selector manager")).setHeading();
ab_tab_content_item.createEl("p", { text: t("Selector manager2") });
this.selectorPanel = generateSelectorInfoTable(ab_tab_content_item);
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("Convertor manager") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Convertor manager")).setHeading();
ab_tab_content_item.createEl("p", { text: t("Convertor manager2") });
ab_tab_content_item.createEl("p", { text: t("Convertor manager3") });
const div = ab_tab_content_item.createEl("div");
ABConvertManager.autoABConvert(div, "info_converter", "", "unknown");
this.processorPanel = div;
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("AliasSystem manager") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("AliasSystem manager")).setHeading();
ab_tab_content_item.createEl("p", { text: t("AliasSystem manager2") });
ab_tab_content_item.createEl("p", { text: t("AliasSystem manager3") });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("AliasSystem manager4")).addButton((component) => {
component.setIcon("plus-circle").onClick((e) => {
new ABModal_alias(this.app, async (result) => {
settings.alias_user.push({
regex: result.regex,
replacement: result.replacement
});
let newReg;
if (/^\/.*\/$/.test(result.regex)) {
newReg = new RegExp(result.regex.slice(1, -1));
} else {
newReg = result.regex;
}
ABAlias_user.push({
regex: newReg,
replacement: result.replacement
});
await this.plugin.saveSettings();
}).open();
});
});
new import_obsidian3.Setting(ab_tab_content_item).setName(t("AliasSystem manager5")).addButton((component) => {
component.setIcon("plus-circle").onClick((e) => {
new ABProcessorModal(this.app, async (result) => {
ABConvert.factory(result);
settings.user_processor.push(result);
await this.plugin.saveSettings();
this.processorPanel.remove();
const div2 = ab_tab_content_item.createEl("div");
ABConvertManager.autoABConvert(div2, "info_converter", "", "null_content");
this.processorPanel = div2;
}).open();
});
});
if (ABCSetting.env === "obsidian-pro") {
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: "\u7F16\u8F91\u5668\u83DC\u5355" });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName("\u7F16\u8F91\u5668\u83DC\u5355").setHeading();
ab_tab_content_item.createEl("p", { text: `(!\u5C06\u5F03\u7528\uFF0C\u8BF7\u4F7F\u7528\u540C\u4F5C\u8005\u5F00\u53D1\u7684 AnyMenu \u63D2\u4EF6)` });
ab_tab_content_item.createEl("p", { text: `\u4F60\u53EF\u4EE5\u5728\u8FD9\u91CC\u7F16\u8F91\u6269\u5C55\u7684\u7F16\u8F91\u5668\u53F3\u952E\u83DC\u5355\uFF0C\u52A0\u5165\u81EA\u5B9A\u4E49\u8981\u9ECF\u8D34\u7684\u9884\u8BBE\u6587\u672C\u3002
\u7F16\u8F91\u5668\u83DC\u5355\u662F\u4E00\u4E2A\u72EC\u7ACB\u529F\u80FD\u7684\u901A\u7528\u6A21\u5757\uFF0C\u4F60\u53EF\u4EE5\u628A\u4ED6\u5F53\u4F5C\u53E6\u4E00\u4E2A\u72EC\u7ACB\u529F\u80FD\u7684\u63D2\u4EF6\u6765\u4F7F\u7528` });
ab_tab_content_item.createEl("p", { text: `! \u4EC5\u6D4B\u8BD5\u7528\u3002\u76EE\u524D\u8FD9\u4E00\u90E8\u5206\u5728\u975EPro\u7248\u4EC5\u4F9B\u67E5\u8BE2\u4E0D\u53EF\u7F16\u8F91\uFF0C\u4E14\u76EE\u524D\u4E0D\u5199\u914D\u7F6E\u6587\u4EF6\uFF0C\u8BBE\u7F6E\u540E\u91CD\u542F\u5C31\u4E0D\u751F\u6548\u4E86` });
}
if (ABCSetting.env === "obsidian-pro") {
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("Pro") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Pro")).setHeading();
ab_tab_content_item.createEl("p", { text: t("Pro2") });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Pro disable")).setDesc(t("Pro disable2")).addToggle(
(toggle) => toggle.setValue(settings.pro.disable).onChange(async (value) => {
settings.pro.disable = value;
ABCSetting.pro.disable = value;
await this.plugin.saveSettings();
})
);
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Pro editableblock render")).setDesc(
createFragment((frag) => {
frag.appendText(t("Pro editableblock render2"));
frag.appendChild(document.createElement("br"));
frag.appendText(t("Pro editableblock render21"));
frag.appendChild(document.createElement("br"));
frag.appendText(t("Pro editableblock render22"));
frag.appendChild(document.createElement("br"));
frag.appendText(t("Pro editableblock render23"));
frag.appendChild(document.createElement("br"));
frag.appendText(t("Pro editableblock render24"));
})
).addDropdown((component) => {
component.addOption("readmode", t("Pro editableblock render3")).addOption("realtime", t("Pro editableblock render4")).addOption("textarea", t("Pro editableblock render5")).setValue(settings.pro.editableblock_defaultRender).onChange(async (v) => {
const value = v;
settings.pro.editableblock_defaultRender = value;
ABCSetting.pro.editableblock_defaultRender = value;
});
});
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Pro alias override")).setDesc(t("Pro alias override2")).addToggle(
(toggle) => toggle.setValue(settings.pro.enable_alias_override).onChange(async (value) => {
settings.pro.enable_alias_override = value;
ABCSetting.pro.enable_alias_override = value;
await this.plugin.saveSettings();
})
);
new import_obsidian3.Setting(ab_tab_content_item).setName(t("Pro callout")).setDesc(t("Pro callout2")).addToggle(
(toggle) => toggle.setValue(settings.pro.enable_callout_selector).onChange(async (value) => {
settings.pro.enable_callout_selector = value;
ABCSetting.pro.enable_callout_selector = value;
await this.plugin.saveSettings();
})
);
}
if (ABCSetting.env === "obsidian-pro") {
ab_tab_nav_item = el_tab_nav.createEl("button", { cls: "ab-tab-nav-item", text: t("License") });
ab_tab_content_item = el_tab_content.createEl("div", { cls: "ab-tab-content-item" });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("License")).setHeading();
ab_tab_content_item.createEl("p", { text: t("License2") });
new import_obsidian3.Setting(ab_tab_content_item).setName(t("License key")).addTextArea(
(text5) => text5.setValue(settings.pro.license_key).onChange(async (value) => {
settings.pro.license_key = value;
await this.plugin.saveSettings();
})
);
new import_obsidian3.Setting(ab_tab_content_item).setName(t("License Expiry")).addText(
(text5) => text5.setDisabled(true).setValue(expiry.expiry > 0 ? new Date(expiry.expiry).toLocaleDateString() : "No License: " + expiry.expiry)
);
new import_obsidian3.Setting(ab_tab_content_item).setName("Debug").setDesc("Only for developer use").addToggle(
(toggle) => toggle.setValue(settings.is_debug).onChange(async (value) => {
settings.is_debug = value;
ABCSetting.is_debug = value;
await this.plugin.saveSettings();
})
);
}
const lis = el_tab.querySelectorAll(":scope>.ab-tab-nav>.ab-tab-nav-item");
const contents2 = el_tab.querySelectorAll(":scope>.ab-tab-content>.ab-tab-content-item");
if (lis.length != contents2.length)
console.warn("ab-tab-nav-item\u548Cab-tab-content-item\u7684\u6570\u91CF\u4E0D\u4E00\u81F42");
for (let i = 0; i < lis.length; i++) {
if (i == 0) {
lis[i].setAttribute("is_activate", "true");
contents2[i].setAttribute("is_activate", "true");
contents2[i].classList.remove("ab-hide");
} else {
lis[i].setAttribute("is_activate", "false");
contents2[i].setAttribute("is_activate", "false");
contents2[i].classList.add("ab-hide");
}
lis[i].onclick = () => {
for (let j = 0; j < contents2.length; j++) {
lis[j].setAttribute("is_activate", "false");
contents2[j].setAttribute("is_activate", "false");
contents2[j].classList.add("ab-hide");
}
lis[i].setAttribute("is_activate", "true");
contents2[i].setAttribute("is_activate", "true");
contents2[i].classList.remove("ab-hide");
};
}
}
};
var ABProcessorModal = class extends import_obsidian3.Modal {
constructor(app2, onSubmit) {
super(app2);
this.args = {
id: "",
name: "",
match: "",
process_alias: ""
};
this.onSubmit = onSubmit;
}
onOpen() {
let { contentEl } = this;
contentEl.setText(t("Custom processor"));
contentEl.createEl("p", { text: "" });
new import_obsidian3.Setting(contentEl).setName(t("Custom processor2")).setDesc(t("Custom processor3")).addText((text5) => {
text5.onChange((value) => {
this.args.id = value;
});
});
new import_obsidian3.Setting(contentEl).setName(t("Custom processor4")).setDesc(t("Custom processor5")).addText((text5) => {
text5.onChange((value) => {
this.args.name = value;
});
});
new import_obsidian3.Setting(contentEl).setName(t("Custom processor6")).setDesc(t("Custom processor7")).addText((text5) => {
text5.onChange((value) => {
this.args.match = value;
});
});
new import_obsidian3.Setting(contentEl).setName(t("Custom processor8")).setDesc(t("Custom processor9")).addText((text5) => {
text5.onChange((value) => {
this.args.process_alias = value;
});
});
new import_obsidian3.Setting(contentEl).addButton((btn) => {
btn.setButtonText(t("Submit")).setCta().onClick(() => {
if (this.args.id && this.args.name && this.args.match && this.args.process_alias) {
this.close();
this.onSubmit(this.args);
}
});
});
}
onClose() {
let { contentEl } = this;
contentEl.empty();
}
};
var ABModal_alias = class extends import_obsidian3.Modal {
constructor(app2, onSubmit) {
super(app2);
this.args = {
regex: "",
replacement: ""
};
this.onSubmit = onSubmit;
}
onOpen() {
let { contentEl } = this;
contentEl.setText(t("Custom alias"));
contentEl.createEl("p", { text: "" });
new import_obsidian3.Setting(contentEl).setName(t("Custom alias2")).setDesc(t("Custom alias3")).addText((text5) => {
text5.onChange((value) => {
this.args.regex = value;
});
});
new import_obsidian3.Setting(contentEl).setName(t("Custom alias4")).setDesc(t("Custom alias5")).addText((text5) => {
text5.onChange((value) => {
this.args.replacement = value;
});
});
new import_obsidian3.Setting(contentEl).addButton((btn) => {
btn.setButtonText(t("Submit")).setCta().onClick(() => {
if (this.args.regex && this.args.replacement) {
this.close();
this.onSubmit(this.args);
}
});
});
}
onClose() {
let { contentEl } = this;
contentEl.empty();
}
};
// ab_manager/abm_cm/ABStateManager.ts
var global_timer = null;
var managerMap = /* @__PURE__ */ new Map();
var decorationField = import_state.StateField.define({
create: (_editorState) => {
return import_view2.Decoration.none;
},
update: (decorationSet, tr) => {
for (const [v, abStateManager] of managerMap) {
if (v.state === tr.startState) {
return abStateManager.onUpdate(decorationSet, tr);
}
}
return decorationSet;
},
provide: (f) => import_view2.EditorView.decorations.from(f)
});
var ABStateManager = class {
constructor(plugin_this) {
this.replace_this = this;
this.customData = {
cancelFlag: [],
updateMode: ""
};
this.plugin_this = plugin_this;
let ret = this.constructor_init();
if (this.plugin_this.settings.is_debug)
console.log(">>> ABStateManager, initialFileName:", this.initialFileName, "initRet:", ret);
if (!ret)
return;
managerMap.set(this.editorView, this);
this.setStateEffects();
{
if (global_timer !== null) {
window.clearInterval(global_timer);
global_timer = null;
}
if (plugin_this.settings.enhance_refresh_time > 0) {
if (plugin_this.settings.enhance_refresh_time < 500)
plugin_this.settings.enhance_refresh_time = 500;
global_timer = window.setInterval(() => {
if (plugin_this.settings.is_debug)
console.log(` auto refresh event (${global_timer}): ${this.initialFileName}`);
abConvertEvent(document, true);
}, plugin_this.settings.enhance_refresh_time);
}
}
abConvertEvent(document);
}
constructor_init() {
var _a3;
const view = this.plugin_this.app.workspace.getActiveViewOfType(import_obsidian4.MarkdownView);
if (!view)
return false;
this.view = view;
this.initialFileName = (_a3 = this.view.file) == null ? void 0 : _a3.basename;
this.editor = this.view.editor;
if (!this.editor) {
return false;
}
if (this.editor.hasOwnProperty("cm") == false) {
return false;
}
this.editorView = this.editor.cm;
this.editorState = this.editorView.state;
this.is_prev_cursor_in = true;
this.prev_decoration_mode = "none" /* none */;
this.prev_editor_mode = 0 /* NONE */;
return true;
}
destructor() {
if (global_timer !== null) {
window.clearInterval(global_timer);
global_timer = null;
}
if (this.plugin_this.settings.is_debug)
console.log("<<< ABStateManager, initialFileName:", this.initialFileName);
managerMap.delete(this.editorView);
}
setStateEffects() {
if (this.editorState.field(decorationField, false))
return;
let stateEffects = [];
stateEffects.push(import_state.StateEffect.appendConfig.of(
[decorationField]
));
this.editorView.dispatch({ effects: stateEffects });
return true;
}
onUpdate(decorationSet, tr) {
let editor_mode = this.getEditorMode();
let decoration_mode;
if (editor_mode == 1 /* SOURCE */) {
decoration_mode = this.plugin_this.settings.decoration_source;
} else if (editor_mode == 2 /* SOURCE_LIVE */) {
decoration_mode = this.plugin_this.settings.decoration_live;
} else {
decoration_mode = this.plugin_this.settings.decoration_render;
}
if (decoration_mode == "none" /* none */) {
if (decoration_mode != this.prev_decoration_mode) {
decorationSet = decorationSet.update({
filter: (from, to, value) => {
return false;
}
});
} else {
}
this.is_prev_cursor_in = true;
this.prev_decoration_mode = decoration_mode;
this.prev_editor_mode = editor_mode;
return decorationSet;
}
if (ABCSetting.env != "obsidian-pro" || ABCSetting.pro.disable || ABCSetting.pro.create_decorations == void 0) {
const new_decorationSet = this.onUpdate_refresh(decorationSet, tr, decoration_mode, editor_mode);
this.prev_decoration_mode = decoration_mode;
this.prev_editor_mode = editor_mode;
return new_decorationSet;
} else {
const create_widget = (customData, _state, _oldView, rangeSpec, _focusLine = null, _focusOffset = 0) => {
const rangeSpec_ = {
content: rangeSpec.text_content,
from_ch: rangeSpec.fromPos,
to_ch: rangeSpec.toPos,
header: rangeSpec.header,
selector: rangeSpec.selector,
prefix: rangeSpec.parent_prefix
};
return new ABReplacer_Widget(rangeSpec_, this.editor, customData);
};
const new_decorationSet = ABCSetting.pro.create_decorations(
this.customData,
this.editorView,
tr,
decorationSet,
create_widget
);
this.prev_decoration_mode = decoration_mode;
this.prev_editor_mode = editor_mode;
return new_decorationSet;
}
}
onUpdate_refresh(decorationSet, tr, decoration_mode, editor_mode) {
const updateMode = this.customData.updateMode;
this.customData.updateMode = "";
try {
decorationSet = decorationSet.map(tr.changes);
} catch (e) {
console.warn("decorationSet map error, maybe paste ab at end", e);
}
const list_rangeSpec = autoMdSelector(this.getMdText(tr));
let list_decoration_nochange = [];
let list_decoration_change = [];
const cursorSpec = this.getCursorCh(tr);
const cursorSpec_last = this.getCursorCh();
let is_current_cursor_in = false;
for (let rangeSpec of list_rangeSpec) {
let isCursorIn = false;
let isCursonIn_last = false;
if (cursorSpec.from >= rangeSpec.from_ch && cursorSpec.from <= rangeSpec.to_ch || cursorSpec.to >= rangeSpec.from_ch && cursorSpec.to <= rangeSpec.to_ch) {
isCursorIn = true;
}
if (cursorSpec_last.from >= rangeSpec.from_ch && cursorSpec_last.from <= rangeSpec.to_ch || cursorSpec_last.to >= rangeSpec.from_ch && cursorSpec_last.to <= rangeSpec.to_ch) {
isCursonIn_last = true;
}
if (this.customData.cancelFlag.includes(rangeSpec.from_ch)) {
if (isCursorIn) {
const decoration = import_view2.Decoration.mark({
class: "ab-line-yellow",
inclusive: true
});
list_decoration_change.push(decoration.range(rangeSpec.from_ch, rangeSpec.to_ch));
continue;
} else {
if (this.customData.cancelFlag.includes(rangeSpec.from_ch)) {
this.customData.cancelFlag = this.customData.cancelFlag.filter((item) => item !== rangeSpec.from_ch);
}
}
}
if (isCursorIn) {
is_current_cursor_in = true;
const decoration = import_view2.Decoration.mark({ class: "ab-line-yellow" });
list_decoration_change.push(decoration.range(rangeSpec.from_ch, rangeSpec.to_ch));
} else if (isCursonIn_last) {
const decoration = import_view2.Decoration.replace({
widget: new ABReplacer_Widget(rangeSpec, this.editor, this.customData)
});
list_decoration_change.push(decoration.range(rangeSpec.from_ch, rangeSpec.to_ch));
} else {
const decoration = import_view2.Decoration.replace({
widget: new ABReplacer_Widget(rangeSpec, this.editor, this.customData)
});
if (typeof updateMode == "number" && updateMode >= rangeSpec.from_ch && updateMode <= rangeSpec.to_ch) {
list_decoration_change.push(decoration.range(rangeSpec.from_ch, rangeSpec.to_ch));
} else {
list_decoration_nochange.push(decoration.range(rangeSpec.from_ch, rangeSpec.to_ch));
}
}
}
if (list_decoration_change.length == 0 && is_current_cursor_in == this.is_prev_cursor_in && decoration_mode == this.prev_decoration_mode && editor_mode == this.prev_editor_mode) {
this.is_prev_cursor_in = is_current_cursor_in;
return decorationSet;
}
let debug_count1 = 0, debug_count2 = 0, debug_count3 = 0, debug_count4 = 0;
decorationSet = decorationSet.update({
filter(from, to, _value) {
for (let i = 0; i < list_decoration_nochange.length; i++) {
const item = list_decoration_nochange[i];
if (item.from == from && item.to == to) {
debug_count1++;
list_decoration_nochange.splice(i, 1);
return true;
}
}
debug_count1++;
debug_count2++;
return false;
}
});
for (const item of list_decoration_nochange) {
debug_count3++;
decorationSet = decorationSet.update({
add: [item]
});
}
for (const item of list_decoration_change) {
debug_count4++;
decorationSet = decorationSet.update({
add: [item]
});
}
if (this.plugin_this.settings.is_debug)
console.log(`ab cm \u88C5\u9970\u96C6\u53D8\u5316: ${debug_count1} -${debug_count2}+${debug_count3}+${debug_count4}`);
this.is_prev_cursor_in = is_current_cursor_in;
return decorationSet;
}
getEditorMode() {
let editor_dom = this.view.containerEl;
if (!editor_dom) {
return 0 /* NONE */;
}
let str = editor_dom == null ? void 0 : editor_dom.getAttribute("data-mode");
if (str == "source") {
editor_dom = editor_dom == null ? void 0 : editor_dom.getElementsByClassName("markdown-source-view")[0];
if (editor_dom == null ? void 0 : editor_dom.classList.contains("is-live-preview"))
return 2 /* SOURCE_LIVE */;
else
return 1 /* SOURCE */;
} else if (str == "preview") {
return 3 /* PREVIEW */;
} else {
return 0 /* NONE */;
}
}
getCursorCh(tr) {
var _a3, _b;
const ranges = (_b = (_a3 = tr == null ? void 0 : tr.state) == null ? void 0 : _a3.selection) == null ? void 0 : _b.ranges;
if (ranges && ranges.length == 1) {
return {
from: ranges[0].from,
to: ranges[0].to
};
}
let cursor_from_ch = 0;
let cursor_to_ch = 0;
let list_text = this.editor.getValue().split("\n");
for (let i = 0; i <= this.editor.getCursor("to").line; i++) {
if (this.editor.getCursor("from").line == i) {
cursor_from_ch = cursor_to_ch + this.editor.getCursor("from").ch;
}
if (this.editor.getCursor("to").line == i) {
cursor_to_ch = cursor_to_ch + this.editor.getCursor("to").ch;
break;
}
cursor_to_ch += list_text[i].length + 1;
}
return {
from: cursor_from_ch,
to: cursor_to_ch
};
}
getMdText(tr) {
var _a3, _b;
const mdText = (_b = (_a3 = tr == null ? void 0 : tr.state) == null ? void 0 : _a3.doc) == null ? void 0 : _b.toString();
if (mdText) {
return mdText;
}
return this.editor.getValue();
}
setPos(cursorSepc) {
window.setTimeout(() => {
const newSelection = import_state.EditorSelection.create([
import_state.EditorSelection.range(cursorSepc, cursorSepc)
]);
this.editorView.dispatch({
selection: newSelection
});
}, 50);
}
};
// ab_manager/abm_html/ABSelector_PostHtml.ts
var import_html_to_md = __toESM(require_dist());
var import_obsidian6 = require("obsidian");
// ab_manager/abm_html/ABReplacer_Render.ts
var import_obsidian5 = require("obsidian");
var ABReplacer_Render = class extends import_obsidian5.MarkdownRenderChild {
constructor(containerEl, header, content, selectorName = "replacer_default") {
super(containerEl);
this.header = header;
this.content = content;
this.selectorName = selectorName;
}
onload() {
const div = this.containerEl.createDiv({
cls: ["ab-replace", "cm-embed-block"]
});
div.setAttribute("type_header", this.header);
const dom_note = div.createDiv({
cls: ["ab-note", "drop-shadow"]
});
let dom_replaceEl = dom_note.createDiv({
cls: ["ab-replaceEl"]
});
ABConvertManager.autoABConvert(dom_replaceEl, this.header, this.content, this.selectorName);
this.containerEl.replaceWith(div);
let dom_edit2 = div.createEl("div", {
cls: ["ab-button", "ab-button-1", "edit-block-button"],
attr: { "aria-label": "Refresh the block" }
});
dom_edit2.empty();
dom_edit2.appendChild((0, import_obsidian5.sanitizeHTMLToDom)(ABReplacer_Widget.STR_ICON_REFRESH));
dom_edit2.onclick = () => {
abConvertEvent(div);
};
const dom_edit = div.createEl("div", {
cls: ["ab-button", "ab-button-2", "edit-block-button", "ab-button-select"]
});
const dom_edit_mask = dom_edit.createEl("button", {});
dom_edit_mask.empty();
dom_edit_mask.appendChild((0, import_obsidian5.sanitizeHTMLToDom)(``));
const dom_edit_select = dom_edit.createEl("select", {
attr: { "aria-label": "Change the block - " + this.header }
});
const first_dom_option = dom_edit_select.createEl("option", {
text: "\u590D\u5408\u683C\u5F0F:" + this.header,
attr: { "value": this.header, "title": this.header }
});
first_dom_option.selected = true;
let header_name_flag = "";
for (let item of ABConvertManager.getInstance().getConvertOptions()) {
const _dom_option = dom_edit_select.createEl("option", {
text: item.name,
attr: { "value": item.id }
});
if (this.header == item.id) {
header_name_flag = item.name;
}
}
if (header_name_flag != "") {
first_dom_option.setText(header_name_flag);
}
dom_edit_select.onchange = () => {
const new_header = dom_edit_select.options[dom_edit_select.selectedIndex].value;
const new_dom_replaceEl = dom_note.createDiv({
cls: ["ab-replaceEl"]
});
ABConvertManager.autoABConvert(new_dom_replaceEl, new_header, this.content, this.selectorName);
dom_replaceEl.replaceWith(new_dom_replaceEl);
dom_replaceEl = new_dom_replaceEl;
};
const button_show = () => {
dom_edit.show();
dom_edit2.show();
};
const button_hide = () => {
dom_edit.hide();
dom_edit2.hide();
};
button_hide();
dom_note.onmouseover = button_show;
dom_note.onmouseout = button_hide;
dom_edit.onmouseover = button_show;
dom_edit.onmouseout = button_hide;
dom_edit2.onmouseover = button_show;
dom_edit2.onmouseout = button_hide;
}
};
ABReplacer_Render.str_icon_code2 = ``;
// ab_manager/abm_html/ABSelector_PostHtml.ts
var ABSelector_PostHtml = class {
static processor(el, ctx) {
var _a3, _b, _c, _d, _e, _f, _g;
ABCSetting.obsidian.global_ctx = ctx;
if (this.settings.decoration_render == "none" /* none */)
return;
const mdSrc = getSourceMarkdown(el, ctx);
if (!mdSrc) {
if (false)
console.log(" -- ABPosthtmlManager.processor, called by 'ReRender'");
if (!el.classList.contains("markdown-rendered") && !((_c = (_b = (_a3 = el.parentElement) == null ? void 0 : _a3.parentElement) == null ? void 0 : _b.classList) == null ? void 0 : _c.contains("block-language-dataviewjs")) && !((_f = (_e = (_d = el.parentElement) == null ? void 0 : _d.parentElement) == null ? void 0 : _e.classList) == null ? void 0 : _f.contains("block-language-dataview")))
return;
const calloutEl = el.querySelector(":scope>div>div.callout-content");
if (calloutEl) {
el = calloutEl;
el.classList.add("ab-note");
}
findABBlock_recurve(el);
return;
} else {
const is_start = mdSrc.from_line == 0 || mdSrc.content_all.split("\n").slice(0, mdSrc.from_line).join("\n").trim() == "";
const is_end = mdSrc.to_line == mdSrc.to_line_all;
let is_newContent = false;
let is_subContent = false;
let cache_item = null;
(() => {
var _a4, _b2, _c2, _d2;
const ppEl = (_b2 = (_a4 = el.parentElement) == null ? void 0 : _a4.parentElement) == null ? void 0 : _b2.parentElement;
if (!ppEl) {
} else if (ppEl.classList.contains("markdown-embed-content")) {
is_subContent = true;
return;
}
if (mdSrc.from_line == 0 && mdSrc.to_line == mdSrc.to_line_all) {
is_subContent = true;
return;
}
const view = this.app.workspace.getActiveViewOfType(import_obsidian6.MarkdownView);
const path = (_c2 = view == null ? void 0 : view.file) == null ? void 0 : _c2.path;
const basename = (_d2 = view == null ? void 0 : view.file) == null ? void 0 : _d2.basename;
if (path && path !== ctx.sourcePath) {
if (this.settings.is_debug)
console.log(` !! Check SubPage: [${basename}] quote ![[${ctx.sourcePath}]] and no self-quote`);
is_subContent = true;
return;
}
const containerEl = view == null ? void 0 : view.containerEl;
if (!containerEl) {
if (this.settings.is_debug)
console.log(` !! Check subPage, [${basename}] quote ![[${ctx.sourcePath}]] in canvas or other`);
is_subContent = true;
return;
} else if (containerEl.getAttribute("data-type") != "markdown") {
if (this.settings.is_debug)
console.log(` !! Check subPage, [${basename}] quote ![[${ctx.sourcePath}]] in excalidraw or other`);
is_subContent = true;
return;
} else if (containerEl.getAttribute("data-mode") != "preview") {
if (this.settings.is_debug)
console.log(` !! Check subPage, [${basename}] quote ![[${ctx.sourcePath}]] in no readmode`);
is_subContent = true;
return;
}
})();
if (!is_subContent) {
for (let item of cache_map) {
if (item.name == ctx.sourcePath) {
cache_item = item;
break;
}
}
if (!cache_item) {
if (this.settings.is_debug)
console.log(` !! Check cache, noCache -> hasCache, null -> ${mdSrc.content_all.length}`);
cache_item = { name: ctx.sourcePath, content: mdSrc.content_all };
cache_map.push(cache_item);
is_newContent = true;
} else {
if (cache_item.content != mdSrc.content_all) {
if (this.settings.is_debug)
console.log(` !! Check cache, hasCache -> ChangeCache, ${cache_item.content.length} -> ${mdSrc.content_all.length}`);
cache_item.content = mdSrc.content_all;
is_newContent = true;
} else {
is_newContent = false;
}
}
}
if (is_newContent || is_start) {
selected_els = [];
selected_mdSrc = null;
}
if (this.settings.is_debug) {
console.log(
` -- ABPosthtmlManager.processor, called by 'ReadMode'. [current] [${mdSrc.from_line},${mdSrc.to_line})/${mdSrc.to_line_all}. ${is_start ? "is_start " : ""}${is_end ? "is_end " : ""}[last] ${selected_mdSrc && selected_mdSrc.header ? "in ABBlock: " + selected_mdSrc.header + ". " : ""}`
);
}
if (!is_subContent && is_newContent) {
if (cache_item && (/((\s|>\s|-\s|\*\s|\+\s)*)(%%)?(\[((?!toc)(?!TOC)[0-9a-zA-Z\u4e00-\u9fa5].*)\]):?(%%)?\s*\n/.test(cache_item.content) || /((\s|>\s|-\s|\*\s|\+\s)*)(:::)\s?(\S*)\n/.test(cache_item.content))) {
const leaf = (_g = this.app.workspace.getActiveViewOfType(import_obsidian6.MarkdownView)) == null ? void 0 : _g.leaf;
if (!leaf) {
return;
}
leaf.rebuildView();
if (this.settings.is_debug)
console.log(" !! RebuildView: executed");
return;
} else {
}
}
for (let i = 0; i < el.children.length; i++) {
const subEl = el.children[i];
findABBlock_cross(subEl, ctx, is_end, i);
}
if (is_end) {
findABBlock_end();
}
}
}
};
function findABBlock_recurve(targetEl) {
var _a3, _b;
for (let i = 0; i < targetEl.children.length; i++) {
const contentEl = targetEl.children[i];
if (contentEl instanceof HTMLParagraphElement) {
const m_headtail = contentEl.getText().match(ABReg.reg_mdit_head_noprefix);
if (!m_headtail || !m_headtail[3] || !m_headtail[4])
continue;
let end_index = 0;
for (let j = i + 1; j < targetEl.children.length; j++) {
const contentEl2 = targetEl.children[j];
if (!(contentEl2 instanceof HTMLParagraphElement))
continue;
if (contentEl2.getText() != m_headtail[3])
continue;
end_index = j;
break;
}
if (end_index == 0)
continue;
let contentHtml = "";
const elementsToReplace = [];
for (let k = i; k <= end_index; k++) {
const el = targetEl.children[k];
elementsToReplace.push(el);
if (k > i && k < end_index) {
contentHtml += el.outerHTML;
}
}
i = end_index;
const newEl2 = document.createElement("div");
newEl2.addClass("ab-re-rendered");
(_a3 = contentEl.parentNode) == null ? void 0 : _a3.insertBefore(newEl2, contentEl);
elementsToReplace.forEach((el) => el.hide());
ABConvertManager.autoABConvert(newEl2, m_headtail[4], (0, import_html_to_md.default)(contentHtml), "mdit");
continue;
}
if (contentEl instanceof HTMLHeadingElement) {
const selector_name2 = "heading";
continue;
}
if (!(contentEl instanceof HTMLUListElement || contentEl instanceof HTMLQuoteElement || contentEl instanceof HTMLPreElement || contentEl instanceof HTMLTableElement))
continue;
const headerEl = i == 0 ? null : targetEl.children[i - 1];
if (i == 0 || !(headerEl instanceof HTMLParagraphElement)) {
if (contentEl instanceof HTMLUListElement || contentEl instanceof HTMLQuoteElement)
findABBlock_recurve(contentEl);
continue;
}
const header_match = headerEl.getText().match(ABReg.reg_header);
if (!header_match) {
if (contentEl instanceof HTMLUListElement || contentEl instanceof HTMLQuoteElement)
findABBlock_recurve(contentEl);
continue;
}
const header_str = header_match[5];
let selector_name = "postHtml";
if (contentEl instanceof HTMLUListElement)
selector_name = "list";
else if (contentEl instanceof HTMLQuoteElement)
selector_name = "quote";
else if (contentEl instanceof HTMLPreElement)
selector_name = "code";
else if (contentEl instanceof HTMLTableElement)
selector_name = "table";
const newEl = document.createElement("div");
newEl.addClass("ab-re-rendered");
(_b = headerEl.parentNode) == null ? void 0 : _b.insertBefore(newEl, headerEl.nextSibling);
ABConvertManager.autoABConvert(newEl, header_str, (0, import_html_to_md.default)(contentEl.innerHTML), "postHtml");
contentEl.hide();
headerEl.hide();
}
}
function findABBlock_end() {
abConvertEvent(document);
}
var cache_map = [];
var selected_els = [];
var selected_mdSrc = null;
function findABBlock_cross(targetEl, ctx, is_last = false, sub_index) {
const current_mdSrc = getSourceMarkdown(targetEl, ctx);
if (!current_mdSrc) {
return false;
}
if (selected_mdSrc && selected_mdSrc.header) {
if (!selected_mdSrc.seFlag) {
if (current_mdSrc.type == "list" || current_mdSrc.type == "code" || current_mdSrc.type == "quote" || current_mdSrc.type == "table") {
if (current_mdSrc.type == "list") {
if (current_mdSrc.header.indexOf("2") == 0)
current_mdSrc.header = "list" + current_mdSrc.header;
}
selected_els.push(targetEl);
selected_mdSrc.to_line = current_mdSrc.to_line;
if (sub_index == 0) {
selected_mdSrc.content += "\n\n" + current_mdSrc.content;
}
;
const replaceEl = selected_els.pop();
if (replaceEl) {
ctx.addChild(new ABReplacer_Render(replaceEl, selected_mdSrc.header, selected_mdSrc.content.split("\n").slice(2).join("\n"), selected_mdSrc.type));
for (const el of selected_els) {
el.hide();
}
;
selected_mdSrc = null;
selected_els = [];
}
} else if (current_mdSrc.type == "heading" || current_mdSrc.type == "mdit") {
selected_els.push(targetEl);
selected_mdSrc.to_line = current_mdSrc.to_line;
if (sub_index == 0) {
selected_mdSrc.content += "\n\n" + current_mdSrc.content;
}
;
selected_mdSrc.seFlag = current_mdSrc.seFlag;
} else {
selected_mdSrc = null;
selected_els = [];
}
} else {
if ((current_mdSrc.type == "mdit_tail" || current_mdSrc.type == "mdit") && selected_mdSrc.seFlag.length == current_mdSrc.seFlag.length) {
selected_els.push(targetEl);
selected_mdSrc.to_line = current_mdSrc.to_line;
if (sub_index == 0) {
selected_mdSrc.content += "\n\n" + current_mdSrc.content;
}
;
const replaceEl = selected_els.pop();
if (replaceEl) {
ctx.addChild(new ABReplacer_Render(replaceEl, selected_mdSrc.header, selected_mdSrc.content.split("\n").slice(2, -1).join("\n"), selected_mdSrc.type));
for (const el of selected_els) {
el.hide();
}
;
selected_mdSrc = null;
selected_els = [];
}
} else if (current_mdSrc.type == "heading" && selected_mdSrc.seFlag.length > current_mdSrc.seFlag.length) {
const replaceEl = selected_els.pop();
if (replaceEl) {
ctx.addChild(new ABReplacer_Render(replaceEl, selected_mdSrc.header, selected_mdSrc.content.split("\n").slice(2).join("\n"), selected_mdSrc.type));
for (const el of selected_els) {
el.hide();
}
;
selected_mdSrc = null;
selected_els = [];
}
} else if (is_last) {
selected_els.push(targetEl);
selected_mdSrc.to_line = current_mdSrc.to_line;
if (sub_index == 0) {
selected_mdSrc.content += "\n\n" + current_mdSrc.content;
}
;
const replaceEl = selected_els.pop();
if (replaceEl) {
ctx.addChild(new ABReplacer_Render(replaceEl, selected_mdSrc.header, selected_mdSrc.content.split("\n").slice(2).join("\n"), selected_mdSrc.type));
for (const el of selected_els) {
el.hide();
}
;
selected_mdSrc = null;
selected_els = [];
}
} else {
selected_els.push(targetEl);
selected_mdSrc.to_line = current_mdSrc.to_line;
if (sub_index == 0) {
selected_mdSrc.content += "\n\n" + current_mdSrc.content;
}
;
}
}
}
if (!selected_mdSrc || !selected_mdSrc.header) {
if (current_mdSrc.type == "header" || current_mdSrc.type == "mdit") {
selected_mdSrc = current_mdSrc;
selected_els = [targetEl];
} else {
selected_mdSrc = null;
selected_els = [];
}
}
if (is_last) {
selected_els = [];
selected_mdSrc = null;
}
}
function getSourceMarkdown(sectionEl, ctx) {
let info = ctx.getSectionInfo(sectionEl);
if (!info) {
return null;
}
const {
text: text5,
lineStart,
lineEnd
} = info;
const list_text = text5.split("\n");
const list_content = list_text.slice(lineStart, lineEnd + 1);
let range = {
to_line_all: list_text.length,
from_line: lineStart,
to_line: list_text.length - lineEnd < 3 && list_text.slice(lineEnd + 1, list_text.length).join("\n").trim() == "" ? list_text.length : lineEnd + 1,
content: list_content.join("\n").replace(/(\n)+$/, ""),
content_all: text5,
type: "",
header: "",
seFlag: "",
prefix: ""
};
if (sectionEl instanceof HTMLUListElement) {
range.type = "list";
const match3 = list_content[0].match(ABReg.reg_list);
if (!match3)
return range;
range.prefix = match3[1];
} else if (sectionEl instanceof HTMLQuoteElement) {
range.type = "quote";
const match3 = list_content[0].match(ABReg.reg_quote);
if (!match3)
return range;
range.prefix = match3[1];
} else if (sectionEl instanceof HTMLPreElement) {
range.type = "code";
const match3 = list_content[0].match(ABReg.reg_code);
if (!match3)
return range;
range.prefix = match3[1];
} else if (sectionEl instanceof HTMLTableElement) {
range.type = "table";
const match3 = list_content[0].match(ABReg.reg_table);
if (!match3)
return range;
range.prefix = match3[1];
} else if (sectionEl instanceof HTMLHeadingElement) {
range.type = "heading";
const match3 = list_content[0].match(ABReg.reg_heading);
if (!match3)
return range;
range.seFlag = match3[3];
} else if (sectionEl instanceof HTMLParagraphElement) {
range.type = "paragraph";
const match_header = list_content[0].match(ABReg.reg_header);
const match_mdit_head = list_content[0].match(ABReg.reg_mdit_head);
const match_mdit_tail = list_content[0].match(ABReg.reg_mdit_tail);
if (match_header) {
range.type = "header";
range.prefix = match_header[1];
range.header = match_header[5];
} else if (match_mdit_head) {
range.type = "mdit";
range.prefix = match_mdit_head[1];
range.seFlag = match_mdit_head[3];
range.header = match_mdit_head[4];
} else if (match_mdit_tail) {
range.type = "mdit_tail";
range.prefix = match_mdit_tail[1];
range.seFlag = match_mdit_tail[3];
}
} else {
range.type = "other";
}
return range;
}
// utils.ts
var import_obsidian7 = require("obsidian");
// ../Scripts/index.ts
function convert_to_codeblock(file_content) {
const mdSelectorRangeSpec = autoMdSelector(file_content);
const sortedSpecs = [...mdSelectorRangeSpec].sort((a, b) => a.from_ch - b.from_ch);
let cursor = 0;
const parts = [];
for (const rangeSpec of sortedSpecs) {
if (rangeSpec.from_ch > cursor) {
parts.push(file_content.slice(cursor, rangeSpec.from_ch));
}
parts.push(
`~~~~~~anyblock
[${rangeSpec.header}]
${rangeSpec.content}
~~~~~~`
);
cursor = Math.max(cursor, rangeSpec.to_ch);
}
if (cursor < file_content.length) {
parts.push(file_content.slice(cursor));
}
return parts.join("");
}
function convert_delete_ab_header(file_content) {
const mdSelectorRangeSpec = autoMdSelector(file_content);
const sortedSpecs = [...mdSelectorRangeSpec].sort((a, b) => a.from_ch - b.from_ch);
let cursor = 0;
const parts = [];
for (const rangeSpec of sortedSpecs) {
if (rangeSpec.from_ch > cursor) {
parts.push(file_content.slice(cursor, rangeSpec.from_ch));
}
parts.push(
rangeSpec.content
);
cursor = Math.max(cursor, rangeSpec.to_ch);
}
if (cursor < file_content.length) {
parts.push(file_content.slice(cursor));
}
return parts.join("");
}
// utils.ts
function registerCommands(plugin2) {
plugin2.addCommand({
id: "any-block-rebuild-view",
name: t("any-block-rebuild-view"),
editorCallback: async (_editor, view) => {
if (!(view instanceof import_obsidian7.MarkdownView))
return;
const leaf = view.leaf;
if (!leaf)
return;
leaf.rebuildView();
}
});
plugin2.addCommand({
id: "any-block-to-codeblock",
name: t("any-block-to-codeblock"),
editorCallback: async (_editor, view) => {
if (!(view instanceof import_obsidian7.MarkdownView))
return;
const file = view.file;
if (!file)
return;
const text5 = view.data;
const newText = convert_to_codeblock(text5);
const newPath = `temp_any_block_convert.md`;
await save_to_newPath(newText, newPath);
}
});
plugin2.addCommand({
id: "any-block-delete-ab-header",
name: t("any-block-delete-ab-header"),
editorCallback: async (_editor, view) => {
if (!(view instanceof import_obsidian7.MarkdownView))
return;
const file = view.file;
if (!file)
return;
const text5 = view.data;
const newText = convert_delete_ab_header(text5);
const newPath = `temp_any_block_convert.md`;
await save_to_newPath(newText, newPath);
}
});
async function save_to_newPath(newText, newPath) {
try {
let newFile;
const abstractFile = plugin2.app.vault.getAbstractFileByPath(newPath);
if (abstractFile instanceof import_obsidian7.TFile) {
newFile = abstractFile;
await plugin2.app.vault.modify(abstractFile, newText);
} else {
newFile = await plugin2.app.vault.create(newPath, newText);
}
await plugin2.app.workspace.getLeaf("tab").openFile(newFile);
new import_obsidian7.Notice(t("any-block-to-codeblock-success") + newPath);
} catch (error2) {
console.error("\u8F6C\u6362\u65F6\u6587\u4EF6\u4FDD\u5B58\u5931\u8D25:", error2);
new import_obsidian7.Notice(t("any-block-to-codeblock-fail"));
}
}
}
function registerStatus(plugin2) {
{
const statusBtnContainer = plugin2.addStatusBarItem();
statusBtnContainer.addClass("mod-clickable");
const statusBtn = statusBtnContainer.createEl("div", {
cls: "ab-rebuildview-btn"
});
(0, import_obsidian7.setIcon)(statusBtn, "refresh-cw");
statusBtn.setAttribute("aria-label", t("any-block-rebuild-view-btn"));
statusBtn.setAttribute("data-tooltip-position", "top");
statusBtn.onclick = () => {
var _a3;
const leaf = (_a3 = plugin2.app.workspace.getActiveViewOfType(import_obsidian7.MarkdownView)) == null ? void 0 : _a3.leaf;
if (!leaf)
return;
leaf.rebuildView();
};
}
}
// main.ts
var AnyBlockPlugin = class extends import_obsidian8.Plugin {
async onload() {
ABCSetting.obsidian.global_app = this.app;
ABCSetting.state.language = (0, import_obsidian8.getLanguage)();
await this.loadSettings();
this.addSettingTab(new ABSettingTab(this.app, this));
registerStatus(this);
registerCommands(this);
ABConvertManager.getInstance().redefine_renderMarkdown((markdown, el, ctx) => {
var _a3, _b, _c;
el.classList.add("markdown-rendered");
const mdrc = new import_obsidian8.MarkdownRenderChild(el);
if (ctx)
ctx.addChild(mdrc);
else if (ABCSetting.obsidian.global_ctx) {
ABCSetting.obsidian.global_ctx.addChild(mdrc);
}
import_obsidian8.MarkdownRenderer.render(this.app, markdown, el, (_c = (_b = (_a3 = this.app.workspace.getActiveViewOfType(import_obsidian8.MarkdownView)) == null ? void 0 : _a3.file) == null ? void 0 : _b.path) != null ? _c : "", mdrc);
});
ABCSetting.obsidian.mermaid = (0, import_obsidian8.loadMermaid)();
this.registerMarkdownCodeBlockProcessor("ab", ABReplacer_CodeBlock.processor);
this.registerMarkdownCodeBlockProcessor("anyblock", ABReplacer_CodeBlock.processor);
{
let abm;
this.app.workspace.onLayoutReady(() => {
abm == null ? void 0 : abm.destructor();
abm = new ABStateManager(this);
});
this.registerEvent(
this.app.workspace.on("file-open", (fileObj) => {
abm == null ? void 0 : abm.destructor();
abm = new ABStateManager(this);
})
);
this.registerEvent(
this.app.workspace.on("layout-change", () => {
abm == null ? void 0 : abm.destructor();
abm = new ABStateManager(this);
})
);
}
const htmlProcessor = ABSelector_PostHtml.processor.bind(this);
this.registerMarkdownPostProcessor(htmlProcessor);
console.log(">>> Loading plugin AnyBlock");
}
async loadSettings() {
const data2 = await this.loadData();
this.settings = Object.assign({}, AB_SETTINGS, data2);
for (const result of this.settings.alias_user) {
let newReg;
if (/^\/.*\/$/.test(result.regex)) {
newReg = new RegExp(result.regex.slice(1, -1));
} else {
newReg = result.regex;
}
ABAlias_user.push({
regex: newReg,
replacement: result.replacement
});
}
ABCSetting.is_debug = this.settings.is_debug;
ABCSetting.pro.disable = this.settings.pro.disable;
ABCSetting.pro.enable_alias_override = this.settings.pro.enable_alias_override;
ABCSetting.pro.enable_callout_selector = this.settings.pro.enable_callout_selector;
ABCSetting.pro.editableblock_defaultRender = this.settings.pro.editableblock_defaultRender;
this.saveData(this.settings);
}
async saveSettings() {
ABCSetting.is_debug = this.settings.is_debug;
ABCSetting.pro.disable = this.settings.pro.disable;
ABCSetting.pro.enable_alias_override = this.settings.pro.enable_alias_override;
ABCSetting.pro.enable_callout_selector = this.settings.pro.enable_callout_selector;
ABCSetting.pro.editableblock_defaultRender = this.settings.pro.editableblock_defaultRender;
await this.saveData(this.settings);
}
onunload() {
console.log("<<< Unloading plugin AnyBlock");
if (global_timer !== null) {
window.clearInterval(global_timer);
}
}
};
/*! @gera2ld/jsx-dom v2.2.2 | ISC License */
/*! @license DOMPurify 3.4.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.3/LICENSE */
/* nosourcemap */