diff --git a/docs/browser-entry.mjs b/docs/browser-entry.mjs new file mode 100644 index 0000000..6f09bfe --- /dev/null +++ b/docs/browser-entry.mjs @@ -0,0 +1,8 @@ +export { + renderStreamingMarkdown, + StreamingMarkdownRenderer, + setSanitizerBackend, + isBrowserSanitizerSupported, +} from '../dist/index.js' + +export { dompurifyBackend } from '../dist/sanitize-dompurify.js' diff --git a/docs/index.html b/docs/index.html index 61235e4..0a434c7 100644 --- a/docs/index.html +++ b/docs/index.html @@ -771,7 +771,15 @@
${content}`;
+ i = span.closeEnd;
+ }
+ return out;
+}
+
+// dist/backslash-escapes.js
+var ESCAPED_BASE = 57344;
+function isEscapablePunctuation(ch) {
+ return /^[!-/:-@[-`{-~]$/.test(ch);
+}
+var ANGLE_AUTOLINK_RE = /^<(?:[a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^<>\s]*|[^<>\s@]+@[^<>\s@]+\.[^<>\s@]+)>/;
+var RAW_TAG_LIKE_RE = /^<\/?[a-zA-Z][\s\S]*?>/;
+var ENTITY_CANDIDATE_RE = /^&(?:#[0-9]{1,7};|#[xX][0-9a-fA-F]{1,6};|[a-zA-Z][a-zA-Z0-9]{0,31};)/;
+var INCOMPLETE_ENTITY_RE = /&(?:#[0-9]{0,7}|#[xX][0-9a-fA-F]{0,6}|[a-zA-Z][a-zA-Z0-9]{0,31})?$/;
+function encodeLiteralChar(ch) {
+ return isEscapablePunctuation(ch) ? String.fromCharCode(ESCAPED_BASE + ch.charCodeAt(0)) : ch;
+}
+function trailingEntityHoldStart(s) {
+ const window2 = Math.min(34, s.length);
+ const m = INCOMPLETE_ENTITY_RE.exec(s.slice(s.length - window2));
+ if (!m)
+ return s.length;
+ return s.length - window2 + m.index;
+}
+function encodeBackslashEscapes(text2) {
+ let out = "";
+ let i = 0;
+ while (i < text2.length) {
+ const ch = text2[i] ?? "";
+ if (ch === "`") {
+ const span = nextCodeSpan(text2, i);
+ if (span && span.type === "closed" && span.open === i) {
+ out += text2.slice(i, span.closeEnd);
+ i = span.closeEnd;
+ continue;
+ }
+ const runEnd = span && span.type === "unclosed" && span.open === i ? i + span.runLen : i + 1;
+ out += text2.slice(i, runEnd);
+ i = runEnd;
+ continue;
+ }
+ if (ch === "<") {
+ const verbatim = ANGLE_AUTOLINK_RE.exec(text2.slice(i))?.[0] ?? RAW_TAG_LIKE_RE.exec(text2.slice(i))?.[0];
+ if (verbatim) {
+ out += verbatim;
+ i += verbatim.length;
+ continue;
+ }
+ }
+ if (ch === "&") {
+ const candidate = ENTITY_CANDIDATE_RE.exec(text2.slice(i))?.[0];
+ if (candidate) {
+ const decoded = decodeHTMLStrict(candidate);
+ if (decoded !== candidate) {
+ for (const c of decoded)
+ out += encodeLiteralChar(c);
+ i += candidate.length;
+ continue;
+ }
+ }
+ }
+ const next = text2[i + 1] ?? "";
+ if (ch === "\\" && isEscapablePunctuation(next)) {
+ out += String.fromCharCode(ESCAPED_BASE + next.charCodeAt(0));
+ i += 2;
+ continue;
+ }
+ out += ch;
+ i++;
+ }
+ return out;
+}
+var ENCODED_PUNCT_RE = /[\uE021-\uE07E]/g;
+var DECODE_HTML_ESCAPES = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'"
+};
+function decodeEscapedPunctuation(html2) {
+ return html2.replace(ENCODED_PUNCT_RE, (c) => {
+ const ch = String.fromCharCode(c.charCodeAt(0) - ESCAPED_BASE);
+ return DECODE_HTML_ESCAPES[ch] ?? ch;
+ });
+}
+function decodeEscapedPunctuationRaw(text2) {
+ return text2.replace(ENCODED_PUNCT_RE, (c) => String.fromCharCode(c.charCodeAt(0) - ESCAPED_BASE));
+}
+function canonicalizeEscapedPunctuation(text2) {
+ return decodeEscapedPunctuationRaw(encodeBackslashEscapes(text2));
+}
+
+// dist/link-references.js
+function normalizeReferenceLabel(label) {
+ return label.replace(/\s+/g, " ").trim().toLocaleLowerCase("und");
+}
+function hasUnescapedBrackets(raw) {
+ for (let i = 0; i < raw.length; i++) {
+ const ch = raw[i];
+ if (ch === "\\") {
+ i++;
+ continue;
+ }
+ if (ch === "[" || ch === "]")
+ return true;
+ }
+ return false;
+}
+function isValidReferenceLabel(raw) {
+ return raw.trim() !== "" && !hasUnescapedBrackets(raw);
+}
+function decodeEscapes(text2) {
+ return canonicalizeEscapedPunctuation(text2);
+}
+function decodeDestinationEscapes(text2) {
+ return text2.replace(/\\([!"#$%&'()*+,-./:;<=>?@[\\\]^_`{|}~])/g, "$1");
+}
+function decodeHtmlCharRefs(text2) {
+ return decodeHTMLStrict(text2);
+}
+function percentEncodeHref(decoded) {
+ let out = "";
+ for (let i = 0; i < decoded.length; i++) {
+ const ch = decoded.charAt(i);
+ if (ch === "%" && /^%[0-9A-Fa-f]{2}/.test(decoded.slice(i, i + 3))) {
+ out += decoded.slice(i, i + 3);
+ i += 2;
+ continue;
+ }
+ const cp = ch.codePointAt(0);
+ if (cp === void 0)
+ continue;
+ if (cp < 128 && /[A-Za-z0-9\-._~:/?#@!$&'()*+,;=]/.test(ch)) {
+ out += ch;
+ } else {
+ out += encodeURIComponent(ch);
+ }
+ }
+ return out;
+}
+function encodeHrefForOutput(href) {
+ return percentEncodeHref(decodeHtmlCharRefs(href));
+}
+function parseLinkTitleAt(source, start) {
+ let i = start;
+ while (i < source.length && (source[i] === " " || source[i] === " " || source[i] === "\n"))
+ i++;
+ const slice = source.slice(i);
+ const dquote = slice.match(/^"((?:\\.|[^"\\])*)"/);
+ if (dquote?.[1] !== void 0) {
+ return {
+ title: decodeHtmlCharRefs(decodeDestinationEscapes(dquote[1])),
+ end: i + dquote[0].length
+ };
+ }
+ const squote = slice.match(/^'((?:\\.|[^'\\])*)'/);
+ if (squote?.[1] !== void 0) {
+ return {
+ title: decodeHtmlCharRefs(decodeDestinationEscapes(squote[1])),
+ end: i + squote[0].length
+ };
+ }
+ const paren = slice.match(/^\(((?:\\.|[^)\\])*(?:\\[\s\S])?)\)/);
+ if (paren?.[1] !== void 0) {
+ return {
+ title: decodeHtmlCharRefs(decodeDestinationEscapes(paren[1])),
+ end: i + paren[0].length
+ };
+ }
+ return null;
+}
+function parseDestination(source, start) {
+ if (source[start] === "<") {
+ let i2 = start + 1;
+ while (i2 < source.length) {
+ if (source[i2] === "\n")
+ return null;
+ if (source[i2] === "\\" && i2 + 1 < source.length) {
+ i2 += 2;
+ continue;
+ }
+ if (source[i2] === ">") {
+ const raw2 = source.slice(start + 1, i2);
+ const href2 = decodeDestinationEscapes(raw2);
+ const end2 = i2 + 1;
+ const titlePart2 = parseLinkTitleAt(source, end2);
+ if (titlePart2) {
+ return { href: href2, end: titlePart2.end, title: titlePart2.title };
+ }
+ return { href: href2, end: end2 };
+ }
+ i2++;
+ }
+ return null;
+ }
+ let i = start;
+ let parenDepth = 0;
+ while (i < source.length) {
+ const ch = source[i];
+ if (ch === "\\" && i + 1 < source.length) {
+ i += 2;
+ continue;
+ }
+ if (ch === "(")
+ parenDepth++;
+ else if (ch === ")") {
+ if (parenDepth > 0)
+ parenDepth--;
+ else
+ break;
+ } else if ((ch === " " || ch === "\n" || ch === " ") && parenDepth === 0) {
+ break;
+ }
+ i++;
+ }
+ const raw = source.slice(start, i);
+ if (raw === "" || /[ \n\t]/.test(raw))
+ return null;
+ const end = i;
+ const titlePart = parseLinkTitleAt(source, end);
+ const href = decodeDestinationEscapes(raw);
+ if (titlePart) {
+ return { href, end: titlePart.end, title: titlePart.title };
+ }
+ return { href, end };
+}
+function parseBracketedLabel(source, start) {
+ if (source[start] !== "[")
+ return null;
+ let i = start + 1;
+ let depth = 1;
+ while (i < source.length && depth > 0) {
+ const ch = source[i];
+ if (ch === "\\" && i + 1 < source.length) {
+ i += 2;
+ continue;
+ }
+ if (ch === "[")
+ depth++;
+ else if (ch === "]")
+ depth--;
+ i++;
+ }
+ if (depth !== 0)
+ return null;
+ const label = source.slice(start + 1, i - 1);
+ return { label, end: i };
+}
+function isLinkReferenceDefStart(source, index) {
+ if (index > 0 && source[index - 1] !== "\n")
+ return false;
+ let col = 0;
+ let i = index - 1;
+ while (i >= 0 && source[i] !== "\n") {
+ if (source[i] === " ")
+ return false;
+ if (source[i] !== " ")
+ return false;
+ col++;
+ if (col > 3)
+ return false;
+ i--;
+ }
+ return source[index] === "[";
+}
+function parseLinkReferenceDefinitions(source) {
+ const refs = /* @__PURE__ */ new Map();
+ let i = 0;
+ while (i < source.length) {
+ if (source[i] === "\n") {
+ i++;
+ continue;
+ }
+ if (!isLinkReferenceDefStart(source, i)) {
+ i++;
+ continue;
+ }
+ const labelPart = parseBracketedLabel(source, i);
+ if (!labelPart) {
+ i++;
+ continue;
+ }
+ let j = labelPart.end;
+ while (j < source.length && (source[j] === " " || source[j] === " "))
+ j++;
+ if (source[j] !== ":") {
+ i++;
+ continue;
+ }
+ j++;
+ let sawNewline = false;
+ while (j < source.length) {
+ const c = source[j];
+ if (c === " " || c === " ") {
+ j++;
+ } else if (c === "\n" && !sawNewline) {
+ sawNewline = true;
+ j++;
+ } else {
+ break;
+ }
+ }
+ const dest = parseDestination(source, j);
+ if (!dest) {
+ i++;
+ continue;
+ }
+ let tail = dest.end;
+ while (tail < source.length && (source[tail] === " " || source[tail] === " "))
+ tail++;
+ if (tail < source.length && source[tail] !== "\n") {
+ i++;
+ continue;
+ }
+ if (!isValidReferenceLabel(labelPart.label)) {
+ i++;
+ continue;
+ }
+ const key = normalizeReferenceLabel(decodeEscapes(labelPart.label));
+ if (!refs.has(key)) {
+ const entry = { href: dest.href };
+ if (dest.title !== void 0)
+ entry.title = dest.title;
+ refs.set(key, entry);
+ }
+ i = dest.end;
+ while (i < source.length && source[i] !== "\n")
+ i++;
+ }
+ return refs;
+}
+function lookupLinkReference(refs, label) {
+ if (!isValidReferenceLabel(label))
+ return void 0;
+ return refs.get(normalizeReferenceLabel(decodeEscapes(label)));
+}
+function parseInlineLinkDestination(source, openParenIndex) {
+ if (source[openParenIndex] !== "(")
+ return null;
+ let j = openParenIndex + 1;
+ while (j < source.length && (source[j] === " " || source[j] === " " || source[j] === "\n"))
+ j++;
+ if (source[j] === ")")
+ return { href: "", end: j + 1 };
+ const dest = parseDestination(source, j);
+ if (!dest)
+ return null;
+ let end = dest.end;
+ while (end < source.length && (source[end] === " " || source[end] === " " || source[end] === "\n")) {
+ end++;
+ }
+ if (source[end] !== ")")
+ return null;
+ return {
+ href: dest.href,
+ end: end + 1,
+ ...dest.title !== void 0 ? { title: dest.title } : {}
+ };
+}
+function parseReferenceLabel(source, openBracketIndex, fallbackLabel) {
+ if (source[openBracketIndex] !== "[")
+ return null;
+ if (source[openBracketIndex + 1] === "]") {
+ return { label: fallbackLabel, end: openBracketIndex + 2 };
+ }
+ const parsed = parseBracketedLabel(source, openBracketIndex);
+ if (!parsed)
+ return null;
+ return { label: parsed.label, end: parsed.end };
+}
+
+// dist/block-patterns.js
+function leadingIndentWidth(line) {
+ let col = 0;
+ for (let i = 0; i < line.length; i++) {
+ const ch = line[i];
+ if (ch === " ")
+ col++;
+ else if (ch === " ")
+ col += 4 - col % 4;
+ else
+ break;
+ }
+ return col;
+}
+function stripFourColumnIndent(line) {
+ let col = 0;
+ let i = 0;
+ while (i < line.length && col < 4) {
+ const ch = line[i];
+ if (ch === " ") {
+ col++;
+ i++;
+ continue;
+ }
+ if (ch === " ") {
+ const advance = 4 - col % 4;
+ if (col + advance > 4)
+ return " ".repeat(col + advance - 4) + line.slice(i + 1);
+ col += advance;
+ i++;
+ continue;
+ }
+ break;
+ }
+ return line.slice(i);
+}
+var FENCE_OPEN_RE = /^ {0,3}(`{3,}|~{3,})([^\n`]*)\s*$/;
+var FENCE_CLOSE_RE = /^ {0,3}(`{3,}|~{3,})\s*$/;
+var ATX_HEADING_DETECT_RE = /^ {0,3}(#{1,6})(?:[ \t]|$)/;
+var ATX_HEADING_CAPTURE_RE = /^ {0,3}(#{1,6})(?:[ \t]+(.*)|$)/;
+var BLOCKQUOTE_DETECT_RE = /^ {0,3}> ?/;
+function stripBlockquoteMarker(line) {
+ return line.replace(BLOCKQUOTE_DETECT_RE, "");
+}
+function dropTrailingNewline(slice) {
+ return slice.endsWith("\n") ? slice.slice(0, -1) : slice;
+}
+function stripAtxClosingHashes(title) {
+ if (/^#+\s*$/.test(title))
+ return "";
+ return title.replace(/(?= len;
+}
+function parseFenceSlice(slice) {
+ const lines = dropTrailingNewline(slice).split("\n");
+ const open = lines[0] ?? "";
+ const openMatch = open.match(FENCE_OPEN_RE);
+ const marker = openMatch?.[1] ?? "```";
+ const lang = fenceInfoLanguage(openMatch?.[2] ?? "");
+ const indent = fenceOpenIndent(open);
+ let closeIndex = lines.length - 1;
+ while (closeIndex > 0) {
+ const line = lines[closeIndex] ?? "";
+ if (fenceCloses(marker, marker.length, line)) {
+ break;
+ }
+ closeIndex--;
+ }
+ const code = lines.slice(1, closeIndex).map((line) => stripLeadingSpaces(line, indent)).join("\n");
+ return { lang, code };
+}
+function parseOpenFenceContent(source) {
+ const lines = source.split("\n");
+ const open = lines[0] ?? "";
+ const openMatch = open.match(FENCE_OPEN_RE);
+ if (!openMatch?.[1])
+ return null;
+ const lang = fenceInfoLanguage(openMatch[2] ?? "");
+ const indent = fenceOpenIndent(open);
+ let bodyLines = lines.slice(1);
+ const last = bodyLines.at(-1) ?? "";
+ if (bodyLines.length > 0 && fenceCloses(openMatch[1], openMatch[1].length, last)) {
+ bodyLines = bodyLines.slice(0, -1);
+ }
+ return { lang, code: bodyLines.map((line) => stripLeadingSpaces(line, indent)).join("\n") };
+}
+
+// dist/block-tokenizer.js
+var THEMATIC_BREAK_RE = /^ {0,3}([-*_])(?:[ \t]*\1){2,}[ \t]*$/;
+var UNORDERED_LIST_ITEM_RE = /^ {0,3}[-*+](?:\s|$)/;
+var ORDERED_LIST_MARKER_RE = /^ {0,3}(\d{1,9})([.)])(?:\s|$)/;
+var LIST_ITEM_RE = /^ {0,3}(?:(?:[-*+])(?:\s|$)|(?:\d{1,9}[.)](?:\s|$)))/;
+var EMPTY_LIST_ITEM_RE = /^ {0,3}(?:[-*+]|\d{1,9}[.)])(?:\s|$)/;
+var BLOCKQUOTE_RE = /^ {0,3}> ?/;
+var SETEXT_UNDERLINE_RE = /^ {0,3}(=+|-+)\s*$/;
+var TABLE_SEP_RE = /^\s*\|?\s*:?-{1,}:?\s*(\|\s*:?-{1,}:?\s*)*\|?\s*$/;
+function parseOrderedListMarker(line) {
+ const m = line.match(ORDERED_LIST_MARKER_RE);
+ if (!m?.[1])
+ return null;
+ return parseInt(m[1], 10);
+}
+function orderedListMarkerDelimiter(line) {
+ const m = line.match(ORDERED_LIST_MARKER_RE);
+ const d = m?.[2];
+ if (d === "." || d === ")")
+ return d;
+ return null;
+}
+function isUnorderedListItemLine(line) {
+ return UNORDERED_LIST_ITEM_RE.test(line);
+}
+function isListItemLine(line) {
+ return isUnorderedListItemLine(line) || parseOrderedListMarker(line) !== null;
+}
+function unorderedListMarkerChar(line) {
+ const m = line.match(/^ {0,3}([-*+])(?:\s|$)/);
+ const ch = m?.[1];
+ if (ch === "-" || ch === "*" || ch === "+")
+ return ch;
+ return null;
+}
+function isEmptyListItemLine(line) {
+ const m = line.match(EMPTY_LIST_ITEM_RE);
+ if (!m)
+ return false;
+ return line.slice(m[0].length).trim() === "";
+}
+function listItemContentColumn(line) {
+ const m = line.match(/^( {0,3})(\d{1,9}[.)]|[-*+])( *)(.*)$/);
+ if (!m)
+ return Infinity;
+ const indent = m[1]?.length ?? 0;
+ const markerWidth = m[2]?.length ?? 0;
+ const spaces = m[3]?.length ?? 0;
+ const hasContent = (m[4]?.length ?? 0) > 0;
+ const n = hasContent && spaces >= 1 && spaces <= 4 ? spaces : 1;
+ return indent + markerWidth + n;
+}
+function lazyContinuationIndent(line) {
+ return line.match(/^ */)?.[0].length ?? 0;
+}
+function orderedMarkerContinuesParagraph(prevLine, line) {
+ const num = parseOrderedListMarker(line);
+ if (num === null)
+ return false;
+ if (num === 1)
+ return false;
+ return prevLine.trimEnd().length > 0;
+}
+function isLazyUnorderedContinuation(itemStartLine, line) {
+ if (isListItemLine(line))
+ return false;
+ return lazyContinuationIndent(line) >= listItemContentColumn(itemStartLine);
+}
+function isLazyListContinuation(itemStartLine, line) {
+ return isLazyUnorderedContinuation(itemStartLine, line);
+}
+function lineContainsPipeCellDelimiter(line) {
+ return line.includes("|") && line.trim() !== "";
+}
+function isProseMetadataPipeLine(line) {
+ if (!lineContainsPipeCellDelimiter(line))
+ return false;
+ const trimmed = line.trimStart();
+ if (/\*\*[^*\n]+:\*\*/.test(trimmed))
+ return true;
+ if (/ /i.test(trimmed))
+ return true;
+ return false;
+}
+function isGfmTableRowLine(line) {
+ if (!lineContainsPipeCellDelimiter(line))
+ return false;
+ if (isProseMetadataPipeLine(line))
+ return false;
+ const trimmed = line.trimStart();
+ if (trimmed.startsWith("|"))
+ return true;
+ return splitTableRow(trimmed).length >= 2;
+}
+function isTableRow(line) {
+ return isGfmTableRowLine(line);
+}
+function isPartialTableSeparatorLine(line) {
+ const trimmed = line.trim();
+ if (!trimmed.includes("-"))
+ return false;
+ return /^\|?\s*:?-{1,}/.test(trimmed);
+}
+function isPotentialTableStart(lines, i) {
+ const line = lines[i];
+ if (!line || !isTableRow(line.text))
+ return false;
+ const next = lines[i + 1];
+ if (next && TABLE_SEP_RE.test(next.text))
+ return true;
+ if (next && isPartialTableSeparatorLine(next.text))
+ return true;
+ if (next && isTableRow(next.text))
+ return true;
+ return line.text.trimStart().startsWith("|");
+}
+function scanLines(source) {
+ const lines = [];
+ let i = 0;
+ while (i <= source.length) {
+ const start = i;
+ const end = source.indexOf("\n", i);
+ if (end === -1) {
+ if (start < source.length) {
+ lines.push({ text: source.slice(start), start, end: source.length, terminated: false });
+ }
+ break;
+ }
+ lines.push({ text: source.slice(start, end), start, end: end + 1, terminated: true });
+ i = end + 1;
+ }
+ return lines;
+}
+function pushBlock(blocks, kind, status, start, end) {
+ if (end <= start)
+ return;
+ blocks.push({ kind, status, start, end });
+}
+function tryLinkRefDefBlock(lines, i) {
+ const startLine = lines[i];
+ if (!startLine || !/^ {0,3}\[/.test(startLine.text))
+ return null;
+ let j = i;
+ let buf = "";
+ while (j < lines.length) {
+ const line = lines[j];
+ if (!line)
+ break;
+ if (j > i && line.text.trim() === "")
+ return null;
+ if (j > i && (ATX_HEADING_DETECT_RE.test(line.text) || LIST_ITEM_RE.test(line.text) || BLOCKQUOTE_RE.test(line.text) || fenceMarker(line.text) || THEMATIC_BREAK_RE.test(line.text))) {
+ return null;
+ }
+ buf += line.text;
+ if (line.terminated)
+ buf += "\n";
+ if (/\]:[ \t]/.test(buf) || /\]:\n/.test(buf)) {
+ const probe = buf.endsWith("\n") ? buf : `${buf}
+`;
+ if (parseLinkReferenceDefinitions(probe).size > 0)
+ return j + 1;
+ }
+ j++;
+ }
+ return null;
+}
+function breaksUnorderedListItem(lines, itemStart, j) {
+ const itemStartLine = lines[itemStart]?.text ?? "";
+ const col = listItemContentColumn(itemStartLine);
+ const next = lines[j];
+ if (!next)
+ return true;
+ if (next.text.trim() === "") {
+ let k = j + 1;
+ while (k < lines.length && lines[k]?.text.trim() === "")
+ k++;
+ const after = lines[k];
+ if (!after)
+ return true;
+ if (lazyContinuationIndent(after.text) >= col)
+ return false;
+ if (isListItemLine(after.text))
+ return true;
+ return !isLazyUnorderedContinuation(itemStartLine, after.text);
+ }
+ if (lazyContinuationIndent(next.text) >= col && next.text.trim() !== "")
+ return false;
+ if (isListItemLine(next.text))
+ return true;
+ if (ATX_HEADING_DETECT_RE.test(next.text) || THEMATIC_BREAK_RE.test(next.text) || fenceMarker(next.text) || BLOCKQUOTE_RE.test(next.text) || tryLinkRefDefBlock(lines, j) !== null || isTableRow(next.text) && lines[j + 1] && TABLE_SEP_RE.test(lines[j + 1]?.text ?? "")) {
+ return true;
+ }
+ return false;
+}
+function tokenizeBlocks(source) {
+ const lines = scanLines(source);
+ const blocks = [];
+ let i = 0;
+ while (i < lines.length) {
+ const line = lines[i];
+ if (!line)
+ break;
+ if (line.text.trim() === "") {
+ pushBlock(blocks, "blank", line.terminated ? "complete" : "open", line.start, line.end);
+ i++;
+ continue;
+ }
+ if (leadingIndentWidth(line.text) >= 4 && line.text.trim() !== "") {
+ let j2 = i + 1;
+ let lastContent = i;
+ while (j2 < lines.length) {
+ const next = lines[j2];
+ if (!next)
+ break;
+ if (next.text.trim() === "") {
+ j2++;
+ continue;
+ }
+ if (leadingIndentWidth(next.text) >= 4) {
+ lastContent = j2;
+ j2++;
+ continue;
+ }
+ break;
+ }
+ const last2 = lines[lastContent] ?? line;
+ const terminatorSeen = j2 < lines.length && lines[j2] !== void 0;
+ const status2 = !last2.terminated ? "open" : terminatorSeen ? "complete" : "open";
+ pushBlock(blocks, "indented_code", status2, line.start, last2.end);
+ i = lastContent + 1;
+ continue;
+ }
+ const fence = fenceMarker(line.text);
+ if (fence) {
+ const fenceStart = line.start;
+ let j2 = i + 1;
+ let closed = false;
+ while (j2 < lines.length) {
+ const next = lines[j2];
+ if (next && fenceCloses(fence.marker, fence.len, next.text)) {
+ closed = true;
+ pushBlock(blocks, "fence", "complete", fenceStart, next.end);
+ i = j2 + 1;
+ break;
+ }
+ j2++;
+ }
+ if (!closed) {
+ const end = lines.at(-1)?.end ?? source.length;
+ pushBlock(blocks, "fence", "open", fenceStart, end);
+ break;
+ }
+ continue;
+ }
+ if (ATX_HEADING_DETECT_RE.test(line.text)) {
+ const status2 = line.terminated ? "complete" : "ambiguous";
+ pushBlock(blocks, "atx_heading", status2, line.start, line.end);
+ i++;
+ continue;
+ }
+ if (THEMATIC_BREAK_RE.test(line.text)) {
+ const status2 = line.terminated ? "complete" : "ambiguous";
+ pushBlock(blocks, "thematic_break", status2, line.start, line.end);
+ i++;
+ continue;
+ }
+ const linkRefEnd = tryLinkRefDefBlock(lines, i);
+ if (linkRefEnd !== null) {
+ const last2 = lines[linkRefEnd - 1] ?? line;
+ const status2 = last2.terminated ? "complete" : "open";
+ pushBlock(blocks, "link_ref_def", status2, line.start, last2.end);
+ i = linkRefEnd;
+ continue;
+ }
+ if (isListItemLine(line.text)) {
+ const isOrdered = parseOrderedListMarker(line.text) !== null;
+ const itemStart = line.start;
+ let j2 = i + 1;
+ while (j2 < lines.length) {
+ if (isOrdered) {
+ const next = lines[j2];
+ if (!next)
+ break;
+ if (next.text.trim() !== "" && lazyContinuationIndent(next.text) >= listItemContentColumn(line.text)) {
+ j2++;
+ continue;
+ }
+ if (isListItemLine(next.text))
+ break;
+ if (next.text.trim() === "") {
+ j2++;
+ continue;
+ }
+ if (ATX_HEADING_DETECT_RE.test(next.text) || THEMATIC_BREAK_RE.test(next.text) || fenceMarker(next.text) || BLOCKQUOTE_RE.test(next.text) || tryLinkRefDefBlock(lines, j2) !== null || isTableRow(next.text) && lines[j2 + 1] && TABLE_SEP_RE.test(lines[j2 + 1]?.text ?? "")) {
+ break;
+ }
+ j2++;
+ continue;
+ }
+ if (breaksUnorderedListItem(lines, i, j2))
+ break;
+ j2++;
+ }
+ const last2 = lines[j2 - 1] ?? line;
+ const status2 = last2.terminated ? "complete" : "open";
+ pushBlock(blocks, "list_item", status2, itemStart, last2.end);
+ i = j2;
+ continue;
+ }
+ if (BLOCKQUOTE_RE.test(line.text)) {
+ const bqStart = line.start;
+ let j2 = i + 1;
+ while (j2 < lines.length) {
+ const next = lines[j2];
+ if (!next)
+ break;
+ if (next.text.trim() === "") {
+ let k = j2 + 1;
+ while (k < lines.length && lines[k]?.text.trim() === "")
+ k++;
+ if (k < lines.length && lines[k] && BLOCKQUOTE_RE.test(lines[k]?.text ?? "")) {
+ j2++;
+ continue;
+ }
+ break;
+ }
+ if (!BLOCKQUOTE_RE.test(next.text) && (ATX_HEADING_DETECT_RE.test(next.text) || LIST_ITEM_RE.test(next.text) || fenceMarker(next.text) || THEMATIC_BREAK_RE.test(next.text))) {
+ break;
+ }
+ j2++;
+ }
+ const last2 = lines[j2 - 1] ?? line;
+ const status2 = last2.terminated ? "complete" : "open";
+ pushBlock(blocks, "blockquote", status2, bqStart, last2.end);
+ i = j2;
+ continue;
+ }
+ if (isTableRow(line.text)) {
+ const nextLine2 = lines[i + 1];
+ if (nextLine2 && TABLE_SEP_RE.test(nextLine2.text)) {
+ const tableStart = line.start;
+ let j2 = i + 2;
+ while (j2 < lines.length) {
+ const row = lines[j2];
+ if (!row || !isTableRow(row.text))
+ break;
+ j2++;
+ }
+ const last2 = lines[j2 - 1] ?? lines[i + 1] ?? line;
+ const lastRow = lines[j2 - 1];
+ const status2 = lastRow && !lastRow.terminated && j2 === lines.length ? "open" : "complete";
+ pushBlock(blocks, "table", status2, tableStart, last2.end);
+ i = j2;
+ continue;
+ }
+ if (isPotentialTableStart(lines, i)) {
+ const tableStart = line.start;
+ let j2 = i + 1;
+ while (j2 < lines.length) {
+ const nl = lines[j2];
+ if (!nl)
+ break;
+ if (TABLE_SEP_RE.test(nl.text))
+ break;
+ if (!isTableRow(nl.text) && !isPartialTableSeparatorLine(nl.text) && nl.text.trim() !== "") {
+ break;
+ }
+ j2++;
+ }
+ const last2 = lines[j2 - 1] ?? line;
+ const status2 = last2.terminated && j2 > i + 1 ? "open" : last2.terminated ? "ambiguous" : "open";
+ pushBlock(blocks, "table", status2, tableStart, last2.end);
+ i = j2;
+ continue;
+ }
+ }
+ const nextLine = lines[i + 1];
+ if (nextLine && SETEXT_UNDERLINE_RE.test(nextLine.text)) {
+ if (!nextLine.terminated) {
+ pushBlock(blocks, "paragraph", line.terminated ? "complete" : "open", line.start, line.end);
+ pushBlock(blocks, "thematic_break", "ambiguous", nextLine.start, nextLine.end);
+ i += 2;
+ continue;
+ }
+ pushBlock(blocks, "setext_heading", "complete", line.start, nextLine.end);
+ i += 2;
+ continue;
+ }
+ if (!line.terminated && i === lines.length - 1) {
+ if (isPotentialTableStart(lines, i)) {
+ pushBlock(blocks, "table", "ambiguous", line.start, line.end);
+ } else {
+ pushBlock(blocks, "paragraph", "open", line.start, line.end);
+ }
+ break;
+ }
+ const paraStart = line.start;
+ let j = i + 1;
+ while (j < lines.length) {
+ const next = lines[j];
+ if (!next || next.text.trim() === "")
+ break;
+ if (ATX_HEADING_DETECT_RE.test(next.text) || THEMATIC_BREAK_RE.test(next.text) || LIST_ITEM_RE.test(next.text) && // An empty list item cannot interrupt a paragraph (#285).
+ !isEmptyListItemLine(next.text) && !orderedMarkerContinuesParagraph(lines[j - 1]?.text ?? "", next.text) || BLOCKQUOTE_RE.test(next.text) || fenceMarker(next.text) || tryLinkRefDefBlock(lines, j) !== null || isTableRow(next.text) && lines[j + 1] && TABLE_SEP_RE.test(lines[j + 1]?.text ?? "") || lines[j + 1] && SETEXT_UNDERLINE_RE.test(lines[j + 1]?.text ?? "")) {
+ break;
+ }
+ j++;
+ }
+ const last = lines[j - 1] ?? line;
+ const status = last.terminated ? "complete" : "open";
+ pushBlock(blocks, "paragraph", status, paraStart, last.end);
+ i = j;
+ }
+ return blocks;
+}
+function streamingHoldStart(blocks) {
+ let commitEnd = 0;
+ for (const block of blocks) {
+ if (block.status !== "complete")
+ return block.start;
+ commitEnd = block.end;
+ }
+ return commitEnd;
+}
+function completeEndsInOpenTable(complete) {
+ const blocks = tokenizeBlocks(complete);
+ const last = blocks.at(-1);
+ return last?.kind === "table" && last.status === "complete";
+}
+function pendingLineBelongsInTable(complete, pending) {
+ return pending.includes("|") && completeEndsInOpenTable(complete);
+}
+function getIncompleteTableSource(content) {
+ const blocks = tokenizeBlocks(content);
+ for (let i = blocks.length - 1; i >= 0; i--) {
+ const block = blocks[i];
+ if (block?.kind === "table" && block.status !== "complete") {
+ return content.slice(block.start, block.end);
+ }
+ }
+ return null;
+}
+function getIncompleteFenceSource(content) {
+ const blocks = tokenizeBlocks(content);
+ for (let i = blocks.length - 1; i >= 0; i--) {
+ const block = blocks[i];
+ if (block?.kind === "fence" && block.status !== "complete") {
+ return content.slice(block.start, block.end);
+ }
+ }
+ return null;
+}
+function splitTableRow(line) {
+ let s = line.trim();
+ if (s.startsWith("|"))
+ s = s.slice(1);
+ if (s.endsWith("|"))
+ s = s.slice(0, -1);
+ return s.split("|").map((c) => c.trim());
+}
+function isAmbiguousBlockLine(line) {
+ const trimmed = line.trimStart();
+ if (trimmed === "")
+ return false;
+ if (/^ {4}/.test(line))
+ return true;
+ if (ATX_HEADING_DETECT_RE.test(line))
+ return true;
+ if (THEMATIC_BREAK_RE.test(line))
+ return true;
+ if (FENCE_OPEN_RE.test(line))
+ return true;
+ if (LIST_ITEM_RE.test(line))
+ return true;
+ if (BLOCKQUOTE_RE.test(line))
+ return true;
+ if (isGfmTableRowLine(line))
+ return true;
+ return false;
+}
+
+// dist/escape.js
+var HTML_ESCAPES = {
+ "&": "&",
+ "<": "<",
+ ">": ">",
+ '"': """,
+ "'": "'"
+};
+function escapeHtml(text2) {
+ return text2.replace(/[&<>"']/g, (ch) => HTML_ESCAPES[ch] ?? ch);
+}
+var SAFE_OUTER_TAG_RE = /^(?:|<\/(?:a|code|em|strong)>|<(?:code|em|strong)\b[^>]*>|[\s\S]*?<\/code>)/g).map((segment, index) => {
+ if (index % 2 === 1) {
+ const match = segment.match(/^()([\s\S]*?)(<\/code>)$/);
+ if (!match)
+ return segment;
+ return `${match[1] ?? ""}${escapeHtml(match[2] ?? "")}${match[3] ?? ""}`;
+ }
+ return escapeHtmlOutsideSafeTags(segment);
+ }).join("");
+}
+function escapeMermaidHtml(text2) {
+ return text2.replace(/[&<"']/g, (ch) => HTML_ESCAPES[ch] ?? ch);
+}
+function decodeEscapedHref(raw) {
+ return raw.replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
+}
+var SAFE_MARKDOWN_ENTITY_RE = /&(?:amp;)?(?:nbsp|#160|#x0*a);/gi;
+var KNOWN_SAFE_ENTITIES = [
+ " ",
+ " ",
+ " ",
+ " ",
+ " ",
+ " "
+];
+function stripIncompleteSafeEntities(text2) {
+ const amp = text2.lastIndexOf("&");
+ if (amp === -1)
+ return text2;
+ const suffix = text2.slice(amp);
+ if (/^&(?:amp;)?(?:nbsp|#160|#x0*a);$/i.test(suffix))
+ return text2;
+ const lower = suffix.toLowerCase();
+ if (KNOWN_SAFE_ENTITIES.some((entity) => entity.startsWith(lower) && lower.length < entity.length)) {
+ return text2.slice(0, amp);
+ }
+ return text2;
+}
+function decodeSafeMarkdownEntities(text2) {
+ const stripped = stripIncompleteSafeEntities(text2);
+ return stripped.replace(SAFE_MARKDOWN_ENTITY_RE, (entity) => {
+ const lower = entity.toLowerCase();
+ if (lower === " " || lower === " " || lower === " " || lower === " " || lower === " " || lower === " ") {
+ return "\xA0";
+ }
+ return entity;
+ });
+}
+
+// node_modules/highlight.js/es/core.js
+var import_core = __toESM(require_core(), 1);
+var core_default = import_core.default;
+
+// node_modules/highlight.js/es/languages/bash.js
+function bash(hljs) {
+ const regex = hljs.regex;
+ const VAR = {};
+ const BRACED_VAR = {
+ begin: /\$\{/,
+ end: /\}/,
+ contains: [
+ "self",
+ {
+ begin: /:-/,
+ contains: [VAR]
+ }
+ // default values
+ ]
+ };
+ Object.assign(VAR, {
+ className: "variable",
+ variants: [
+ { begin: regex.concat(
+ /\$[\w\d#@][\w\d_]*/,
+ // negative look-ahead tries to avoid matching patterns that are not
+ // Perl at all like $ident$, @ident@, etc.
+ `(?![\\w\\d])(?![$])`
+ ) },
+ BRACED_VAR
+ ]
+ });
+ const SUBST = {
+ className: "subst",
+ begin: /\$\(/,
+ end: /\)/,
+ contains: [hljs.BACKSLASH_ESCAPE]
+ };
+ const COMMENT = hljs.inherit(
+ hljs.COMMENT(),
+ {
+ match: [
+ /(^|\s)/,
+ /#.*$/
+ ],
+ scope: {
+ 2: "comment"
+ }
+ }
+ );
+ const HERE_DOC = {
+ begin: /<<-?\s*(?=\w+)/,
+ starts: { contains: [
+ hljs.END_SAME_AS_BEGIN({
+ begin: /(\w+)/,
+ end: /(\w+)/,
+ className: "string"
+ })
+ ] }
+ };
+ const QUOTE_STRING = {
+ className: "string",
+ begin: /"/,
+ end: /"/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ VAR,
+ SUBST
+ ]
+ };
+ SUBST.contains.push(QUOTE_STRING);
+ const ESCAPED_QUOTE = {
+ match: /\\"/
+ };
+ const APOS_STRING = {
+ className: "string",
+ begin: /'/,
+ end: /'/
+ };
+ const ESCAPED_APOS = {
+ match: /\\'/
+ };
+ const ARITHMETIC = {
+ begin: /\$?\(\(/,
+ end: /\)\)/,
+ contains: [
+ {
+ begin: /\d+#[0-9a-f]+/,
+ className: "number"
+ },
+ hljs.NUMBER_MODE,
+ VAR
+ ]
+ };
+ const SH_LIKE_SHELLS = [
+ "fish",
+ "bash",
+ "zsh",
+ "sh",
+ "csh",
+ "ksh",
+ "tcsh",
+ "dash",
+ "scsh"
+ ];
+ const KNOWN_SHEBANG = hljs.SHEBANG({
+ binary: `(${SH_LIKE_SHELLS.join("|")})`,
+ relevance: 10
+ });
+ const FUNCTION = {
+ className: "function",
+ begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
+ returnBegin: true,
+ contains: [hljs.inherit(hljs.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
+ relevance: 0
+ };
+ const KEYWORDS3 = [
+ "if",
+ "then",
+ "else",
+ "elif",
+ "fi",
+ "time",
+ "for",
+ "while",
+ "until",
+ "in",
+ "do",
+ "done",
+ "case",
+ "esac",
+ "coproc",
+ "function",
+ "select"
+ ];
+ const LITERALS3 = [
+ "true",
+ "false"
+ ];
+ const PATH_MODE = { match: /(\/[a-z._-]+)+/ };
+ const SHELL_BUILT_INS = [
+ "break",
+ "cd",
+ "continue",
+ "eval",
+ "exec",
+ "exit",
+ "export",
+ "getopts",
+ "hash",
+ "pwd",
+ "readonly",
+ "return",
+ "shift",
+ "test",
+ "times",
+ "trap",
+ "umask",
+ "unset"
+ ];
+ const BASH_BUILT_INS = [
+ "alias",
+ "bind",
+ "builtin",
+ "caller",
+ "command",
+ "declare",
+ "echo",
+ "enable",
+ "help",
+ "let",
+ "local",
+ "logout",
+ "mapfile",
+ "printf",
+ "read",
+ "readarray",
+ "source",
+ "sudo",
+ "type",
+ "typeset",
+ "ulimit",
+ "unalias"
+ ];
+ const ZSH_BUILT_INS = [
+ "autoload",
+ "bg",
+ "bindkey",
+ "bye",
+ "cap",
+ "chdir",
+ "clone",
+ "comparguments",
+ "compcall",
+ "compctl",
+ "compdescribe",
+ "compfiles",
+ "compgroups",
+ "compquote",
+ "comptags",
+ "comptry",
+ "compvalues",
+ "dirs",
+ "disable",
+ "disown",
+ "echotc",
+ "echoti",
+ "emulate",
+ "fc",
+ "fg",
+ "float",
+ "functions",
+ "getcap",
+ "getln",
+ "history",
+ "integer",
+ "jobs",
+ "kill",
+ "limit",
+ "log",
+ "noglob",
+ "popd",
+ "print",
+ "pushd",
+ "pushln",
+ "rehash",
+ "sched",
+ "setcap",
+ "setopt",
+ "stat",
+ "suspend",
+ "ttyctl",
+ "unfunction",
+ "unhash",
+ "unlimit",
+ "unsetopt",
+ "vared",
+ "wait",
+ "whence",
+ "where",
+ "which",
+ "zcompile",
+ "zformat",
+ "zftp",
+ "zle",
+ "zmodload",
+ "zparseopts",
+ "zprof",
+ "zpty",
+ "zregexparse",
+ "zsocket",
+ "zstyle",
+ "ztcp"
+ ];
+ const GNU_CORE_UTILS = [
+ "chcon",
+ "chgrp",
+ "chown",
+ "chmod",
+ "cp",
+ "dd",
+ "df",
+ "dir",
+ "dircolors",
+ "ln",
+ "ls",
+ "mkdir",
+ "mkfifo",
+ "mknod",
+ "mktemp",
+ "mv",
+ "realpath",
+ "rm",
+ "rmdir",
+ "shred",
+ "sync",
+ "touch",
+ "truncate",
+ "vdir",
+ "b2sum",
+ "base32",
+ "base64",
+ "cat",
+ "cksum",
+ "comm",
+ "csplit",
+ "cut",
+ "expand",
+ "fmt",
+ "fold",
+ "head",
+ "join",
+ "md5sum",
+ "nl",
+ "numfmt",
+ "od",
+ "paste",
+ "ptx",
+ "pr",
+ "sha1sum",
+ "sha224sum",
+ "sha256sum",
+ "sha384sum",
+ "sha512sum",
+ "shuf",
+ "sort",
+ "split",
+ "sum",
+ "tac",
+ "tail",
+ "tr",
+ "tsort",
+ "unexpand",
+ "uniq",
+ "wc",
+ "arch",
+ "basename",
+ "chroot",
+ "date",
+ "dirname",
+ "du",
+ "echo",
+ "env",
+ "expr",
+ "factor",
+ // "false", // keyword literal already
+ "groups",
+ "hostid",
+ "id",
+ "link",
+ "logname",
+ "nice",
+ "nohup",
+ "nproc",
+ "pathchk",
+ "pinky",
+ "printenv",
+ "printf",
+ "pwd",
+ "readlink",
+ "runcon",
+ "seq",
+ "sleep",
+ "stat",
+ "stdbuf",
+ "stty",
+ "tee",
+ "test",
+ "timeout",
+ // "true", // keyword literal already
+ "tty",
+ "uname",
+ "unlink",
+ "uptime",
+ "users",
+ "who",
+ "whoami",
+ "yes"
+ ];
+ return {
+ name: "Bash",
+ aliases: [
+ "sh",
+ "zsh"
+ ],
+ keywords: {
+ $pattern: /\b[a-z][a-z0-9._-]+\b/,
+ keyword: KEYWORDS3,
+ literal: LITERALS3,
+ built_in: [
+ ...SHELL_BUILT_INS,
+ ...BASH_BUILT_INS,
+ // Shell modifiers
+ "set",
+ "shopt",
+ ...ZSH_BUILT_INS,
+ ...GNU_CORE_UTILS
+ ]
+ },
+ contains: [
+ KNOWN_SHEBANG,
+ // to catch known shells and boost relevancy
+ hljs.SHEBANG(),
+ // to catch unknown shells but still highlight the shebang
+ FUNCTION,
+ ARITHMETIC,
+ COMMENT,
+ HERE_DOC,
+ PATH_MODE,
+ QUOTE_STRING,
+ ESCAPED_QUOTE,
+ APOS_STRING,
+ ESCAPED_APOS,
+ VAR
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/css.js
+var MODES = (hljs) => {
+ return {
+ IMPORTANT: {
+ scope: "meta",
+ begin: "!important"
+ },
+ BLOCK_COMMENT: hljs.C_BLOCK_COMMENT_MODE,
+ HEXCOLOR: {
+ scope: "number",
+ begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
+ },
+ FUNCTION_DISPATCH: {
+ className: "built_in",
+ begin: /[\w-]+(?=\()/
+ },
+ ATTRIBUTE_SELECTOR_MODE: {
+ scope: "selector-attr",
+ begin: /\[/,
+ end: /\]/,
+ illegal: "$",
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE
+ ]
+ },
+ CSS_NUMBER_MODE: {
+ scope: "number",
+ begin: hljs.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
+ relevance: 0
+ },
+ CSS_VARIABLE: {
+ className: "attr",
+ begin: /--[A-Za-z_][A-Za-z0-9_-]*/
+ }
+ };
+};
+var HTML_TAGS = [
+ "a",
+ "abbr",
+ "address",
+ "article",
+ "aside",
+ "audio",
+ "b",
+ "blockquote",
+ "body",
+ "button",
+ "canvas",
+ "caption",
+ "cite",
+ "code",
+ "dd",
+ "del",
+ "details",
+ "dfn",
+ "div",
+ "dl",
+ "dt",
+ "em",
+ "fieldset",
+ "figcaption",
+ "figure",
+ "footer",
+ "form",
+ "h1",
+ "h2",
+ "h3",
+ "h4",
+ "h5",
+ "h6",
+ "header",
+ "hgroup",
+ "html",
+ "i",
+ "iframe",
+ "img",
+ "input",
+ "ins",
+ "kbd",
+ "label",
+ "legend",
+ "li",
+ "main",
+ "mark",
+ "menu",
+ "nav",
+ "object",
+ "ol",
+ "optgroup",
+ "option",
+ "p",
+ "picture",
+ "q",
+ "quote",
+ "samp",
+ "section",
+ "select",
+ "source",
+ "span",
+ "strong",
+ "summary",
+ "sup",
+ "table",
+ "tbody",
+ "td",
+ "textarea",
+ "tfoot",
+ "th",
+ "thead",
+ "time",
+ "tr",
+ "ul",
+ "var",
+ "video"
+];
+var SVG_TAGS = [
+ "defs",
+ "g",
+ "marker",
+ "mask",
+ "pattern",
+ "svg",
+ "switch",
+ "symbol",
+ "feBlend",
+ "feColorMatrix",
+ "feComponentTransfer",
+ "feComposite",
+ "feConvolveMatrix",
+ "feDiffuseLighting",
+ "feDisplacementMap",
+ "feFlood",
+ "feGaussianBlur",
+ "feImage",
+ "feMerge",
+ "feMorphology",
+ "feOffset",
+ "feSpecularLighting",
+ "feTile",
+ "feTurbulence",
+ "linearGradient",
+ "radialGradient",
+ "stop",
+ "circle",
+ "ellipse",
+ "image",
+ "line",
+ "path",
+ "polygon",
+ "polyline",
+ "rect",
+ "text",
+ "use",
+ "textPath",
+ "tspan",
+ "foreignObject",
+ "clipPath"
+];
+var TAGS = [
+ ...HTML_TAGS,
+ ...SVG_TAGS
+];
+var MEDIA_FEATURES = [
+ "any-hover",
+ "any-pointer",
+ "aspect-ratio",
+ "color",
+ "color-gamut",
+ "color-index",
+ "device-aspect-ratio",
+ "device-height",
+ "device-width",
+ "display-mode",
+ "forced-colors",
+ "grid",
+ "height",
+ "hover",
+ "inverted-colors",
+ "monochrome",
+ "orientation",
+ "overflow-block",
+ "overflow-inline",
+ "pointer",
+ "prefers-color-scheme",
+ "prefers-contrast",
+ "prefers-reduced-motion",
+ "prefers-reduced-transparency",
+ "resolution",
+ "scan",
+ "scripting",
+ "update",
+ "width",
+ // TODO: find a better solution?
+ "min-width",
+ "max-width",
+ "min-height",
+ "max-height"
+].sort().reverse();
+var PSEUDO_CLASSES = [
+ "active",
+ "any-link",
+ "blank",
+ "checked",
+ "current",
+ "default",
+ "defined",
+ "dir",
+ // dir()
+ "disabled",
+ "drop",
+ "empty",
+ "enabled",
+ "first",
+ "first-child",
+ "first-of-type",
+ "fullscreen",
+ "future",
+ "focus",
+ "focus-visible",
+ "focus-within",
+ "has",
+ // has()
+ "host",
+ // host or host()
+ "host-context",
+ // host-context()
+ "hover",
+ "indeterminate",
+ "in-range",
+ "invalid",
+ "is",
+ // is()
+ "lang",
+ // lang()
+ "last-child",
+ "last-of-type",
+ "left",
+ "link",
+ "local-link",
+ "not",
+ // not()
+ "nth-child",
+ // nth-child()
+ "nth-col",
+ // nth-col()
+ "nth-last-child",
+ // nth-last-child()
+ "nth-last-col",
+ // nth-last-col()
+ "nth-last-of-type",
+ //nth-last-of-type()
+ "nth-of-type",
+ //nth-of-type()
+ "only-child",
+ "only-of-type",
+ "optional",
+ "out-of-range",
+ "past",
+ "placeholder-shown",
+ "read-only",
+ "read-write",
+ "required",
+ "right",
+ "root",
+ "scope",
+ "target",
+ "target-within",
+ "user-invalid",
+ "valid",
+ "visited",
+ "where"
+ // where()
+].sort().reverse();
+var PSEUDO_ELEMENTS = [
+ "after",
+ "backdrop",
+ "before",
+ "cue",
+ "cue-region",
+ "first-letter",
+ "first-line",
+ "grammar-error",
+ "marker",
+ "part",
+ "placeholder",
+ "selection",
+ "slotted",
+ "spelling-error"
+].sort().reverse();
+var ATTRIBUTES = [
+ "accent-color",
+ "align-content",
+ "align-items",
+ "align-self",
+ "alignment-baseline",
+ "all",
+ "anchor-name",
+ "animation",
+ "animation-composition",
+ "animation-delay",
+ "animation-direction",
+ "animation-duration",
+ "animation-fill-mode",
+ "animation-iteration-count",
+ "animation-name",
+ "animation-play-state",
+ "animation-range",
+ "animation-range-end",
+ "animation-range-start",
+ "animation-timeline",
+ "animation-timing-function",
+ "appearance",
+ "aspect-ratio",
+ "backdrop-filter",
+ "backface-visibility",
+ "background",
+ "background-attachment",
+ "background-blend-mode",
+ "background-clip",
+ "background-color",
+ "background-image",
+ "background-origin",
+ "background-position",
+ "background-position-x",
+ "background-position-y",
+ "background-repeat",
+ "background-size",
+ "baseline-shift",
+ "block-size",
+ "border",
+ "border-block",
+ "border-block-color",
+ "border-block-end",
+ "border-block-end-color",
+ "border-block-end-style",
+ "border-block-end-width",
+ "border-block-start",
+ "border-block-start-color",
+ "border-block-start-style",
+ "border-block-start-width",
+ "border-block-style",
+ "border-block-width",
+ "border-bottom",
+ "border-bottom-color",
+ "border-bottom-left-radius",
+ "border-bottom-right-radius",
+ "border-bottom-style",
+ "border-bottom-width",
+ "border-collapse",
+ "border-color",
+ "border-end-end-radius",
+ "border-end-start-radius",
+ "border-image",
+ "border-image-outset",
+ "border-image-repeat",
+ "border-image-slice",
+ "border-image-source",
+ "border-image-width",
+ "border-inline",
+ "border-inline-color",
+ "border-inline-end",
+ "border-inline-end-color",
+ "border-inline-end-style",
+ "border-inline-end-width",
+ "border-inline-start",
+ "border-inline-start-color",
+ "border-inline-start-style",
+ "border-inline-start-width",
+ "border-inline-style",
+ "border-inline-width",
+ "border-left",
+ "border-left-color",
+ "border-left-style",
+ "border-left-width",
+ "border-radius",
+ "border-right",
+ "border-right-color",
+ "border-right-style",
+ "border-right-width",
+ "border-spacing",
+ "border-start-end-radius",
+ "border-start-start-radius",
+ "border-style",
+ "border-top",
+ "border-top-color",
+ "border-top-left-radius",
+ "border-top-right-radius",
+ "border-top-style",
+ "border-top-width",
+ "border-width",
+ "bottom",
+ "box-align",
+ "box-decoration-break",
+ "box-direction",
+ "box-flex",
+ "box-flex-group",
+ "box-lines",
+ "box-ordinal-group",
+ "box-orient",
+ "box-pack",
+ "box-shadow",
+ "box-sizing",
+ "break-after",
+ "break-before",
+ "break-inside",
+ "caption-side",
+ "caret-color",
+ "clear",
+ "clip",
+ "clip-path",
+ "clip-rule",
+ "color",
+ "color-interpolation",
+ "color-interpolation-filters",
+ "color-profile",
+ "color-rendering",
+ "color-scheme",
+ "column-count",
+ "column-fill",
+ "column-gap",
+ "column-rule",
+ "column-rule-color",
+ "column-rule-style",
+ "column-rule-width",
+ "column-span",
+ "column-width",
+ "columns",
+ "contain",
+ "contain-intrinsic-block-size",
+ "contain-intrinsic-height",
+ "contain-intrinsic-inline-size",
+ "contain-intrinsic-size",
+ "contain-intrinsic-width",
+ "container",
+ "container-name",
+ "container-type",
+ "content",
+ "content-visibility",
+ "counter-increment",
+ "counter-reset",
+ "counter-set",
+ "cue",
+ "cue-after",
+ "cue-before",
+ "cursor",
+ "cx",
+ "cy",
+ "direction",
+ "display",
+ "dominant-baseline",
+ "empty-cells",
+ "enable-background",
+ "field-sizing",
+ "fill",
+ "fill-opacity",
+ "fill-rule",
+ "filter",
+ "flex",
+ "flex-basis",
+ "flex-direction",
+ "flex-flow",
+ "flex-grow",
+ "flex-shrink",
+ "flex-wrap",
+ "float",
+ "flood-color",
+ "flood-opacity",
+ "flow",
+ "font",
+ "font-display",
+ "font-family",
+ "font-feature-settings",
+ "font-kerning",
+ "font-language-override",
+ "font-optical-sizing",
+ "font-palette",
+ "font-size",
+ "font-size-adjust",
+ "font-smooth",
+ "font-smoothing",
+ "font-stretch",
+ "font-style",
+ "font-synthesis",
+ "font-synthesis-position",
+ "font-synthesis-small-caps",
+ "font-synthesis-style",
+ "font-synthesis-weight",
+ "font-variant",
+ "font-variant-alternates",
+ "font-variant-caps",
+ "font-variant-east-asian",
+ "font-variant-emoji",
+ "font-variant-ligatures",
+ "font-variant-numeric",
+ "font-variant-position",
+ "font-variation-settings",
+ "font-weight",
+ "forced-color-adjust",
+ "gap",
+ "glyph-orientation-horizontal",
+ "glyph-orientation-vertical",
+ "grid",
+ "grid-area",
+ "grid-auto-columns",
+ "grid-auto-flow",
+ "grid-auto-rows",
+ "grid-column",
+ "grid-column-end",
+ "grid-column-start",
+ "grid-gap",
+ "grid-row",
+ "grid-row-end",
+ "grid-row-start",
+ "grid-template",
+ "grid-template-areas",
+ "grid-template-columns",
+ "grid-template-rows",
+ "hanging-punctuation",
+ "height",
+ "hyphenate-character",
+ "hyphenate-limit-chars",
+ "hyphens",
+ "icon",
+ "image-orientation",
+ "image-rendering",
+ "image-resolution",
+ "ime-mode",
+ "initial-letter",
+ "initial-letter-align",
+ "inline-size",
+ "inset",
+ "inset-area",
+ "inset-block",
+ "inset-block-end",
+ "inset-block-start",
+ "inset-inline",
+ "inset-inline-end",
+ "inset-inline-start",
+ "isolation",
+ "justify-content",
+ "justify-items",
+ "justify-self",
+ "kerning",
+ "left",
+ "letter-spacing",
+ "lighting-color",
+ "line-break",
+ "line-height",
+ "line-height-step",
+ "list-style",
+ "list-style-image",
+ "list-style-position",
+ "list-style-type",
+ "margin",
+ "margin-block",
+ "margin-block-end",
+ "margin-block-start",
+ "margin-bottom",
+ "margin-inline",
+ "margin-inline-end",
+ "margin-inline-start",
+ "margin-left",
+ "margin-right",
+ "margin-top",
+ "margin-trim",
+ "marker",
+ "marker-end",
+ "marker-mid",
+ "marker-start",
+ "marks",
+ "mask",
+ "mask-border",
+ "mask-border-mode",
+ "mask-border-outset",
+ "mask-border-repeat",
+ "mask-border-slice",
+ "mask-border-source",
+ "mask-border-width",
+ "mask-clip",
+ "mask-composite",
+ "mask-image",
+ "mask-mode",
+ "mask-origin",
+ "mask-position",
+ "mask-repeat",
+ "mask-size",
+ "mask-type",
+ "masonry-auto-flow",
+ "math-depth",
+ "math-shift",
+ "math-style",
+ "max-block-size",
+ "max-height",
+ "max-inline-size",
+ "max-width",
+ "min-block-size",
+ "min-height",
+ "min-inline-size",
+ "min-width",
+ "mix-blend-mode",
+ "nav-down",
+ "nav-index",
+ "nav-left",
+ "nav-right",
+ "nav-up",
+ "none",
+ "normal",
+ "object-fit",
+ "object-position",
+ "offset",
+ "offset-anchor",
+ "offset-distance",
+ "offset-path",
+ "offset-position",
+ "offset-rotate",
+ "opacity",
+ "order",
+ "orphans",
+ "outline",
+ "outline-color",
+ "outline-offset",
+ "outline-style",
+ "outline-width",
+ "overflow",
+ "overflow-anchor",
+ "overflow-block",
+ "overflow-clip-margin",
+ "overflow-inline",
+ "overflow-wrap",
+ "overflow-x",
+ "overflow-y",
+ "overlay",
+ "overscroll-behavior",
+ "overscroll-behavior-block",
+ "overscroll-behavior-inline",
+ "overscroll-behavior-x",
+ "overscroll-behavior-y",
+ "padding",
+ "padding-block",
+ "padding-block-end",
+ "padding-block-start",
+ "padding-bottom",
+ "padding-inline",
+ "padding-inline-end",
+ "padding-inline-start",
+ "padding-left",
+ "padding-right",
+ "padding-top",
+ "page",
+ "page-break-after",
+ "page-break-before",
+ "page-break-inside",
+ "paint-order",
+ "pause",
+ "pause-after",
+ "pause-before",
+ "perspective",
+ "perspective-origin",
+ "place-content",
+ "place-items",
+ "place-self",
+ "pointer-events",
+ "position",
+ "position-anchor",
+ "position-visibility",
+ "print-color-adjust",
+ "quotes",
+ "r",
+ "resize",
+ "rest",
+ "rest-after",
+ "rest-before",
+ "right",
+ "rotate",
+ "row-gap",
+ "ruby-align",
+ "ruby-position",
+ "scale",
+ "scroll-behavior",
+ "scroll-margin",
+ "scroll-margin-block",
+ "scroll-margin-block-end",
+ "scroll-margin-block-start",
+ "scroll-margin-bottom",
+ "scroll-margin-inline",
+ "scroll-margin-inline-end",
+ "scroll-margin-inline-start",
+ "scroll-margin-left",
+ "scroll-margin-right",
+ "scroll-margin-top",
+ "scroll-padding",
+ "scroll-padding-block",
+ "scroll-padding-block-end",
+ "scroll-padding-block-start",
+ "scroll-padding-bottom",
+ "scroll-padding-inline",
+ "scroll-padding-inline-end",
+ "scroll-padding-inline-start",
+ "scroll-padding-left",
+ "scroll-padding-right",
+ "scroll-padding-top",
+ "scroll-snap-align",
+ "scroll-snap-stop",
+ "scroll-snap-type",
+ "scroll-timeline",
+ "scroll-timeline-axis",
+ "scroll-timeline-name",
+ "scrollbar-color",
+ "scrollbar-gutter",
+ "scrollbar-width",
+ "shape-image-threshold",
+ "shape-margin",
+ "shape-outside",
+ "shape-rendering",
+ "speak",
+ "speak-as",
+ "src",
+ // @font-face
+ "stop-color",
+ "stop-opacity",
+ "stroke",
+ "stroke-dasharray",
+ "stroke-dashoffset",
+ "stroke-linecap",
+ "stroke-linejoin",
+ "stroke-miterlimit",
+ "stroke-opacity",
+ "stroke-width",
+ "tab-size",
+ "table-layout",
+ "text-align",
+ "text-align-all",
+ "text-align-last",
+ "text-anchor",
+ "text-combine-upright",
+ "text-decoration",
+ "text-decoration-color",
+ "text-decoration-line",
+ "text-decoration-skip",
+ "text-decoration-skip-ink",
+ "text-decoration-style",
+ "text-decoration-thickness",
+ "text-emphasis",
+ "text-emphasis-color",
+ "text-emphasis-position",
+ "text-emphasis-style",
+ "text-indent",
+ "text-justify",
+ "text-orientation",
+ "text-overflow",
+ "text-rendering",
+ "text-shadow",
+ "text-size-adjust",
+ "text-transform",
+ "text-underline-offset",
+ "text-underline-position",
+ "text-wrap",
+ "text-wrap-mode",
+ "text-wrap-style",
+ "timeline-scope",
+ "top",
+ "touch-action",
+ "transform",
+ "transform-box",
+ "transform-origin",
+ "transform-style",
+ "transition",
+ "transition-behavior",
+ "transition-delay",
+ "transition-duration",
+ "transition-property",
+ "transition-timing-function",
+ "translate",
+ "unicode-bidi",
+ "user-modify",
+ "user-select",
+ "vector-effect",
+ "vertical-align",
+ "view-timeline",
+ "view-timeline-axis",
+ "view-timeline-inset",
+ "view-timeline-name",
+ "view-transition-name",
+ "visibility",
+ "voice-balance",
+ "voice-duration",
+ "voice-family",
+ "voice-pitch",
+ "voice-range",
+ "voice-rate",
+ "voice-stress",
+ "voice-volume",
+ "white-space",
+ "white-space-collapse",
+ "widows",
+ "width",
+ "will-change",
+ "word-break",
+ "word-spacing",
+ "word-wrap",
+ "writing-mode",
+ "x",
+ "y",
+ "z-index",
+ "zoom"
+].sort().reverse();
+function css(hljs) {
+ const regex = hljs.regex;
+ const modes = MODES(hljs);
+ const VENDOR_PREFIX = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ };
+ const AT_MODIFIERS = "and or not only";
+ const AT_PROPERTY_RE = /@-?\w[\w]*(-\w+)*/;
+ const IDENT_RE3 = "[a-zA-Z-][a-zA-Z0-9_-]*";
+ const STRINGS = [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE
+ ];
+ return {
+ name: "CSS",
+ case_insensitive: true,
+ illegal: /[=|'\$]/,
+ keywords: { keyframePosition: "from to" },
+ classNameAliases: {
+ // for visual continuity with `tag {}` and because we
+ // don't have a great class for this?
+ keyframePosition: "selector-tag"
+ },
+ contains: [
+ modes.BLOCK_COMMENT,
+ VENDOR_PREFIX,
+ // to recognize keyframe 40% etc which are outside the scope of our
+ // attribute value mode
+ modes.CSS_NUMBER_MODE,
+ {
+ className: "selector-id",
+ begin: /#[A-Za-z0-9_-]+/,
+ relevance: 0
+ },
+ {
+ className: "selector-class",
+ begin: "\\." + IDENT_RE3,
+ relevance: 0
+ },
+ modes.ATTRIBUTE_SELECTOR_MODE,
+ {
+ className: "selector-pseudo",
+ variants: [
+ { begin: ":(" + PSEUDO_CLASSES.join("|") + ")" },
+ { begin: ":(:)?(" + PSEUDO_ELEMENTS.join("|") + ")" }
+ ]
+ },
+ // we may actually need this (12/2020)
+ // { // pseudo-selector params
+ // begin: /\(/,
+ // end: /\)/,
+ // contains: [ hljs.CSS_NUMBER_MODE ]
+ // },
+ modes.CSS_VARIABLE,
+ {
+ className: "attribute",
+ begin: "\\b(" + ATTRIBUTES.join("|") + ")\\b"
+ },
+ // attribute values
+ {
+ begin: /:/,
+ end: /[;}{]/,
+ contains: [
+ modes.BLOCK_COMMENT,
+ modes.HEXCOLOR,
+ modes.IMPORTANT,
+ modes.CSS_NUMBER_MODE,
+ ...STRINGS,
+ // needed to highlight these as strings and to avoid issues with
+ // illegal characters that might be inside urls that would tigger the
+ // languages illegal stack
+ {
+ begin: /(url|data-uri)\(/,
+ end: /\)/,
+ relevance: 0,
+ // from keywords
+ keywords: { built_in: "url data-uri" },
+ contains: [
+ ...STRINGS,
+ {
+ className: "string",
+ // any character other than `)` as in `url()` will be the start
+ // of a string, which ends with `)` (from the parent mode)
+ begin: /[^)]/,
+ endsWithParent: true,
+ excludeEnd: true
+ }
+ ]
+ },
+ modes.FUNCTION_DISPATCH
+ ]
+ },
+ {
+ begin: regex.lookahead(/@/),
+ end: "[{;]",
+ relevance: 0,
+ illegal: /:/,
+ // break on Less variables @var: ...
+ contains: [
+ {
+ className: "keyword",
+ begin: AT_PROPERTY_RE
+ },
+ {
+ begin: /\s/,
+ endsWithParent: true,
+ excludeEnd: true,
+ relevance: 0,
+ keywords: {
+ $pattern: /[a-z-]+/,
+ keyword: AT_MODIFIERS,
+ attribute: MEDIA_FEATURES.join(" ")
+ },
+ contains: [
+ {
+ begin: /[a-z-]+(?=:)/,
+ className: "attribute"
+ },
+ ...STRINGS,
+ modes.CSS_NUMBER_MODE
+ ]
+ }
+ ]
+ },
+ {
+ className: "selector-tag",
+ begin: "\\b(" + TAGS.join("|") + ")\\b"
+ }
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/go.js
+function go(hljs) {
+ const LITERALS3 = [
+ "true",
+ "false",
+ "iota",
+ "nil"
+ ];
+ const BUILT_INS3 = [
+ "append",
+ "cap",
+ "close",
+ "complex",
+ "copy",
+ "imag",
+ "len",
+ "make",
+ "new",
+ "panic",
+ "print",
+ "println",
+ "real",
+ "recover",
+ "delete"
+ ];
+ const TYPES3 = [
+ "bool",
+ "byte",
+ "complex64",
+ "complex128",
+ "error",
+ "float32",
+ "float64",
+ "int8",
+ "int16",
+ "int32",
+ "int64",
+ "string",
+ "uint8",
+ "uint16",
+ "uint32",
+ "uint64",
+ "int",
+ "uint",
+ "uintptr",
+ "rune"
+ ];
+ const KWS = [
+ "break",
+ "case",
+ "chan",
+ "const",
+ "continue",
+ "default",
+ "defer",
+ "else",
+ "fallthrough",
+ "for",
+ "func",
+ "go",
+ "goto",
+ "if",
+ "import",
+ "interface",
+ "map",
+ "package",
+ "range",
+ "return",
+ "select",
+ "struct",
+ "switch",
+ "type",
+ "var"
+ ];
+ const KEYWORDS3 = {
+ keyword: KWS,
+ type: TYPES3,
+ literal: LITERALS3,
+ built_in: BUILT_INS3
+ };
+ return {
+ name: "Go",
+ aliases: ["golang"],
+ keywords: KEYWORDS3,
+ illegal: "",
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: "string",
+ variants: [
+ hljs.QUOTE_STRING_MODE,
+ hljs.APOS_STRING_MODE,
+ {
+ begin: "`",
+ end: "`"
+ }
+ ]
+ },
+ {
+ className: "number",
+ variants: [
+ {
+ match: /-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,
+ // hex without a present digit before . (making a digit afterwards required)
+ relevance: 0
+ },
+ {
+ match: /-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,
+ // hex with a present digit before . (making a digit afterwards optional)
+ relevance: 0
+ },
+ {
+ match: /-?\b0[oO](_?[0-7])*i?/,
+ // leading 0o octal
+ relevance: 0
+ },
+ {
+ match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,
+ // decimal without a present digit before . (making a digit afterwards required)
+ relevance: 0
+ },
+ {
+ match: /-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,
+ // decimal with a present digit before . (making a digit afterwards optional)
+ relevance: 0
+ }
+ ]
+ },
+ {
+ begin: /:=/
+ // relevance booster
+ },
+ {
+ className: "function",
+ beginKeywords: "func",
+ end: "\\s*(\\{|$)",
+ excludeEnd: true,
+ contains: [
+ hljs.TITLE_MODE,
+ {
+ className: "params",
+ begin: /\(/,
+ end: /\)/,
+ endsParent: true,
+ keywords: KEYWORDS3,
+ illegal: /["']/
+ }
+ ]
+ }
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/javascript.js
+var IDENT_RE = "[A-Za-z$_][0-9A-Za-z$_]*";
+var KEYWORDS = [
+ "as",
+ // for exports
+ "in",
+ "of",
+ "if",
+ "for",
+ "while",
+ "finally",
+ "var",
+ "new",
+ "function",
+ "do",
+ "return",
+ "void",
+ "else",
+ "break",
+ "catch",
+ "instanceof",
+ "with",
+ "throw",
+ "case",
+ "default",
+ "try",
+ "switch",
+ "continue",
+ "typeof",
+ "delete",
+ "let",
+ "yield",
+ "const",
+ "class",
+ // JS handles these with a special rule
+ // "get",
+ // "set",
+ "debugger",
+ "async",
+ "await",
+ "static",
+ "import",
+ "from",
+ "export",
+ "extends",
+ // It's reached stage 3, which is "recommended for implementation":
+ "using"
+];
+var LITERALS = [
+ "true",
+ "false",
+ "null",
+ "undefined",
+ "NaN",
+ "Infinity"
+];
+var TYPES = [
+ // Fundamental objects
+ "Object",
+ "Function",
+ "Boolean",
+ "Symbol",
+ // numbers and dates
+ "Math",
+ "Date",
+ "Number",
+ "BigInt",
+ // text
+ "String",
+ "RegExp",
+ // Indexed collections
+ "Array",
+ "Float32Array",
+ "Float64Array",
+ "Int8Array",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Int16Array",
+ "Int32Array",
+ "Uint16Array",
+ "Uint32Array",
+ "BigInt64Array",
+ "BigUint64Array",
+ // Keyed collections
+ "Set",
+ "Map",
+ "WeakSet",
+ "WeakMap",
+ // Structured data
+ "ArrayBuffer",
+ "SharedArrayBuffer",
+ "Atomics",
+ "DataView",
+ "JSON",
+ // Control abstraction objects
+ "Promise",
+ "Generator",
+ "GeneratorFunction",
+ "AsyncFunction",
+ // Reflection
+ "Reflect",
+ "Proxy",
+ // Internationalization
+ "Intl",
+ // WebAssembly
+ "WebAssembly"
+];
+var ERROR_TYPES = [
+ "Error",
+ "EvalError",
+ "InternalError",
+ "RangeError",
+ "ReferenceError",
+ "SyntaxError",
+ "TypeError",
+ "URIError"
+];
+var BUILT_IN_GLOBALS = [
+ "setInterval",
+ "setTimeout",
+ "clearInterval",
+ "clearTimeout",
+ "require",
+ "exports",
+ "eval",
+ "isFinite",
+ "isNaN",
+ "parseFloat",
+ "parseInt",
+ "decodeURI",
+ "decodeURIComponent",
+ "encodeURI",
+ "encodeURIComponent",
+ "escape",
+ "unescape"
+];
+var BUILT_IN_VARIABLES = [
+ "arguments",
+ "this",
+ "super",
+ "console",
+ "window",
+ "document",
+ "localStorage",
+ "sessionStorage",
+ "module",
+ "global"
+ // Node.js
+];
+var BUILT_INS = [].concat(
+ BUILT_IN_GLOBALS,
+ TYPES,
+ ERROR_TYPES
+);
+function javascript(hljs) {
+ const regex = hljs.regex;
+ const hasClosingTag = (match, { after }) => {
+ const tag = "" + match[0].slice(1);
+ const pos = match.input.indexOf(tag, after);
+ return pos !== -1;
+ };
+ const IDENT_RE$1 = IDENT_RE;
+ const FRAGMENT = {
+ begin: "<>",
+ end: ">"
+ };
+ const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;
+ const XML_TAG = {
+ begin: /<[A-Za-z0-9\\._:-]+/,
+ end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
+ /**
+ * @param {RegExpMatchArray} match
+ * @param {CallbackResponse} response
+ */
+ isTrulyOpeningTag: (match, response) => {
+ const afterMatchIndex = match[0].length + match.index;
+ const nextChar = match.input[afterMatchIndex];
+ if (
+ // HTML should not include another raw `<` inside a tag
+ // nested type?
+ // `>`, etc.
+ nextChar === "<" || // the , gives away that this is not HTML
+ // ``
+ nextChar === ","
+ ) {
+ response.ignoreMatch();
+ return;
+ }
+ if (nextChar === ">") {
+ if (!hasClosingTag(match, { after: afterMatchIndex })) {
+ response.ignoreMatch();
+ }
+ }
+ let m;
+ const afterMatch = match.input.substring(afterMatchIndex);
+ if (m = afterMatch.match(/^\s*=/)) {
+ response.ignoreMatch();
+ return;
+ }
+ if (m = afterMatch.match(/^\s+extends\s+/)) {
+ if (m.index === 0) {
+ response.ignoreMatch();
+ return;
+ }
+ }
+ }
+ };
+ const KEYWORDS$1 = {
+ $pattern: IDENT_RE,
+ keyword: KEYWORDS,
+ literal: LITERALS,
+ built_in: BUILT_INS,
+ "variable.language": BUILT_IN_VARIABLES
+ };
+ const decimalDigits = "[0-9](_?[0-9])*";
+ const frac = `\\.(${decimalDigits})`;
+ const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;
+ const NUMBER = {
+ className: "number",
+ variants: [
+ // DecimalLiteral
+ { begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))[eE][+-]?(${decimalDigits})\\b` },
+ { begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },
+ // DecimalBigIntegerLiteral
+ { begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },
+ // NonDecimalIntegerLiteral
+ { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
+ { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
+ { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
+ // LegacyOctalIntegerLiteral (does not include underscore separators)
+ // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
+ { begin: "\\b0[0-7]+n?\\b" }
+ ],
+ relevance: 0
+ };
+ const SUBST = {
+ className: "subst",
+ begin: "\\$\\{",
+ end: "\\}",
+ keywords: KEYWORDS$1,
+ contains: []
+ // defined later
+ };
+ const HTML_TEMPLATE = {
+ begin: ".?html`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "xml"
+ }
+ };
+ const CSS_TEMPLATE = {
+ begin: ".?css`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "css"
+ }
+ };
+ const GRAPHQL_TEMPLATE = {
+ begin: ".?gql`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "graphql"
+ }
+ };
+ const TEMPLATE_STRING = {
+ className: "string",
+ begin: "`",
+ end: "`",
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ]
+ };
+ const JSDOC_COMMENT = hljs.COMMENT(
+ /\/\*\*(?!\/)/,
+ "\\*/",
+ {
+ relevance: 0,
+ contains: [
+ {
+ begin: "(?=@[A-Za-z]+)",
+ relevance: 0,
+ contains: [
+ {
+ className: "doctag",
+ begin: "@[A-Za-z]+"
+ },
+ {
+ className: "type",
+ begin: "\\{",
+ end: "\\}",
+ excludeEnd: true,
+ excludeBegin: true,
+ relevance: 0
+ },
+ {
+ className: "variable",
+ begin: IDENT_RE$1 + "(?=\\s*(-)|$)",
+ endsParent: true,
+ relevance: 0
+ },
+ // eat spaces (not newlines) so we can find
+ // types or variables
+ {
+ begin: /(?=[^\n])\s/,
+ relevance: 0
+ }
+ ]
+ }
+ ]
+ }
+ );
+ const COMMENT = {
+ className: "comment",
+ variants: [
+ JSDOC_COMMENT,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_LINE_COMMENT_MODE
+ ]
+ };
+ const SUBST_INTERNALS = [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ HTML_TEMPLATE,
+ CSS_TEMPLATE,
+ GRAPHQL_TEMPLATE,
+ TEMPLATE_STRING,
+ // Skip numbers when they are part of a variable name
+ { match: /\$\d+/ },
+ NUMBER
+ // This is intentional:
+ // See https://github.com/highlightjs/highlight.js/issues/3288
+ // hljs.REGEXP_MODE
+ ];
+ SUBST.contains = SUBST_INTERNALS.concat({
+ // we need to pair up {} inside our subst to prevent
+ // it from ending too early by matching another }
+ begin: /\{/,
+ end: /\}/,
+ keywords: KEYWORDS$1,
+ contains: [
+ "self"
+ ].concat(SUBST_INTERNALS)
+ });
+ const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);
+ const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([
+ // eat recursive parens in sub expressions
+ {
+ begin: /(\s*)\(/,
+ end: /\)/,
+ keywords: KEYWORDS$1,
+ contains: ["self"].concat(SUBST_AND_COMMENTS)
+ }
+ ]);
+ const PARAMS = {
+ className: "params",
+ // convert this to negative lookbehind in v12
+ begin: /(\s*)\(/,
+ // to match the parms with
+ end: /\)/,
+ excludeBegin: true,
+ excludeEnd: true,
+ keywords: KEYWORDS$1,
+ contains: PARAMS_CONTAINS
+ };
+ const CLASS_OR_EXTENDS = {
+ variants: [
+ // class Car extends vehicle
+ {
+ match: [
+ /class/,
+ /\s+/,
+ IDENT_RE$1,
+ /\s+/,
+ /extends/,
+ /\s+/,
+ regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.class",
+ 5: "keyword",
+ 7: "title.class.inherited"
+ }
+ },
+ // class Car
+ {
+ match: [
+ /class/,
+ /\s+/,
+ IDENT_RE$1
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.class"
+ }
+ }
+ ]
+ };
+ const CLASS_REFERENCE = {
+ relevance: 0,
+ match: regex.either(
+ // Hard coded exceptions
+ /\bJSON/,
+ // Float32Array, OutT
+ /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
+ // CSSFactory, CSSFactoryT
+ /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
+ // FPs, FPsT
+ /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
+ // P
+ // single letters are not highlighted
+ // BLAH
+ // this will be flagged as a UPPER_CASE_CONSTANT instead
+ ),
+ className: "title.class",
+ keywords: {
+ _: [
+ // se we still get relevance credit for JS library classes
+ ...TYPES,
+ ...ERROR_TYPES
+ ]
+ }
+ };
+ const USE_STRICT = {
+ label: "use_strict",
+ className: "meta",
+ relevance: 10,
+ begin: /^\s*['"]use (strict|asm)['"]/
+ };
+ const FUNCTION_DEFINITION = {
+ variants: [
+ {
+ match: [
+ /function/,
+ /\s+/,
+ IDENT_RE$1,
+ /(?=\s*\()/
+ ]
+ },
+ // anonymous function
+ {
+ match: [
+ /function/,
+ /\s*(?=\()/
+ ]
+ }
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ label: "func.def",
+ contains: [PARAMS],
+ illegal: /%/
+ };
+ const UPPER_CASE_CONSTANT = {
+ relevance: 0,
+ match: /\b[A-Z][A-Z_0-9]+\b/,
+ className: "variable.constant"
+ };
+ function noneOf(list) {
+ return regex.concat("(?!", list.join("|"), ")");
+ }
+ const FUNCTION_CALL = {
+ match: regex.concat(
+ /\b/,
+ noneOf([
+ ...BUILT_IN_GLOBALS,
+ "super",
+ "import"
+ ].map((x) => `${x}\\s*\\(`)),
+ IDENT_RE$1,
+ regex.lookahead(/\s*\(/)
+ ),
+ className: "title.function",
+ relevance: 0
+ };
+ const PROPERTY_ACCESS = {
+ begin: regex.concat(/\./, regex.lookahead(
+ regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)
+ )),
+ end: IDENT_RE$1,
+ excludeBegin: true,
+ keywords: "prototype",
+ className: "property",
+ relevance: 0
+ };
+ const GETTER_OR_SETTER = {
+ match: [
+ /get|set/,
+ /\s+/,
+ IDENT_RE$1,
+ /(?=\()/
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ contains: [
+ {
+ // eat to avoid empty params
+ begin: /\(\)/
+ },
+ PARAMS
+ ]
+ };
+ const FUNC_LEAD_IN_RE = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + hljs.UNDERSCORE_IDENT_RE + ")\\s*=>";
+ const FUNCTION_VARIABLE = {
+ match: [
+ /const|var|let/,
+ /\s+/,
+ IDENT_RE$1,
+ /\s*/,
+ /=\s*/,
+ /(async\s*)?/,
+ // async is optional
+ regex.lookahead(FUNC_LEAD_IN_RE)
+ ],
+ keywords: "async",
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ contains: [
+ PARAMS
+ ]
+ };
+ return {
+ name: "JavaScript",
+ aliases: ["js", "jsx", "mjs", "cjs"],
+ keywords: KEYWORDS$1,
+ // this will be extended by TypeScript
+ exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
+ illegal: /#(?![$_A-z])/,
+ contains: [
+ hljs.SHEBANG({
+ label: "shebang",
+ binary: "node",
+ relevance: 5
+ }),
+ USE_STRICT,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ HTML_TEMPLATE,
+ CSS_TEMPLATE,
+ GRAPHQL_TEMPLATE,
+ TEMPLATE_STRING,
+ COMMENT,
+ // Skip numbers when they are part of a variable name
+ { match: /\$\d+/ },
+ NUMBER,
+ CLASS_REFERENCE,
+ {
+ scope: "attr",
+ match: IDENT_RE$1 + regex.lookahead(":"),
+ relevance: 0
+ },
+ FUNCTION_VARIABLE,
+ {
+ // "value" container
+ begin: "(" + hljs.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
+ keywords: "return throw case",
+ relevance: 0,
+ contains: [
+ COMMENT,
+ hljs.REGEXP_MODE,
+ {
+ className: "function",
+ // we have to count the parens to make sure we actually have the
+ // correct bounding ( ) before the =>. There could be any number of
+ // sub-expressions inside also surrounded by parens.
+ begin: FUNC_LEAD_IN_RE,
+ returnBegin: true,
+ end: "\\s*=>",
+ contains: [
+ {
+ className: "params",
+ variants: [
+ {
+ begin: hljs.UNDERSCORE_IDENT_RE,
+ relevance: 0
+ },
+ {
+ className: null,
+ begin: /\(\s*\)/,
+ skip: true
+ },
+ {
+ begin: /(\s*)\(/,
+ end: /\)/,
+ excludeBegin: true,
+ excludeEnd: true,
+ keywords: KEYWORDS$1,
+ contains: PARAMS_CONTAINS
+ }
+ ]
+ }
+ ]
+ },
+ {
+ // could be a comma delimited list of params to a function call
+ begin: /,/,
+ relevance: 0
+ },
+ {
+ match: /\s+/,
+ relevance: 0
+ },
+ {
+ // JSX
+ variants: [
+ { begin: FRAGMENT.begin, end: FRAGMENT.end },
+ { match: XML_SELF_CLOSING },
+ {
+ begin: XML_TAG.begin,
+ // we carefully check the opening tag to see if it truly
+ // is a tag and not a false positive
+ "on:begin": XML_TAG.isTrulyOpeningTag,
+ end: XML_TAG.end
+ }
+ ],
+ subLanguage: "xml",
+ contains: [
+ {
+ begin: XML_TAG.begin,
+ end: XML_TAG.end,
+ skip: true,
+ contains: ["self"]
+ }
+ ]
+ }
+ ]
+ },
+ FUNCTION_DEFINITION,
+ {
+ // prevent this from getting swallowed up by function
+ // since they appear "function like"
+ beginKeywords: "while if switch catch for"
+ },
+ {
+ // we have to count the parens to make sure we actually have the correct
+ // bounding ( ). There could be any number of sub-expressions inside
+ // also surrounded by parens.
+ begin: "\\b(?!function)" + hljs.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
+ // end parens
+ returnBegin: true,
+ label: "func.def",
+ contains: [
+ PARAMS,
+ hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: "title.function" })
+ ]
+ },
+ // catch ... so it won't trigger the property rule below
+ {
+ match: /\.\.\./,
+ relevance: 0
+ },
+ PROPERTY_ACCESS,
+ // hack: prevents detection of keywords in some circumstances
+ // .keyword()
+ // $keyword = x
+ {
+ match: "\\$" + IDENT_RE$1,
+ relevance: 0
+ },
+ {
+ match: [/\bconstructor(?=\s*\()/],
+ className: { 1: "title.function" },
+ contains: [PARAMS]
+ },
+ FUNCTION_CALL,
+ UPPER_CASE_CONSTANT,
+ CLASS_OR_EXTENDS,
+ GETTER_OR_SETTER,
+ {
+ match: /\$[(.]/
+ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
+ }
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/json.js
+function json(hljs) {
+ const ATTRIBUTE = {
+ className: "attr",
+ begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
+ relevance: 1.01
+ };
+ const PUNCTUATION = {
+ match: /[{}[\],:]/,
+ className: "punctuation",
+ relevance: 0
+ };
+ const LITERALS3 = [
+ "true",
+ "false",
+ "null"
+ ];
+ const LITERALS_MODE = {
+ scope: "literal",
+ beginKeywords: LITERALS3.join(" ")
+ };
+ return {
+ name: "JSON",
+ aliases: ["jsonc"],
+ keywords: {
+ literal: LITERALS3
+ },
+ contains: [
+ ATTRIBUTE,
+ PUNCTUATION,
+ hljs.QUOTE_STRING_MODE,
+ LITERALS_MODE,
+ hljs.C_NUMBER_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE
+ ],
+ illegal: "\\S"
+ };
+}
+
+// node_modules/highlight.js/es/languages/markdown.js
+function markdown(hljs) {
+ const regex = hljs.regex;
+ const INLINE_HTML = {
+ begin: /<\/?[A-Za-z_]/,
+ end: ">",
+ subLanguage: "xml",
+ relevance: 0
+ };
+ const HORIZONTAL_RULE = {
+ begin: "^[-\\*]{3,}",
+ end: "$"
+ };
+ const CODE = {
+ className: "code",
+ variants: [
+ // TODO: fix to allow these to work with sublanguage also
+ { begin: "(`{3,})[^`](.|\\n)*?\\1`*[ ]*" },
+ { begin: "(~{3,})[^~](.|\\n)*?\\1~*[ ]*" },
+ // needed to allow markdown as a sublanguage to work
+ {
+ begin: "```",
+ end: "```+[ ]*$"
+ },
+ {
+ begin: "~~~",
+ end: "~~~+[ ]*$"
+ },
+ { begin: "`.+?`" },
+ {
+ begin: "(?=^( {4}|\\t))",
+ // use contains to gobble up multiple lines to allow the block to be whatever size
+ // but only have a single open/close tag vs one per line
+ contains: [
+ {
+ begin: "^( {4}|\\t)",
+ end: "(\\n)$"
+ }
+ ],
+ relevance: 0
+ }
+ ]
+ };
+ const LIST = {
+ className: "bullet",
+ begin: "^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",
+ end: "\\s+",
+ excludeEnd: true
+ };
+ const LINK_REFERENCE = {
+ begin: /^\[[^\n]+\]:/,
+ returnBegin: true,
+ contains: [
+ {
+ className: "symbol",
+ begin: /\[/,
+ end: /\]/,
+ excludeBegin: true,
+ excludeEnd: true
+ },
+ {
+ className: "link",
+ begin: /:\s*/,
+ end: /$/,
+ excludeBegin: true
+ }
+ ]
+ };
+ const URL_SCHEME = /[A-Za-z][A-Za-z0-9+.-]*/;
+ const LINK = {
+ variants: [
+ // too much like nested array access in so many languages
+ // to have any real relevance
+ {
+ begin: /\[.+?\]\[.*?\]/,
+ relevance: 0
+ },
+ // popular internet URLs
+ {
+ begin: /\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
+ relevance: 2
+ },
+ {
+ begin: regex.concat(/\[.+?\]\(/, URL_SCHEME, /:\/\/.*?\)/),
+ relevance: 2
+ },
+ // relative urls
+ {
+ begin: /\[.+?\]\([./?].*?\)/,
+ relevance: 1
+ },
+ // whatever else, lower relevance (might not be a link at all)
+ {
+ begin: /\[.*?\]\(.*?\)/,
+ relevance: 0
+ }
+ ],
+ returnBegin: true,
+ contains: [
+ {
+ // empty strings for alt or link text
+ match: /\[(?=\])/
+ },
+ {
+ className: "string",
+ relevance: 0,
+ begin: "\\[",
+ end: "\\]",
+ excludeBegin: true,
+ returnEnd: true
+ },
+ {
+ className: "link",
+ relevance: 0,
+ begin: "\\]\\(",
+ end: "\\)",
+ excludeBegin: true,
+ excludeEnd: true
+ },
+ {
+ className: "symbol",
+ relevance: 0,
+ begin: "\\]\\[",
+ end: "\\]",
+ excludeBegin: true,
+ excludeEnd: true
+ }
+ ]
+ };
+ const BOLD = {
+ className: "strong",
+ contains: [],
+ // defined later
+ variants: [
+ {
+ begin: /_{2}(?!\s)/,
+ end: /_{2}/
+ },
+ {
+ begin: /\*{2}(?!\s)/,
+ end: /\*{2}/
+ }
+ ]
+ };
+ const ITALIC = {
+ className: "emphasis",
+ contains: [],
+ // defined later
+ variants: [
+ {
+ begin: /\*(?![*\s])/,
+ end: /\*/
+ },
+ {
+ begin: /_(?![_\s])/,
+ end: /_/,
+ relevance: 0
+ }
+ ]
+ };
+ const BOLD_WITHOUT_ITALIC = hljs.inherit(BOLD, { contains: [] });
+ const ITALIC_WITHOUT_BOLD = hljs.inherit(ITALIC, { contains: [] });
+ BOLD.contains.push(ITALIC_WITHOUT_BOLD);
+ ITALIC.contains.push(BOLD_WITHOUT_ITALIC);
+ let CONTAINABLE = [
+ INLINE_HTML,
+ LINK
+ ];
+ [
+ BOLD,
+ ITALIC,
+ BOLD_WITHOUT_ITALIC,
+ ITALIC_WITHOUT_BOLD
+ ].forEach((m) => {
+ m.contains = m.contains.concat(CONTAINABLE);
+ });
+ CONTAINABLE = CONTAINABLE.concat(BOLD, ITALIC);
+ const HEADER = {
+ className: "section",
+ variants: [
+ {
+ begin: "^#{1,6}",
+ end: "$",
+ contains: CONTAINABLE
+ },
+ {
+ begin: "(?=^.+?\\n[=-]{2,}$)",
+ contains: [
+ { begin: "^[=-]*$" },
+ {
+ begin: "^",
+ end: "\\n",
+ contains: CONTAINABLE
+ }
+ ]
+ }
+ ]
+ };
+ const BLOCKQUOTE = {
+ className: "quote",
+ begin: "^>\\s+",
+ contains: CONTAINABLE,
+ end: "$"
+ };
+ const ENTITY = {
+ //https://spec.commonmark.org/0.31.2/#entity-references
+ scope: "literal",
+ match: /&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/
+ };
+ return {
+ name: "Markdown",
+ aliases: [
+ "md",
+ "mkdown",
+ "mkd"
+ ],
+ contains: [
+ HEADER,
+ INLINE_HTML,
+ LIST,
+ BOLD,
+ ITALIC,
+ BLOCKQUOTE,
+ CODE,
+ HORIZONTAL_RULE,
+ LINK,
+ LINK_REFERENCE,
+ ENTITY
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/python.js
+function python(hljs) {
+ const regex = hljs.regex;
+ const IDENT_RE3 = /[\p{XID_Start}_]\p{XID_Continue}*/u;
+ const RESERVED_WORDS = [
+ "and",
+ "as",
+ "assert",
+ "async",
+ "await",
+ "break",
+ "case",
+ "class",
+ "continue",
+ "def",
+ "del",
+ "elif",
+ "else",
+ "except",
+ "finally",
+ "for",
+ "from",
+ "global",
+ "if",
+ "import",
+ "in",
+ "is",
+ "lambda",
+ "match",
+ "nonlocal|10",
+ "not",
+ "or",
+ "pass",
+ "raise",
+ "return",
+ "try",
+ "while",
+ "with",
+ "yield"
+ ];
+ const BUILT_INS3 = [
+ "__import__",
+ "abs",
+ "all",
+ "any",
+ "ascii",
+ "bin",
+ "bool",
+ "breakpoint",
+ "bytearray",
+ "bytes",
+ "callable",
+ "chr",
+ "classmethod",
+ "compile",
+ "complex",
+ "delattr",
+ "dict",
+ "dir",
+ "divmod",
+ "enumerate",
+ "eval",
+ "exec",
+ "filter",
+ "float",
+ "format",
+ "frozenset",
+ "getattr",
+ "globals",
+ "hasattr",
+ "hash",
+ "help",
+ "hex",
+ "id",
+ "input",
+ "int",
+ "isinstance",
+ "issubclass",
+ "iter",
+ "len",
+ "list",
+ "locals",
+ "map",
+ "max",
+ "memoryview",
+ "min",
+ "next",
+ "object",
+ "oct",
+ "open",
+ "ord",
+ "pow",
+ "print",
+ "property",
+ "range",
+ "repr",
+ "reversed",
+ "round",
+ "set",
+ "setattr",
+ "slice",
+ "sorted",
+ "staticmethod",
+ "str",
+ "sum",
+ "super",
+ "tuple",
+ "type",
+ "vars",
+ "zip"
+ ];
+ const LITERALS3 = [
+ "__debug__",
+ "Ellipsis",
+ "False",
+ "None",
+ "NotImplemented",
+ "True"
+ ];
+ const TYPES3 = [
+ "Any",
+ "Callable",
+ "Coroutine",
+ "Dict",
+ "List",
+ "Literal",
+ "Generic",
+ "Optional",
+ "Sequence",
+ "Set",
+ "Tuple",
+ "Type",
+ "Union"
+ ];
+ const KEYWORDS3 = {
+ $pattern: /[A-Za-z]\w+|__\w+__/,
+ keyword: RESERVED_WORDS,
+ built_in: BUILT_INS3,
+ literal: LITERALS3,
+ type: TYPES3
+ };
+ const PROMPT = {
+ className: "meta",
+ begin: /^(>>>|\.\.\.) /
+ };
+ const SUBST = {
+ className: "subst",
+ begin: /\{/,
+ end: /\}/,
+ keywords: KEYWORDS3,
+ illegal: /#/
+ };
+ const LITERAL_BRACKET = {
+ begin: /\{\{/,
+ relevance: 0
+ };
+ const STRING = {
+ className: "string",
+ contains: [hljs.BACKSLASH_ESCAPE],
+ variants: [
+ {
+ begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
+ end: /'''/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ PROMPT
+ ],
+ relevance: 10
+ },
+ {
+ begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
+ end: /"""/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ PROMPT
+ ],
+ relevance: 10
+ },
+ {
+ begin: /([fF][rR]|[rR][fF]|[fF])'''/,
+ end: /'''/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ PROMPT,
+ LITERAL_BRACKET,
+ SUBST
+ ]
+ },
+ {
+ begin: /([fF][rR]|[rR][fF]|[fF])"""/,
+ end: /"""/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ PROMPT,
+ LITERAL_BRACKET,
+ SUBST
+ ]
+ },
+ {
+ begin: /([uU]|[rR])'/,
+ end: /'/,
+ relevance: 10
+ },
+ {
+ begin: /([uU]|[rR])"/,
+ end: /"/,
+ relevance: 10
+ },
+ {
+ begin: /([bB]|[bB][rR]|[rR][bB])'/,
+ end: /'/
+ },
+ {
+ begin: /([bB]|[bB][rR]|[rR][bB])"/,
+ end: /"/
+ },
+ {
+ begin: /([fF][rR]|[rR][fF]|[fF])'/,
+ end: /'/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ LITERAL_BRACKET,
+ SUBST
+ ]
+ },
+ {
+ begin: /([fF][rR]|[rR][fF]|[fF])"/,
+ end: /"/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ LITERAL_BRACKET,
+ SUBST
+ ]
+ },
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE
+ ]
+ };
+ const digitpart = "[0-9](_?[0-9])*";
+ const pointfloat = `(\\b(${digitpart}))?\\.(${digitpart})|\\b(${digitpart})\\.`;
+ const lookahead = `\\b|${RESERVED_WORDS.join("|")}`;
+ const NUMBER = {
+ className: "number",
+ relevance: 0,
+ variants: [
+ // exponentfloat, pointfloat
+ // https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals
+ // optionally imaginary
+ // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
+ // Note: no leading \b because floats can start with a decimal point
+ // and we don't want to mishandle e.g. `fn(.5)`,
+ // no trailing \b for pointfloat because it can end with a decimal point
+ // and we don't want to mishandle e.g. `0..hex()`; this should be safe
+ // because both MUST contain a decimal point and so cannot be confused with
+ // the interior part of an identifier
+ {
+ begin: `(\\b(${digitpart})|(${pointfloat}))[eE][+-]?(${digitpart})[jJ]?(?=${lookahead})`
+ },
+ {
+ begin: `(${pointfloat})[jJ]?`
+ },
+ // decinteger, bininteger, octinteger, hexinteger
+ // https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
+ // optionally "long" in Python 2
+ // https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals
+ // decinteger is optionally imaginary
+ // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
+ {
+ begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${lookahead})`
+ },
+ {
+ begin: `\\b0[bB](_?[01])+[lL]?(?=${lookahead})`
+ },
+ {
+ begin: `\\b0[oO](_?[0-7])+[lL]?(?=${lookahead})`
+ },
+ {
+ begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${lookahead})`
+ },
+ // imagnumber (digitpart-based)
+ // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
+ {
+ begin: `\\b(${digitpart})[jJ](?=${lookahead})`
+ }
+ ]
+ };
+ const COMMENT_TYPE = {
+ className: "comment",
+ begin: regex.lookahead(/# type:/),
+ end: /$/,
+ keywords: KEYWORDS3,
+ contains: [
+ {
+ // prevent keywords from coloring `type`
+ begin: /# type:/
+ },
+ // comment within a datatype comment includes no keywords
+ {
+ begin: /#/,
+ end: /\b\B/,
+ endsWithParent: true
+ }
+ ]
+ };
+ const PARAMS = {
+ className: "params",
+ variants: [
+ // Exclude params in functions without params
+ {
+ className: "",
+ begin: /\(\s*\)/,
+ skip: true
+ },
+ {
+ begin: /\(/,
+ end: /\)/,
+ excludeBegin: true,
+ excludeEnd: true,
+ keywords: KEYWORDS3,
+ contains: [
+ "self",
+ PROMPT,
+ NUMBER,
+ STRING,
+ hljs.HASH_COMMENT_MODE
+ ]
+ }
+ ]
+ };
+ SUBST.contains = [
+ STRING,
+ NUMBER,
+ PROMPT
+ ];
+ return {
+ name: "Python",
+ aliases: [
+ "py",
+ "gyp",
+ "ipython"
+ ],
+ unicodeRegex: true,
+ keywords: KEYWORDS3,
+ illegal: /(<\/|\?)|=>/,
+ contains: [
+ PROMPT,
+ NUMBER,
+ {
+ // very common convention
+ scope: "variable.language",
+ match: /\bself\b/
+ },
+ {
+ // eat "if" prior to string so that it won't accidentally be
+ // labeled as an f-string
+ beginKeywords: "if",
+ relevance: 0
+ },
+ { match: /\bor\b/, scope: "keyword" },
+ STRING,
+ COMMENT_TYPE,
+ hljs.HASH_COMMENT_MODE,
+ {
+ match: [
+ /\bdef/,
+ /\s+/,
+ IDENT_RE3
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ contains: [PARAMS]
+ },
+ {
+ variants: [
+ {
+ match: [
+ /\bclass/,
+ /\s+/,
+ IDENT_RE3,
+ /\s*/,
+ /\(\s*/,
+ IDENT_RE3,
+ /\s*\)/
+ ]
+ },
+ {
+ match: [
+ /\bclass/,
+ /\s+/,
+ IDENT_RE3
+ ]
+ }
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.class",
+ 6: "title.class.inherited"
+ }
+ },
+ {
+ className: "meta",
+ begin: /^[\t ]*@/,
+ end: /(?=#)|$/,
+ contains: [
+ NUMBER,
+ PARAMS,
+ STRING
+ ]
+ }
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/rust.js
+function rust(hljs) {
+ const regex = hljs.regex;
+ const RAW_IDENTIFIER = /(r#)?/;
+ const UNDERSCORE_IDENT_RE = regex.concat(RAW_IDENTIFIER, hljs.UNDERSCORE_IDENT_RE);
+ const IDENT_RE3 = regex.concat(RAW_IDENTIFIER, hljs.IDENT_RE);
+ const FUNCTION_INVOKE = {
+ className: "title.function.invoke",
+ relevance: 0,
+ begin: regex.concat(
+ /\b/,
+ /(?!let|for|while|if|else|match\b)/,
+ IDENT_RE3,
+ regex.lookahead(/\s*\(/)
+ )
+ };
+ const NUMBER_SUFFIX = "([ui](8|16|32|64|128|size)|f(32|64))?";
+ const KEYWORDS3 = [
+ "abstract",
+ "as",
+ "async",
+ "await",
+ "become",
+ "box",
+ "break",
+ "const",
+ "continue",
+ "crate",
+ "do",
+ "dyn",
+ "else",
+ "enum",
+ "extern",
+ "false",
+ "final",
+ "fn",
+ "for",
+ "if",
+ "impl",
+ "in",
+ "let",
+ "loop",
+ "macro",
+ "match",
+ "mod",
+ "move",
+ "mut",
+ "override",
+ "priv",
+ "pub",
+ "ref",
+ "return",
+ "self",
+ "Self",
+ "static",
+ "struct",
+ "super",
+ "trait",
+ "true",
+ "try",
+ "type",
+ "typeof",
+ "union",
+ "unsafe",
+ "unsized",
+ "use",
+ "virtual",
+ "where",
+ "while",
+ "yield"
+ ];
+ const LITERALS3 = [
+ "true",
+ "false",
+ "Some",
+ "None",
+ "Ok",
+ "Err"
+ ];
+ const BUILTINS = [
+ // functions
+ "drop ",
+ // traits
+ "Copy",
+ "Send",
+ "Sized",
+ "Sync",
+ "Drop",
+ "Fn",
+ "FnMut",
+ "FnOnce",
+ "ToOwned",
+ "Clone",
+ "Debug",
+ "PartialEq",
+ "PartialOrd",
+ "Eq",
+ "Ord",
+ "AsRef",
+ "AsMut",
+ "Into",
+ "From",
+ "Default",
+ "Iterator",
+ "Extend",
+ "IntoIterator",
+ "DoubleEndedIterator",
+ "ExactSizeIterator",
+ "SliceConcatExt",
+ "ToString",
+ // macros
+ "assert!",
+ "assert_eq!",
+ "bitflags!",
+ "bytes!",
+ "cfg!",
+ "col!",
+ "concat!",
+ "concat_idents!",
+ "debug_assert!",
+ "debug_assert_eq!",
+ "env!",
+ "eprintln!",
+ "panic!",
+ "file!",
+ "format!",
+ "format_args!",
+ "include_bytes!",
+ "include_str!",
+ "line!",
+ "local_data_key!",
+ "module_path!",
+ "option_env!",
+ "print!",
+ "println!",
+ "select!",
+ "stringify!",
+ "try!",
+ "unimplemented!",
+ "unreachable!",
+ "vec!",
+ "write!",
+ "writeln!",
+ "macro_rules!",
+ "assert_ne!",
+ "debug_assert_ne!"
+ ];
+ const TYPES3 = [
+ "i8",
+ "i16",
+ "i32",
+ "i64",
+ "i128",
+ "isize",
+ "u8",
+ "u16",
+ "u32",
+ "u64",
+ "u128",
+ "usize",
+ "f32",
+ "f64",
+ "str",
+ "char",
+ "bool",
+ "Box",
+ "Option",
+ "Result",
+ "String",
+ "Vec"
+ ];
+ return {
+ name: "Rust",
+ aliases: ["rs"],
+ keywords: {
+ $pattern: hljs.IDENT_RE + "!?",
+ type: TYPES3,
+ keyword: KEYWORDS3,
+ literal: LITERALS3,
+ built_in: BUILTINS
+ },
+ illegal: "",
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.COMMENT("/\\*", "\\*/", { contains: ["self"] }),
+ hljs.inherit(hljs.QUOTE_STRING_MODE, {
+ begin: /b?"/,
+ illegal: null
+ }),
+ {
+ className: "symbol",
+ // negative lookahead to avoid matching `'`
+ begin: /'[a-zA-Z_][a-zA-Z0-9_]*(?!')/
+ },
+ {
+ scope: "string",
+ variants: [
+ { begin: /b?r(#*)"(.|\n)*?"\1(?!#)/ },
+ {
+ begin: /b?'/,
+ end: /'/,
+ contains: [
+ {
+ scope: "char.escape",
+ match: /\\('|\w|x\w{2}|u\w{4}|U\w{8})/
+ }
+ ]
+ }
+ ]
+ },
+ {
+ className: "number",
+ variants: [
+ { begin: "\\b0b([01_]+)" + NUMBER_SUFFIX },
+ { begin: "\\b0o([0-7_]+)" + NUMBER_SUFFIX },
+ { begin: "\\b0x([A-Fa-f0-9_]+)" + NUMBER_SUFFIX },
+ { begin: "\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)" + NUMBER_SUFFIX }
+ ],
+ relevance: 0
+ },
+ {
+ begin: [
+ /fn/,
+ /\s+/,
+ UNDERSCORE_IDENT_RE
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ }
+ },
+ {
+ className: "meta",
+ begin: "#!?\\[",
+ end: "\\]",
+ contains: [
+ {
+ className: "string",
+ begin: /"/,
+ end: /"/,
+ contains: [
+ hljs.BACKSLASH_ESCAPE
+ ]
+ }
+ ]
+ },
+ {
+ begin: [
+ /let/,
+ /\s+/,
+ /(?:mut\s+)?/,
+ UNDERSCORE_IDENT_RE
+ ],
+ className: {
+ 1: "keyword",
+ 3: "keyword",
+ 4: "variable"
+ }
+ },
+ // must come before impl/for rule later
+ {
+ begin: [
+ /for/,
+ /\s+/,
+ UNDERSCORE_IDENT_RE,
+ /\s+/,
+ /in/
+ ],
+ className: {
+ 1: "keyword",
+ 3: "variable",
+ 5: "keyword"
+ }
+ },
+ {
+ begin: [
+ /type/,
+ /\s+/,
+ UNDERSCORE_IDENT_RE
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.class"
+ }
+ },
+ {
+ begin: [
+ /(?:trait|enum|struct|union|impl|for)/,
+ /\s+/,
+ UNDERSCORE_IDENT_RE
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.class"
+ }
+ },
+ {
+ begin: hljs.IDENT_RE + "::",
+ keywords: {
+ keyword: "Self",
+ built_in: BUILTINS,
+ type: TYPES3
+ }
+ },
+ {
+ className: "punctuation",
+ begin: "->"
+ },
+ FUNCTION_INVOKE
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/shell.js
+function shell(hljs) {
+ return {
+ name: "Shell Session",
+ aliases: [
+ "console",
+ "shellsession"
+ ],
+ contains: [
+ {
+ className: "meta.prompt",
+ // We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
+ // For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
+ // echo /path/to/home > t.exe
+ begin: /^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,
+ starts: {
+ end: /[^\\](?=\s*$)/,
+ subLanguage: "bash"
+ }
+ }
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/sql.js
+function sql(hljs) {
+ const regex = hljs.regex;
+ const COMMENT_MODE = hljs.COMMENT("--", "$");
+ const STRING = {
+ scope: "string",
+ variants: [
+ {
+ begin: /'/,
+ end: /'/,
+ contains: [{ match: /''/ }]
+ }
+ ]
+ };
+ const QUOTED_IDENTIFIER = {
+ begin: /"/,
+ end: /"/,
+ contains: [{ match: /""/ }]
+ };
+ const LITERALS3 = [
+ "true",
+ "false",
+ // Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.
+ // "null",
+ "unknown"
+ ];
+ const MULTI_WORD_TYPES = [
+ "double precision",
+ "large object",
+ "with timezone",
+ "without timezone"
+ ];
+ const TYPES3 = [
+ "bigint",
+ "binary",
+ "blob",
+ "boolean",
+ "char",
+ "character",
+ "clob",
+ "date",
+ "dec",
+ "decfloat",
+ "decimal",
+ "float",
+ "int",
+ "integer",
+ "interval",
+ "nchar",
+ "nclob",
+ "national",
+ "numeric",
+ "real",
+ "row",
+ "smallint",
+ "time",
+ "timestamp",
+ "varchar",
+ "varying",
+ // modifier (character varying)
+ "varbinary"
+ ];
+ const NON_RESERVED_WORDS = [
+ "add",
+ "asc",
+ "collation",
+ "desc",
+ "final",
+ "first",
+ "last",
+ "view"
+ ];
+ const RESERVED_WORDS = [
+ "abs",
+ "acos",
+ "all",
+ "allocate",
+ "alter",
+ "and",
+ "any",
+ "are",
+ "array",
+ "array_agg",
+ "array_max_cardinality",
+ "as",
+ "asensitive",
+ "asin",
+ "asymmetric",
+ "at",
+ "atan",
+ "atomic",
+ "authorization",
+ "avg",
+ "begin",
+ "begin_frame",
+ "begin_partition",
+ "between",
+ "bigint",
+ "binary",
+ "blob",
+ "boolean",
+ "both",
+ "by",
+ "call",
+ "called",
+ "cardinality",
+ "cascaded",
+ "case",
+ "cast",
+ "ceil",
+ "ceiling",
+ "char",
+ "char_length",
+ "character",
+ "character_length",
+ "check",
+ "classifier",
+ "clob",
+ "close",
+ "coalesce",
+ "collate",
+ "collect",
+ "column",
+ "commit",
+ "condition",
+ "connect",
+ "constraint",
+ "contains",
+ "convert",
+ "copy",
+ "corr",
+ "corresponding",
+ "cos",
+ "cosh",
+ "count",
+ "covar_pop",
+ "covar_samp",
+ "create",
+ "cross",
+ "cube",
+ "cume_dist",
+ "current",
+ "current_catalog",
+ "current_date",
+ "current_default_transform_group",
+ "current_path",
+ "current_role",
+ "current_row",
+ "current_schema",
+ "current_time",
+ "current_timestamp",
+ "current_path",
+ "current_role",
+ "current_transform_group_for_type",
+ "current_user",
+ "cursor",
+ "cycle",
+ "date",
+ "day",
+ "deallocate",
+ "dec",
+ "decimal",
+ "decfloat",
+ "declare",
+ "default",
+ "define",
+ "delete",
+ "dense_rank",
+ "deref",
+ "describe",
+ "deterministic",
+ "disconnect",
+ "distinct",
+ "double",
+ "drop",
+ "dynamic",
+ "each",
+ "element",
+ "else",
+ "empty",
+ "end",
+ "end_frame",
+ "end_partition",
+ "end-exec",
+ "equals",
+ "escape",
+ "every",
+ "except",
+ "exec",
+ "execute",
+ "exists",
+ "exp",
+ "external",
+ "extract",
+ "false",
+ "fetch",
+ "filter",
+ "first_value",
+ "float",
+ "floor",
+ "for",
+ "foreign",
+ "frame_row",
+ "free",
+ "from",
+ "full",
+ "function",
+ "fusion",
+ "get",
+ "global",
+ "grant",
+ "group",
+ "grouping",
+ "groups",
+ "having",
+ "hold",
+ "hour",
+ "identity",
+ "in",
+ "indicator",
+ "initial",
+ "inner",
+ "inout",
+ "insensitive",
+ "insert",
+ "int",
+ "integer",
+ "intersect",
+ "intersection",
+ "interval",
+ "into",
+ "is",
+ "join",
+ "json_array",
+ "json_arrayagg",
+ "json_exists",
+ "json_object",
+ "json_objectagg",
+ "json_query",
+ "json_table",
+ "json_table_primitive",
+ "json_value",
+ "lag",
+ "language",
+ "large",
+ "last_value",
+ "lateral",
+ "lead",
+ "leading",
+ "left",
+ "like",
+ "like_regex",
+ "listagg",
+ "ln",
+ "local",
+ "localtime",
+ "localtimestamp",
+ "log",
+ "log10",
+ "lower",
+ "match",
+ "match_number",
+ "match_recognize",
+ "matches",
+ "max",
+ "member",
+ "merge",
+ "method",
+ "min",
+ "minute",
+ "mod",
+ "modifies",
+ "module",
+ "month",
+ "multiset",
+ "national",
+ "natural",
+ "nchar",
+ "nclob",
+ "new",
+ "no",
+ "none",
+ "normalize",
+ "not",
+ "nth_value",
+ "ntile",
+ "null",
+ "nullif",
+ "numeric",
+ "octet_length",
+ "occurrences_regex",
+ "of",
+ "offset",
+ "old",
+ "omit",
+ "on",
+ "one",
+ "only",
+ "open",
+ "or",
+ "order",
+ "out",
+ "outer",
+ "over",
+ "overlaps",
+ "overlay",
+ "parameter",
+ "partition",
+ "pattern",
+ "per",
+ "percent",
+ "percent_rank",
+ "percentile_cont",
+ "percentile_disc",
+ "period",
+ "portion",
+ "position",
+ "position_regex",
+ "power",
+ "precedes",
+ "precision",
+ "prepare",
+ "primary",
+ "procedure",
+ "ptf",
+ "range",
+ "rank",
+ "reads",
+ "real",
+ "recursive",
+ "ref",
+ "references",
+ "referencing",
+ "regr_avgx",
+ "regr_avgy",
+ "regr_count",
+ "regr_intercept",
+ "regr_r2",
+ "regr_slope",
+ "regr_sxx",
+ "regr_sxy",
+ "regr_syy",
+ "release",
+ "result",
+ "return",
+ "returns",
+ "revoke",
+ "right",
+ "rollback",
+ "rollup",
+ "row",
+ "row_number",
+ "rows",
+ "running",
+ "savepoint",
+ "scope",
+ "scroll",
+ "search",
+ "second",
+ "seek",
+ "select",
+ "sensitive",
+ "session_user",
+ "set",
+ "show",
+ "similar",
+ "sin",
+ "sinh",
+ "skip",
+ "smallint",
+ "some",
+ "specific",
+ "specifictype",
+ "sql",
+ "sqlexception",
+ "sqlstate",
+ "sqlwarning",
+ "sqrt",
+ "start",
+ "static",
+ "stddev_pop",
+ "stddev_samp",
+ "submultiset",
+ "subset",
+ "substring",
+ "substring_regex",
+ "succeeds",
+ "sum",
+ "symmetric",
+ "system",
+ "system_time",
+ "system_user",
+ "table",
+ "tablesample",
+ "tan",
+ "tanh",
+ "then",
+ "time",
+ "timestamp",
+ "timezone_hour",
+ "timezone_minute",
+ "to",
+ "trailing",
+ "translate",
+ "translate_regex",
+ "translation",
+ "treat",
+ "trigger",
+ "trim",
+ "trim_array",
+ "true",
+ "truncate",
+ "uescape",
+ "union",
+ "unique",
+ "unknown",
+ "unnest",
+ "update",
+ "upper",
+ "user",
+ "using",
+ "value",
+ "values",
+ "value_of",
+ "var_pop",
+ "var_samp",
+ "varbinary",
+ "varchar",
+ "varying",
+ "versioning",
+ "when",
+ "whenever",
+ "where",
+ "width_bucket",
+ "window",
+ "with",
+ "within",
+ "without",
+ "year"
+ ];
+ const RESERVED_FUNCTIONS = [
+ "abs",
+ "acos",
+ "array_agg",
+ "asin",
+ "atan",
+ "avg",
+ "cast",
+ "ceil",
+ "ceiling",
+ "coalesce",
+ "corr",
+ "cos",
+ "cosh",
+ "count",
+ "covar_pop",
+ "covar_samp",
+ "cume_dist",
+ "dense_rank",
+ "deref",
+ "element",
+ "exp",
+ "extract",
+ "first_value",
+ "floor",
+ "json_array",
+ "json_arrayagg",
+ "json_exists",
+ "json_object",
+ "json_objectagg",
+ "json_query",
+ "json_table",
+ "json_table_primitive",
+ "json_value",
+ "lag",
+ "last_value",
+ "lead",
+ "listagg",
+ "ln",
+ "log",
+ "log10",
+ "lower",
+ "max",
+ "min",
+ "mod",
+ "nth_value",
+ "ntile",
+ "nullif",
+ "percent_rank",
+ "percentile_cont",
+ "percentile_disc",
+ "position",
+ "position_regex",
+ "power",
+ "rank",
+ "regr_avgx",
+ "regr_avgy",
+ "regr_count",
+ "regr_intercept",
+ "regr_r2",
+ "regr_slope",
+ "regr_sxx",
+ "regr_sxy",
+ "regr_syy",
+ "row_number",
+ "sin",
+ "sinh",
+ "sqrt",
+ "stddev_pop",
+ "stddev_samp",
+ "substring",
+ "substring_regex",
+ "sum",
+ "tan",
+ "tanh",
+ "translate",
+ "translate_regex",
+ "treat",
+ "trim",
+ "trim_array",
+ "unnest",
+ "upper",
+ "value_of",
+ "var_pop",
+ "var_samp",
+ "width_bucket"
+ ];
+ const POSSIBLE_WITHOUT_PARENS = [
+ "current_catalog",
+ "current_date",
+ "current_default_transform_group",
+ "current_path",
+ "current_role",
+ "current_schema",
+ "current_transform_group_for_type",
+ "current_user",
+ "session_user",
+ "system_time",
+ "system_user",
+ "current_time",
+ "localtime",
+ "current_timestamp",
+ "localtimestamp"
+ ];
+ const COMBOS = [
+ "create table",
+ "insert into",
+ "primary key",
+ "foreign key",
+ "not null",
+ "alter table",
+ "add constraint",
+ "grouping sets",
+ "on overflow",
+ "character set",
+ "respect nulls",
+ "ignore nulls",
+ "nulls first",
+ "nulls last",
+ "depth first",
+ "breadth first"
+ ];
+ const FUNCTIONS = RESERVED_FUNCTIONS;
+ const KEYWORDS3 = [
+ ...RESERVED_WORDS,
+ ...NON_RESERVED_WORDS
+ ].filter((keyword) => {
+ return !RESERVED_FUNCTIONS.includes(keyword);
+ });
+ const VARIABLE = {
+ scope: "variable",
+ match: /@[a-z0-9][a-z0-9_]*/
+ };
+ const OPERATOR = {
+ scope: "operator",
+ match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
+ relevance: 0
+ };
+ const FUNCTION_CALL = {
+ match: regex.concat(/\b/, regex.either(...FUNCTIONS), /\s*\(/),
+ relevance: 0,
+ keywords: { built_in: FUNCTIONS }
+ };
+ function kws_to_regex(list) {
+ return regex.concat(
+ /\b/,
+ regex.either(...list.map((kw) => {
+ return kw.replace(/\s+/, "\\s+");
+ })),
+ /\b/
+ );
+ }
+ const MULTI_WORD_KEYWORDS = {
+ scope: "keyword",
+ match: kws_to_regex(COMBOS),
+ relevance: 0
+ };
+ function reduceRelevancy(list, {
+ exceptions,
+ when
+ } = {}) {
+ const qualifyFn = when;
+ exceptions = exceptions || [];
+ return list.map((item) => {
+ if (item.match(/\|\d+$/) || exceptions.includes(item)) {
+ return item;
+ } else if (qualifyFn(item)) {
+ return `${item}|0`;
+ } else {
+ return item;
+ }
+ });
+ }
+ return {
+ name: "SQL",
+ case_insensitive: true,
+ // does not include {} or HTML tags ``
+ illegal: /[{}]|<\//,
+ keywords: {
+ $pattern: /\b[\w\.]+/,
+ keyword: reduceRelevancy(KEYWORDS3, { when: (x) => x.length < 3 }),
+ literal: LITERALS3,
+ type: TYPES3,
+ built_in: POSSIBLE_WITHOUT_PARENS
+ },
+ contains: [
+ {
+ scope: "type",
+ match: kws_to_regex(MULTI_WORD_TYPES)
+ },
+ MULTI_WORD_KEYWORDS,
+ FUNCTION_CALL,
+ VARIABLE,
+ STRING,
+ QUOTED_IDENTIFIER,
+ hljs.C_NUMBER_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ COMMENT_MODE,
+ OPERATOR
+ ]
+ };
+}
+
+// node_modules/highlight.js/es/languages/typescript.js
+var IDENT_RE2 = "[A-Za-z$_][0-9A-Za-z$_]*";
+var KEYWORDS2 = [
+ "as",
+ // for exports
+ "in",
+ "of",
+ "if",
+ "for",
+ "while",
+ "finally",
+ "var",
+ "new",
+ "function",
+ "do",
+ "return",
+ "void",
+ "else",
+ "break",
+ "catch",
+ "instanceof",
+ "with",
+ "throw",
+ "case",
+ "default",
+ "try",
+ "switch",
+ "continue",
+ "typeof",
+ "delete",
+ "let",
+ "yield",
+ "const",
+ "class",
+ // JS handles these with a special rule
+ // "get",
+ // "set",
+ "debugger",
+ "async",
+ "await",
+ "static",
+ "import",
+ "from",
+ "export",
+ "extends",
+ // It's reached stage 3, which is "recommended for implementation":
+ "using"
+];
+var LITERALS2 = [
+ "true",
+ "false",
+ "null",
+ "undefined",
+ "NaN",
+ "Infinity"
+];
+var TYPES2 = [
+ // Fundamental objects
+ "Object",
+ "Function",
+ "Boolean",
+ "Symbol",
+ // numbers and dates
+ "Math",
+ "Date",
+ "Number",
+ "BigInt",
+ // text
+ "String",
+ "RegExp",
+ // Indexed collections
+ "Array",
+ "Float32Array",
+ "Float64Array",
+ "Int8Array",
+ "Uint8Array",
+ "Uint8ClampedArray",
+ "Int16Array",
+ "Int32Array",
+ "Uint16Array",
+ "Uint32Array",
+ "BigInt64Array",
+ "BigUint64Array",
+ // Keyed collections
+ "Set",
+ "Map",
+ "WeakSet",
+ "WeakMap",
+ // Structured data
+ "ArrayBuffer",
+ "SharedArrayBuffer",
+ "Atomics",
+ "DataView",
+ "JSON",
+ // Control abstraction objects
+ "Promise",
+ "Generator",
+ "GeneratorFunction",
+ "AsyncFunction",
+ // Reflection
+ "Reflect",
+ "Proxy",
+ // Internationalization
+ "Intl",
+ // WebAssembly
+ "WebAssembly"
+];
+var ERROR_TYPES2 = [
+ "Error",
+ "EvalError",
+ "InternalError",
+ "RangeError",
+ "ReferenceError",
+ "SyntaxError",
+ "TypeError",
+ "URIError"
+];
+var BUILT_IN_GLOBALS2 = [
+ "setInterval",
+ "setTimeout",
+ "clearInterval",
+ "clearTimeout",
+ "require",
+ "exports",
+ "eval",
+ "isFinite",
+ "isNaN",
+ "parseFloat",
+ "parseInt",
+ "decodeURI",
+ "decodeURIComponent",
+ "encodeURI",
+ "encodeURIComponent",
+ "escape",
+ "unescape"
+];
+var BUILT_IN_VARIABLES2 = [
+ "arguments",
+ "this",
+ "super",
+ "console",
+ "window",
+ "document",
+ "localStorage",
+ "sessionStorage",
+ "module",
+ "global"
+ // Node.js
+];
+var BUILT_INS2 = [].concat(
+ BUILT_IN_GLOBALS2,
+ TYPES2,
+ ERROR_TYPES2
+);
+function javascript2(hljs) {
+ const regex = hljs.regex;
+ const hasClosingTag = (match, { after }) => {
+ const tag = "" + match[0].slice(1);
+ const pos = match.input.indexOf(tag, after);
+ return pos !== -1;
+ };
+ const IDENT_RE$1 = IDENT_RE2;
+ const FRAGMENT = {
+ begin: "<>",
+ end: ">"
+ };
+ const XML_SELF_CLOSING = /<[A-Za-z0-9\\._:-]+\s*\/>/;
+ const XML_TAG = {
+ begin: /<[A-Za-z0-9\\._:-]+/,
+ end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
+ /**
+ * @param {RegExpMatchArray} match
+ * @param {CallbackResponse} response
+ */
+ isTrulyOpeningTag: (match, response) => {
+ const afterMatchIndex = match[0].length + match.index;
+ const nextChar = match.input[afterMatchIndex];
+ if (
+ // HTML should not include another raw `<` inside a tag
+ // nested type?
+ // `>`, etc.
+ nextChar === "<" || // the , gives away that this is not HTML
+ // ``
+ nextChar === ","
+ ) {
+ response.ignoreMatch();
+ return;
+ }
+ if (nextChar === ">") {
+ if (!hasClosingTag(match, { after: afterMatchIndex })) {
+ response.ignoreMatch();
+ }
+ }
+ let m;
+ const afterMatch = match.input.substring(afterMatchIndex);
+ if (m = afterMatch.match(/^\s*=/)) {
+ response.ignoreMatch();
+ return;
+ }
+ if (m = afterMatch.match(/^\s+extends\s+/)) {
+ if (m.index === 0) {
+ response.ignoreMatch();
+ return;
+ }
+ }
+ }
+ };
+ const KEYWORDS$1 = {
+ $pattern: IDENT_RE2,
+ keyword: KEYWORDS2,
+ literal: LITERALS2,
+ built_in: BUILT_INS2,
+ "variable.language": BUILT_IN_VARIABLES2
+ };
+ const decimalDigits = "[0-9](_?[0-9])*";
+ const frac = `\\.(${decimalDigits})`;
+ const decimalInteger = `0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`;
+ const NUMBER = {
+ className: "number",
+ variants: [
+ // DecimalLiteral
+ { begin: `(\\b(${decimalInteger})((${frac})|\\.)?|(${frac}))[eE][+-]?(${decimalDigits})\\b` },
+ { begin: `\\b(${decimalInteger})\\b((${frac})\\b|\\.)?|(${frac})\\b` },
+ // DecimalBigIntegerLiteral
+ { begin: `\\b(0|[1-9](_?[0-9])*)n\\b` },
+ // NonDecimalIntegerLiteral
+ { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
+ { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
+ { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
+ // LegacyOctalIntegerLiteral (does not include underscore separators)
+ // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
+ { begin: "\\b0[0-7]+n?\\b" }
+ ],
+ relevance: 0
+ };
+ const SUBST = {
+ className: "subst",
+ begin: "\\$\\{",
+ end: "\\}",
+ keywords: KEYWORDS$1,
+ contains: []
+ // defined later
+ };
+ const HTML_TEMPLATE = {
+ begin: ".?html`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "xml"
+ }
+ };
+ const CSS_TEMPLATE = {
+ begin: ".?css`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "css"
+ }
+ };
+ const GRAPHQL_TEMPLATE = {
+ begin: ".?gql`",
+ end: "",
+ starts: {
+ end: "`",
+ returnEnd: false,
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ],
+ subLanguage: "graphql"
+ }
+ };
+ const TEMPLATE_STRING = {
+ className: "string",
+ begin: "`",
+ end: "`",
+ contains: [
+ hljs.BACKSLASH_ESCAPE,
+ SUBST
+ ]
+ };
+ const JSDOC_COMMENT = hljs.COMMENT(
+ /\/\*\*(?!\/)/,
+ "\\*/",
+ {
+ relevance: 0,
+ contains: [
+ {
+ begin: "(?=@[A-Za-z]+)",
+ relevance: 0,
+ contains: [
+ {
+ className: "doctag",
+ begin: "@[A-Za-z]+"
+ },
+ {
+ className: "type",
+ begin: "\\{",
+ end: "\\}",
+ excludeEnd: true,
+ excludeBegin: true,
+ relevance: 0
+ },
+ {
+ className: "variable",
+ begin: IDENT_RE$1 + "(?=\\s*(-)|$)",
+ endsParent: true,
+ relevance: 0
+ },
+ // eat spaces (not newlines) so we can find
+ // types or variables
+ {
+ begin: /(?=[^\n])\s/,
+ relevance: 0
+ }
+ ]
+ }
+ ]
+ }
+ );
+ const COMMENT = {
+ className: "comment",
+ variants: [
+ JSDOC_COMMENT,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_LINE_COMMENT_MODE
+ ]
+ };
+ const SUBST_INTERNALS = [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ HTML_TEMPLATE,
+ CSS_TEMPLATE,
+ GRAPHQL_TEMPLATE,
+ TEMPLATE_STRING,
+ // Skip numbers when they are part of a variable name
+ { match: /\$\d+/ },
+ NUMBER
+ // This is intentional:
+ // See https://github.com/highlightjs/highlight.js/issues/3288
+ // hljs.REGEXP_MODE
+ ];
+ SUBST.contains = SUBST_INTERNALS.concat({
+ // we need to pair up {} inside our subst to prevent
+ // it from ending too early by matching another }
+ begin: /\{/,
+ end: /\}/,
+ keywords: KEYWORDS$1,
+ contains: [
+ "self"
+ ].concat(SUBST_INTERNALS)
+ });
+ const SUBST_AND_COMMENTS = [].concat(COMMENT, SUBST.contains);
+ const PARAMS_CONTAINS = SUBST_AND_COMMENTS.concat([
+ // eat recursive parens in sub expressions
+ {
+ begin: /(\s*)\(/,
+ end: /\)/,
+ keywords: KEYWORDS$1,
+ contains: ["self"].concat(SUBST_AND_COMMENTS)
+ }
+ ]);
+ const PARAMS = {
+ className: "params",
+ // convert this to negative lookbehind in v12
+ begin: /(\s*)\(/,
+ // to match the parms with
+ end: /\)/,
+ excludeBegin: true,
+ excludeEnd: true,
+ keywords: KEYWORDS$1,
+ contains: PARAMS_CONTAINS
+ };
+ const CLASS_OR_EXTENDS = {
+ variants: [
+ // class Car extends vehicle
+ {
+ match: [
+ /class/,
+ /\s+/,
+ IDENT_RE$1,
+ /\s+/,
+ /extends/,
+ /\s+/,
+ regex.concat(IDENT_RE$1, "(", regex.concat(/\./, IDENT_RE$1), ")*")
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.class",
+ 5: "keyword",
+ 7: "title.class.inherited"
+ }
+ },
+ // class Car
+ {
+ match: [
+ /class/,
+ /\s+/,
+ IDENT_RE$1
+ ],
+ scope: {
+ 1: "keyword",
+ 3: "title.class"
+ }
+ }
+ ]
+ };
+ const CLASS_REFERENCE = {
+ relevance: 0,
+ match: regex.either(
+ // Hard coded exceptions
+ /\bJSON/,
+ // Float32Array, OutT
+ /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
+ // CSSFactory, CSSFactoryT
+ /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
+ // FPs, FPsT
+ /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
+ // P
+ // single letters are not highlighted
+ // BLAH
+ // this will be flagged as a UPPER_CASE_CONSTANT instead
+ ),
+ className: "title.class",
+ keywords: {
+ _: [
+ // se we still get relevance credit for JS library classes
+ ...TYPES2,
+ ...ERROR_TYPES2
+ ]
+ }
+ };
+ const USE_STRICT = {
+ label: "use_strict",
+ className: "meta",
+ relevance: 10,
+ begin: /^\s*['"]use (strict|asm)['"]/
+ };
+ const FUNCTION_DEFINITION = {
+ variants: [
+ {
+ match: [
+ /function/,
+ /\s+/,
+ IDENT_RE$1,
+ /(?=\s*\()/
+ ]
+ },
+ // anonymous function
+ {
+ match: [
+ /function/,
+ /\s*(?=\()/
+ ]
+ }
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ label: "func.def",
+ contains: [PARAMS],
+ illegal: /%/
+ };
+ const UPPER_CASE_CONSTANT = {
+ relevance: 0,
+ match: /\b[A-Z][A-Z_0-9]+\b/,
+ className: "variable.constant"
+ };
+ function noneOf(list) {
+ return regex.concat("(?!", list.join("|"), ")");
+ }
+ const FUNCTION_CALL = {
+ match: regex.concat(
+ /\b/,
+ noneOf([
+ ...BUILT_IN_GLOBALS2,
+ "super",
+ "import"
+ ].map((x) => `${x}\\s*\\(`)),
+ IDENT_RE$1,
+ regex.lookahead(/\s*\(/)
+ ),
+ className: "title.function",
+ relevance: 0
+ };
+ const PROPERTY_ACCESS = {
+ begin: regex.concat(/\./, regex.lookahead(
+ regex.concat(IDENT_RE$1, /(?![0-9A-Za-z$_(])/)
+ )),
+ end: IDENT_RE$1,
+ excludeBegin: true,
+ keywords: "prototype",
+ className: "property",
+ relevance: 0
+ };
+ const GETTER_OR_SETTER = {
+ match: [
+ /get|set/,
+ /\s+/,
+ IDENT_RE$1,
+ /(?=\()/
+ ],
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ contains: [
+ {
+ // eat to avoid empty params
+ begin: /\(\)/
+ },
+ PARAMS
+ ]
+ };
+ const FUNC_LEAD_IN_RE = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + hljs.UNDERSCORE_IDENT_RE + ")\\s*=>";
+ const FUNCTION_VARIABLE = {
+ match: [
+ /const|var|let/,
+ /\s+/,
+ IDENT_RE$1,
+ /\s*/,
+ /=\s*/,
+ /(async\s*)?/,
+ // async is optional
+ regex.lookahead(FUNC_LEAD_IN_RE)
+ ],
+ keywords: "async",
+ className: {
+ 1: "keyword",
+ 3: "title.function"
+ },
+ contains: [
+ PARAMS
+ ]
+ };
+ return {
+ name: "JavaScript",
+ aliases: ["js", "jsx", "mjs", "cjs"],
+ keywords: KEYWORDS$1,
+ // this will be extended by TypeScript
+ exports: { PARAMS_CONTAINS, CLASS_REFERENCE },
+ illegal: /#(?![$_A-z])/,
+ contains: [
+ hljs.SHEBANG({
+ label: "shebang",
+ binary: "node",
+ relevance: 5
+ }),
+ USE_STRICT,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ HTML_TEMPLATE,
+ CSS_TEMPLATE,
+ GRAPHQL_TEMPLATE,
+ TEMPLATE_STRING,
+ COMMENT,
+ // Skip numbers when they are part of a variable name
+ { match: /\$\d+/ },
+ NUMBER,
+ CLASS_REFERENCE,
+ {
+ scope: "attr",
+ match: IDENT_RE$1 + regex.lookahead(":"),
+ relevance: 0
+ },
+ FUNCTION_VARIABLE,
+ {
+ // "value" container
+ begin: "(" + hljs.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
+ keywords: "return throw case",
+ relevance: 0,
+ contains: [
+ COMMENT,
+ hljs.REGEXP_MODE,
+ {
+ className: "function",
+ // we have to count the parens to make sure we actually have the
+ // correct bounding ( ) before the =>. There could be any number of
+ // sub-expressions inside also surrounded by parens.
+ begin: FUNC_LEAD_IN_RE,
+ returnBegin: true,
+ end: "\\s*=>",
+ contains: [
+ {
+ className: "params",
+ variants: [
+ {
+ begin: hljs.UNDERSCORE_IDENT_RE,
+ relevance: 0
+ },
+ {
+ className: null,
+ begin: /\(\s*\)/,
+ skip: true
+ },
+ {
+ begin: /(\s*)\(/,
+ end: /\)/,
+ excludeBegin: true,
+ excludeEnd: true,
+ keywords: KEYWORDS$1,
+ contains: PARAMS_CONTAINS
+ }
+ ]
+ }
+ ]
+ },
+ {
+ // could be a comma delimited list of params to a function call
+ begin: /,/,
+ relevance: 0
+ },
+ {
+ match: /\s+/,
+ relevance: 0
+ },
+ {
+ // JSX
+ variants: [
+ { begin: FRAGMENT.begin, end: FRAGMENT.end },
+ { match: XML_SELF_CLOSING },
+ {
+ begin: XML_TAG.begin,
+ // we carefully check the opening tag to see if it truly
+ // is a tag and not a false positive
+ "on:begin": XML_TAG.isTrulyOpeningTag,
+ end: XML_TAG.end
+ }
+ ],
+ subLanguage: "xml",
+ contains: [
+ {
+ begin: XML_TAG.begin,
+ end: XML_TAG.end,
+ skip: true,
+ contains: ["self"]
+ }
+ ]
+ }
+ ]
+ },
+ FUNCTION_DEFINITION,
+ {
+ // prevent this from getting swallowed up by function
+ // since they appear "function like"
+ beginKeywords: "while if switch catch for"
+ },
+ {
+ // we have to count the parens to make sure we actually have the correct
+ // bounding ( ). There could be any number of sub-expressions inside
+ // also surrounded by parens.
+ begin: "\\b(?!function)" + hljs.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
+ // end parens
+ returnBegin: true,
+ label: "func.def",
+ contains: [
+ PARAMS,
+ hljs.inherit(hljs.TITLE_MODE, { begin: IDENT_RE$1, className: "title.function" })
+ ]
+ },
+ // catch ... so it won't trigger the property rule below
+ {
+ match: /\.\.\./,
+ relevance: 0
+ },
+ PROPERTY_ACCESS,
+ // hack: prevents detection of keywords in some circumstances
+ // .keyword()
+ // $keyword = x
+ {
+ match: "\\$" + IDENT_RE$1,
+ relevance: 0
+ },
+ {
+ match: [/\bconstructor(?=\s*\()/],
+ className: { 1: "title.function" },
+ contains: [PARAMS]
+ },
+ FUNCTION_CALL,
+ UPPER_CASE_CONSTANT,
+ CLASS_OR_EXTENDS,
+ GETTER_OR_SETTER,
+ {
+ match: /\$[(.]/
+ // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
+ }
+ ]
+ };
+}
+function typescript(hljs) {
+ const regex = hljs.regex;
+ const tsLanguage = javascript2(hljs);
+ const IDENT_RE$1 = IDENT_RE2;
+ const TYPES3 = [
+ "any",
+ "void",
+ "number",
+ "boolean",
+ "string",
+ "object",
+ "never",
+ "symbol",
+ "bigint",
+ "unknown"
+ ];
+ const NAMESPACE = {
+ begin: [
+ /namespace/,
+ /\s+/,
+ hljs.IDENT_RE
+ ],
+ beginScope: {
+ 1: "keyword",
+ 3: "title.class"
+ }
+ };
+ const INTERFACE = {
+ beginKeywords: "interface",
+ end: /\{/,
+ excludeEnd: true,
+ keywords: {
+ keyword: "interface extends",
+ built_in: TYPES3
+ },
+ contains: [tsLanguage.exports.CLASS_REFERENCE]
+ };
+ const USE_STRICT = {
+ className: "meta",
+ relevance: 10,
+ begin: /^\s*['"]use strict['"]/
+ };
+ const TS_SPECIFIC_KEYWORDS = [
+ "type",
+ // "namespace",
+ "interface",
+ "public",
+ "private",
+ "protected",
+ "implements",
+ "declare",
+ "abstract",
+ "readonly",
+ "enum",
+ "override",
+ "satisfies"
+ ];
+ const KEYWORDS$1 = {
+ $pattern: IDENT_RE2,
+ keyword: KEYWORDS2.concat(TS_SPECIFIC_KEYWORDS),
+ literal: LITERALS2,
+ built_in: BUILT_INS2.concat(TYPES3),
+ "variable.language": BUILT_IN_VARIABLES2
+ };
+ const DECORATOR = {
+ className: "meta",
+ begin: "@" + IDENT_RE$1
+ };
+ const swapMode = (mode, label, replacement) => {
+ const indx = mode.contains.findIndex((m) => m.label === label);
+ if (indx === -1) {
+ throw new Error("can not find mode to replace");
+ }
+ mode.contains.splice(indx, 1, replacement);
+ };
+ Object.assign(tsLanguage.keywords, KEYWORDS$1);
+ tsLanguage.exports.PARAMS_CONTAINS.push(DECORATOR);
+ const ATTRIBUTE_HIGHLIGHT = tsLanguage.contains.find((c) => c.scope === "attr");
+ const OPTIONAL_KEY_OR_ARGUMENT = Object.assign(
+ {},
+ ATTRIBUTE_HIGHLIGHT,
+ { match: regex.concat(IDENT_RE$1, regex.lookahead(/\s*\?:/)) }
+ );
+ tsLanguage.exports.PARAMS_CONTAINS.push([
+ tsLanguage.exports.CLASS_REFERENCE,
+ // class reference for highlighting the params types
+ ATTRIBUTE_HIGHLIGHT,
+ // highlight the params key
+ OPTIONAL_KEY_OR_ARGUMENT
+ // Added for optional property assignment highlighting
+ ]);
+ tsLanguage.contains = tsLanguage.contains.concat([
+ DECORATOR,
+ NAMESPACE,
+ INTERFACE,
+ OPTIONAL_KEY_OR_ARGUMENT
+ // Added for optional property assignment highlighting
+ ]);
+ swapMode(tsLanguage, "shebang", hljs.SHEBANG());
+ swapMode(tsLanguage, "use_strict", USE_STRICT);
+ const functionDeclaration = tsLanguage.contains.find((m) => m.label === "func.def");
+ functionDeclaration.relevance = 0;
+ Object.assign(tsLanguage, {
+ name: "TypeScript",
+ aliases: [
+ "ts",
+ "tsx",
+ "mts",
+ "cts"
+ ]
+ });
+ return tsLanguage;
+}
+
+// node_modules/highlight.js/es/languages/xml.js
+function xml(hljs) {
+ const regex = hljs.regex;
+ const TAG_NAME_RE = regex.concat(/[\p{L}_]/u, regex.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u);
+ const XML_IDENT_RE = /[\p{L}0-9._:-]+/u;
+ const XML_ENTITIES = {
+ className: "symbol",
+ begin: /&[a-z]+;|[0-9]+;|[a-f0-9]+;/
+ };
+ const XML_META_KEYWORDS = {
+ begin: /\s/,
+ contains: [
+ {
+ className: "keyword",
+ begin: /#?[a-z_][a-z1-9_-]+/,
+ illegal: /\n/
+ }
+ ]
+ };
+ const XML_META_PAR_KEYWORDS = hljs.inherit(XML_META_KEYWORDS, {
+ begin: /\(/,
+ end: /\)/
+ });
+ const APOS_META_STRING_MODE = hljs.inherit(hljs.APOS_STRING_MODE, { className: "string" });
+ const QUOTE_META_STRING_MODE = hljs.inherit(hljs.QUOTE_STRING_MODE, { className: "string" });
+ const TAG_INTERNALS = {
+ endsWithParent: true,
+ illegal: /,
+ relevance: 0,
+ contains: [
+ {
+ className: "attr",
+ begin: XML_IDENT_RE,
+ relevance: 0
+ },
+ {
+ begin: /=\s*/,
+ relevance: 0,
+ contains: [
+ {
+ className: "string",
+ endsParent: true,
+ variants: [
+ {
+ begin: /"/,
+ end: /"/,
+ contains: [XML_ENTITIES]
+ },
+ {
+ begin: /'/,
+ end: /'/,
+ contains: [XML_ENTITIES]
+ },
+ { begin: /[^\s"'=<>`]+/ }
+ ]
+ }
+ ]
+ }
+ ]
+ };
+ return {
+ name: "HTML, XML",
+ aliases: [
+ "html",
+ "xhtml",
+ "rss",
+ "atom",
+ "xjb",
+ "xsd",
+ "xsl",
+ "plist",
+ "wsf",
+ "svg"
+ ],
+ case_insensitive: true,
+ unicodeRegex: true,
+ contains: [
+ {
+ className: "meta",
+ begin: //,
+ relevance: 10,
+ contains: [
+ XML_META_KEYWORDS,
+ QUOTE_META_STRING_MODE,
+ APOS_META_STRING_MODE,
+ XML_META_PAR_KEYWORDS,
+ {
+ begin: /\[/,
+ end: /\]/,
+ contains: [
+ {
+ className: "meta",
+ begin: //,
+ contains: [
+ XML_META_KEYWORDS,
+ XML_META_PAR_KEYWORDS,
+ QUOTE_META_STRING_MODE,
+ APOS_META_STRING_MODE
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ hljs.COMMENT(
+ //,
+ { relevance: 10 }
+ ),
+ {
+ begin: //,
+ relevance: 10
+ },
+ XML_ENTITIES,
+ // xml processing instructions
+ {
+ className: "meta",
+ end: /\?>/,
+ variants: [
+ {
+ begin: /<\?xml/,
+ relevance: 10,
+ contains: [
+ QUOTE_META_STRING_MODE
+ ]
+ },
+ {
+ begin: /<\?[a-z][a-z0-9]+/
+ }
+ ]
+ },
+ {
+ className: "tag",
+ /*
+ The lookahead pattern (?=...) ensures that 'begin' only matches
+ '