UNPKG

nadesiko3

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