import{r as Ue}from"./entities.797c3e49.js";import{u as Ge,c as We}from"./uc.micro.39573202.js";import{m as Le}from"./mdurl.2f66c031.js";import{l as Qe}from"./linkify-it.3ecfda1e.js";import{r as Ve}from"./punycode.c1b51344.js";var E={},Oe=Ue;(function(n){function e(d){return Object.prototype.toString.call(d)}function r(d){return e(d)==="[object String]"}var i=Object.prototype.hasOwnProperty;function l(d,A){return i.call(d,A)}function o(d){var A=Array.prototype.slice.call(arguments,1);return A.forEach(function(g){if(!!g){if(typeof g!="object")throw new TypeError(g+"must be object");Object.keys(g).forEach(function(O){d[O]=g[O]})}}),d}function t(d,A,g){return[].concat(d.slice(0,A),g,d.slice(A+1))}function c(d){return!(d>=55296&&d<=57343||d>=64976&&d<=65007||(d&65535)===65535||(d&65535)===65534||d>=0&&d<=8||d===11||d>=14&&d<=31||d>=127&&d<=159||d>1114111)}function f(d){if(d>65535){d-=65536;var A=55296+(d>>10),g=56320+(d&1023);return String.fromCharCode(A,g)}return String.fromCharCode(d)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,p=new RegExp(s.source+"|"+u.source,"gi"),h=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i,a=Oe;function v(d,A){var g;return l(a,A)?a[A]:A.charCodeAt(0)===35&&h.test(A)&&(g=A[1].toLowerCase()==="x"?parseInt(A.slice(2),16):parseInt(A.slice(1),10),c(g))?f(g):d}function x(d){return d.indexOf("\\")<0?d:d.replace(s,"$1")}function C(d){return d.indexOf("\\")<0&&d.indexOf("&")<0?d:d.replace(p,function(A,g,O){return g||v(A,O)})}var _=/[&<>"]/,k=/[&<>"]/g,b={"&":"&","<":"<",">":">",'"':"""};function y(d){return b[d]}function S(d){return _.test(d)?d.replace(k,y):d}var m=/[.?*+^$[\]\\(){}|-]/g;function T(d){return d.replace(m,"\\$&")}function w(d){switch(d){case 9:case 32:return!0}return!1}function L(d){if(d>=8192&&d<=8202)return!0;switch(d){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var M=We;function P(d){return M.test(d)}function B(d){switch(d){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function H(d){return d=d.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(d=d.replace(/ẞ/g,"\xDF")),d.toLowerCase().toUpperCase()}n.lib={},n.lib.mdurl=Le,n.lib.ucmicro=Ge,n.assign=o,n.isString=r,n.has=l,n.unescapeMd=x,n.unescapeAll=C,n.isValidEntityCode=c,n.fromCodePoint=f,n.escapeHtml=S,n.arrayReplaceAt=t,n.isSpace=w,n.isWhiteSpace=L,n.isMdAsciiPunct=B,n.isPunctChar=P,n.escapeRE=T,n.normalizeReference=H})(E);var J={},Je=function(e,r,i){var l,o,t,c,f=-1,s=e.posMax,u=e.pos;for(e.pos=r+1,l=1;e.pos32))return c;if(l===41){if(o===0)break;o--}t++}return r===t||o!==0||(c.str=ke(e.slice(r,t)),c.pos=t,c.ok=!0),c},Ke=E.unescapeAll,Xe=function(e,r,i){var l,o,t=0,c=r,f={ok:!1,pos:0,lines:0,str:""};if(c>=i||(o=e.charCodeAt(c),o!==34&&o!==39&&o!==40))return f;for(c++,o===40&&(o=41);c"+F(o.content)+""};$.code_block=function(n,e,r,i,l){var o=n[e];return""+F(n[e].content)+` `};$.fence=function(n,e,r,i,l){var o=n[e],t=o.info?rr(o.info).trim():"",c="",f="",s,u,p,h,a;return t&&(p=t.split(/(\s+)/g),c=p[0],f=p.slice(2).join("")),r.highlight?s=r.highlight(o.content,c,f)||F(o.content):s=F(o.content),s.indexOf(""+s+` `):"
"+s+`
`};$.image=function(n,e,r,i,l){var o=n[e];return o.attrs[o.attrIndex("alt")][1]=l.renderInlineAsText(o.children,r,i),l.renderToken(n,e,r)};$.hardbreak=function(n,e,r){return r.xhtmlOut?`
`:`
`};$.softbreak=function(n,e,r){return r.breaks?r.xhtmlOut?`
`:`
`:` `};$.text=function(n,e){return F(n[e].content)};$.html_block=function(n,e){return n[e].content};$.html_inline=function(n,e){return n[e].content};function j(){this.rules=er({},$)}j.prototype.renderAttrs=function(e){var r,i,l;if(!e.attrs)return"";for(l="",r=0,i=e.attrs.length;r `:">",o)};j.prototype.renderInline=function(n,e,r){for(var i,l="",o=this.rules,t=0,c=n.length;t\s]/i.test(n)}function ur(n){return/^<\/a\s*>/i.test(n)}var ar=function(e){var r,i,l,o,t,c,f,s,u,p,h,a,v,x,C,_,k=e.tokens,b;if(!!e.md.options.linkify){for(i=0,l=k.length;i=0;r--){if(c=o[r],c.type==="link_close"){for(r--;o[r].level!==c.level&&o[r].type!=="link_open";)r--;continue}if(c.type==="html_inline"&&(sr(c.content)&&v>0&&v--,ur(c.content)&&v++),!(v>0)&&c.type==="text"&&e.md.linkify.test(c.content)){for(u=c.content,b=e.md.linkify.match(u),f=[],a=c.level,h=0,b.length>0&&b[0].index===0&&r>0&&o[r-1].type==="text_special"&&(b=b.slice(1)),s=0;sh&&(t=new e.Token("text","",0),t.content=u.slice(h,p),t.level=a,f.push(t)),t=new e.Token("link_open","a",1),t.attrs=[["href",C]],t.level=a++,t.markup="linkify",t.info="auto",f.push(t),t=new e.Token("text","",0),t.content=_,t.level=a,f.push(t),t=new e.Token("link_close","a",-1),t.level=--a,t.markup="linkify",t.info="auto",f.push(t),h=b[s].lastIndex);h=0;e--)r=n[e],r.type==="text"&&!i&&(r.content=r.content.replace(pr,kr)),r.type==="link_open"&&r.info==="auto"&&i--,r.type==="link_close"&&r.info==="auto"&&i++}function xr(n){var e,r,i=0;for(e=n.length-1;e>=0;e--)r=n[e],r.type==="text"&&!i&&De.test(r.content)&&(r.content=r.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),r.type==="link_open"&&r.info==="auto"&&i--,r.type==="link_close"&&r.info==="auto"&&i++}var gr=function(e){var r;if(!!e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)e.tokens[r].type==="inline"&&(hr.test(e.tokens[r].content)&&mr(e.tokens[r].children),De.test(e.tokens[r].content)&&xr(e.tokens[r].children))},me=E.isWhiteSpace,xe=E.isPunctChar,ge=E.isMdAsciiPunct,_r=/['"]/,_e=/['"]/g,ve="\u2019";function W(n,e,r){return n.slice(0,e)+r+n.slice(e+1)}function vr(n,e){var r,i,l,o,t,c,f,s,u,p,h,a,v,x,C,_,k,b,y,S,m;for(y=[],r=0;r=0&&!(y[k].level<=f);k--);if(y.length=k+1,i.type!=="text")continue;l=i.content,t=0,c=l.length;e:for(;t=0)u=l.charCodeAt(o.index-1);else for(k=r-1;k>=0&&!(n[k].type==="softbreak"||n[k].type==="hardbreak");k--)if(!!n[k].content){u=n[k].content.charCodeAt(n[k].content.length-1);break}if(p=32,t=48&&u<=57&&(_=C=!1),C&&_&&(C=h,_=a),!C&&!_){b&&(i.content=W(i.content,o.index,ve));continue}if(_){for(k=y.length-1;k>=0&&(s=y[k],!(y[k].level=0;r--)e.tokens[r].type!=="inline"||!_r.test(e.tokens[r].content)||vr(e.tokens[r].children,e)},Cr=function(e){var r,i,l,o,t,c,f=e.tokens;for(r=0,i=f.length;r=0&&(i=this.attrs[r][1]),i};N.prototype.attrJoin=function(e,r){var i=this.attrIndex(e);i<0?this.attrPush([e,r]):this.attrs[i][1]=this.attrs[i][1]+" "+r};var ue=N,Ar=ue;function Fe(n,e,r){this.src=n,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}Fe.prototype.Token=Ar;var yr=Fe,Er=se,ne=[["normalize",lr],["block",tr],["inline",fr],["linkify",ar],["replacements",gr],["smartquotes",br],["text_join",Cr]];function ae(){this.ruler=new Er;for(var n=0;ni||(u=r+1,e.sCount[u]=4||(c=e.bMarks[u]+e.tShift[u],c>=e.eMarks[u])||(S=e.src.charCodeAt(c++),S!==124&&S!==45&&S!==58)||c>=e.eMarks[u]||(m=e.src.charCodeAt(c++),m!==124&&m!==45&&m!==58&&!ie(m))||S===45&&ie(m))return!1;for(;c=4||(p=be(t),p.length&&p[0]===""&&p.shift(),p.length&&p[p.length-1]===""&&p.pop(),h=p.length,h===0||h!==v.length))return!1;if(l)return!0;for(k=e.parentType,e.parentType="table",y=e.md.block.ruler.getRules("blockquote"),a=e.push("table_open","table",1),a.map=C=[r,0],a=e.push("thead_open","thead",1),a.map=[r,r+1],a=e.push("tr_open","tr",1),a.map=[r,r+1],f=0;f=4)break;for(p=be(t),p.length&&p[0]===""&&p.shift(),p.length&&p[p.length-1]===""&&p.pop(),u===r+2&&(a=e.push("tbody_open","tbody",1),a.map=_=[r+2,0]),a=e.push("tr_open","tr",1),a.map=[u,u+1],f=0;f=4){l++,o=l;continue}break}return e.line=o,t=e.push("code_block","code",0),t.content=e.getLines(r,o,4+e.blkIndent,!1)+` `,t.map=[r,e.line],!0},wr=function(e,r,i,l){var o,t,c,f,s,u,p,h=!1,a=e.bMarks[r]+e.tShift[r],v=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||a+3>v||(o=e.src.charCodeAt(a),o!==126&&o!==96)||(s=a,a=e.skipChars(a,o),t=a-s,t<3)||(p=e.src.slice(s,a),c=e.src.slice(a,v),o===96&&c.indexOf(String.fromCharCode(o))>=0))return!1;if(l)return!0;for(f=r;f++,!(f>=i||(a=s=e.bMarks[f]+e.tShift[f],v=e.eMarks[f],a=4)&&(a=e.skipChars(a,o),!(a-s=4||e.src.charCodeAt(M)!==62)return!1;if(l)return!0;for(v=[],x=[],k=[],b=[],m=e.md.block.ruler.getRules("blockquote"),_=e.parentType,e.parentType="blockquote",h=r;h=P));h++){if(e.src.charCodeAt(M++)===62&&!w){for(f=e.sCount[h]+1,e.src.charCodeAt(M)===32?(M++,f++,o=!1,y=!0):e.src.charCodeAt(M)===9?(y=!0,(e.bsCount[h]+f)%4===3?(M++,f++,o=!1):o=!0):y=!1,a=f,v.push(e.bMarks[h]),e.bMarks[h]=M;M=P,x.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(y?1:0),k.push(e.sCount[h]),e.sCount[h]=a-f,b.push(e.tShift[h]),e.tShift[h]=M-e.bMarks[h];continue}if(u)break;for(S=!1,c=0,s=m.length;c",T.map=p=[r,0],e.md.block.tokenize(e,r,h),T=e.push("blockquote_close","blockquote",-1),T.markup=">",e.lineMax=L,e.parentType=_,p[1]=e.line,c=0;c=4||(o=e.src.charCodeAt(s++),o!==42&&o!==45&&o!==95))return!1;for(t=1;s=o||(r=n.src.charCodeAt(l++),r<48||r>57))return-1;for(;;){if(l>=o)return-1;if(r=n.src.charCodeAt(l++),r>=48&&r<=57){if(l-i>=10)return-1;continue}if(r===41||r===46)break;return-1}return l=4||e.listIndent>=0&&e.sCount[g]-e.listIndent>=4&&e.sCount[g]=e.blkIndent&&(O=!0),(M=Ae(e,g))>=0){if(p=!0,B=e.bMarks[g]+e.tShift[g],_=Number(e.src.slice(B,M-1)),O&&_!==1)return!1}else if((M=Ce(e,g))>=0)p=!1;else return!1;if(O&&e.skipSpaces(M)>=e.eMarks[g])return!1;if(l)return!0;for(C=e.src.charCodeAt(M-1),x=e.tokens.length,p?(A=e.push("ordered_list_open","ol",1),_!==1&&(A.attrs=[["start",_]])):A=e.push("bullet_list_open","ul",1),A.map=v=[g,0],A.markup=String.fromCharCode(C),P=!1,d=e.md.block.ruler.getRules("list"),S=e.parentType,e.parentType="list";g=k?s=1:s=b-u,s>4&&(s=1),f=u+s,A=e.push("list_item_open","li",1),A.markup=String.fromCharCode(C),A.map=h=[g,0],p&&(A.info=e.src.slice(B,M-1)),w=e.tight,T=e.tShift[g],m=e.sCount[g],y=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=f,e.tight=!0,e.tShift[g]=t-e.bMarks[g],e.sCount[g]=b,t>=k&&e.isEmpty(g+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,g,i,!0),(!e.tight||P)&&(de=!1),P=e.line-g>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=y,e.tShift[g]=T,e.sCount[g]=m,e.tight=w,A=e.push("list_item_close","li",-1),A.markup=String.fromCharCode(C),g=e.line,h[1]=g,g>=i||e.sCount[g]=4)break;for(H=!1,c=0,a=d.length;c=4||e.src.charCodeAt(m)!==91)return!1;for(;++m3)&&!(e.sCount[w]<0)){for(k=!1,u=0,p=b.length;u`\\x00-\\x20]+",jr="'[^']*'",Nr='"[^"]*"',Hr="(?:"+qr+"|"+jr+"|"+Nr+")",Zr="(?:\\s+"+Br+"(?:\\s*=\\s*"+Hr+")?)",qe="<[A-Za-z][A-Za-z0-9\\-]*"+Zr+"*\\s*\\/?>",je="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ur="|",Gr="<[?][\\s\\S]*?[?]>",Wr="]*>",Qr="",Vr=new RegExp("^(?:"+qe+"|"+je+"|"+Ur+"|"+Gr+"|"+Wr+"|"+Qr+")"),Jr=new RegExp("^(?:"+qe+"|"+je+")");Y.HTML_TAG_RE=Vr;Y.HTML_OPEN_CLOSE_TAG_RE=Jr;var Yr=Fr,Kr=Y.HTML_OPEN_CLOSE_TAG_RE,q=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(Kr.source+"\\s*$"),/^$/,!1]],Xr=function(e,r,i,l){var o,t,c,f,s=e.bMarks[r]+e.tShift[r],u=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(s)!==60)return!1;for(f=e.src.slice(s,u),o=0;o=4||(o=e.src.charCodeAt(s),o!==35||s>=u))return!1;for(t=1,o=e.src.charCodeAt(++s);o===35&&s6||ss&&ye(e.src.charCodeAt(c-1))&&(u=c),e.line=r+1,f=e.push("heading_open","h"+String(t),1),f.markup="########".slice(0,t),f.map=[r,e.line],f=e.push("inline","",0),f.content=e.src.slice(s,u).trim(),f.map=[r,e.line],f.children=[],f=e.push("heading_close","h"+String(t),-1),f.markup="########".slice(0,t)),!0)},rn=function(e,r,i){var l,o,t,c,f,s,u,p,h,a=r+1,v,x=e.md.block.ruler.getRules("paragraph");if(e.sCount[r]-e.blkIndent>=4)return!1;for(v=e.parentType,e.parentType="paragraph";a3)){if(e.sCount[a]>=e.blkIndent&&(s=e.bMarks[a]+e.tShift[a],u=e.eMarks[a],s=u)))){p=h===61?1:2;break}if(!(e.sCount[a]<0)){for(o=!1,t=0,c=x.length;t3)&&!(e.sCount[u]<0)){for(o=!1,t=0,c=p.length;t0&&this.level++,this.tokens.push(i),i};z.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};z.prototype.skipEmptyLines=function(e){for(var r=this.lineMax;er;)if(!K(this.src.charCodeAt(--e)))return e+1;return e};z.prototype.skipChars=function(e,r){for(var i=this.src.length;ei;)if(r!==this.src.charCodeAt(--e))return e+1;return e};z.prototype.getLines=function(e,r,i,l){var o,t,c,f,s,u,p,h=e;if(e>=r)return"";for(u=new Array(r-e),o=0;hi?u[o]=new Array(t-i+1).join(" ")+this.src.slice(f,s):u[o]=this.src.slice(f,s)}return u.join("")};z.prototype.Token=Ne;var on=z,ln=se,V=[["table",Mr,["paragraph","reference"]],["code",Tr],["fence",wr,["paragraph","reference","blockquote","list"]],["blockquote",Rr,["paragraph","reference","blockquote","list"]],["hr",$r,["paragraph","reference","blockquote","list"]],["list",Lr,["paragraph","reference","blockquote"]],["reference",Dr],["html_block",Xr,["paragraph","reference","blockquote"]],["heading",en,["paragraph","reference","blockquote"]],["lheading",rn],["paragraph",nn]];function X(){this.ruler=new ln;for(var n=0;n=r||n.sCount[f]=u){n.line=r;break}for(o=n.line,l=0;l=n.line)throw new Error("block rule didn't increment state.line");break}if(!i)throw new Error("none of the block rules matched");n.tight=!s,n.isEmpty(n.line-1)&&(s=!0),f=n.line,f0||(i=e.pos,l=e.posMax,i+3>l)||e.src.charCodeAt(i)!==58||e.src.charCodeAt(i+1)!==47||e.src.charCodeAt(i+2)!==47||(o=e.pending.match(sn),!o)||(t=o[1],c=e.md.linkify.matchAtStart(e.src.slice(i-t.length)),!c)||(f=c.url,f.length<=t.length)||(f=f.replace(/\*+$/,""),s=e.md.normalizeLink(f),!e.md.validateLink(s))?!1:(r||(e.pending=e.pending.slice(0,-t.length),u=e.push("link_open","a",1),u.attrs=[["href",s]],u.markup="linkify",u.info="auto",u=e.push("text","",0),u.content=e.md.normalizeLinkText(f),u=e.push("link_close","a",-1),u.markup="linkify",u.info="auto"),e.pos+=f.length-t.length,!0)},an=E.isSpace,hn=function(e,r){var i,l,o,t=e.pos;if(e.src.charCodeAt(t)!==10)return!1;if(i=e.pending.length-1,l=e.posMax,!r)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){for(o=i-1;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(t++;t?@[]^_`{|}~-".split("").forEach(function(n){he[n.charCodeAt(0)]=1});var dn=function(e,r){var i,l,o,t,c,f=e.pos,s=e.posMax;if(e.src.charCodeAt(f)!==92||(f++,f>=s))return!1;if(i=e.src.charCodeAt(f),i===10){for(r||e.push("hardbreak","br",0),f++;f=55296&&i<=56319&&f+1=56320&&l<=57343&&(t+=e.src[f+1],f++)),o="\\"+t,r||(c=e.push("text_special","",0),i<256&&he[i]!==0?c.content=t:c.content=o,c.markup=o,c.info="escape"),e.pos=f+1,!0},kn=function(e,r){var i,l,o,t,c,f,s,u,p=e.pos,h=e.src.charCodeAt(p);if(h!==96)return!1;for(i=p,p++,l=e.posMax;p=0;r--)i=e[r],!(i.marker!==95&&i.marker!==42)&&i.end!==-1&&(l=e[i.end],c=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===l.token+1,t=String.fromCharCode(i.marker),o=n.tokens[i.token],o.type=c?"strong_open":"em_open",o.tag=c?"strong":"em",o.nesting=1,o.markup=c?t+t:t,o.content="",o=n.tokens[l.token],o.type=c?"strong_close":"em_close",o.tag=c?"strong":"em",o.nesting=-1,o.markup=c?t+t:t,o.content="",c&&(n.tokens[e[r-1].token].content="",n.tokens[e[i.end+1].token].content="",r--))}re.postProcess=function(e){var r,i=e.tokens_meta,l=e.tokens_meta.length;for(Me(e,e.delimiters),r=0;r=x)return!1;if(C=f,s=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),s.ok){for(h=e.md.normalizeLink(s.str),e.md.validateLink(h)?f=s.pos:h="",C=f;f=x||e.src.charCodeAt(f)!==41)&&(_=!0),f++}if(_){if(typeof e.env.references=="undefined")return!1;if(f=0?o=e.src.slice(C,f++):f=t+1):f=t+1,o||(o=e.src.slice(c,t)),u=e.env.references[mn(o)],!u)return e.pos=v,!1;h=u.href,a=u.title}return r||(e.pos=c,e.posMax=t,p=e.push("link_open","a",1),p.attrs=i=[["href",h]],a&&i.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,p=e.push("link_close","a",-1)),e.pos=f,e.posMax=x,!0},gn=E.normalizeReference,te=E.isSpace,_n=function(e,r){var i,l,o,t,c,f,s,u,p,h,a,v,x,C="",_=e.pos,k=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91||(f=e.pos+2,c=e.md.helpers.parseLinkLabel(e,e.pos+1,!1),c<0))return!1;if(s=c+1,s=k)return!1;for(x=s,p=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),p.ok&&(C=e.md.normalizeLink(p.str),e.md.validateLink(C)?s=p.pos:C=""),x=s;s=k||e.src.charCodeAt(s)!==41)return e.pos=_,!1;s++}else{if(typeof e.env.references=="undefined")return!1;if(s=0?t=e.src.slice(x,s++):s=c+1):s=c+1,t||(t=e.src.slice(f,c)),u=e.env.references[gn(t)],!u)return e.pos=_,!1;C=u.href,h=u.title}return r||(o=e.src.slice(f,c),e.md.inline.parse(o,e.md,e.env,v=[]),a=e.push("image","img",0),a.attrs=i=[["src",C],["alt",""]],a.children=v,a.content=o,h&&i.push(["title",h])),e.pos=s,e.posMax=k,!0},vn=/^([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])?)*)$/,bn=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/,Cn=function(e,r){var i,l,o,t,c,f,s=e.pos;if(e.src.charCodeAt(s)!==60)return!1;for(c=e.pos,f=e.posMax;;){if(++s>=f||(t=e.src.charCodeAt(s),t===60))return!1;if(t===62)break}return i=e.src.slice(c+1,s),bn.test(i)?(l=e.md.normalizeLink(i),e.md.validateLink(l)?(r||(o=e.push("link_open","a",1),o.attrs=[["href",l]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(i),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=i.length+2,!0):!1):vn.test(i)?(l=e.md.normalizeLink("mailto:"+i),e.md.validateLink(l)?(r||(o=e.push("link_open","a",1),o.attrs=[["href",l]],o.markup="autolink",o.info="auto",o=e.push("text","",0),o.content=e.md.normalizeLinkText(i),o=e.push("link_close","a",-1),o.markup="autolink",o.info="auto"),e.pos+=i.length+2,!0):!1):!1},An=Y.HTML_TAG_RE;function yn(n){return/^\s]/i.test(n)}function En(n){return/^<\/a\s*>/i.test(n)}function Sn(n){var e=n|32;return e>=97&&e<=122}var Mn=function(e,r){var i,l,o,t,c=e.pos;return!e.md.options.html||(o=e.posMax,e.src.charCodeAt(c)!==60||c+2>=o)||(i=e.src.charCodeAt(c+1),i!==33&&i!==63&&i!==47&&!Sn(i))||(l=e.src.slice(c).match(An),!l)?!1:(r||(t=e.push("html_inline","",0),t.content=l[0],yn(t.content)&&e.linkLevel++,En(t.content)&&e.linkLevel--),e.pos+=l[0].length,!0)},Te=Oe,Tn=E.has,wn=E.isValidEntityCode,we=E.fromCodePoint,In=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Rn=/^&([a-z][a-z0-9]{1,31});/i,Pn=function(e,r){var i,l,o,t,c=e.pos,f=e.posMax;if(e.src.charCodeAt(c)!==38||c+1>=f)return!1;if(i=e.src.charCodeAt(c+1),i===35){if(o=e.src.slice(c).match(In),o)return r||(l=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),t=e.push("text_special","",0),t.content=wn(l)?we(l):we(65533),t.markup=o[0],t.info="entity"),e.pos+=o[0].length,!0}else if(o=e.src.slice(c).match(Rn),o&&Tn(Te,o[1]))return r||(t=e.push("text_special","",0),t.content=Te[o[1]],t.markup=o[0],t.info="entity"),e.pos+=o[0].length,!0;return!1};function Ie(n){var e,r,i,l,o,t,c,f,s={},u=n.length;if(!!u){var p=0,h=-2,a=[];for(e=0;eo;r-=a[r]+1)if(l=n[r],l.marker===i.marker&&l.open&&l.end<0&&(c=!1,(l.close||i.open)&&(l.length+i.length)%3===0&&(l.length%3!==0||i.length%3!==0)&&(c=!0),!c)){f=r>0&&!n[r-1].open?a[r-1]+1:0,a[e]=e-r+f,a[r]=f,i.open=!1,l.end=e,l.close=!1,t=-1,h=-2;break}t!==-1&&(s[i.marker][(i.open?3:0)+(i.length||0)%3]=t)}}}var $n=function(e){var r,i=e.tokens_meta,l=e.tokens_meta.length;for(Ie(e.delimiters),r=0;r0&&l++,o[r].type==="text"&&r+10&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],l={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(l),i};U.prototype.scanDelims=function(n,e){var r=n,i,l,o,t,c,f,s,u,p,h=!0,a=!0,v=this.posMax,x=this.src.charCodeAt(n);for(i=n>0?this.src.charCodeAt(n-1):32;r=n.pos)throw new Error("inline rule didn't increment state.pos");break}}else n.pos=n.posMax;e||n.pos++,c[i]=n.pos};G.prototype.tokenize=function(n){for(var e,r,i,l=this.ruler.getRules(""),o=l.length,t=n.posMax,c=n.md.options.maxNesting;n.pos=n.pos)throw new Error("inline rule didn't increment state.pos");break}}if(e){if(n.pos>=t)break;continue}n.pending+=n.src[n.pos++]}n.pending&&n.pushPending()};G.prototype.parse=function(n,e,r,i){var l,o,t,c=new this.State(n,e,r,i);for(this.tokenize(c),o=this.ruler2.getRules(""),t=o.length,l=0;l=0))try{e.hostname=He.toASCII(e.hostname)}catch{}return D.encode(D.format(e))}function Yn(n){var e=D.parse(n,!0);if(e.hostname&&(!e.protocol||Ze.indexOf(e.protocol)>=0))try{e.hostname=He.toUnicode(e.hostname)}catch{}return D.decode(D.format(e),D.decode.defaultChars+"%")}function I(n,e){if(!(this instanceof I))return new I(n,e);e||Z.isString(n)||(e=n||{},n="default"),this.inline=new Zn,this.block=new Hn,this.core=new Nn,this.renderer=new jn,this.linkify=new Un,this.validateLink=Vn,this.normalizeLink=Jn,this.normalizeLinkText=Yn,this.utils=Z,this.helpers=Z.assign({},qn),this.options={},this.configure(n),e&&this.set(e)}I.prototype.set=function(n){return Z.assign(this.options,n),this};I.prototype.configure=function(n){var e=this,r;if(Z.isString(n)&&(r=n,n=Gn[r],!n))throw new Error('Wrong `markdown-it` preset "'+r+'", check name');if(!n)throw new Error("Wrong `markdown-it` preset, can't be empty");return n.options&&e.set(n.options),n.components&&Object.keys(n.components).forEach(function(i){n.components[i].rules&&e[i].ruler.enableOnly(n.components[i].rules),n.components[i].rules2&&e[i].ruler2.enableOnly(n.components[i].rules2)}),this};I.prototype.enable=function(n,e){var r=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(l){r=r.concat(this[l].ruler.enable(n,!0))},this),r=r.concat(this.inline.ruler2.enable(n,!0));var i=n.filter(function(l){return r.indexOf(l)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};I.prototype.disable=function(n,e){var r=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(l){r=r.concat(this[l].ruler.disable(n,!0))},this),r=r.concat(this.inline.ruler2.disable(n,!0));var i=n.filter(function(l){return r.indexOf(l)<0});if(i.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};I.prototype.use=function(n){var e=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,e),this};I.prototype.parse=function(n,e){if(typeof n!="string")throw new Error("Input data should be a String");var r=new this.core.State(n,this,e);return this.core.process(r),r.tokens};I.prototype.render=function(n,e){return e=e||{},this.renderer.render(this.parse(n,e),this.options,e)};I.prototype.parseInline=function(n,e){var r=new this.core.State(n,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};I.prototype.renderInline=function(n,e){return e=e||{},this.renderer.render(this.parseInline(n,e),this.options,e)};var Kn=I,oi=Kn;export{oi as m};