@arcgis/coding-components 5.1.0-next.13 → 5.1.0-next.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,78 +1,86 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function D() {
2
+ function Q() {
3
3
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
4
4
  }
5
- var R = D();
6
- function ne(s) {
7
- R = s;
5
+ var R = Q();
6
+ function se(n) {
7
+ R = n;
8
8
  }
9
- var _ = { exec: () => null };
10
- function p(s, e = "") {
11
- let r = typeof s == "string" ? s : s.source, n = { replace: (t, i) => {
9
+ var $ = { exec: () => null };
10
+ function p(n, e = "") {
11
+ let r = typeof n == "string" ? n : n.source, s = { replace: (t, i) => {
12
12
  let l = typeof i == "string" ? i : i.source;
13
- return l = l.replace(x.caret, "$1"), r = r.replace(t, l), n;
13
+ return l = l.replace(x.caret, "$1"), r = r.replace(t, l), s;
14
14
  }, getRegex: () => new RegExp(r, e) };
15
- return n;
15
+ return s;
16
16
  }
17
- var de = (() => {
17
+ var be = (() => {
18
18
  try {
19
19
  return !!new RegExp("(?<=1)(?<!1)");
20
20
  } catch {
21
21
  return !1;
22
22
  }
23
- })(), x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (s) => new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (s) => new RegExp(`^ {0,${Math.min(3, s - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (s) => new RegExp(`^ {0,${Math.min(3, s - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (s) => new RegExp(`^ {0,${Math.min(3, s - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (s) => new RegExp(`^ {0,${Math.min(3, s - 1)}}#`), htmlBeginRegex: (s) => new RegExp(`^ {0,${Math.min(3, s - 1)}}<(?:[a-z].*>|!--)`, "i") }, xe = /^(?:[ \t]*(?:\n|$))+/, be = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, we = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, me = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, O = /(?:[*+-]|\d{1,9}[.)])/, le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ie = p(le).replace(/bull/g, O).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), ye = p(le).replace(/bull/g, O).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), H = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, $e = /^[^\n]+/, N = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Re = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", N).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Se = p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, O).getRegex(), v = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Te = p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", v).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = p(H).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), ze = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), G = { blockquote: ze, code: be, def: Re, fences: we, heading: me, hr: P, html: Te, lheading: ie, list: Se, newline: xe, paragraph: ae, table: _, text: $e }, V = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex(), Ae = { ...G, lheading: ye, table: V, paragraph: p(H).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", V).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", v).getRegex() }, _e = { ...G, html: p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: _, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(H).replace("hr", P).replace("heading", ` *#{1,6} *[^
24
- ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pe = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ie = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Le = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, X = /[\s\p{P}\p{S}]/u, ce = /[^\s\p{P}\p{S}]/u, Ce = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(), he = /(?!~)[\p{P}\p{S}]/u, qe = /(?!~)[\s\p{P}\p{S}]/u, ve = /(?:[^\s\p{P}\p{S}]|~)/u, Be = p(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", de ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), pe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Ee = p(pe, "u").replace(/punct/g, B).getRegex(), Ze = p(pe, "u").replace(/punct/g, he).getRegex(), ue = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Me = p(ue, "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, B).getRegex(), Qe = p(ue, "gu").replace(/notPunctSpace/g, ve).replace(/punctSpace/g, qe).replace(/punct/g, he).getRegex(), De = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, B).getRegex(), Oe = p(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), He = p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ne = p(j).replace("(?:-->|$)", "-->").getRegex(), je = p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ne).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ge = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ge = p(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", N).getRegex(), ke = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", N).getRegex(), Xe = p("reflink|nolink(?!\\()", "g").replace("reflink", ge).replace("nolink", ke).getRegex(), Y = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, F = { _backpedal: _, anyPunctuation: Oe, autolink: He, blockSkip: Be, br: oe, code: Ie, del: _, emStrongLDelim: Ee, emStrongRDelimAst: Me, emStrongRDelimUnd: De, escape: Pe, link: Ge, nolink: ke, punctuation: Ce, reflink: ge, reflinkSearch: Xe, tag: je, text: Le, url: _ }, Fe = { ...F, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, Z = { ...F, emStrongRDelimAst: Qe, emStrongLDelim: Ze, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Y).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Y).getRegex() }, We = { ...Z, br: p(oe).replace("{2,}", "*").getRegex(), text: p(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: G, gfm: Ae, pedantic: _e }, T = { normal: F, gfm: Z, breaks: We, pedantic: Fe }, Ue = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ee = (s) => Ue[s];
25
- function y(s, e) {
23
+ })(), x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}>`) }, we = /^(?:[ \t]*(?:\n|$))+/, me = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ye = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, $e = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, H = / {0,3}(?:[*+-]|\d{1,9}[.)])/, le = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ie = p(le).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Se = p(le).replace(/bull/g, H).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), N = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Re = /^[^\n]+/, O = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Te = p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), ze = p(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, H).getRegex(), C = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", j = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ae = p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", j).replace("tag", C).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex(), _e = p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), G = { blockquote: _e, code: me, def: Te, fences: ye, heading: $e, hr: P, html: Ae, lheading: ie, list: ze, newline: we, paragraph: ae, table: $, text: Re }, V = p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex(), Pe = { ...G, lheading: Se, table: V, paragraph: p(N).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", V).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", C).getRegex() }, Ie = { ...G, html: p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", j).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: $, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: p(N).replace("hr", P).replace("heading", ` *#{1,6} *[^
24
+ ]`).replace("lheading", ie).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Le = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, qe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, oe = /^( {2,}|\\)\n(?!\s*$)/, Be = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, v = /[\p{P}\p{S}]/u, X = /[\s\p{P}\p{S}]/u, ce = /[^\s\p{P}\p{S}]/u, Ce = p(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, X).getRegex(), he = /(?!~)[\p{P}\p{S}]/u, ve = /(?!~)[\s\p{P}\p{S}]/u, Ee = /(?:[^\s\p{P}\p{S}]|~)/u, pe = /(?![*_])[\p{P}\p{S}]/u, Ze = /(?![*_])[\s\p{P}\p{S}]/u, De = /(?:[^\s\p{P}\p{S}]|[*_])/u, Me = p(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", be ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ue = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Qe = p(ue, "u").replace(/punct/g, v).getRegex(), He = p(ue, "u").replace(/punct/g, he).getRegex(), ge = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ne = p(ge, "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, v).getRegex(), Oe = p(ge, "gu").replace(/notPunctSpace/g, Ee).replace(/punctSpace/g, ve).replace(/punct/g, he).getRegex(), je = p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, ce).replace(/punctSpace/g, X).replace(/punct/g, v).getRegex(), Ge = p(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, pe).getRegex(), Xe = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Fe = p(Xe, "gu").replace(/notPunctSpace/g, De).replace(/punctSpace/g, Ze).replace(/punct/g, pe).getRegex(), We = p(/\\(punct)/, "gu").replace(/punct/g, v).getRegex(), Ue = p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Je = p(j).replace("(?:-->|$)", "-->").getRegex(), Ke = p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Je).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Ve = p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ke = p(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", O).getRegex(), fe = p(/^!?\[(ref)\](?:\[\])?/).replace("ref", O).getRegex(), Ye = p("reflink|nolink(?!\\()", "g").replace("reflink", ke).replace("nolink", fe).getRegex(), Y = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, F = { _backpedal: $, anyPunctuation: We, autolink: Ue, blockSkip: Me, br: oe, code: qe, del: $, delLDelim: $, delRDelim: $, emStrongLDelim: Qe, emStrongRDelimAst: Ne, emStrongRDelimUnd: je, escape: Le, link: Ve, nolink: fe, punctuation: Ce, reflink: ke, reflinkSearch: Ye, tag: Ke, text: Be, url: $ }, et = { ...F, link: p(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, Z = { ...F, emStrongRDelimAst: Oe, emStrongLDelim: He, delLDelim: Ge, delRDelim: Fe, url: p(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Y).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: p(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Y).getRegex() }, tt = { ...Z, br: p(oe).replace("{2,}", "*").getRegex(), text: p(Z.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: G, gfm: Pe, pedantic: Ie }, z = { normal: F, gfm: Z, breaks: tt, pedantic: et }, rt = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, ee = (n) => rt[n];
25
+ function y(n, e) {
26
26
  if (e) {
27
- if (x.escapeTest.test(s)) return s.replace(x.escapeReplace, ee);
28
- } else if (x.escapeTestNoEncode.test(s)) return s.replace(x.escapeReplaceNoEncode, ee);
29
- return s;
27
+ if (x.escapeTest.test(n)) return n.replace(x.escapeReplace, ee);
28
+ } else if (x.escapeTestNoEncode.test(n)) return n.replace(x.escapeReplaceNoEncode, ee);
29
+ return n;
30
30
  }
31
- function te(s) {
31
+ function te(n) {
32
32
  try {
33
- s = encodeURI(s).replace(x.percentDecode, "%");
33
+ n = encodeURI(n).replace(x.percentDecode, "%");
34
34
  } catch {
35
35
  return null;
36
36
  }
37
- return s;
37
+ return n;
38
38
  }
39
- function re(s, e) {
40
- let r = s.replace(x.findPipe, (i, l, o) => {
39
+ function re(n, e) {
40
+ let r = n.replace(x.findPipe, (i, l, o) => {
41
41
  let a = !1, h = l;
42
42
  for (; --h >= 0 && o[h] === "\\"; ) a = !a;
43
43
  return a ? "|" : " |";
44
- }), n = r.split(x.splitPipe), t = 0;
45
- if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), e) if (n.length > e) n.splice(e);
46
- else for (; n.length < e; ) n.push("");
47
- for (; t < n.length; t++) n[t] = n[t].trim().replace(x.slashPipe, "|");
48
- return n;
44
+ }), s = r.split(x.splitPipe), t = 0;
45
+ if (s[0].trim() || s.shift(), s.length > 0 && !s.at(-1)?.trim() && s.pop(), e) if (s.length > e) s.splice(e);
46
+ else for (; s.length < e; ) s.push("");
47
+ for (; t < s.length; t++) s[t] = s[t].trim().replace(x.slashPipe, "|");
48
+ return s;
49
49
  }
50
- function z(s, e, r) {
51
- let n = s.length;
52
- if (n === 0) return "";
50
+ function A(n, e, r) {
51
+ let s = n.length;
52
+ if (s === 0) return "";
53
53
  let t = 0;
54
- for (; t < n && s.charAt(n - t - 1) === e; )
54
+ for (; t < s && n.charAt(s - t - 1) === e; )
55
55
  t++;
56
- return s.slice(0, n - t);
56
+ return n.slice(0, s - t);
57
57
  }
58
- function Je(s, e) {
59
- if (s.indexOf(e[1]) === -1) return -1;
58
+ function nt(n, e) {
59
+ if (n.indexOf(e[1]) === -1) return -1;
60
60
  let r = 0;
61
- for (let n = 0; n < s.length; n++) if (s[n] === "\\") n++;
62
- else if (s[n] === e[0]) r++;
63
- else if (s[n] === e[1] && (r--, r < 0)) return n;
61
+ for (let s = 0; s < n.length; s++) if (n[s] === "\\") s++;
62
+ else if (n[s] === e[0]) r++;
63
+ else if (n[s] === e[1] && (r--, r < 0)) return s;
64
64
  return r > 0 ? -2 : -1;
65
65
  }
66
- function se(s, e, r, n, t) {
67
- let i = e.href, l = e.title || null, o = s[1].replace(t.other.outputLinkReplace, "$1");
68
- n.state.inLink = !0;
69
- let a = { type: s[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: o, tokens: n.inlineTokens(o) };
70
- return n.state.inLink = !1, a;
66
+ function st(n, e = 0) {
67
+ let r = e, s = "";
68
+ for (let t of n) if (t === " ") {
69
+ let i = 4 - r % 4;
70
+ s += " ".repeat(i), r += i;
71
+ } else s += t, r++;
72
+ return s;
71
73
  }
72
- function Ke(s, e, r) {
73
- let n = s.match(r.other.indentCodeCompensation);
74
- if (n === null) return e;
75
- let t = n[1];
74
+ function ne(n, e, r, s, t) {
75
+ let i = e.href, l = e.title || null, o = n[1].replace(t.other.outputLinkReplace, "$1");
76
+ s.state.inLink = !0;
77
+ let a = { type: n[0].charAt(0) === "!" ? "image" : "link", raw: r, href: i, title: l, text: o, tokens: s.inlineTokens(o) };
78
+ return s.state.inLink = !1, a;
79
+ }
80
+ function lt(n, e, r) {
81
+ let s = n.match(r.other.indentCodeCompensation);
82
+ if (s === null) return e;
83
+ let t = s[1];
76
84
  return e.split(`
77
85
  `).map((i) => {
78
86
  let l = i.match(r.other.beginningSpace);
@@ -82,54 +90,54 @@ function Ke(s, e, r) {
82
90
  }).join(`
83
91
  `);
84
92
  }
85
- var C = class {
93
+ var q = class {
86
94
  options;
87
95
  rules;
88
96
  lexer;
89
- constructor(s) {
90
- this.options = s || R;
97
+ constructor(n) {
98
+ this.options = n || R;
91
99
  }
92
- space(s) {
93
- let e = this.rules.block.newline.exec(s);
100
+ space(n) {
101
+ let e = this.rules.block.newline.exec(n);
94
102
  if (e && e[0].length > 0) return { type: "space", raw: e[0] };
95
103
  }
96
- code(s) {
97
- let e = this.rules.block.code.exec(s);
104
+ code(n) {
105
+ let e = this.rules.block.code.exec(n);
98
106
  if (e) {
99
107
  let r = e[0].replace(this.rules.other.codeRemoveIndent, "");
100
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : z(r, `
108
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? r : A(r, `
101
109
  `) };
102
110
  }
103
111
  }
104
- fences(s) {
105
- let e = this.rules.block.fences.exec(s);
112
+ fences(n) {
113
+ let e = this.rules.block.fences.exec(n);
106
114
  if (e) {
107
- let r = e[0], n = Ke(r, e[3] || "", this.rules);
108
- return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: n };
115
+ let r = e[0], s = lt(r, e[3] || "", this.rules);
116
+ return { type: "code", raw: r, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
109
117
  }
110
118
  }
111
- heading(s) {
112
- let e = this.rules.block.heading.exec(s);
119
+ heading(n) {
120
+ let e = this.rules.block.heading.exec(n);
113
121
  if (e) {
114
122
  let r = e[2].trim();
115
123
  if (this.rules.other.endingHash.test(r)) {
116
- let n = z(r, "#");
117
- (this.options.pedantic || !n || this.rules.other.endingSpaceChar.test(n)) && (r = n.trim());
124
+ let s = A(r, "#");
125
+ (this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (r = s.trim());
118
126
  }
119
127
  return { type: "heading", raw: e[0], depth: e[1].length, text: r, tokens: this.lexer.inline(r) };
120
128
  }
121
129
  }
122
- hr(s) {
123
- let e = this.rules.block.hr.exec(s);
124
- if (e) return { type: "hr", raw: z(e[0], `
130
+ hr(n) {
131
+ let e = this.rules.block.hr.exec(n);
132
+ if (e) return { type: "hr", raw: A(e[0], `
125
133
  `) };
126
134
  }
127
- blockquote(s) {
128
- let e = this.rules.block.blockquote.exec(s);
135
+ blockquote(n) {
136
+ let e = this.rules.block.blockquote.exec(n);
129
137
  if (e) {
130
- let r = z(e[0], `
138
+ let r = A(e[0], `
131
139
  `).split(`
132
- `), n = "", t = "", i = [];
140
+ `), s = "", t = "", i = [];
133
141
  for (; r.length > 0; ) {
134
142
  let l = !1, o = [], a;
135
143
  for (a = 0; a < r.length; a++) if (this.rules.other.blockquoteStart.test(r[a])) o.push(r[a]), l = !0;
@@ -139,60 +147,60 @@ var C = class {
139
147
  let h = o.join(`
140
148
  `), c = h.replace(this.rules.other.blockquoteSetextReplace, `
141
149
  $1`).replace(this.rules.other.blockquoteSetextReplace2, "");
142
- n = n ? `${n}
150
+ s = s ? `${s}
143
151
  ${h}` : h, t = t ? `${t}
144
152
  ${c}` : c;
145
- let k = this.lexer.state.top;
146
- if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = k, r.length === 0) break;
153
+ let g = this.lexer.state.top;
154
+ if (this.lexer.state.top = !0, this.lexer.blockTokens(c, i, !0), this.lexer.state.top = g, r.length === 0) break;
147
155
  let u = i.at(-1);
148
156
  if (u?.type === "code") break;
149
157
  if (u?.type === "blockquote") {
150
158
  let d = u, f = d.raw + `
151
159
  ` + r.join(`
152
- `), b = this.blockquote(f);
153
- i[i.length - 1] = b, n = n.substring(0, n.length - d.raw.length) + b.raw, t = t.substring(0, t.length - d.text.length) + b.text;
160
+ `), m = this.blockquote(f);
161
+ i[i.length - 1] = m, s = s.substring(0, s.length - d.raw.length) + m.raw, t = t.substring(0, t.length - d.text.length) + m.text;
154
162
  break;
155
163
  } else if (u?.type === "list") {
156
164
  let d = u, f = d.raw + `
157
165
  ` + r.join(`
158
- `), b = this.list(f);
159
- i[i.length - 1] = b, n = n.substring(0, n.length - u.raw.length) + b.raw, t = t.substring(0, t.length - d.raw.length) + b.raw, r = f.substring(i.at(-1).raw.length).split(`
166
+ `), m = this.list(f);
167
+ i[i.length - 1] = m, s = s.substring(0, s.length - u.raw.length) + m.raw, t = t.substring(0, t.length - d.raw.length) + m.raw, r = f.substring(i.at(-1).raw.length).split(`
160
168
  `);
161
169
  continue;
162
170
  }
163
171
  }
164
- return { type: "blockquote", raw: n, tokens: i, text: t };
172
+ return { type: "blockquote", raw: s, tokens: i, text: t };
165
173
  }
166
174
  }
167
- list(s) {
168
- let e = this.rules.block.list.exec(s);
175
+ list(n) {
176
+ let e = this.rules.block.list.exec(n);
169
177
  if (e) {
170
- let r = e[1].trim(), n = r.length > 1, t = { type: "list", raw: "", ordered: n, start: n ? +r.slice(0, -1) : "", loose: !1, items: [] };
171
- r = n ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = n ? r : "[*+-]");
178
+ let r = e[1].trim(), s = r.length > 1, t = { type: "list", raw: "", ordered: s, start: s ? +r.slice(0, -1) : "", loose: !1, items: [] };
179
+ r = s ? `\\d{1,9}\\${r.slice(-1)}` : `\\${r}`, this.options.pedantic && (r = s ? r : "[*+-]");
172
180
  let i = this.rules.other.listItemRegex(r), l = !1;
173
- for (; s; ) {
181
+ for (; n; ) {
174
182
  let a = !1, h = "", c = "";
175
- if (!(e = i.exec(s)) || this.rules.block.hr.test(s)) break;
176
- h = e[0], s = s.substring(h.length);
177
- let k = e[2].split(`
178
- `, 1)[0].replace(this.rules.other.listReplaceTabs, (b) => " ".repeat(3 * b.length)), u = s.split(`
179
- `, 1)[0], d = !k.trim(), f = 0;
180
- if (this.options.pedantic ? (f = 2, c = k.trimStart()) : d ? f = e[1].length + 1 : (f = e[2].search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = k.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(u) && (h += u + `
181
- `, s = s.substring(u.length + 1), a = !0), !a) {
182
- let b = this.rules.other.nextBulletRegex(f), U = this.rules.other.hrRegex(f), J = this.rules.other.fencesBeginRegex(f), K = this.rules.other.headingBeginRegex(f), fe = this.rules.other.htmlBeginRegex(f);
183
- for (; s; ) {
184
- let E = s.split(`
185
- `, 1)[0], S;
186
- if (u = E, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), S = u) : S = u.replace(this.rules.other.tabCharGlobal, " "), J.test(u) || K.test(u) || fe.test(u) || b.test(u) || U.test(u)) break;
187
- if (S.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
188
- ` + S.slice(f);
183
+ if (!(e = i.exec(n)) || this.rules.block.hr.test(n)) break;
184
+ h = e[0], n = n.substring(h.length);
185
+ let g = st(e[2].split(`
186
+ `, 1)[0], e[1].length), u = n.split(`
187
+ `, 1)[0], d = !g.trim(), f = 0;
188
+ if (this.options.pedantic ? (f = 2, c = g.trimStart()) : d ? f = e[1].length + 1 : (f = g.search(this.rules.other.nonSpaceChar), f = f > 4 ? 1 : f, c = g.slice(f), f += e[1].length), d && this.rules.other.blankLine.test(u) && (h += u + `
189
+ `, n = n.substring(u.length + 1), a = !0), !a) {
190
+ let m = this.rules.other.nextBulletRegex(f), U = this.rules.other.hrRegex(f), J = this.rules.other.fencesBeginRegex(f), K = this.rules.other.headingBeginRegex(f), de = this.rules.other.htmlBeginRegex(f), xe = this.rules.other.blockquoteBeginRegex(f);
191
+ for (; n; ) {
192
+ let E = n.split(`
193
+ `, 1)[0], T;
194
+ if (u = E, this.options.pedantic ? (u = u.replace(this.rules.other.listReplaceNesting, " "), T = u) : T = u.replace(this.rules.other.tabCharGlobal, " "), J.test(u) || K.test(u) || de.test(u) || xe.test(u) || m.test(u) || U.test(u)) break;
195
+ if (T.search(this.rules.other.nonSpaceChar) >= f || !u.trim()) c += `
196
+ ` + T.slice(f);
189
197
  else {
190
- if (d || k.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || J.test(k) || K.test(k) || U.test(k)) break;
198
+ if (d || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || J.test(g) || K.test(g) || U.test(g)) break;
191
199
  c += `
192
200
  ` + u;
193
201
  }
194
- !d && !u.trim() && (d = !0), h += E + `
195
- `, s = s.substring(E.length + 1), k = S.slice(f);
202
+ d = !u.trim(), h += E + `
203
+ `, n = n.substring(E.length + 1), g = T.slice(f);
196
204
  }
197
205
  }
198
206
  t.loose || (l ? t.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (l = !0)), t.items.push({ type: "list_item", raw: h, task: !!this.options.gfm && this.rules.other.listIsTask.test(c), loose: !1, text: c, tokens: [] }), t.raw += h;
@@ -217,7 +225,7 @@ ${c}` : c;
217
225
  }
218
226
  }
219
227
  if (!t.loose) {
220
- let h = a.tokens.filter((k) => k.type === "space"), c = h.length > 0 && h.some((k) => this.rules.other.anyLine.test(k.raw));
228
+ let h = a.tokens.filter((g) => g.type === "space"), c = h.length > 0 && h.some((g) => this.rules.other.anyLine.test(g.raw));
221
229
  t.loose = c;
222
230
  }
223
231
  }
@@ -228,187 +236,200 @@ ${c}` : c;
228
236
  return t;
229
237
  }
230
238
  }
231
- html(s) {
232
- let e = this.rules.block.html.exec(s);
239
+ html(n) {
240
+ let e = this.rules.block.html.exec(n);
233
241
  if (e) return { type: "html", block: !0, raw: e[0], pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: e[0] };
234
242
  }
235
- def(s) {
236
- let e = this.rules.block.def.exec(s);
243
+ def(n) {
244
+ let e = this.rules.block.def.exec(n);
237
245
  if (e) {
238
- let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), n = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", t = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
239
- return { type: "def", tag: r, raw: e[0], href: n, title: t };
246
+ let r = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), s = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", t = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
247
+ return { type: "def", tag: r, raw: e[0], href: s, title: t };
240
248
  }
241
249
  }
242
- table(s) {
243
- let e = this.rules.block.table.exec(s);
250
+ table(n) {
251
+ let e = this.rules.block.table.exec(n);
244
252
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
245
- let r = re(e[1]), n = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
253
+ let r = re(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), t = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
246
254
  `) : [], i = { type: "table", raw: e[0], header: [], align: [], rows: [] };
247
- if (r.length === n.length) {
248
- for (let l of n) this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
255
+ if (r.length === s.length) {
256
+ for (let l of s) this.rules.other.tableAlignRight.test(l) ? i.align.push("right") : this.rules.other.tableAlignCenter.test(l) ? i.align.push("center") : this.rules.other.tableAlignLeft.test(l) ? i.align.push("left") : i.align.push(null);
249
257
  for (let l = 0; l < r.length; l++) i.header.push({ text: r[l], tokens: this.lexer.inline(r[l]), header: !0, align: i.align[l] });
250
258
  for (let l of t) i.rows.push(re(l, i.header.length).map((o, a) => ({ text: o, tokens: this.lexer.inline(o), header: !1, align: i.align[a] })));
251
259
  return i;
252
260
  }
253
261
  }
254
- lheading(s) {
255
- let e = this.rules.block.lheading.exec(s);
262
+ lheading(n) {
263
+ let e = this.rules.block.lheading.exec(n);
256
264
  if (e) return { type: "heading", raw: e[0], depth: e[2].charAt(0) === "=" ? 1 : 2, text: e[1], tokens: this.lexer.inline(e[1]) };
257
265
  }
258
- paragraph(s) {
259
- let e = this.rules.block.paragraph.exec(s);
266
+ paragraph(n) {
267
+ let e = this.rules.block.paragraph.exec(n);
260
268
  if (e) {
261
269
  let r = e[1].charAt(e[1].length - 1) === `
262
270
  ` ? e[1].slice(0, -1) : e[1];
263
271
  return { type: "paragraph", raw: e[0], text: r, tokens: this.lexer.inline(r) };
264
272
  }
265
273
  }
266
- text(s) {
267
- let e = this.rules.block.text.exec(s);
274
+ text(n) {
275
+ let e = this.rules.block.text.exec(n);
268
276
  if (e) return { type: "text", raw: e[0], text: e[0], tokens: this.lexer.inline(e[0]) };
269
277
  }
270
- escape(s) {
271
- let e = this.rules.inline.escape.exec(s);
278
+ escape(n) {
279
+ let e = this.rules.inline.escape.exec(n);
272
280
  if (e) return { type: "escape", raw: e[0], text: e[1] };
273
281
  }
274
- tag(s) {
275
- let e = this.rules.inline.tag.exec(s);
282
+ tag(n) {
283
+ let e = this.rules.inline.tag.exec(n);
276
284
  if (e) return !this.lexer.state.inLink && this.rules.other.startATag.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && this.rules.other.endATag.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(e[0]) && (this.lexer.state.inRawBlock = !1), { type: "html", raw: e[0], inLink: this.lexer.state.inLink, inRawBlock: this.lexer.state.inRawBlock, block: !1, text: e[0] };
277
285
  }
278
- link(s) {
279
- let e = this.rules.inline.link.exec(s);
286
+ link(n) {
287
+ let e = this.rules.inline.link.exec(n);
280
288
  if (e) {
281
289
  let r = e[2].trim();
282
290
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
283
291
  if (!this.rules.other.endAngleBracket.test(r)) return;
284
- let i = z(r.slice(0, -1), "\\");
292
+ let i = A(r.slice(0, -1), "\\");
285
293
  if ((r.length - i.length) % 2 === 0) return;
286
294
  } else {
287
- let i = Je(e[2], "()");
295
+ let i = nt(e[2], "()");
288
296
  if (i === -2) return;
289
297
  if (i > -1) {
290
298
  let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + i;
291
299
  e[2] = e[2].substring(0, i), e[0] = e[0].substring(0, l).trim(), e[3] = "";
292
300
  }
293
301
  }
294
- let n = e[2], t = "";
302
+ let s = e[2], t = "";
295
303
  if (this.options.pedantic) {
296
- let i = this.rules.other.pedanticHrefTitle.exec(n);
297
- i && (n = i[1], t = i[3]);
304
+ let i = this.rules.other.pedanticHrefTitle.exec(s);
305
+ i && (s = i[1], t = i[3]);
298
306
  } else t = e[3] ? e[3].slice(1, -1) : "";
299
- return n = n.trim(), this.rules.other.startAngleBracket.test(n) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? n = n.slice(1) : n = n.slice(1, -1)), se(e, { href: n && n.replace(this.rules.inline.anyPunctuation, "$1"), title: t && t.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
307
+ return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? s = s.slice(1) : s = s.slice(1, -1)), ne(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: t && t.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
300
308
  }
301
309
  }
302
- reflink(s, e) {
310
+ reflink(n, e) {
303
311
  let r;
304
- if ((r = this.rules.inline.reflink.exec(s)) || (r = this.rules.inline.nolink.exec(s))) {
305
- let n = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[n.toLowerCase()];
312
+ if ((r = this.rules.inline.reflink.exec(n)) || (r = this.rules.inline.nolink.exec(n))) {
313
+ let s = (r[2] || r[1]).replace(this.rules.other.multipleSpaceGlobal, " "), t = e[s.toLowerCase()];
306
314
  if (!t) {
307
315
  let i = r[0].charAt(0);
308
316
  return { type: "text", raw: i, text: i };
309
317
  }
310
- return se(r, t, r[0], this.lexer, this.rules);
318
+ return ne(r, t, r[0], this.lexer, this.rules);
311
319
  }
312
320
  }
313
- emStrong(s, e, r = "") {
314
- let n = this.rules.inline.emStrongLDelim.exec(s);
315
- if (!(!n || n[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(n[1] || n[2]) || !r || this.rules.inline.punctuation.exec(r))) {
316
- let t = [...n[0]].length - 1, i, l, o = t, a = 0, h = n[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
317
- for (h.lastIndex = 0, e = e.slice(-1 * s.length + t); (n = h.exec(e)) != null; ) {
318
- if (i = n[1] || n[2] || n[3] || n[4] || n[5] || n[6], !i) continue;
319
- if (l = [...i].length, n[3] || n[4]) {
321
+ emStrong(n, e, r = "") {
322
+ let s = this.rules.inline.emStrongLDelim.exec(n);
323
+ if (!(!s || s[3] && r.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !r || this.rules.inline.punctuation.exec(r))) {
324
+ let t = [...s[0]].length - 1, i, l, o = t, a = 0, h = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
325
+ for (h.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = h.exec(e)) != null; ) {
326
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i) continue;
327
+ if (l = [...i].length, s[3] || s[4]) {
320
328
  o += l;
321
329
  continue;
322
- } else if ((n[5] || n[6]) && t % 3 && !((t + l) % 3)) {
330
+ } else if ((s[5] || s[6]) && t % 3 && !((t + l) % 3)) {
323
331
  a += l;
324
332
  continue;
325
333
  }
326
334
  if (o -= l, o > 0) continue;
327
335
  l = Math.min(l, l + o + a);
328
- let c = [...n[0]][0].length, k = s.slice(0, t + n.index + c + l);
336
+ let c = [...s[0]][0].length, g = n.slice(0, t + s.index + c + l);
329
337
  if (Math.min(t, l) % 2) {
330
- let d = k.slice(1, -1);
331
- return { type: "em", raw: k, text: d, tokens: this.lexer.inlineTokens(d) };
338
+ let d = g.slice(1, -1);
339
+ return { type: "em", raw: g, text: d, tokens: this.lexer.inlineTokens(d) };
332
340
  }
333
- let u = k.slice(2, -2);
334
- return { type: "strong", raw: k, text: u, tokens: this.lexer.inlineTokens(u) };
341
+ let u = g.slice(2, -2);
342
+ return { type: "strong", raw: g, text: u, tokens: this.lexer.inlineTokens(u) };
335
343
  }
336
344
  }
337
345
  }
338
- codespan(s) {
339
- let e = this.rules.inline.code.exec(s);
346
+ codespan(n) {
347
+ let e = this.rules.inline.code.exec(n);
340
348
  if (e) {
341
- let r = e[2].replace(this.rules.other.newLineCharGlobal, " "), n = this.rules.other.nonSpaceChar.test(r), t = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
342
- return n && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
349
+ let r = e[2].replace(this.rules.other.newLineCharGlobal, " "), s = this.rules.other.nonSpaceChar.test(r), t = this.rules.other.startingSpaceChar.test(r) && this.rules.other.endingSpaceChar.test(r);
350
+ return s && t && (r = r.substring(1, r.length - 1)), { type: "codespan", raw: e[0], text: r };
343
351
  }
344
352
  }
345
- br(s) {
346
- let e = this.rules.inline.br.exec(s);
353
+ br(n) {
354
+ let e = this.rules.inline.br.exec(n);
347
355
  if (e) return { type: "br", raw: e[0] };
348
356
  }
349
- del(s) {
350
- let e = this.rules.inline.del.exec(s);
351
- if (e) return { type: "del", raw: e[0], text: e[2], tokens: this.lexer.inlineTokens(e[2]) };
357
+ del(n, e, r = "") {
358
+ let s = this.rules.inline.delLDelim.exec(n);
359
+ if (s && (!s[1] || !r || this.rules.inline.punctuation.exec(r))) {
360
+ let t = [...s[0]].length - 1, i, l, o = t, a = this.rules.inline.delRDelim;
361
+ for (a.lastIndex = 0, e = e.slice(-1 * n.length + t); (s = a.exec(e)) != null; ) {
362
+ if (i = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !i || (l = [...i].length, l !== t)) continue;
363
+ if (s[3] || s[4]) {
364
+ o += l;
365
+ continue;
366
+ }
367
+ if (o -= l, o > 0) continue;
368
+ l = Math.min(l, l + o);
369
+ let h = [...s[0]][0].length, c = n.slice(0, t + s.index + h + l), g = c.slice(t, -t);
370
+ return { type: "del", raw: c, text: g, tokens: this.lexer.inlineTokens(g) };
371
+ }
372
+ }
352
373
  }
353
- autolink(s) {
354
- let e = this.rules.inline.autolink.exec(s);
374
+ autolink(n) {
375
+ let e = this.rules.inline.autolink.exec(n);
355
376
  if (e) {
356
- let r, n;
357
- return e[2] === "@" ? (r = e[1], n = "mailto:" + r) : (r = e[1], n = r), { type: "link", raw: e[0], text: r, href: n, tokens: [{ type: "text", raw: r, text: r }] };
377
+ let r, s;
378
+ return e[2] === "@" ? (r = e[1], s = "mailto:" + r) : (r = e[1], s = r), { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
358
379
  }
359
380
  }
360
- url(s) {
381
+ url(n) {
361
382
  let e;
362
- if (e = this.rules.inline.url.exec(s)) {
363
- let r, n;
364
- if (e[2] === "@") r = e[0], n = "mailto:" + r;
383
+ if (e = this.rules.inline.url.exec(n)) {
384
+ let r, s;
385
+ if (e[2] === "@") r = e[0], s = "mailto:" + r;
365
386
  else {
366
387
  let t;
367
388
  do
368
389
  t = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
369
390
  while (t !== e[0]);
370
- r = e[0], e[1] === "www." ? n = "http://" + e[0] : n = e[0];
391
+ r = e[0], e[1] === "www." ? s = "http://" + e[0] : s = e[0];
371
392
  }
372
- return { type: "link", raw: e[0], text: r, href: n, tokens: [{ type: "text", raw: r, text: r }] };
393
+ return { type: "link", raw: e[0], text: r, href: s, tokens: [{ type: "text", raw: r, text: r }] };
373
394
  }
374
395
  }
375
- inlineText(s) {
376
- let e = this.rules.inline.text.exec(s);
396
+ inlineText(n) {
397
+ let e = this.rules.inline.text.exec(n);
377
398
  if (e) {
378
399
  let r = this.lexer.state.inRawBlock;
379
400
  return { type: "text", raw: e[0], text: e[0], escaped: r };
380
401
  }
381
402
  }
382
- }, w = class M {
403
+ }, b = class D {
383
404
  tokens;
384
405
  options;
385
406
  state;
386
407
  inlineQueue;
387
408
  tokenizer;
388
409
  constructor(e) {
389
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new C(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
390
- let r = { other: x, block: I.normal, inline: T.normal };
391
- this.options.pedantic ? (r.block = I.pedantic, r.inline = T.pedantic) : this.options.gfm && (r.block = I.gfm, this.options.breaks ? r.inline = T.breaks : r.inline = T.gfm), this.tokenizer.rules = r;
410
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || R, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
411
+ let r = { other: x, block: I.normal, inline: z.normal };
412
+ this.options.pedantic ? (r.block = I.pedantic, r.inline = z.pedantic) : this.options.gfm && (r.block = I.gfm, this.options.breaks ? r.inline = z.breaks : r.inline = z.gfm), this.tokenizer.rules = r;
392
413
  }
393
414
  static get rules() {
394
- return { block: I, inline: T };
415
+ return { block: I, inline: z };
395
416
  }
396
417
  static lex(e, r) {
397
- return new M(r).lex(e);
418
+ return new D(r).lex(e);
398
419
  }
399
420
  static lexInline(e, r) {
400
- return new M(r).inlineTokens(e);
421
+ return new D(r).inlineTokens(e);
401
422
  }
402
423
  lex(e) {
403
424
  e = e.replace(x.carriageReturn, `
404
425
  `), this.blockTokens(e, this.tokens);
405
426
  for (let r = 0; r < this.inlineQueue.length; r++) {
406
- let n = this.inlineQueue[r];
407
- this.inlineTokens(n.src, n.tokens);
427
+ let s = this.inlineQueue[r];
428
+ this.inlineTokens(s.src, s.tokens);
408
429
  }
409
430
  return this.inlineQueue = [], this.tokens;
410
431
  }
411
- blockTokens(e, r = [], n = !1) {
432
+ blockTokens(e, r = [], s = !1) {
412
433
  for (this.options.pedantic && (e = e.replace(x.tabCharGlobal, " ").replace(x.spaceLine, "")); e; ) {
413
434
  let t;
414
435
  if (this.options.extensions?.block?.some((l) => (t = l.call({ lexer: this }, e, r)) ? (e = e.substring(t.raw.length), r.push(t), !0) : !1)) continue;
@@ -478,10 +499,10 @@ ${c}` : c;
478
499
  }
479
500
  if (this.state.top && (t = this.tokenizer.paragraph(i))) {
480
501
  let l = r.at(-1);
481
- n && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
502
+ s && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
482
503
  `) ? "" : `
483
504
  `) + t.raw, l.text += `
484
- ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t), n = i.length !== e.length, e = e.substring(t.raw.length);
505
+ ` + t.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : r.push(t), s = i.length !== e.length, e = e.substring(t.raw.length);
485
506
  continue;
486
507
  }
487
508
  if (t = this.tokenizer.text(e)) {
@@ -507,15 +528,15 @@ ${c}` : c;
507
528
  return this.inlineQueue.push({ src: e, tokens: r }), r;
508
529
  }
509
530
  inlineTokens(e, r = []) {
510
- let n = e, t = null;
531
+ let s = e, t = null;
511
532
  if (this.tokens.links) {
512
533
  let a = Object.keys(this.tokens.links);
513
- if (a.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(n)) != null; ) a.includes(t[0].slice(t[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
534
+ if (a.length > 0) for (; (t = this.tokenizer.rules.inline.reflinkSearch.exec(s)) != null; ) a.includes(t[0].slice(t[0].lastIndexOf("[") + 1, -1)) && (s = s.slice(0, t.index) + "[" + "a".repeat(t[0].length - 2) + "]" + s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
514
535
  }
515
- for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(n)) != null; ) n = n.slice(0, t.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
536
+ for (; (t = this.tokenizer.rules.inline.anyPunctuation.exec(s)) != null; ) s = s.slice(0, t.index) + "++" + s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
516
537
  let i;
517
- for (; (t = this.tokenizer.rules.inline.blockSkip.exec(n)) != null; ) i = t[2] ? t[2].length : 0, n = n.slice(0, t.index + i) + "[" + "a".repeat(t[0].length - i - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
518
- n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
538
+ for (; (t = this.tokenizer.rules.inline.blockSkip.exec(s)) != null; ) i = t[2] ? t[2].length : 0, s = s.slice(0, t.index + i) + "[" + "a".repeat(t[0].length - i - 2) + "]" + s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
539
+ s = this.options.hooks?.emStrongMask?.call({ lexer: this }, s) ?? s;
519
540
  let l = !1, o = "";
520
541
  for (; e; ) {
521
542
  l || (o = ""), l = !1;
@@ -539,7 +560,7 @@ ${c}` : c;
539
560
  a.type === "text" && c?.type === "text" ? (c.raw += a.raw, c.text += a.text) : r.push(a);
540
561
  continue;
541
562
  }
542
- if (a = this.tokenizer.emStrong(e, n, o)) {
563
+ if (a = this.tokenizer.emStrong(e, s, o)) {
543
564
  e = e.substring(a.raw.length), r.push(a);
544
565
  continue;
545
566
  }
@@ -551,7 +572,7 @@ ${c}` : c;
551
572
  e = e.substring(a.raw.length), r.push(a);
552
573
  continue;
553
574
  }
554
- if (a = this.tokenizer.del(e)) {
575
+ if (a = this.tokenizer.del(e, s, o)) {
555
576
  e = e.substring(a.raw.length), r.push(a);
556
577
  continue;
557
578
  }
@@ -565,9 +586,9 @@ ${c}` : c;
565
586
  }
566
587
  let h = e;
567
588
  if (this.options.extensions?.startInline) {
568
- let c = 1 / 0, k = e.slice(1), u;
589
+ let c = 1 / 0, g = e.slice(1), u;
569
590
  this.options.extensions.startInline.forEach((d) => {
570
- u = d.call({ lexer: this }, k), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
591
+ u = d.call({ lexer: this }, g), typeof u == "number" && u >= 0 && (c = Math.min(c, u));
571
592
  }), c < 1 / 0 && c >= 0 && (h = e.substring(0, c + 1));
572
593
  }
573
594
  if (a = this.tokenizer.inlineText(h)) {
@@ -586,171 +607,171 @@ ${c}` : c;
586
607
  }
587
608
  return r;
588
609
  }
589
- }, q = class {
610
+ }, B = class {
590
611
  options;
591
612
  parser;
592
- constructor(s) {
593
- this.options = s || R;
613
+ constructor(n) {
614
+ this.options = n || R;
594
615
  }
595
- space(s) {
616
+ space(n) {
596
617
  return "";
597
618
  }
598
- code({ text: s, lang: e, escaped: r }) {
599
- let n = (e || "").match(x.notSpaceStart)?.[0], t = s.replace(x.endingNewline, "") + `
619
+ code({ text: n, lang: e, escaped: r }) {
620
+ let s = (e || "").match(x.notSpaceStart)?.[0], t = n.replace(x.endingNewline, "") + `
600
621
  `;
601
- return n ? '<pre><code class="language-' + y(n) + '">' + (r ? t : y(t, !0)) + `</code></pre>
622
+ return s ? '<pre><code class="language-' + y(s) + '">' + (r ? t : y(t, !0)) + `</code></pre>
602
623
  ` : "<pre><code>" + (r ? t : y(t, !0)) + `</code></pre>
603
624
  `;
604
625
  }
605
- blockquote({ tokens: s }) {
626
+ blockquote({ tokens: n }) {
606
627
  return `<blockquote>
607
- ${this.parser.parse(s)}</blockquote>
628
+ ${this.parser.parse(n)}</blockquote>
608
629
  `;
609
630
  }
610
- html({ text: s }) {
611
- return s;
631
+ html({ text: n }) {
632
+ return n;
612
633
  }
613
- def(s) {
634
+ def(n) {
614
635
  return "";
615
636
  }
616
- heading({ tokens: s, depth: e }) {
617
- return `<h${e}>${this.parser.parseInline(s)}</h${e}>
637
+ heading({ tokens: n, depth: e }) {
638
+ return `<h${e}>${this.parser.parseInline(n)}</h${e}>
618
639
  `;
619
640
  }
620
- hr(s) {
641
+ hr(n) {
621
642
  return `<hr>
622
643
  `;
623
644
  }
624
- list(s) {
625
- let e = s.ordered, r = s.start, n = "";
626
- for (let l = 0; l < s.items.length; l++) {
627
- let o = s.items[l];
628
- n += this.listitem(o);
645
+ list(n) {
646
+ let e = n.ordered, r = n.start, s = "";
647
+ for (let l = 0; l < n.items.length; l++) {
648
+ let o = n.items[l];
649
+ s += this.listitem(o);
629
650
  }
630
651
  let t = e ? "ol" : "ul", i = e && r !== 1 ? ' start="' + r + '"' : "";
631
652
  return "<" + t + i + `>
632
- ` + n + "</" + t + `>
653
+ ` + s + "</" + t + `>
633
654
  `;
634
655
  }
635
- listitem(s) {
636
- return `<li>${this.parser.parse(s.tokens)}</li>
656
+ listitem(n) {
657
+ return `<li>${this.parser.parse(n.tokens)}</li>
637
658
  `;
638
659
  }
639
- checkbox({ checked: s }) {
640
- return "<input " + (s ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
660
+ checkbox({ checked: n }) {
661
+ return "<input " + (n ? 'checked="" ' : "") + 'disabled="" type="checkbox"> ';
641
662
  }
642
- paragraph({ tokens: s }) {
643
- return `<p>${this.parser.parseInline(s)}</p>
663
+ paragraph({ tokens: n }) {
664
+ return `<p>${this.parser.parseInline(n)}</p>
644
665
  `;
645
666
  }
646
- table(s) {
667
+ table(n) {
647
668
  let e = "", r = "";
648
- for (let t = 0; t < s.header.length; t++) r += this.tablecell(s.header[t]);
669
+ for (let t = 0; t < n.header.length; t++) r += this.tablecell(n.header[t]);
649
670
  e += this.tablerow({ text: r });
650
- let n = "";
651
- for (let t = 0; t < s.rows.length; t++) {
652
- let i = s.rows[t];
671
+ let s = "";
672
+ for (let t = 0; t < n.rows.length; t++) {
673
+ let i = n.rows[t];
653
674
  r = "";
654
675
  for (let l = 0; l < i.length; l++) r += this.tablecell(i[l]);
655
- n += this.tablerow({ text: r });
676
+ s += this.tablerow({ text: r });
656
677
  }
657
- return n && (n = `<tbody>${n}</tbody>`), `<table>
678
+ return s && (s = `<tbody>${s}</tbody>`), `<table>
658
679
  <thead>
659
680
  ` + e + `</thead>
660
- ` + n + `</table>
681
+ ` + s + `</table>
661
682
  `;
662
683
  }
663
- tablerow({ text: s }) {
684
+ tablerow({ text: n }) {
664
685
  return `<tr>
665
- ${s}</tr>
686
+ ${n}</tr>
666
687
  `;
667
688
  }
668
- tablecell(s) {
669
- let e = this.parser.parseInline(s.tokens), r = s.header ? "th" : "td";
670
- return (s.align ? `<${r} align="${s.align}">` : `<${r}>`) + e + `</${r}>
689
+ tablecell(n) {
690
+ let e = this.parser.parseInline(n.tokens), r = n.header ? "th" : "td";
691
+ return (n.align ? `<${r} align="${n.align}">` : `<${r}>`) + e + `</${r}>
671
692
  `;
672
693
  }
673
- strong({ tokens: s }) {
674
- return `<strong>${this.parser.parseInline(s)}</strong>`;
694
+ strong({ tokens: n }) {
695
+ return `<strong>${this.parser.parseInline(n)}</strong>`;
675
696
  }
676
- em({ tokens: s }) {
677
- return `<em>${this.parser.parseInline(s)}</em>`;
697
+ em({ tokens: n }) {
698
+ return `<em>${this.parser.parseInline(n)}</em>`;
678
699
  }
679
- codespan({ text: s }) {
680
- return `<code>${y(s, !0)}</code>`;
700
+ codespan({ text: n }) {
701
+ return `<code>${y(n, !0)}</code>`;
681
702
  }
682
- br(s) {
703
+ br(n) {
683
704
  return "<br>";
684
705
  }
685
- del({ tokens: s }) {
686
- return `<del>${this.parser.parseInline(s)}</del>`;
706
+ del({ tokens: n }) {
707
+ return `<del>${this.parser.parseInline(n)}</del>`;
687
708
  }
688
- link({ href: s, title: e, tokens: r }) {
689
- let n = this.parser.parseInline(r), t = te(s);
690
- if (t === null) return n;
691
- s = t;
692
- let i = '<a href="' + s + '"';
693
- return e && (i += ' title="' + y(e) + '"'), i += ">" + n + "</a>", i;
709
+ link({ href: n, title: e, tokens: r }) {
710
+ let s = this.parser.parseInline(r), t = te(n);
711
+ if (t === null) return s;
712
+ n = t;
713
+ let i = '<a href="' + n + '"';
714
+ return e && (i += ' title="' + y(e) + '"'), i += ">" + s + "</a>", i;
694
715
  }
695
- image({ href: s, title: e, text: r, tokens: n }) {
696
- n && (r = this.parser.parseInline(n, this.parser.textRenderer));
697
- let t = te(s);
716
+ image({ href: n, title: e, text: r, tokens: s }) {
717
+ s && (r = this.parser.parseInline(s, this.parser.textRenderer));
718
+ let t = te(n);
698
719
  if (t === null) return y(r);
699
- s = t;
700
- let i = `<img src="${s}" alt="${r}"`;
720
+ n = t;
721
+ let i = `<img src="${n}" alt="${r}"`;
701
722
  return e && (i += ` title="${y(e)}"`), i += ">", i;
702
723
  }
703
- text(s) {
704
- return "tokens" in s && s.tokens ? this.parser.parseInline(s.tokens) : "escaped" in s && s.escaped ? s.text : y(s.text);
724
+ text(n) {
725
+ return "tokens" in n && n.tokens ? this.parser.parseInline(n.tokens) : "escaped" in n && n.escaped ? n.text : y(n.text);
705
726
  }
706
727
  }, W = class {
707
- strong({ text: s }) {
708
- return s;
728
+ strong({ text: n }) {
729
+ return n;
709
730
  }
710
- em({ text: s }) {
711
- return s;
731
+ em({ text: n }) {
732
+ return n;
712
733
  }
713
- codespan({ text: s }) {
714
- return s;
734
+ codespan({ text: n }) {
735
+ return n;
715
736
  }
716
- del({ text: s }) {
717
- return s;
737
+ del({ text: n }) {
738
+ return n;
718
739
  }
719
- html({ text: s }) {
720
- return s;
740
+ html({ text: n }) {
741
+ return n;
721
742
  }
722
- text({ text: s }) {
723
- return s;
743
+ text({ text: n }) {
744
+ return n;
724
745
  }
725
- link({ text: s }) {
726
- return "" + s;
746
+ link({ text: n }) {
747
+ return "" + n;
727
748
  }
728
- image({ text: s }) {
729
- return "" + s;
749
+ image({ text: n }) {
750
+ return "" + n;
730
751
  }
731
752
  br() {
732
753
  return "";
733
754
  }
734
- checkbox({ raw: s }) {
735
- return s;
755
+ checkbox({ raw: n }) {
756
+ return n;
736
757
  }
737
- }, m = class Q {
758
+ }, w = class M {
738
759
  options;
739
760
  renderer;
740
761
  textRenderer;
741
762
  constructor(e) {
742
- this.options = e || R, this.options.renderer = this.options.renderer || new q(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new W();
763
+ this.options = e || R, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new W();
743
764
  }
744
765
  static parse(e, r) {
745
- return new Q(r).parse(e);
766
+ return new M(r).parse(e);
746
767
  }
747
768
  static parseInline(e, r) {
748
- return new Q(r).parseInline(e);
769
+ return new M(r).parseInline(e);
749
770
  }
750
771
  parse(e) {
751
772
  let r = "";
752
- for (let n = 0; n < e.length; n++) {
753
- let t = e[n];
773
+ for (let s = 0; s < e.length; s++) {
774
+ let t = e[s];
754
775
  if (this.options.extensions?.renderers?.[t.type]) {
755
776
  let l = t, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
756
777
  if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
@@ -818,60 +839,60 @@ ${s}</tr>
818
839
  return r;
819
840
  }
820
841
  parseInline(e, r = this.renderer) {
821
- let n = "";
842
+ let s = "";
822
843
  for (let t = 0; t < e.length; t++) {
823
844
  let i = e[t];
824
845
  if (this.options.extensions?.renderers?.[i.type]) {
825
846
  let o = this.options.extensions.renderers[i.type].call({ parser: this }, i);
826
847
  if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(i.type)) {
827
- n += o || "";
848
+ s += o || "";
828
849
  continue;
829
850
  }
830
851
  }
831
852
  let l = i;
832
853
  switch (l.type) {
833
854
  case "escape": {
834
- n += r.text(l);
855
+ s += r.text(l);
835
856
  break;
836
857
  }
837
858
  case "html": {
838
- n += r.html(l);
859
+ s += r.html(l);
839
860
  break;
840
861
  }
841
862
  case "link": {
842
- n += r.link(l);
863
+ s += r.link(l);
843
864
  break;
844
865
  }
845
866
  case "image": {
846
- n += r.image(l);
867
+ s += r.image(l);
847
868
  break;
848
869
  }
849
870
  case "checkbox": {
850
- n += r.checkbox(l);
871
+ s += r.checkbox(l);
851
872
  break;
852
873
  }
853
874
  case "strong": {
854
- n += r.strong(l);
875
+ s += r.strong(l);
855
876
  break;
856
877
  }
857
878
  case "em": {
858
- n += r.em(l);
879
+ s += r.em(l);
859
880
  break;
860
881
  }
861
882
  case "codespan": {
862
- n += r.codespan(l);
883
+ s += r.codespan(l);
863
884
  break;
864
885
  }
865
886
  case "br": {
866
- n += r.br(l);
887
+ s += r.br(l);
867
888
  break;
868
889
  }
869
890
  case "del": {
870
- n += r.del(l);
891
+ s += r.del(l);
871
892
  break;
872
893
  }
873
894
  case "text": {
874
- n += r.text(l);
895
+ s += r.text(l);
875
896
  break;
876
897
  }
877
898
  default: {
@@ -881,64 +902,64 @@ ${s}</tr>
881
902
  }
882
903
  }
883
904
  }
884
- return n;
905
+ return s;
885
906
  }
886
- }, A = class {
907
+ }, _ = class {
887
908
  options;
888
909
  block;
889
- constructor(s) {
890
- this.options = s || R;
910
+ constructor(n) {
911
+ this.options = n || R;
891
912
  }
892
913
  static passThroughHooks = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"]);
893
914
  static passThroughHooksRespectAsync = /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"]);
894
- preprocess(s) {
895
- return s;
915
+ preprocess(n) {
916
+ return n;
896
917
  }
897
- postprocess(s) {
898
- return s;
918
+ postprocess(n) {
919
+ return n;
899
920
  }
900
- processAllTokens(s) {
901
- return s;
921
+ processAllTokens(n) {
922
+ return n;
902
923
  }
903
- emStrongMask(s) {
904
- return s;
924
+ emStrongMask(n) {
925
+ return n;
905
926
  }
906
927
  provideLexer() {
907
- return this.block ? w.lex : w.lexInline;
928
+ return this.block ? b.lex : b.lexInline;
908
929
  }
909
930
  provideParser() {
910
- return this.block ? m.parse : m.parseInline;
931
+ return this.block ? w.parse : w.parseInline;
911
932
  }
912
- }, Ve = class {
913
- defaults = D();
933
+ }, it = class {
934
+ defaults = Q();
914
935
  options = this.setOptions;
915
936
  parse = this.parseMarkdown(!0);
916
937
  parseInline = this.parseMarkdown(!1);
917
- Parser = m;
918
- Renderer = q;
938
+ Parser = w;
939
+ Renderer = B;
919
940
  TextRenderer = W;
920
- Lexer = w;
921
- Tokenizer = C;
922
- Hooks = A;
923
- constructor(...s) {
924
- this.use(...s);
941
+ Lexer = b;
942
+ Tokenizer = q;
943
+ Hooks = _;
944
+ constructor(...n) {
945
+ this.use(...n);
925
946
  }
926
- walkTokens(s, e) {
947
+ walkTokens(n, e) {
927
948
  let r = [];
928
- for (let n of s) switch (r = r.concat(e.call(this, n)), n.type) {
949
+ for (let s of n) switch (r = r.concat(e.call(this, s)), s.type) {
929
950
  case "table": {
930
- let t = n;
951
+ let t = s;
931
952
  for (let i of t.header) r = r.concat(this.walkTokens(i.tokens, e));
932
953
  for (let i of t.rows) for (let l of i) r = r.concat(this.walkTokens(l.tokens, e));
933
954
  break;
934
955
  }
935
956
  case "list": {
936
- let t = n;
957
+ let t = s;
937
958
  r = r.concat(this.walkTokens(t.items, e));
938
959
  break;
939
960
  }
940
961
  default: {
941
- let t = n;
962
+ let t = s;
942
963
  this.defaults.extensions?.childTokens?.[t.type] ? this.defaults.extensions.childTokens[t.type].forEach((i) => {
943
964
  let l = t[i].flat(1 / 0);
944
965
  r = r.concat(this.walkTokens(l, e));
@@ -947,11 +968,11 @@ ${s}</tr>
947
968
  }
948
969
  return r;
949
970
  }
950
- use(...s) {
971
+ use(...n) {
951
972
  let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
952
- return s.forEach((r) => {
953
- let n = { ...r };
954
- if (n.async = this.defaults.async || n.async || !1, r.extensions && (r.extensions.forEach((t) => {
973
+ return n.forEach((r) => {
974
+ let s = { ...r };
975
+ if (s.async = this.defaults.async || s.async || !1, r.extensions && (r.extensions.forEach((t) => {
955
976
  if (!t.name) throw new Error("extension name required");
956
977
  if ("renderer" in t) {
957
978
  let i = e.renderers[t.name];
@@ -966,8 +987,8 @@ ${s}</tr>
966
987
  i ? i.unshift(t.tokenizer) : e[t.level] = [t.tokenizer], t.start && (t.level === "block" ? e.startBlock ? e.startBlock.push(t.start) : e.startBlock = [t.start] : t.level === "inline" && (e.startInline ? e.startInline.push(t.start) : e.startInline = [t.start]));
967
988
  }
968
989
  "childTokens" in t && t.childTokens && (e.childTokens[t.name] = t.childTokens);
969
- }), n.extensions = e), r.renderer) {
970
- let t = this.defaults.renderer || new q(this.defaults);
990
+ }), s.extensions = e), r.renderer) {
991
+ let t = this.defaults.renderer || new B(this.defaults);
971
992
  for (let i in r.renderer) {
972
993
  if (!(i in t)) throw new Error(`renderer '${i}' does not exist`);
973
994
  if (["options", "parser"].includes(i)) continue;
@@ -977,10 +998,10 @@ ${s}</tr>
977
998
  return c === !1 && (c = a.apply(t, h)), c || "";
978
999
  };
979
1000
  }
980
- n.renderer = t;
1001
+ s.renderer = t;
981
1002
  }
982
1003
  if (r.tokenizer) {
983
- let t = this.defaults.tokenizer || new C(this.defaults);
1004
+ let t = this.defaults.tokenizer || new q(this.defaults);
984
1005
  for (let i in r.tokenizer) {
985
1006
  if (!(i in t)) throw new Error(`tokenizer '${i}' does not exist`);
986
1007
  if (["options", "rules", "lexer"].includes(i)) continue;
@@ -990,134 +1011,134 @@ ${s}</tr>
990
1011
  return c === !1 && (c = a.apply(t, h)), c;
991
1012
  };
992
1013
  }
993
- n.tokenizer = t;
1014
+ s.tokenizer = t;
994
1015
  }
995
1016
  if (r.hooks) {
996
- let t = this.defaults.hooks || new A();
1017
+ let t = this.defaults.hooks || new _();
997
1018
  for (let i in r.hooks) {
998
1019
  if (!(i in t)) throw new Error(`hook '${i}' does not exist`);
999
1020
  if (["options", "block"].includes(i)) continue;
1000
1021
  let l = i, o = r.hooks[l], a = t[l];
1001
- A.passThroughHooks.has(i) ? t[l] = (h) => {
1002
- if (this.defaults.async && A.passThroughHooksRespectAsync.has(i)) return (async () => {
1003
- let k = await o.call(t, h);
1004
- return a.call(t, k);
1022
+ _.passThroughHooks.has(i) ? t[l] = (h) => {
1023
+ if (this.defaults.async && _.passThroughHooksRespectAsync.has(i)) return (async () => {
1024
+ let g = await o.call(t, h);
1025
+ return a.call(t, g);
1005
1026
  })();
1006
1027
  let c = o.call(t, h);
1007
1028
  return a.call(t, c);
1008
1029
  } : t[l] = (...h) => {
1009
1030
  if (this.defaults.async) return (async () => {
1010
- let k = await o.apply(t, h);
1011
- return k === !1 && (k = await a.apply(t, h)), k;
1031
+ let g = await o.apply(t, h);
1032
+ return g === !1 && (g = await a.apply(t, h)), g;
1012
1033
  })();
1013
1034
  let c = o.apply(t, h);
1014
1035
  return c === !1 && (c = a.apply(t, h)), c;
1015
1036
  };
1016
1037
  }
1017
- n.hooks = t;
1038
+ s.hooks = t;
1018
1039
  }
1019
1040
  if (r.walkTokens) {
1020
1041
  let t = this.defaults.walkTokens, i = r.walkTokens;
1021
- n.walkTokens = function(l) {
1042
+ s.walkTokens = function(l) {
1022
1043
  let o = [];
1023
1044
  return o.push(i.call(this, l)), t && (o = o.concat(t.call(this, l))), o;
1024
1045
  };
1025
1046
  }
1026
- this.defaults = { ...this.defaults, ...n };
1047
+ this.defaults = { ...this.defaults, ...s };
1027
1048
  }), this;
1028
1049
  }
1029
- setOptions(s) {
1030
- return this.defaults = { ...this.defaults, ...s }, this;
1050
+ setOptions(n) {
1051
+ return this.defaults = { ...this.defaults, ...n }, this;
1031
1052
  }
1032
- lexer(s, e) {
1033
- return w.lex(s, e ?? this.defaults);
1053
+ lexer(n, e) {
1054
+ return b.lex(n, e ?? this.defaults);
1034
1055
  }
1035
- parser(s, e) {
1036
- return m.parse(s, e ?? this.defaults);
1056
+ parser(n, e) {
1057
+ return w.parse(n, e ?? this.defaults);
1037
1058
  }
1038
- parseMarkdown(s) {
1059
+ parseMarkdown(n) {
1039
1060
  return (e, r) => {
1040
- let n = { ...r }, t = { ...this.defaults, ...n }, i = this.onError(!!t.silent, !!t.async);
1041
- if (this.defaults.async === !0 && n.async === !1) return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1061
+ let s = { ...r }, t = { ...this.defaults, ...s }, i = this.onError(!!t.silent, !!t.async);
1062
+ if (this.defaults.async === !0 && s.async === !1) return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
1042
1063
  if (typeof e > "u" || e === null) return i(new Error("marked(): input parameter is undefined or null"));
1043
1064
  if (typeof e != "string") return i(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
1044
- if (t.hooks && (t.hooks.options = t, t.hooks.block = s), t.async) return (async () => {
1045
- let l = t.hooks ? await t.hooks.preprocess(e) : e, o = await (t.hooks ? await t.hooks.provideLexer() : s ? w.lex : w.lexInline)(l, t), a = t.hooks ? await t.hooks.processAllTokens(o) : o;
1065
+ if (t.hooks && (t.hooks.options = t, t.hooks.block = n), t.async) return (async () => {
1066
+ let l = t.hooks ? await t.hooks.preprocess(e) : e, o = await (t.hooks ? await t.hooks.provideLexer() : n ? b.lex : b.lexInline)(l, t), a = t.hooks ? await t.hooks.processAllTokens(o) : o;
1046
1067
  t.walkTokens && await Promise.all(this.walkTokens(a, t.walkTokens));
1047
- let h = await (t.hooks ? await t.hooks.provideParser() : s ? m.parse : m.parseInline)(a, t);
1068
+ let h = await (t.hooks ? await t.hooks.provideParser() : n ? w.parse : w.parseInline)(a, t);
1048
1069
  return t.hooks ? await t.hooks.postprocess(h) : h;
1049
1070
  })().catch(i);
1050
1071
  try {
1051
1072
  t.hooks && (e = t.hooks.preprocess(e));
1052
- let l = (t.hooks ? t.hooks.provideLexer() : s ? w.lex : w.lexInline)(e, t);
1073
+ let l = (t.hooks ? t.hooks.provideLexer() : n ? b.lex : b.lexInline)(e, t);
1053
1074
  t.hooks && (l = t.hooks.processAllTokens(l)), t.walkTokens && this.walkTokens(l, t.walkTokens);
1054
- let o = (t.hooks ? t.hooks.provideParser() : s ? m.parse : m.parseInline)(l, t);
1075
+ let o = (t.hooks ? t.hooks.provideParser() : n ? w.parse : w.parseInline)(l, t);
1055
1076
  return t.hooks && (o = t.hooks.postprocess(o)), o;
1056
1077
  } catch (l) {
1057
1078
  return i(l);
1058
1079
  }
1059
1080
  };
1060
1081
  }
1061
- onError(s, e) {
1082
+ onError(n, e) {
1062
1083
  return (r) => {
1063
1084
  if (r.message += `
1064
- Please report this to https://github.com/markedjs/marked.`, s) {
1065
- let n = "<p>An error occurred:</p><pre>" + y(r.message + "", !0) + "</pre>";
1066
- return e ? Promise.resolve(n) : n;
1085
+ Please report this to https://github.com/markedjs/marked.`, n) {
1086
+ let s = "<p>An error occurred:</p><pre>" + y(r.message + "", !0) + "</pre>";
1087
+ return e ? Promise.resolve(s) : s;
1067
1088
  }
1068
1089
  if (e) return Promise.reject(r);
1069
1090
  throw r;
1070
1091
  };
1071
1092
  }
1072
- }, $ = new Ve();
1073
- function g(s, e) {
1074
- return $.parse(s, e);
1093
+ }, S = new it();
1094
+ function k(n, e) {
1095
+ return S.parse(n, e);
1075
1096
  }
1076
- g.options = g.setOptions = function(s) {
1077
- return $.setOptions(s), g.defaults = $.defaults, ne(g.defaults), g;
1097
+ k.options = k.setOptions = function(n) {
1098
+ return S.setOptions(n), k.defaults = S.defaults, se(k.defaults), k;
1078
1099
  };
1079
- g.getDefaults = D;
1080
- g.defaults = R;
1081
- g.use = function(...s) {
1082
- return $.use(...s), g.defaults = $.defaults, ne(g.defaults), g;
1100
+ k.getDefaults = Q;
1101
+ k.defaults = R;
1102
+ k.use = function(...n) {
1103
+ return S.use(...n), k.defaults = S.defaults, se(k.defaults), k;
1083
1104
  };
1084
- g.walkTokens = function(s, e) {
1085
- return $.walkTokens(s, e);
1105
+ k.walkTokens = function(n, e) {
1106
+ return S.walkTokens(n, e);
1086
1107
  };
1087
- g.parseInline = $.parseInline;
1088
- g.Parser = m;
1089
- g.parser = m.parse;
1090
- g.Renderer = q;
1091
- g.TextRenderer = W;
1092
- g.Lexer = w;
1093
- g.lexer = w.lex;
1094
- g.Tokenizer = C;
1095
- g.Hooks = A;
1096
- g.parse = g;
1097
- g.options;
1098
- g.setOptions;
1099
- g.use;
1100
- g.walkTokens;
1101
- g.parseInline;
1102
- m.parse;
1103
- w.lex;
1104
- g.use({
1108
+ k.parseInline = S.parseInline;
1109
+ k.Parser = w;
1110
+ k.parser = w.parse;
1111
+ k.Renderer = B;
1112
+ k.TextRenderer = W;
1113
+ k.Lexer = b;
1114
+ k.lexer = b.lex;
1115
+ k.Tokenizer = q;
1116
+ k.Hooks = _;
1117
+ k.parse = k;
1118
+ k.options;
1119
+ k.setOptions;
1120
+ k.use;
1121
+ k.walkTokens;
1122
+ k.parseInline;
1123
+ w.parse;
1124
+ b.lex;
1125
+ k.use({
1105
1126
  gfm: !0,
1106
1127
  breaks: !0,
1107
1128
  async: !1,
1108
1129
  renderer: {
1109
- link({ href: s, title: e, tokens: r }) {
1110
- const n = this.parser.parseInline(r);
1111
- return `<calcite-link href="${s}" title="${e ?? n}" target="Arcade Help">${n}</calcite-link>`;
1130
+ link({ href: n, title: e, tokens: r }) {
1131
+ const s = this.parser.parseInline(r);
1132
+ return `<calcite-link href="${n}" title="${e ?? s}" target="Arcade Help">${s}</calcite-link>`;
1112
1133
  },
1113
- code({ lang: s, text: e }) {
1114
- return `<arcgis-code-viewer language="${s === "sql" ? "arcgis-sql-expression" : s}">${e}</arcgis-code-viewer>`;
1134
+ code({ lang: n, text: e }) {
1135
+ return `<arcgis-code-viewer language="${n === "sql" ? "arcgis-sql-expression" : n}">${e}</arcgis-code-viewer>`;
1115
1136
  }
1116
1137
  }
1117
1138
  });
1118
- function Ye(s) {
1119
- return s == null ? "" : g.parse(typeof s == "string" ? s : s.value, { async: !1 });
1139
+ function at(n) {
1140
+ return n == null ? "" : k.parse(typeof n == "string" ? n : n.value, { async: !1 });
1120
1141
  }
1121
1142
  export {
1122
- Ye as c
1143
+ at as c
1123
1144
  };