nadesiko3
Version:
Japanese Programming Language
68 lines (67 loc) • 50 kB
JavaScript
;(()=>{var Pe=Object.create;var le=Object.defineProperty;var Ee=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Ce=Object.prototype.hasOwnProperty;var Ne=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports);var qe=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ie(e))!Ce.call(s,n)&&n!==t&&le(s,n,{get:()=>e[n],enumerable:!(r=Ee(e,n))||r.enumerable});return s};var Be=(s,e,t)=>(t=s!=null?Pe(Le(s)):{},qe(e||!s||!s.__esModule?le(t,"default",{value:s,enumerable:!0}):t,s));var Ae=Ne((Mt,$e)=>{function At(s,e){var t,r,n,l,i,o;e=e||{},r=e.indent_size||4,n=e.indent_char||" ",i=e.brace_style||"collapse",l=e.max_char==0?1/0:e.max_char||70,o=e.unformatted||["a","span","bdo","em","strong","dfn","code","samp","kbd","var","cite","abbr","acronym","q","sub","sup","tt","i","b","big","small","u","s","strike","font","ins","del","pre","address","dt","h1","h2","h3","h4","h5","h6"];function a(){return this.pos=0,this.token="",this.current_mode="CONTENT",this.tags={parent:"parent1",parentcount:1,parent1:""},this.tag_type="",this.token_text=this.last_token=this.last_text=this.token_type="",this.Utils={whitespace:`
\r `.split(""),single_token:"br,input,link,meta,!doctype,basefont,base,area,hr,wbr,param,img,isindex,?xml,embed,?php,?,?=".split(","),extra_liners:"head,body,/html".split(","),in_array:function(h,u){for(var d=0;d<u.length;d++)if(h===u[d])return!0;return!1}},this.get_content=function(){for(var h="",u=[],d=!1;this.input.charAt(this.pos)!=="<";){if(this.pos>=this.input.length)return u.length?u.join(""):["","TK_EOF"];if(h=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(h,this.Utils.whitespace)){u.length&&(d=!0),this.line_char_count--;continue}else if(d){if(this.line_char_count>=this.max_char){u.push(`
`);for(var _=0;_<this.indent_level;_++)u.push(this.indent_string);this.line_char_count=0}else u.push(" "),this.line_char_count++;d=!1}u.push(h)}return u.length?u.join(""):""},this.get_contents_to=function(h){if(this.pos==this.input.length)return["","TK_EOF"];var u="",d="",_=new RegExp("</"+h+"\\s*>","igm");_.lastIndex=this.pos;var R=_.exec(this.input),y=R?R.index:this.input.length;return this.pos<y&&(d=this.input.substring(this.pos,y),this.pos=y),d},this.record_tag=function(h){this.tags[h+"count"]?(this.tags[h+"count"]++,this.tags[h+this.tags[h+"count"]]=this.indent_level):(this.tags[h+"count"]=1,this.tags[h+this.tags[h+"count"]]=this.indent_level),this.tags[h+this.tags[h+"count"]+"parent"]=this.tags.parent,this.tags.parent=h+this.tags[h+"count"]},this.retrieve_tag=function(h){if(this.tags[h+"count"]){for(var u=this.tags.parent;u&&h+this.tags[h+"count"]!==u;)u=this.tags[u+"parent"];u&&(this.indent_level=this.tags[h+this.tags[h+"count"]],this.tags.parent=this.tags[u+"parent"]),delete this.tags[h+this.tags[h+"count"]+"parent"],delete this.tags[h+this.tags[h+"count"]],this.tags[h+"count"]==1?delete this.tags[h+"count"]:this.tags[h+"count"]--}},this.get_tag=function(){var h="",u=[],d=!1,_,R;do{if(this.pos>=this.input.length)return u.length?u.join(""):["","TK_EOF"];if(h=this.input.charAt(this.pos),this.pos++,this.line_char_count++,this.Utils.in_array(h,this.Utils.whitespace)){d=!0,this.line_char_count--;continue}(h==="'"||h==='"')&&(!u[1]||u[1]!=="!")&&(h+=this.get_unformatted(h),d=!0),h==="="&&(d=!1),u.length&&u[u.length-1]!=="="&&h!==">"&&d&&(this.line_char_count>=this.max_char?(this.print_newline(!1,u),this.line_char_count=0):(u.push(" "),this.line_char_count++),d=!1),h==="<"&&(_=this.pos-1),u.push(h)}while(h!==">");var y=u.join(""),P;y.indexOf(" ")!=-1?P=y.indexOf(" "):P=y.indexOf(">");var m=y.substring(1,P).toLowerCase();if(y.charAt(y.length-2)==="/"||this.Utils.in_array(m,this.Utils.single_token))this.tag_type="SINGLE";else if(m==="script")this.record_tag(m),this.tag_type="SCRIPT";else if(m==="style")this.record_tag(m),this.tag_type="STYLE";else if(this.Utils.in_array(m,o)){var v=this.get_unformatted("</"+m+">",y);u.push(v),_>0&&this.Utils.in_array(this.input.charAt(_-1),this.Utils.whitespace)&&u.splice(0,0,this.input.charAt(_-1)),R=this.pos-1,this.Utils.in_array(this.input.charAt(R+1),this.Utils.whitespace)&&u.push(this.input.charAt(R+1)),this.tag_type="SINGLE"}else if(m.charAt(0)==="!")if(m.indexOf("[if")!=-1){if(y.indexOf("!IE")!=-1){var v=this.get_unformatted("-->",y);u.push(v)}this.tag_type="START"}else if(m.indexOf("[endif")!=-1)this.tag_type="END",this.unindent();else if(m.indexOf("[cdata[")!=-1){var v=this.get_unformatted("]]>",y);u.push(v),this.tag_type="SINGLE"}else{var v=this.get_unformatted("-->",y);u.push(v),this.tag_type="SINGLE"}else m.charAt(0)==="/"?(this.retrieve_tag(m.substring(1)),this.tag_type="END"):(this.record_tag(m),this.tag_type="START"),this.Utils.in_array(m,this.Utils.extra_liners)&&this.print_newline(!0,this.output);return u.join("")},this.get_unformatted=function(h,u){if(u&&u.toLowerCase().indexOf(h)!=-1)return"";var d="",_="",R=!0;do{if(this.pos>=this.input.length)return _;if(d=this.input.charAt(this.pos),this.pos++,this.Utils.in_array(d,this.Utils.whitespace)){if(!R){this.line_char_count--;continue}if(d===`
`||d==="\r"){_+=`
`,this.line_char_count=0;continue}}_+=d,this.line_char_count++,R=!0}while(_.toLowerCase().indexOf(h)==-1);return _},this.get_token=function(){var h;if(this.last_token==="TK_TAG_SCRIPT"||this.last_token==="TK_TAG_STYLE"){var u=this.last_token.substr(7);return h=this.get_contents_to(u),typeof h!="string"?h:[h,"TK_"+u]}if(this.current_mode==="CONTENT")return h=this.get_content(),typeof h!="string"?h:[h,"TK_CONTENT"];if(this.current_mode==="TAG"){if(h=this.get_tag(),typeof h!="string")return h;var d="TK_TAG_"+this.tag_type;return[h,d]}},this.get_full_indent=function(h){return h=this.indent_level+h||0,h<1?"":Array(h+1).join(this.indent_string)},this.printer=function(h,u,d,_,R){this.input=h||"",this.output=[],this.indent_character=u,this.indent_string="",this.indent_size=d,this.brace_style=R,this.indent_level=0,this.max_char=_,this.line_char_count=0;for(var y=0;y<this.indent_size;y++)this.indent_string+=this.indent_character;this.print_newline=function(P,m){if(this.line_char_count=0,!(!m||!m.length)){if(!P)for(;this.Utils.in_array(m[m.length-1],this.Utils.whitespace);)m.pop();m.push(`
`);for(var v=0;v<this.indent_level;v++)m.push(this.indent_string)}},this.print_token=function(P){this.output.push(P)},this.indent=function(){this.indent_level++},this.unindent=function(){this.indent_level>0&&this.indent_level--}},this}for(t=new a,t.printer(s,n,r,l,i);;){var p=t.get_token();if(t.token_text=p[0],t.token_type=p[1],t.token_type==="TK_EOF")break;switch(t.token_type){case"TK_TAG_START":t.print_newline(!1,t.output),t.print_token(t.token_text),t.indent(),t.current_mode="CONTENT";break;case"TK_TAG_STYLE":case"TK_TAG_SCRIPT":t.print_newline(!1,t.output),t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_TAG_END":if(t.last_token==="TK_CONTENT"&&t.last_text===""){var c=t.token_text.match(/\w+/)[0],k=t.output[t.output.length-1].match(/<\s*(\w+)/);(k===null||k[1]!==c)&&t.print_newline(!0,t.output)}t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_TAG_SINGLE":var g=t.token_text.match(/^\s*<([a-z]+)/i);(!g||!t.Utils.in_array(g[1],o))&&t.print_newline(!1,t.output),t.print_token(t.token_text),t.current_mode="CONTENT";break;case"TK_CONTENT":t.token_text!==""&&t.print_token(t.token_text),t.current_mode="TAG";break;case"TK_STYLE":case"TK_SCRIPT":if(t.token_text!==""){t.output.push(`
`);var w=t.token_text;if(t.token_type=="TK_SCRIPT")var b=typeof js_beautify=="function"&&js_beautify;else if(t.token_type=="TK_STYLE")var b=typeof css_beautify=="function"&&css_beautify;if(e.indent_scripts=="keep")var S=0;else if(e.indent_scripts=="separate")var S=-t.indent_level;else var S=1;var C=t.get_full_indent(S);if(b)w=b(w.replace(/^\s*/,C),e);else{var D=w.match(/^\s*/)[0],G=D.match(/[^\n\r]*$/)[0].split(t.indent_string).length-1,H=t.get_full_indent(S-G);w=w.replace(/^\s*/,C).replace(/\r\n|\r|\n/g,`
`+H).replace(/\s*$/,"")}w&&(t.print_token(w),t.print_newline(!0,t.output))}t.current_mode="TAG";break}t.last_token=t.token_type,t.last_text=t.token_text}return t.output.join("")}$e.exports={prettyPrint:At}});function W(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var L=W();function ge(s){L=s}var E={exec:()=>null};function f(s,e=""){let t=typeof s=="string"?s:s.source,r={replace:(n,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(T.caret,"$1"),t=t.replace(n,i),r},getRegex:()=>new RegExp(t,e)};return r}var Oe=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),T={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: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"),blockquoteBeginRegex:s=>new RegExp(`^ {0,${Math.min(3,s-1)}}>`)},De=/^(?:[ \t]*(?:\n|$))+/,Ge=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,je=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,O=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Me=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,V=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ke=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fe=f(ke).replace(/bull/g,V).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(),Ze=f(ke).replace(/bull/g,V).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(),J=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ue=/^[^\n]+/,ee=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ke=f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ee).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Qe=f(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,V).getRegex(),K="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",te=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,He=f("^ {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",te).replace("tag",K).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),de=f(J).replace("hr",O).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",K).getRegex(),Fe=f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",de).getRegex(),ne={blockquote:Fe,code:Ge,def:Ke,fences:je,heading:Me,hr:O,html:He,lheading:fe,list:Qe,newline:De,paragraph:de,table:E,text:Ue},ae=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",O).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",K).getRegex(),Xe={...ne,lheading:Ze,table:ae,paragraph:f(J).replace("hr",O).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ae).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",K).getRegex()},Ye={...ne,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",te).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:E,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(J).replace("hr",O).replace("heading",` *#{1,6} *[^
]`).replace("lheading",fe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},We=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ve=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xe=/^( {2,}|\\)\n(?!\s*$)/,Je=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Q=/[\p{P}\p{S}]/u,se=/[\s\p{P}\p{S}]/u,be=/[^\s\p{P}\p{S}]/u,et=f(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,se).getRegex(),we=/(?!~)[\p{P}\p{S}]/u,tt=/(?!~)[\s\p{P}\p{S}]/u,nt=/(?:[^\s\p{P}\p{S}]|~)/u,me=/(?![*_])[\p{P}\p{S}]/u,st=/(?![*_])[\s\p{P}\p{S}]/u,rt=/(?:[^\s\p{P}\p{S}]|[*_])/u,it=f(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Oe?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),_e=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,lt=f(_e,"u").replace(/punct/g,Q).getRegex(),at=f(_e,"u").replace(/punct/g,we).getRegex(),ye="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ot=f(ye,"gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,se).replace(/punct/g,Q).getRegex(),ht=f(ye,"gu").replace(/notPunctSpace/g,nt).replace(/punctSpace/g,tt).replace(/punct/g,we).getRegex(),ct=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,be).replace(/punctSpace/g,se).replace(/punct/g,Q).getRegex(),pt=f(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,me).getRegex(),ut="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",gt=f(ut,"gu").replace(/notPunctSpace/g,rt).replace(/punctSpace/g,st).replace(/punct/g,me).getRegex(),kt=f(/\\(punct)/,"gu").replace(/punct/g,Q).getRegex(),ft=f(/^<(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(),dt=f(te).replace("(?:-->|$)","-->").getRegex(),xt=f("^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",dt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,bt=f(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Te=f(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",ee).getRegex(),Se=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",ee).getRegex(),wt=f("reflink|nolink(?!\\()","g").replace("reflink",Te).replace("nolink",Se).getRegex(),oe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,re={_backpedal:E,anyPunctuation:kt,autolink:ft,blockSkip:it,br:xe,code:Ve,del:E,delLDelim:E,delRDelim:E,emStrongLDelim:lt,emStrongRDelimAst:ot,emStrongRDelimUnd:ct,escape:We,link:bt,nolink:Se,punctuation:et,reflink:Te,reflinkSearch:wt,tag:xt,text:Je,url:E},mt={...re,link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",M).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M).getRegex()},F={...re,emStrongRDelimAst:ht,emStrongLDelim:at,delLDelim:pt,delRDelim:gt,url:f(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",oe).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:f(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",oe).getRegex()},_t={...F,br:f(xe).replace("{2,}","*").getRegex(),text:f(F.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},j={normal:ne,gfm:Xe,pedantic:Ye},N={normal:re,gfm:F,breaks:_t,pedantic:mt},yt={"&":"&","<":"<",">":">",'"':""","'":"'"},he=s=>yt[s];function z(s,e){if(e){if(T.escapeTest.test(s))return s.replace(T.escapeReplace,he)}else if(T.escapeTestNoEncode.test(s))return s.replace(T.escapeReplaceNoEncode,he);return s}function ce(s){try{s=encodeURI(s).replace(T.percentDecode,"%")}catch{return null}return s}function pe(s,e){let t=s.replace(T.findPipe,(l,i,o)=>{let a=!1,p=i;for(;--p>=0&&o[p]==="\\";)a=!a;return a?"|":" |"}),r=t.split(T.splitPipe),n=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;n<r.length;n++)r[n]=r[n].trim().replace(T.slashPipe,"|");return r}function q(s,e,t){let r=s.length;if(r===0)return"";let n=0;for(;n<r;){let l=s.charAt(r-n-1);if(l===e&&!t)n++;else if(l!==e&&t)n++;else break}return s.slice(0,r-n)}function Tt(s,e){if(s.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<s.length;r++)if(s[r]==="\\")r++;else if(s[r]===e[0])t++;else if(s[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function St(s,e=0){let t=e,r="";for(let n of s)if(n===" "){let l=4-t%4;r+=" ".repeat(l),t+=l}else r+=n,t++;return r}function ue(s,e,t,r,n){let l=e.href,i=e.title||null,o=s[1].replace(n.other.outputLinkReplace,"$1");r.state.inLink=!0;let a={type:s[0].charAt(0)==="!"?"image":"link",raw:t,href:l,title:i,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,a}function Rt(s,e,t){let r=s.match(t.other.indentCodeCompensation);if(r===null)return e;let n=r[1];return e.split(`
`).map(l=>{let i=l.match(t.other.beginningSpace);if(i===null)return l;let[o]=i;return o.length>=n.length?l.slice(n.length):l}).join(`
`)}var Z=class{options;rules;lexer;constructor(s){this.options=s||L}space(s){let e=this.rules.block.newline.exec(s);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(s){let e=this.rules.block.code.exec(s);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:q(t,`
`)}}}fences(s){let e=this.rules.block.fences.exec(s);if(e){let t=e[0],r=Rt(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(s){let e=this.rules.block.heading.exec(s);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let r=q(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(s){let e=this.rules.block.hr.exec(s);if(e)return{type:"hr",raw:q(e[0],`
`)}}blockquote(s){let e=this.rules.block.blockquote.exec(s);if(e){let t=q(e[0],`
`).split(`
`),r="",n="",l=[];for(;t.length>0;){let i=!1,o=[],a;for(a=0;a<t.length;a++)if(this.rules.other.blockquoteStart.test(t[a]))o.push(t[a]),i=!0;else if(!i)o.push(t[a]);else break;t=t.slice(a);let p=o.join(`
`),c=p.replace(this.rules.other.blockquoteSetextReplace,`
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
${p}`:p,n=n?`${n}
${c}`:c;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,l,!0),this.lexer.state.top=k,t.length===0)break;let g=l.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){let w=g,b=w.raw+`
`+t.join(`
`),S=this.blockquote(b);l[l.length-1]=S,r=r.substring(0,r.length-w.raw.length)+S.raw,n=n.substring(0,n.length-w.text.length)+S.text;break}else if(g?.type==="list"){let w=g,b=w.raw+`
`+t.join(`
`),S=this.list(b);l[l.length-1]=S,r=r.substring(0,r.length-g.raw.length)+S.raw,n=n.substring(0,n.length-w.raw.length)+S.raw,t=b.substring(l.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:r,tokens:l,text:n}}}list(s){let e=this.rules.block.list.exec(s);if(e){let t=e[1].trim(),r=t.length>1,n={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");let l=this.rules.other.listItemRegex(t),i=!1;for(;s;){let a=!1,p="",c="";if(!(e=l.exec(s))||this.rules.block.hr.test(s))break;p=e[0],s=s.substring(p.length);let k=St(e[2].split(`
`,1)[0],e[1].length),g=s.split(`
`,1)[0],w=!k.trim(),b=0;if(this.options.pedantic?(b=2,c=k.trimStart()):w?b=e[1].length+1:(b=k.search(this.rules.other.nonSpaceChar),b=b>4?1:b,c=k.slice(b),b+=e[1].length),w&&this.rules.other.blankLine.test(g)&&(p+=g+`
`,s=s.substring(g.length+1),a=!0),!a){let S=this.rules.other.nextBulletRegex(b),C=this.rules.other.hrRegex(b),D=this.rules.other.fencesBeginRegex(b),G=this.rules.other.headingBeginRegex(b),H=this.rules.other.htmlBeginRegex(b),h=this.rules.other.blockquoteBeginRegex(b);for(;s;){let u=s.split(`
`,1)[0],d;if(g=u,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),d=g):d=g.replace(this.rules.other.tabCharGlobal," "),D.test(g)||G.test(g)||H.test(g)||h.test(g)||S.test(g)||C.test(g))break;if(d.search(this.rules.other.nonSpaceChar)>=b||!g.trim())c+=`
`+d.slice(b);else{if(w||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||D.test(k)||G.test(k)||C.test(k))break;c+=`
`+g}w=!g.trim(),p+=u+`
`,s=s.substring(u.length+1),k=d.slice(b)}}n.loose||(i?n.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(i=!0)),n.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(c),loose:!1,text:c,tokens:[]}),n.raw+=p}let o=n.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let a of n.items){if(this.lexer.state.top=!1,a.tokens=this.lexer.blockTokens(a.text,[]),a.task){if(a.text=a.text.replace(this.rules.other.listReplaceTask,""),a.tokens[0]?.type==="text"||a.tokens[0]?.type==="paragraph"){a.tokens[0].raw=a.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),a.tokens[0].text=a.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let c=this.lexer.inlineQueue.length-1;c>=0;c--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[c].src)){this.lexer.inlineQueue[c].src=this.lexer.inlineQueue[c].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(a.raw);if(p){let c={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};a.checked=c.checked,n.loose?a.tokens[0]&&["paragraph","text"].includes(a.tokens[0].type)&&"tokens"in a.tokens[0]&&a.tokens[0].tokens?(a.tokens[0].raw=c.raw+a.tokens[0].raw,a.tokens[0].text=c.raw+a.tokens[0].text,a.tokens[0].tokens.unshift(c)):a.tokens.unshift({type:"paragraph",raw:c.raw,text:c.raw,tokens:[c]}):a.tokens.unshift(c)}}if(!n.loose){let p=a.tokens.filter(k=>k.type==="space"),c=p.length>0&&p.some(k=>this.rules.other.anyLine.test(k.raw));n.loose=c}}if(n.loose)for(let a of n.items){a.loose=!0;for(let p of a.tokens)p.type==="text"&&(p.type="paragraph")}return n}}html(s){let e=this.rules.block.html.exec(s);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(s){let e=this.rules.block.def.exec(s);if(e){let t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:n}}}table(s){let e=this.rules.block.table.exec(s);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=pe(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(let i of r)this.rules.other.tableAlignRight.test(i)?l.align.push("right"):this.rules.other.tableAlignCenter.test(i)?l.align.push("center"):this.rules.other.tableAlignLeft.test(i)?l.align.push("left"):l.align.push(null);for(let i=0;i<t.length;i++)l.header.push({text:t[i],tokens:this.lexer.inline(t[i]),header:!0,align:l.align[i]});for(let i of n)l.rows.push(pe(i,l.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:l.align[a]})));return l}}lheading(s){let e=this.rules.block.lheading.exec(s);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(s){let e=this.rules.block.paragraph.exec(s);if(e){let t=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(s){let e=this.rules.block.text.exec(s);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(s){let e=this.rules.inline.escape.exec(s);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(s){let e=this.rules.inline.tag.exec(s);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(s){let e=this.rules.inline.link.exec(s);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let l=q(t.slice(0,-1),"\\");if((t.length-l.length)%2===0)return}else{let l=Tt(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let r=e[2],n="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(r);l&&(r=l[1],n=l[3])}else n=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),ue(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(s,e){let t;if((t=this.rules.inline.reflink.exec(s))||(t=this.rules.inline.nolink.exec(s))){let r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[r.toLowerCase()];if(!n){let l=t[0].charAt(0);return{type:"text",raw:l,text:l}}return ue(t,n,t[0],this.lexer,this.rules)}}emStrong(s,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(s);if(!(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,l,i,o=n,a=0,p=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*s.length+n);(r=p.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l)continue;if(i=[...l].length,r[3]||r[4]){o+=i;continue}else if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let c=[...r[0]][0].length,k=s.slice(0,n+r.index+c+i);if(Math.min(n,i)%2){let w=k.slice(1,-1);return{type:"em",raw:k,text:w,tokens:this.lexer.inlineTokens(w)}}let g=k.slice(2,-2);return{type:"strong",raw:k,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(s){let e=this.rules.inline.code.exec(s);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(t),n=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&n&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(s){let e=this.rules.inline.br.exec(s);if(e)return{type:"br",raw:e[0]}}del(s,e,t=""){let r=this.rules.inline.delLDelim.exec(s);if(r&&(!r[1]||!t||this.rules.inline.punctuation.exec(t))){let n=[...r[0]].length-1,l,i,o=n,a=this.rules.inline.delRDelim;for(a.lastIndex=0,e=e.slice(-1*s.length+n);(r=a.exec(e))!=null;){if(l=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!l||(i=[...l].length,i!==n))continue;if(r[3]||r[4]){o+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o);let p=[...r[0]][0].length,c=s.slice(0,n+r.index+p+i),k=c.slice(n,-n);return{type:"del",raw:c,text:k,tokens:this.lexer.inlineTokens(k)}}}}autolink(s){let e=this.rules.inline.autolink.exec(s);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(s){let e;if(e=this.rules.inline.url.exec(s)){let t,r;if(e[2]==="@")t=e[0],r="mailto:"+t;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);t=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(s){let e=this.rules.inline.text.exec(s);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},$=class X{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||L,this.options.tokenizer=this.options.tokenizer||new Z,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 t={other:T,block:j.normal,inline:N.normal};this.options.pedantic?(t.block=j.pedantic,t.inline=N.pedantic):this.options.gfm&&(t.block=j.gfm,this.options.breaks?t.inline=N.breaks:t.inline=N.gfm),this.tokenizer.rules=t}static get rules(){return{block:j,inline:N}}static lex(e,t){return new X(t).lex(e)}static lexInline(e,t){return new X(t).inlineTokens(e)}lex(e){e=e.replace(T.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(T.tabCharGlobal," ").replace(T.spaceLine,""));e;){let n;if(this.options.extensions?.block?.some(i=>(n=i.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))continue;if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length);let i=t.at(-1);n.raw.length===1&&i!==void 0?i.raw+=`
`:t.push(n);continue}if(n=this.tokenizer.code(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+n.raw,i.text+=`
`+n.text,this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+n.raw,i.text+=`
`+n.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title},t.push(n));continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}let l=e;if(this.options.extensions?.startBlock){let i=1/0,o=e.slice(1),a;this.options.extensions.startBlock.forEach(p=>{a=p.call({lexer:this},o),typeof a=="number"&&a>=0&&(i=Math.min(i,a))}),i<1/0&&i>=0&&(l=e.substring(0,i+1))}if(this.state.top&&(n=this.tokenizer.paragraph(l))){let i=t.at(-1);r&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n),r=l.length!==e.length,e=e.substring(n.raw.length);continue}if(n=this.tokenizer.text(e)){e=e.substring(n.raw.length);let i=t.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+n.raw,i.text+=`
`+n.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(n);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,n=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,n.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(n=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)l=n[2]?n[2].length:0,r=r.slice(0,n.index+l)+"["+"a".repeat(n[0].length-l-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let i=!1,o="";for(;e;){i||(o=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=t.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if(this.options.extensions?.startInline){let c=1/0,k=e.slice(1),g;this.options.extensions.startInline.forEach(w=>{g=w.call({lexer:this},k),typeof g=="number"&&g>=0&&(c=Math.min(c,g))}),c<1/0&&c>=0&&(p=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),i=!0;let c=t.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):t.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},U=class{options;parser;constructor(s){this.options=s||L}space(s){return""}code({text:s,lang:e,escaped:t}){let r=(e||"").match(T.notSpaceStart)?.[0],n=s.replace(T.endingNewline,"")+`
`;return r?'<pre><code class="language-'+z(r)+'">'+(t?n:z(n,!0))+`</code></pre>
`:"<pre><code>"+(t?n:z(n,!0))+`</code></pre>
`}blockquote({tokens:s}){return`<blockquote>
${this.parser.parse(s)}</blockquote>
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:e}){return`<h${e}>${this.parser.parseInline(s)}</h${e}>
`}hr(s){return`<hr>
`}list(s){let e=s.ordered,t=s.start,r="";for(let i=0;i<s.items.length;i++){let o=s.items[i];r+=this.listitem(o)}let n=e?"ol":"ul",l=e&&t!==1?' start="'+t+'"':"";return"<"+n+l+`>
`+r+"</"+n+`>
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
`}table(s){let e="",t="";for(let n=0;n<s.header.length;n++)t+=this.tablecell(s.header[n]);e+=this.tablerow({text:t});let r="";for(let n=0;n<s.rows.length;n++){let l=s.rows[n];t="";for(let i=0;i<l.length;i++)t+=this.tablecell(l[i]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+r+`</table>
`}tablerow({text:s}){return`<tr>
${s}</tr>
`}tablecell(s){let e=this.parser.parseInline(s.tokens),t=s.header?"th":"td";return(s.align?`<${t} align="${s.align}">`:`<${t}>`)+e+`</${t}>
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${z(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:e,tokens:t}){let r=this.parser.parseInline(t),n=ce(s);if(n===null)return r;s=n;let l='<a href="'+s+'"';return e&&(l+=' title="'+z(e)+'"'),l+=">"+r+"</a>",l}image({href:s,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));let n=ce(s);if(n===null)return z(t);s=n;let l=`<img src="${s}" alt="${z(t)}"`;return e&&(l+=` title="${z(e)}"`),l+=">",l}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:z(s.text)}},ie=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},A=class Y{options;renderer;textRenderer;constructor(e){this.options=e||L,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ie}static parse(e,t){return new Y(t).parse(e)}static parseInline(e,t){return new Y(t).parseInline(e)}parse(e){let t="";for(let r=0;r<e.length;r++){let n=e[r];if(this.options.extensions?.renderers?.[n.type]){let i=n,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(i.type)){t+=o||"";continue}}let l=n;switch(l.type){case"space":{t+=this.renderer.space(l);break}case"hr":{t+=this.renderer.hr(l);break}case"heading":{t+=this.renderer.heading(l);break}case"code":{t+=this.renderer.code(l);break}case"table":{t+=this.renderer.table(l);break}case"blockquote":{t+=this.renderer.blockquote(l);break}case"list":{t+=this.renderer.list(l);break}case"checkbox":{t+=this.renderer.checkbox(l);break}case"html":{t+=this.renderer.html(l);break}case"def":{t+=this.renderer.def(l);break}case"paragraph":{t+=this.renderer.paragraph(l);break}case"text":{t+=this.renderer.text(l);break}default:{let i='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return t}parseInline(e,t=this.renderer){let r="";for(let n=0;n<e.length;n++){let l=e[n];if(this.options.extensions?.renderers?.[l.type]){let o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=o||"";continue}}let i=l;switch(i.type){case"escape":{r+=t.text(i);break}case"html":{r+=t.html(i);break}case"link":{r+=t.link(i);break}case"image":{r+=t.image(i);break}case"checkbox":{r+=t.checkbox(i);break}case"strong":{r+=t.strong(i);break}case"em":{r+=t.em(i);break}case"codespan":{r+=t.codespan(i);break}case"br":{r+=t.br(i);break}case"del":{r+=t.del(i);break}case"text":{r+=t.text(i);break}default:{let o='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}},B=class{options;block;constructor(s){this.options=s||L}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?A.parse:A.parseInline}},$t=class{defaults=W();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=A;Renderer=U;TextRenderer=ie;Lexer=$;Tokenizer=Z;Hooks=B;constructor(...s){this.use(...s)}walkTokens(s,e){let t=[];for(let r of s)switch(t=t.concat(e.call(this,r)),r.type){case"table":{let n=r;for(let l of n.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of n.rows)for(let i of l)t=t.concat(this.walkTokens(i.tokens,e));break}case"list":{let n=r;t=t.concat(this.walkTokens(n.items,e));break}default:{let n=r;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(l=>{let i=n[l].flat(1/0);t=t.concat(this.walkTokens(i,e))}):n.tokens&&(t=t.concat(this.walkTokens(n.tokens,e)))}}return t}use(...s){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(t=>{let r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let l=e.renderers[n.name];l?e.renderers[n.name]=function(...i){let o=n.renderer.apply(this,i);return o===!1&&(o=l.apply(this,i)),o}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[n.level];l?l.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),r.extensions=e),t.renderer){let n=this.defaults.renderer||new U(this.defaults);for(let l in t.renderer){if(!(l in n))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,o=t.renderer[i],a=n[i];n[i]=(...p)=>{let c=o.apply(n,p);return c===!1&&(c=a.apply(n,p)),c||""}}r.renderer=n}if(t.tokenizer){let n=this.defaults.tokenizer||new Z(this.defaults);for(let l in t.tokenizer){if(!(l in n))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,o=t.tokenizer[i],a=n[i];n[i]=(...p)=>{let c=o.apply(n,p);return c===!1&&(c=a.apply(n,p)),c}}r.tokenizer=n}if(t.hooks){let n=this.defaults.hooks||new B;for(let l in t.hooks){if(!(l in n))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,o=t.hooks[i],a=n[i];B.passThroughHooks.has(l)?n[i]=p=>{if(this.defaults.async&&B.passThroughHooksRespectAsync.has(l))return(async()=>{let k=await o.call(n,p);return a.call(n,k)})();let c=o.call(n,p);return a.call(n,c)}:n[i]=(...p)=>{if(this.defaults.async)return(async()=>{let k=await o.apply(n,p);return k===!1&&(k=await a.apply(n,p)),k})();let c=o.apply(n,p);return c===!1&&(c=a.apply(n,p)),c}}r.hooks=n}if(t.walkTokens){let n=this.defaults.walkTokens,l=t.walkTokens;r.walkTokens=function(i){let o=[];return o.push(l.call(this,i)),n&&(o=o.concat(n.call(this,i))),o}}this.defaults={...this.defaults,...r}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,e){return $.lex(s,e??this.defaults)}parser(s,e){return A.parse(s,e??this.defaults)}parseMarkdown(s){return(e,t)=>{let r={...t},n={...this.defaults,...r},l=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&r.async===!1)return l(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 l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=s),n.async)return(async()=>{let i=n.hooks?await n.hooks.preprocess(e):e,o=await(n.hooks?await n.hooks.provideLexer():s?$.lex:$.lexInline)(i,n),a=n.hooks?await n.hooks.processAllTokens(o):o;n.walkTokens&&await Promise.all(this.walkTokens(a,n.walkTokens));let p=await(n.hooks?await n.hooks.provideParser():s?A.parse:A.parseInline)(a,n);return n.hooks?await n.hooks.postprocess(p):p})().catch(l);try{n.hooks&&(e=n.hooks.preprocess(e));let i=(n.hooks?n.hooks.provideLexer():s?$.lex:$.lexInline)(e,n);n.hooks&&(i=n.hooks.processAllTokens(i)),n.walkTokens&&this.walkTokens(i,n.walkTokens);let o=(n.hooks?n.hooks.provideParser():s?A.parse:A.parseInline)(i,n);return n.hooks&&(o=n.hooks.postprocess(o)),o}catch(i){return l(i)}}}onError(s,e){return t=>{if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,s){let r="<p>An error occurred:</p><pre>"+z(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},I=new $t;function x(s,e){return I.parse(s,e)}x.options=x.setOptions=function(s){return I.setOptions(s),x.defaults=I.defaults,ge(x.defaults),x};x.getDefaults=W;x.defaults=L;x.use=function(...s){return I.use(...s),x.defaults=I.defaults,ge(x.defaults),x};x.walkTokens=function(s,e){return I.walkTokens(s,e)};x.parseInline=I.parseInline;x.Parser=A;x.parser=A.parse;x.Renderer=U;x.TextRenderer=ie;x.Lexer=$;x.lexer=$.lex;x.Tokenizer=Z;x.Hooks=B;x.parse=x;var zt=x.options,Pt=x.setOptions,Et=x.use,It=x.walkTokens,Lt=x.parseInline,Re=x,Ct=A.parse,Nt=$.lex;var ve=Be(Ae(),1),ze={meta:{type:"const",value:{pluginName:"plugin_markup",description:"HTML\u6574\u5F62\u3084\u30DE\u30FC\u30AF\u30C0\u30A6\u30F3\u5909\u63DB\u306A\u3069\u306E\u547D\u4EE4\u3092\u63D0\u4F9B\u3059\u308B\u30D7\u30E9\u30B0\u30A4\u30F3",pluginVersion:"3.6.0",nakoRuntime:["wnako","cnako"],nakoVersion:"3.6.0"}},\u30DE\u30FC\u30AF\u30C0\u30A6\u30F3HTML\u5909\u63DB:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(s){return Re(s)}},HTML\u6574\u5F62:{type:"func",josi:[["\u3092"]],pure:!0,fn:function(s){return ve.default.prettyPrint(s,{indent_size:2})}}},Ut=ze;typeof navigator=="object"&&typeof navigator.nako3=="object"&&navigator.nako3.addPluginObject("PluginMarkup",ze);})();
//# sourceMappingURL=plugin_markup.js.map