import{l as $n}from"./index-YIaDEtYb.js";function ht(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var te=ht();function an(n){te=n}var we={exec:()=>null};function b(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace(N.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var N={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]\] /,listReplaceTask:/^\[[ 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")},Un=/^(?:[ \t]*(?:\n|$))+/,Fn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Hn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ft=/(?:[*+-]|\d{1,9}[.)])/,on=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cn=b(on).replace(/bull/g,ft).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(),Gn=b(on).replace(/bull/g,ft).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(),gt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Wn=/^[^\n]+/,dt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qn=b(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Zn=b(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ft).getRegex(),Ue="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",mt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Yn=b("^ {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",mt).replace("tag",Ue).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),un=b(gt).replace("hr",Ae).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",Ue).getRegex(),jn=b(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",un).getRegex(),kt={blockquote:jn,code:Fn,def:qn,fences:Hn,heading:Bn,hr:Ae,html:Yn,lheading:cn,list:Zn,newline:Un,paragraph:un,table:we,text:Wn},Zt=b("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ae).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",Ue).getRegex(),Xn={...kt,lheading:Gn,table:Zt,paragraph:b(gt).replace("hr",Ae).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Zt).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",Ue).getRegex()},Qn={...kt,html:b(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",mt).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:we,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:b(gt).replace("hr",Ae).replace("heading",` *#{1,6} *[^
]`).replace("lheading",cn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Vn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Kn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pn=/^( {2,}|\\)\n(?!\s*$)/,Jn=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Fe=/[\p{P}\p{S}]/u,bt=/[\s\p{P}\p{S}]/u,hn=/[^\s\p{P}\p{S}]/u,er=b(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,bt).getRegex(),fn=/(?!~)[\p{P}\p{S}]/u,tr=/(?!~)[\s\p{P}\p{S}]/u,nr=/(?:[^\s\p{P}\p{S}]|~)/u,rr=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,gn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sr=b(gn,"u").replace(/punct/g,Fe).getRegex(),ir=b(gn,"u").replace(/punct/g,fn).getRegex(),dn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",lr=b(dn,"gu").replace(/notPunctSpace/g,hn).replace(/punctSpace/g,bt).replace(/punct/g,Fe).getRegex(),ar=b(dn,"gu").replace(/notPunctSpace/g,nr).replace(/punctSpace/g,tr).replace(/punct/g,fn).getRegex(),or=b("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hn).replace(/punctSpace/g,bt).replace(/punct/g,Fe).getRegex(),cr=b(/\\(punct)/,"gu").replace(/punct/g,Fe).getRegex(),ur=b(/^<(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(),pr=b(mt).replace("(?:-->|$)","-->").getRegex(),hr=b("^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",pr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ze=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,fr=b(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ze).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),mn=b(/^!?\[(label)\]\[(ref)\]/).replace("label",ze).replace("ref",dt).getRegex(),kn=b(/^!?\[(ref)\](?:\[\])?/).replace("ref",dt).getRegex(),gr=b("reflink|nolink(?!\\()","g").replace("reflink",mn).replace("nolink",kn).getRegex(),xt={_backpedal:we,anyPunctuation:cr,autolink:ur,blockSkip:rr,br:pn,code:Kn,del:we,emStrongLDelim:sr,emStrongRDelimAst:lr,emStrongRDelimUnd:or,escape:Vn,link:fr,nolink:kn,punctuation:er,reflink:mn,reflinkSearch:gr,tag:hr,text:Jn,url:we},dr={...xt,link:b(/^!?\[(label)\]\((.*?)\)/).replace("label",ze).getRegex(),reflink:b(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ze).getRegex()},at={...xt,emStrongRDelimAst:ar,emStrongLDelim:ir,url:b(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").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:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},mr={...at,br:b(pn).replace("{2,}","*").getRegex(),text:b(at.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},De={normal:kt,gfm:Xn,pedantic:Qn},fe={normal:xt,gfm:at,breaks:mr,pedantic:dr},kr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Yt=n=>kr[n];function H(n,e){if(e){if(N.escapeTest.test(n))return n.replace(N.escapeReplace,Yt)}else if(N.escapeTestNoEncode.test(n))return n.replace(N.escapeReplaceNoEncode,Yt);return n}function jt(n){try{n=encodeURI(n).replace(N.percentDecode,"%")}catch{return null}return n}function Xt(n,e){let r=n.replace(N.findPipe,(a,l,o)=>{let u=!1,p=l;for(;--p>=0&&o[p]==="\\";)u=!u;return u?"|":" |"}),s=r.split(N.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(N.slashPipe,"|");return s}function ge(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s&&n.charAt(s-t-1)===e;)t++;return n.slice(0,s-t)}function br(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function Qt(n,e,r,s,t){let a=e.href,l=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let u={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:l,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,u}function xr(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
`).map(a=>{let l=a.match(r.other.beginningSpace);if(l===null)return a;let[o]=l;return o.length>=t.length?a.slice(t.length):a}).join(`
`)}var ve=class{options;rules;lexer;constructor(n){this.options=n||te}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ge(r,`
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=xr(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=ge(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:ge(e[0],`
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=ge(e[0],`
`).split(`
`),s="",t="",a=[];for(;r.length>0;){let l=!1,o=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))o.push(r[u]),l=!0;else if(!l)o.push(r[u]);else break;r=r.slice(u);let p=o.join(`
`),d=p.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
${p}`:p,t=t?`${t}
${d}`:d;let x=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=x,r.length===0)break;let m=a.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let _=m,T=_.raw+`
`+r.join(`
`),z=this.blockquote(T);a[a.length-1]=z,s=s.substring(0,s.length-_.raw.length)+z.raw,t=t.substring(0,t.length-_.text.length)+z.text;break}else if(m?.type==="list"){let _=m,T=_.raw+`
`+r.join(`
`),z=this.list(T);a[a.length-1]=z,s=s.substring(0,s.length-m.raw.length)+z.raw,t=t.substring(0,t.length-_.raw.length)+z.raw,r=T.substring(a.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let a=this.rules.other.listItemRegex(r),l=!1;for(;n;){let u=!1,p="",d="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;p=e[0],n=n.substring(p.length);let x=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,ce=>" ".repeat(3*ce.length)),m=n.split(`
`,1)[0],_=!x.trim(),T=0;if(this.options.pedantic?(T=2,d=x.trimStart()):_?T=e[1].length+1:(T=e[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,d=x.slice(T),T+=e[1].length),_&&this.rules.other.blankLine.test(m)&&(p+=m+`
`,n=n.substring(m.length+1),u=!0),!u){let ce=this.rules.other.nextBulletRegex(T),Ee=this.rules.other.hrRegex(T),j=this.rules.other.fencesBeginRegex(T),S=this.rules.other.headingBeginRegex(T),X=this.rules.other.htmlBeginRegex(T);for(;n;){let Q=n.split(`
`,1)[0],V;if(m=Q,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting,"  "),V=m):V=m.replace(this.rules.other.tabCharGlobal,"    "),j.test(m)||S.test(m)||X.test(m)||ce.test(m)||Ee.test(m))break;if(V.search(this.rules.other.nonSpaceChar)>=T||!m.trim())d+=`
`+V.slice(T);else{if(_||x.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||j.test(x)||S.test(x)||Ee.test(x))break;d+=`
`+m}!_&&!m.trim()&&(_=!0),p+=Q+`
`,n=n.substring(Q.length+1),x=V.slice(T)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(l=!0));let z=null,_e;this.options.gfm&&(z=this.rules.other.listIsTask.exec(d),z&&(_e=z[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:p,task:!!z,checked:_e,loose:!1,text:d,tokens:[]}),t.raw+=p}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let u=0;u<t.items.length;u++)if(this.lexer.state.top=!1,t.items[u].tokens=this.lexer.blockTokens(t.items[u].text,[]),!t.loose){let p=t.items[u].tokens.filter(x=>x.type==="space"),d=p.length>0&&p.some(x=>this.rules.other.anyLine.test(x.raw));t.loose=d}if(t.loose)for(let u=0;u<t.items.length;u++)t.items[u].loose=!0;return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){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];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=Xt(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<r.length;l++)a.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:a.align[l]});for(let l of t)a.rows.push(Xt(l,a.header.length).map((o,u)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:a.align[u]})));return a}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);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]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=ge(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=br(e[2],"()");if(a===-2)return;if(a>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],t=a[3])}else t=e[3]?e[3].slice(1,-1):"";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)),Qt(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)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return Qt(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,a,l,o=t,u=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*n.length+t);(s=p.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){o+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){u+=l;continue}if(o-=l,o>0)continue;l=Math.min(l,l+o+u);let d=[...s[0]][0].length,x=n.slice(0,t+s.index+d+l);if(Math.min(t,l)%2){let _=x.slice(1,-1);return{type:"em",raw:x,text:_,tokens:this.lexer.inlineTokens(_)}}let m=x.slice(2,-2);return{type:"strong",raw:x,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){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);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;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}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},Z=class ot{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||te,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:N,block:De.normal,inline:fe.normal};this.options.pedantic?(r.block=De.pedantic,r.inline=fe.pedantic):this.options.gfm&&(r.block=De.gfm,this.options.breaks?r.inline=fe.breaks:r.inline=fe.gfm),this.tokenizer.rules=r}static get rules(){return{block:De,inline:fe}}static lex(e,r){return new ot(r).lex(e)}static lexInline(e,r){return new ot(r).inlineTokens(e)}lex(e){e=e.replace(N.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.options.pedantic&&(e=e.replace(N.tabCharGlobal,"    ").replace(N.spaceLine,""));e;){let t;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;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let a=e;if(this.options.extensions?.startBlock){let l=1/0,o=e.slice(1),u;this.options.extensions.startBlock.forEach(p=>{u=p.call({lexer:this},o),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(a=e.substring(0,l+1))}if(this.state.top&&(t=this.tokenizer.paragraph(a))){let l=r.at(-1);s&&l?.type==="paragraph"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),s=a.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
`)?"":`
`)+t.raw,l.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)o.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))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let a=!1,l="";for(;e;){a||(l=""),a=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=r.at(-1);o.type==="text"&&p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(e,s,l)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),r.push(o);continue}let u=e;if(this.options.extensions?.startInline){let p=1/0,d=e.slice(1),x;this.options.extensions.startInline.forEach(m=>{x=m.call({lexer:this},d),typeof x=="number"&&x>=0&&(p=Math.min(p,x))}),p<1/0&&p>=0&&(u=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(u)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(l=o.raw.slice(-1)),a=!0;let p=r.at(-1);p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):r.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},$e=class{options;parser;constructor(n){this.options=n||te}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(N.notSpaceStart)?.[0],t=n.replace(N.endingNewline,"")+`
`;return s?'<pre><code class="language-'+H(s)+'">'+(r?t:H(t,!0))+`</code></pre>
`:"<pre><code>"+(r?t:H(t,!0))+`</code></pre>
`}blockquote({tokens:n}){return`<blockquote>
${this.parser.parse(n)}</blockquote>
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
`}hr(n){return`<hr>
`}list(n){let e=n.ordered,r=n.start,s="";for(let l=0;l<n.items.length;l++){let o=n.items[l];s+=this.listitem(o)}let t=e?"ol":"ul",a=e&&r!==1?' start="'+r+'"':"";return"<"+t+a+`>
`+s+"</"+t+`>
`}listitem(n){let e="";if(n.task){let r=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+H(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
`}table(n){let e="",r="";for(let t=0;t<n.header.length;t++)r+=this.tablecell(n.header[t]);e+=this.tablerow({text:r});let s="";for(let t=0;t<n.rows.length;t++){let a=n.rows[t];r="";for(let l=0;l<a.length;l++)r+=this.tablecell(a[l]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+s+`</table>
`}tablerow({text:n}){return`<tr>
${n}</tr>
`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${H(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=jt(n);if(t===null)return s;n=t;let a='<a href="'+n+'"';return e&&(a+=' title="'+H(e)+'"'),a+=">"+s+"</a>",a}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=jt(n);if(t===null)return H(r);n=t;let a=`<img src="${n}" alt="${r}"`;return e&&(a+=` title="${H(e)}"`),a+=">",a}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:H(n.text)}},Tt=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},Y=class ct{options;renderer;textRenderer;constructor(e){this.options=e||te,this.options.renderer=this.options.renderer||new $e,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Tt}static parse(e,r){return new ct(r).parse(e)}static parseInline(e,r){return new ct(r).parseInline(e)}parse(e,r=!0){let s="";for(let t=0;t<e.length;t++){let a=e[t];if(this.options.extensions?.renderers?.[a.type]){let o=a,u=this.options.extensions.renderers[o.type].call({parser:this},o);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){s+=u||"";continue}}let l=a;switch(l.type){case"space":{s+=this.renderer.space(l);continue}case"hr":{s+=this.renderer.hr(l);continue}case"heading":{s+=this.renderer.heading(l);continue}case"code":{s+=this.renderer.code(l);continue}case"table":{s+=this.renderer.table(l);continue}case"blockquote":{s+=this.renderer.blockquote(l);continue}case"list":{s+=this.renderer.list(l);continue}case"html":{s+=this.renderer.html(l);continue}case"def":{s+=this.renderer.def(l);continue}case"paragraph":{s+=this.renderer.paragraph(l);continue}case"text":{let o=l,u=this.renderer.text(o);for(;t+1<e.length&&e[t+1].type==="text";)o=e[++t],u+=`
`+this.renderer.text(o);r?s+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):s+=u;continue}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let a=e[t];if(this.options.extensions?.renderers?.[a.type]){let o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=o||"";continue}}let l=a;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let o='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return s}},Te=class{options;block;constructor(n){this.options=n||te}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Z.lex:Z.lexInline}provideParser(){return this.block?Y.parse:Y.parseInline}},Tr=class{defaults=ht();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=$e;TextRenderer=Tt;Lexer=Z;Tokenizer=ve;Hooks=Te;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let a of t.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of t.rows)for(let l of a)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(a=>{let l=t[a].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let a=e.renderers[t.name];a?e.renderers[t.name]=function(...l){let o=t.renderer.apply(this,l);return o===!1&&(o=a.apply(this,l)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[t.level];a?a.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]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new $e(this.defaults);for(let a in r.renderer){if(!(a in t))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let l=a,o=r.renderer[l],u=t[l];t[l]=(...p)=>{let d=o.apply(t,p);return d===!1&&(d=u.apply(t,p)),d||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new ve(this.defaults);for(let a in r.tokenizer){if(!(a in t))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let l=a,o=r.tokenizer[l],u=t[l];t[l]=(...p)=>{let d=o.apply(t,p);return d===!1&&(d=u.apply(t,p)),d}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new Te;for(let a in r.hooks){if(!(a in t))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let l=a,o=r.hooks[l],u=t[l];Te.passThroughHooks.has(a)?t[l]=p=>{if(this.defaults.async&&Te.passThroughHooksRespectAsync.has(a))return Promise.resolve(o.call(t,p)).then(x=>u.call(t,x));let d=o.call(t,p);return u.call(t,d)}:t[l]=(...p)=>{let d=o.apply(t,p);return d===!1&&(d=u.apply(t,p)),d}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,a=r.walkTokens;s.walkTokens=function(l){let o=[];return o.push(a.call(this,l)),t&&(o=o.concat(t.call(this,l))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return Z.lex(n,e??this.defaults)}parser(n,e){return Y.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},a=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return a(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."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));t.hooks&&(t.hooks.options=t,t.hooks.block=n);let l=t.hooks?t.hooks.provideLexer():n?Z.lex:Z.lexInline,o=t.hooks?t.hooks.provideParser():n?Y.parse:Y.parseInline;if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(e):e).then(u=>l(u,t)).then(u=>t.hooks?t.hooks.processAllTokens(u):u).then(u=>t.walkTokens?Promise.all(this.walkTokens(u,t.walkTokens)).then(()=>u):u).then(u=>o(u,t)).then(u=>t.hooks?t.hooks.postprocess(u):u).catch(a);try{t.hooks&&(e=t.hooks.preprocess(e));let u=l(e,t);t.hooks&&(u=t.hooks.processAllTokens(u)),t.walkTokens&&this.walkTokens(u,t.walkTokens);let p=o(u,t);return t.hooks&&(p=t.hooks.postprocess(p)),p}catch(u){return a(u)}}}onError(n,e){return r=>{if(r.message+=`
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+H(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},ee=new Tr;function k(n,e){return ee.parse(n,e)}k.options=k.setOptions=function(n){return ee.setOptions(n),k.defaults=ee.defaults,an(k.defaults),k};k.getDefaults=ht;k.defaults=te;k.use=function(...n){return ee.use(...n),k.defaults=ee.defaults,an(k.defaults),k};k.walkTokens=function(n,e){return ee.walkTokens(n,e)};k.parseInline=ee.parseInline;k.Parser=Y;k.parser=Y.parse;k.Renderer=$e;k.TextRenderer=Tt;k.Lexer=Z;k.lexer=Z.lex;k.Tokenizer=ve;k.Hooks=Te;k.parse=k;k.options;k.setOptions;k.use;k.walkTokens;k.parseInline;Y.parse;Z.lex;const{entries:bn,setPrototypeOf:Vt,isFrozen:wr,getPrototypeOf:Ar,getOwnPropertyDescriptor:_r}=Object;let{freeze:M,seal:$,create:xn}=Object,{apply:ut,construct:pt}=typeof Reflect<"u"&&Reflect;M||(M=function(e){return e});$||($=function(e){return e});ut||(ut=function(e,r){for(var s=arguments.length,t=new Array(s>2?s-2:0),a=2;a<s;a++)t[a-2]=arguments[a];return e.apply(r,t)});pt||(pt=function(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),t=1;t<r;t++)s[t-1]=arguments[t];return new e(...s)});const Ne=P(Array.prototype.forEach),Er=P(Array.prototype.lastIndexOf),Kt=P(Array.prototype.pop),de=P(Array.prototype.push),Sr=P(Array.prototype.splice),Pe=P(String.prototype.toLowerCase),tt=P(String.prototype.toString),nt=P(String.prototype.match),me=P(String.prototype.replace),yr=P(String.prototype.indexOf),Rr=P(String.prototype.trim),U=P(Object.prototype.hasOwnProperty),D=P(RegExp.prototype.test),ke=Lr(TypeError);function P(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,s=new Array(r>1?r-1:0),t=1;t<r;t++)s[t-1]=arguments[t];return ut(n,e,s)}}function Lr(n){return function(){for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return pt(n,r)}}function g(n,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pe;Vt&&Vt(n,null);let s=e.length;for(;s--;){let t=e[s];if(typeof t=="string"){const a=r(t);a!==t&&(wr(e)||(e[s]=a),t=a)}n[t]=!0}return n}function Ir(n){for(let e=0;e<n.length;e++)U(n,e)||(n[e]=null);return n}function q(n){const e=xn(null);for(const[r,s]of bn(n))U(n,r)&&(Array.isArray(s)?e[r]=Ir(s):s&&typeof s=="object"&&s.constructor===Object?e[r]=q(s):e[r]=s);return e}function be(n,e){for(;n!==null;){const s=_r(n,e);if(s){if(s.get)return P(s.get);if(typeof s.value=="function")return P(s.value)}n=Ar(n)}function r(){return null}return r}const Jt=M(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),rt=M(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),st=M(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Or=M(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),it=M(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Cr=M(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),en=M(["#text"]),tn=M(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),lt=M(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),nn=M(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Me=M(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dr=$(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nr=$(/<%[\w\W]*|[\w\W]*%>/gm),Mr=$(/\$\{[\w\W]*/gm),Pr=$(/^data-[\-\w.\u00B7-\uFFFF]+$/),zr=$(/^aria-[\-\w]+$/),Tn=$(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vr=$(/^(?:\w+script|data):/i),$r=$(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wn=$(/^html$/i),Ur=$(/^[a-z][.\w]*(-[.\w]+)+$/i);var rn=Object.freeze({__proto__:null,ARIA_ATTR:zr,ATTR_WHITESPACE:$r,CUSTOM_ELEMENT:Ur,DATA_ATTR:Pr,DOCTYPE_NAME:wn,ERB_EXPR:Nr,IS_ALLOWED_URI:Tn,IS_SCRIPT_OR_DATA:vr,MUSTACHE_EXPR:Dr,TMPLIT_EXPR:Mr});const xe={element:1,text:3,progressingInstruction:7,comment:8,document:9},Fr=function(){return typeof window>"u"?null:window},Hr=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const t="data-tt-policy-suffix";r&&r.hasAttribute(t)&&(s=r.getAttribute(t));const a="dompurify"+(s?"#"+s:"");try{return e.createPolicy(a,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},sn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function An(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Fr();const e=f=>An(f);if(e.version="3.2.7",e.removed=[],!n||!n.document||n.document.nodeType!==xe.document||!n.Element)return e.isSupported=!1,e;let{document:r}=n;const s=r,t=s.currentScript,{DocumentFragment:a,HTMLTemplateElement:l,Node:o,Element:u,NodeFilter:p,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:x,DOMParser:m,trustedTypes:_}=n,T=u.prototype,z=be(T,"cloneNode"),_e=be(T,"remove"),ce=be(T,"nextSibling"),Ee=be(T,"childNodes"),j=be(T,"parentNode");if(typeof l=="function"){const f=r.createElement("template");f.content&&f.content.ownerDocument&&(r=f.content.ownerDocument)}let S,X="";const{implementation:Q,createNodeIterator:V,createDocumentFragment:_n,getElementsByTagName:En}=r,{importNode:Sn}=s;let C=sn();e.isSupported=typeof bn=="function"&&typeof j=="function"&&Q&&Q.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:He,ERB_EXPR:Be,TMPLIT_EXPR:Ge,DATA_ATTR:yn,ARIA_ATTR:Rn,IS_SCRIPT_OR_DATA:Ln,ATTR_WHITESPACE:wt,CUSTOM_ELEMENT:In}=rn;let{IS_ALLOWED_URI:At}=rn,y=null;const _t=g({},[...Jt,...rt,...st,...it,...en]);let L=null;const Et=g({},[...tn,...lt,...nn,...Me]);let A=Object.seal(xn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ue=null,We=null,St=!0,qe=!0,yt=!1,Rt=!0,ne=!1,Se=!0,K=!1,Ze=!1,Ye=!1,re=!1,ye=!1,Re=!1,Lt=!0,It=!1;const On="user-content-";let je=!0,pe=!1,se={},ie=null;const Ot=g({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ct=null;const Dt=g({},["audio","video","img","source","image","track"]);let Xe=null;const Nt=g({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Le="http://www.w3.org/1998/Math/MathML",Ie="http://www.w3.org/2000/svg",B="http://www.w3.org/1999/xhtml";let le=B,Qe=!1,Ve=null;const Cn=g({},[Le,Ie,B],tt);let Oe=g({},["mi","mo","mn","ms","mtext"]),Ce=g({},["annotation-xml"]);const Dn=g({},["title","style","font","a","script"]);let he=null;const Nn=["application/xhtml+xml","text/html"],Mn="text/html";let R=null,ae=null;const Pn=r.createElement("form"),Mt=function(i){return i instanceof RegExp||i instanceof Function},Ke=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ae&&ae===i)){if((!i||typeof i!="object")&&(i={}),i=q(i),he=Nn.indexOf(i.PARSER_MEDIA_TYPE)===-1?Mn:i.PARSER_MEDIA_TYPE,R=he==="application/xhtml+xml"?tt:Pe,y=U(i,"ALLOWED_TAGS")?g({},i.ALLOWED_TAGS,R):_t,L=U(i,"ALLOWED_ATTR")?g({},i.ALLOWED_ATTR,R):Et,Ve=U(i,"ALLOWED_NAMESPACES")?g({},i.ALLOWED_NAMESPACES,tt):Cn,Xe=U(i,"ADD_URI_SAFE_ATTR")?g(q(Nt),i.ADD_URI_SAFE_ATTR,R):Nt,Ct=U(i,"ADD_DATA_URI_TAGS")?g(q(Dt),i.ADD_DATA_URI_TAGS,R):Dt,ie=U(i,"FORBID_CONTENTS")?g({},i.FORBID_CONTENTS,R):Ot,ue=U(i,"FORBID_TAGS")?g({},i.FORBID_TAGS,R):q({}),We=U(i,"FORBID_ATTR")?g({},i.FORBID_ATTR,R):q({}),se=U(i,"USE_PROFILES")?i.USE_PROFILES:!1,St=i.ALLOW_ARIA_ATTR!==!1,qe=i.ALLOW_DATA_ATTR!==!1,yt=i.ALLOW_UNKNOWN_PROTOCOLS||!1,Rt=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ne=i.SAFE_FOR_TEMPLATES||!1,Se=i.SAFE_FOR_XML!==!1,K=i.WHOLE_DOCUMENT||!1,re=i.RETURN_DOM||!1,ye=i.RETURN_DOM_FRAGMENT||!1,Re=i.RETURN_TRUSTED_TYPE||!1,Ye=i.FORCE_BODY||!1,Lt=i.SANITIZE_DOM!==!1,It=i.SANITIZE_NAMED_PROPS||!1,je=i.KEEP_CONTENT!==!1,pe=i.IN_PLACE||!1,At=i.ALLOWED_URI_REGEXP||Tn,le=i.NAMESPACE||B,Oe=i.MATHML_TEXT_INTEGRATION_POINTS||Oe,Ce=i.HTML_INTEGRATION_POINTS||Ce,A=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&Mt(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&Mt(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ne&&(qe=!1),ye&&(re=!0),se&&(y=g({},en),L=[],se.html===!0&&(g(y,Jt),g(L,tn)),se.svg===!0&&(g(y,rt),g(L,lt),g(L,Me)),se.svgFilters===!0&&(g(y,st),g(L,lt),g(L,Me)),se.mathMl===!0&&(g(y,it),g(L,nn),g(L,Me))),i.ADD_TAGS&&(y===_t&&(y=q(y)),g(y,i.ADD_TAGS,R)),i.ADD_ATTR&&(L===Et&&(L=q(L)),g(L,i.ADD_ATTR,R)),i.ADD_URI_SAFE_ATTR&&g(Xe,i.ADD_URI_SAFE_ATTR,R),i.FORBID_CONTENTS&&(ie===Ot&&(ie=q(ie)),g(ie,i.FORBID_CONTENTS,R)),je&&(y["#text"]=!0),K&&g(y,["html","head","body"]),y.table&&(g(y,["tbody"]),delete ue.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=i.TRUSTED_TYPES_POLICY,X=S.createHTML("")}else S===void 0&&(S=Hr(_,t)),S!==null&&typeof X=="string"&&(X=S.createHTML(""));M&&M(i),ae=i}},Pt=g({},[...rt,...st,...Or]),zt=g({},[...it,...Cr]),zn=function(i){let c=j(i);(!c||!c.tagName)&&(c={namespaceURI:le,tagName:"template"});const h=Pe(i.tagName),w=Pe(c.tagName);return Ve[i.namespaceURI]?i.namespaceURI===Ie?c.namespaceURI===B?h==="svg":c.namespaceURI===Le?h==="svg"&&(w==="annotation-xml"||Oe[w]):!!Pt[h]:i.namespaceURI===Le?c.namespaceURI===B?h==="math":c.namespaceURI===Ie?h==="math"&&Ce[w]:!!zt[h]:i.namespaceURI===B?c.namespaceURI===Ie&&!Ce[w]||c.namespaceURI===Le&&!Oe[w]?!1:!zt[h]&&(Dn[h]||!Pt[h]):!!(he==="application/xhtml+xml"&&Ve[i.namespaceURI]):!1},F=function(i){de(e.removed,{element:i});try{j(i).removeChild(i)}catch{_e(i)}},J=function(i,c){try{de(e.removed,{attribute:c.getAttributeNode(i),from:c})}catch{de(e.removed,{attribute:null,from:c})}if(c.removeAttribute(i),i==="is")if(re||ye)try{F(c)}catch{}else try{c.setAttribute(i,"")}catch{}},vt=function(i){let c=null,h=null;if(Ye)i="<remove></remove>"+i;else{const E=nt(i,/^[\r\n\t ]+/);h=E&&E[0]}he==="application/xhtml+xml"&&le===B&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const w=S?S.createHTML(i):i;if(le===B)try{c=new m().parseFromString(w,he)}catch{}if(!c||!c.documentElement){c=Q.createDocument(le,"template",null);try{c.documentElement.innerHTML=Qe?X:w}catch{}}const O=c.body||c.documentElement;return i&&h&&O.insertBefore(r.createTextNode(h),O.childNodes[0]||null),le===B?En.call(c,K?"html":"body")[0]:K?c.documentElement:O},$t=function(i){return V.call(i.ownerDocument||i,i,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Je=function(i){return i instanceof x&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof d)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Ut=function(i){return typeof o=="function"&&i instanceof o};function G(f,i,c){Ne(f,h=>{h.call(e,i,c,ae)})}const Ft=function(i){let c=null;if(G(C.beforeSanitizeElements,i,null),Je(i))return F(i),!0;const h=R(i.nodeName);if(G(C.uponSanitizeElement,i,{tagName:h,allowedTags:y}),Se&&i.hasChildNodes()&&!Ut(i.firstElementChild)&&D(/<[/\w!]/g,i.innerHTML)&&D(/<[/\w!]/g,i.textContent)||i.nodeType===xe.progressingInstruction||Se&&i.nodeType===xe.comment&&D(/<[/\w]/g,i.data))return F(i),!0;if(!y[h]||ue[h]){if(!ue[h]&&Bt(h)&&(A.tagNameCheck instanceof RegExp&&D(A.tagNameCheck,h)||A.tagNameCheck instanceof Function&&A.tagNameCheck(h)))return!1;if(je&&!ie[h]){const w=j(i)||i.parentNode,O=Ee(i)||i.childNodes;if(O&&w){const E=O.length;for(let v=E-1;v>=0;--v){const W=z(O[v],!0);W.__removalCount=(i.__removalCount||0)+1,w.insertBefore(W,ce(i))}}}return F(i),!0}return i instanceof u&&!zn(i)||(h==="noscript"||h==="noembed"||h==="noframes")&&D(/<\/no(script|embed|frames)/i,i.innerHTML)?(F(i),!0):(ne&&i.nodeType===xe.text&&(c=i.textContent,Ne([He,Be,Ge],w=>{c=me(c,w," ")}),i.textContent!==c&&(de(e.removed,{element:i.cloneNode()}),i.textContent=c)),G(C.afterSanitizeElements,i,null),!1)},Ht=function(i,c,h){if(Lt&&(c==="id"||c==="name")&&(h in r||h in Pn))return!1;if(!(qe&&!We[c]&&D(yn,c))){if(!(St&&D(Rn,c))){if(!L[c]||We[c]){if(!(Bt(i)&&(A.tagNameCheck instanceof RegExp&&D(A.tagNameCheck,i)||A.tagNameCheck instanceof Function&&A.tagNameCheck(i))&&(A.attributeNameCheck instanceof RegExp&&D(A.attributeNameCheck,c)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(c,i))||c==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&D(A.tagNameCheck,h)||A.tagNameCheck instanceof Function&&A.tagNameCheck(h))))return!1}else if(!Xe[c]){if(!D(At,me(h,wt,""))){if(!((c==="src"||c==="xlink:href"||c==="href")&&i!=="script"&&yr(h,"data:")===0&&Ct[i])){if(!(yt&&!D(Ln,me(h,wt,"")))){if(h)return!1}}}}}}return!0},Bt=function(i){return i!=="annotation-xml"&&nt(i,In)},Gt=function(i){G(C.beforeSanitizeAttributes,i,null);const{attributes:c}=i;if(!c||Je(i))return;const h={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:L,forceKeepAttr:void 0};let w=c.length;for(;w--;){const O=c[w],{name:E,namespaceURI:v,value:W}=O,oe=R(E),et=W;let I=E==="value"?et:Rr(et);if(h.attrName=oe,h.attrValue=I,h.keepAttr=!0,h.forceKeepAttr=void 0,G(C.uponSanitizeAttribute,i,h),I=h.attrValue,It&&(oe==="id"||oe==="name")&&(J(E,i),I=On+I),Se&&D(/((--!?|])>)|<\/(style|title|textarea)/i,I)){J(E,i);continue}if(oe==="attributename"&&nt(I,"href")){J(E,i);continue}if(h.forceKeepAttr)continue;if(!h.keepAttr){J(E,i);continue}if(!Rt&&D(/\/>/i,I)){J(E,i);continue}ne&&Ne([He,Be,Ge],qt=>{I=me(I,qt," ")});const Wt=R(i.nodeName);if(!Ht(Wt,oe,I)){J(E,i);continue}if(S&&typeof _=="object"&&typeof _.getAttributeType=="function"&&!v)switch(_.getAttributeType(Wt,oe)){case"TrustedHTML":{I=S.createHTML(I);break}case"TrustedScriptURL":{I=S.createScriptURL(I);break}}if(I!==et)try{v?i.setAttributeNS(v,E,I):i.setAttribute(E,I),Je(i)?F(i):Kt(e.removed)}catch{J(E,i)}}G(C.afterSanitizeAttributes,i,null)},vn=function f(i){let c=null;const h=$t(i);for(G(C.beforeSanitizeShadowDOM,i,null);c=h.nextNode();)G(C.uponSanitizeShadowNode,c,null),Ft(c),Gt(c),c.content instanceof a&&f(c.content);G(C.afterSanitizeShadowDOM,i,null)};return e.sanitize=function(f){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},c=null,h=null,w=null,O=null;if(Qe=!f,Qe&&(f="<!-->"),typeof f!="string"&&!Ut(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw ke("dirty is not a string, aborting")}else throw ke("toString is not a function");if(!e.isSupported)return f;if(Ze||Ke(i),e.removed=[],typeof f=="string"&&(pe=!1),pe){if(f.nodeName){const W=R(f.nodeName);if(!y[W]||ue[W])throw ke("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof o)c=vt("<!---->"),h=c.ownerDocument.importNode(f,!0),h.nodeType===xe.element&&h.nodeName==="BODY"||h.nodeName==="HTML"?c=h:c.appendChild(h);else{if(!re&&!ne&&!K&&f.indexOf("<")===-1)return S&&Re?S.createHTML(f):f;if(c=vt(f),!c)return re?null:Re?X:""}c&&Ye&&F(c.firstChild);const E=$t(pe?f:c);for(;w=E.nextNode();)Ft(w),Gt(w),w.content instanceof a&&vn(w.content);if(pe)return f;if(re){if(ye)for(O=_n.call(c.ownerDocument);c.firstChild;)O.appendChild(c.firstChild);else O=c;return(L.shadowroot||L.shadowrootmode)&&(O=Sn.call(s,O,!0)),O}let v=K?c.outerHTML:c.innerHTML;return K&&y["!doctype"]&&c.ownerDocument&&c.ownerDocument.doctype&&c.ownerDocument.doctype.name&&D(wn,c.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+c.ownerDocument.doctype.name+`>
`+v),ne&&Ne([He,Be,Ge],W=>{v=me(v,W," ")}),S&&Re?S.createHTML(v):v},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ke(f),Ze=!0},e.clearConfig=function(){ae=null,Ze=!1},e.isValidAttribute=function(f,i,c){ae||Ke({});const h=R(f),w=R(i);return Ht(h,w,c)},e.addHook=function(f,i){typeof i=="function"&&de(C[f],i)},e.removeHook=function(f,i){if(i!==void 0){const c=Er(C[f],i);return c===-1?void 0:Sr(C[f],c,1)[0]}return Kt(C[f])},e.removeHooks=function(f){C[f]=[]},e.removeAllHooks=function(){C=sn()},e}var ln=An();const Gr=n=>{if(!n)return"";let e=n;e=e.replace(/''/g,"'").replace(/'/g,"'").replace(/'/g,"'").replace(/"/g,'"').replace(/"/g,'"');const r=(e.match(/<[^>]+>/g)||[]).length;if(e.includes("<p>")&&e.includes("</p>")&&r>5){const t=/<style[^>]*>[\s\S]*?<\/style>/gi;return e=e.replace(t,""),ln.sanitize(e,{ALLOWED_TAGS:["article","p","br","strong","em","b","i","u","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","blockquote","code","pre","hr","div","span"],ALLOWED_ATTR:["href","src","alt","title","class","id","target","rel"]})}try{k.setOptions({breaks:!0,gfm:!0});const t=k.parse(e);return ln.sanitize(t,{ALLOWED_TAGS:["article","p","br","strong","em","b","i","u","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","blockquote","code","pre","hr","div","span"],ALLOWED_ATTR:["href","src","alt","title","class","id","target","rel"]})}catch(t){return $n.error("Erreur lors du parsing Markdown:",t),`<p>${e.replace(/\n\n/g,"</p><p>").replace(/\n/g,"<br>")}</p>`}};export{Gr as p};