import{r as Ge}from"./entities.797c3e49.js";import{u as We,c as Qe}from"./uc.micro.39573202.js";import{m as De}from"./mdurl.2f66c031.js";import{l as Ve}from"./linkify-it.3ecfda1e.js";import{r as Je}from"./punycode.1f25cbf2.js";var E={},Fe=Ge;(function(n){function e(k){return Object.prototype.toString.call(k)}function r(k){return e(k)==="[object String]"}var i=Object.prototype.hasOwnProperty;function l(k,w){return i.call(k,w)}function o(k){var w=Array.prototype.slice.call(arguments,1);return w.forEach(function(y){if(!!y){if(typeof y!="object")throw new TypeError(y+"must be object");Object.keys(y).forEach(function(O){k[O]=y[O]})}}),k}function t(k,w,y){return[].concat(k.slice(0,w),y,k.slice(w+1))}function c(k){return!(k>=55296&&k<=57343||k>=64976&&k<=65007||(k&65535)===65535||(k&65535)===65534||k>=0&&k<=8||k===11||k>=14&&k<=31||k>=127&&k<=159||k>1114111)}function f(k){if(k>65535){k-=65536;var w=55296+(k>>10),y=56320+(k&1023);return String.fromCharCode(w,y)}return String.fromCharCode(k)}var u=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,s=/&([a-z#][a-z0-9]{1,31});/gi,p=new RegExp(u.source+"|"+s.source,"gi"),h=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,a=Fe;function x(k,w){var y=0;return l(a,w)?a[w]:w.charCodeAt(0)===35&&h.test(w)&&(y=w[1].toLowerCase()==="x"?parseInt(w.slice(2),16):parseInt(w.slice(1),10),c(y))?f(y):k}function g(k){return k.indexOf("\\")<0?k:k.replace(u,"$1")}function b(k){return k.indexOf("\\")<0&&k.indexOf("&")<0?k:k.replace(p,function(w,y,O){return y||x(w,O)})}var _=/[&<>"]/,d=/[&<>"]/g,v={"&":"&","<":"<",">":">",'"':"""};function C(k){return v[k]}function S(k){return _.test(k)?k.replace(d,C):k}var m=/[.?*+^$[\]\\(){}|-]/g;function M(k){return k.replace(m,"\\$&")}function I(k){switch(k){case 9:case 32:return!0}return!1}function B(k){if(k>=8192&&k<=8202)return!0;switch(k){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 A=Qe;function T(k){return A.test(k)}function H(k){switch(k){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 q(k){return k=k.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(k=k.replace(/ẞ/g,"\xDF")),k.toLowerCase().toUpperCase()}n.lib={},n.lib.mdurl=De,n.lib.ucmicro=We,n.assign=o,n.isString=r,n.has=l,n.unescapeMd=g,n.unescapeAll=b,n.isValidEntityCode=c,n.fromCodePoint=f,n.escapeHtml=S,n.arrayReplaceAt=t,n.isSpace=I,n.isWhiteSpace=B,n.isMdAsciiPunct=H,n.isPunctChar=T,n.escapeRE=M,n.normalizeReference=q})(E);var J={},Ye=function(e,r,i){var l,o,t,c,f=-1,u=e.posMax,s=e.pos;for(e.pos=r+1,l=1;e.pos32))return f;if(l===41){if(o===0)break;o--}r++}return c===r||o!==0||(f.str=de(e.slice(c,r)),f.lines=t,f.pos=r,f.ok=!0),f},Xe=E.unescapeAll,er=function(e,r,i){var l,o,t=0,c=r,f={ok:!1,pos:0,lines:0,str:""};if(r>=i||(o=e.charCodeAt(r),o!==34&&o!==39&&o!==40))return f;for(r++,o===40&&(o=41);r"+F(n[e].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?nr(o.info).trim():"",c="",f="",u,s,p,h,a;return t&&(p=t.split(/(\s+)/g),c=p[0],f=p.slice(2).join("")),r.highlight?u=r.highlight(o.content,c,f)||F(o.content):u=F(o.content),u.indexOf(""+u+` `):"
"+u+`
`};$.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 N(){this.rules=rr({},$)}N.prototype.renderAttrs=function(e){var r,i,l;if(!e.attrs)return"";for(l="",r=0,i=e.attrs.length;r `:">",o)};N.prototype.renderInline=function(n,e,r){for(var i,l="",o=this.rules,t=0,c=n.length;t\s]/i.test(n)}function ar(n){return/^<\/a\s*>/i.test(n)}var hr=function(e){var r,i,l,o,t,c,f,u,s,p,h,a,x,g,b,_,d=e.tokens,v;if(!!e.md.options.linkify){for(i=0,l=d.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)&&x>0&&x--,ar(c.content)&&x++),!(x>0)&&c.type==="text"&&e.md.linkify.test(c.content)){for(s=c.content,v=e.md.linkify.match(s),f=[],a=c.level,h=0,v.length>0&&v[0].index===0&&r>0&&o[r-1].type==="text_special"&&(v=v.slice(1)),u=0;uh&&(t=new e.Token("text","",0),t.content=s.slice(h,p),t.level=a,f.push(t)),t=new e.Token("link_open","a",1),t.attrs=[["href",b]],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=v[u].lastIndex);h=0;e--)r=n[e],r.type==="text"&&!i&&(r.content=r.content.replace(kr,mr)),r.type==="link_open"&&r.info==="auto"&&i--,r.type==="link_close"&&r.info==="auto"&&i++}function gr(n){var e,r,i=0;for(e=n.length-1;e>=0;e--)r=n[e],r.type==="text"&&!i&&Be.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 _r=function(e){var r;if(!!e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)e.tokens[r].type==="inline"&&(pr.test(e.tokens[r].content)&&xr(e.tokens[r].children),Be.test(e.tokens[r].content)&&gr(e.tokens[r].children))},me=E.isWhiteSpace,xe=E.isPunctChar,ge=E.isMdAsciiPunct,vr=/['"]/,_e=/['"]/g,ve="\u2019";function W(n,e,r){return n.slice(0,e)+r+n.slice(e+1)}function br(n,e){var r,i,l,o,t,c,f,u,s,p,h,a,x,g,b,_,d,v,C,S,m;for(C=[],r=0;r=0&&!(C[d].level<=f);d--);if(C.length=d+1,i.type!=="text")continue;l=i.content,t=0,c=l.length;e:for(;t=0)s=l.charCodeAt(o.index-1);else for(d=r-1;d>=0&&!(n[d].type==="softbreak"||n[d].type==="hardbreak");d--)if(!!n[d].content){s=n[d].content.charCodeAt(n[d].content.length-1);break}if(p=32,t=48&&s<=57&&(_=b=!1),b&&_&&(b=h,_=a),!b&&!_){v&&(i.content=W(i.content,o.index,ve));continue}if(_){for(d=C.length-1;d>=0&&(u=C[d],!(C[d].level=0;r--)e.tokens[r].type!=="inline"||!vr.test(e.tokens[r].content)||br(e.tokens[r].children,e)},Ar=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};L.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 se=L,yr=se;function qe(n,e,r){this.src=n,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=e}qe.prototype.Token=yr;var Er=qe,Sr=ue,ne=[["normalize",tr],["block",fr],["inline",cr],["linkify",hr],["replacements",_r],["smartquotes",Cr],["text_join",Ar]];function ae(){this.ruler=new Sr;for(var n=0;ni||(s=r+1,e.sCount[s]=4||(c=e.bMarks[s]+e.tShift[s],c>=e.eMarks[s])||(S=e.src.charCodeAt(c++),S!==124&&S!==45&&S!==58)||c>=e.eMarks[s]||(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!==x.length))return!1;if(l)return!0;for(d=e.parentType,e.parentType="table",C=e.md.block.ruler.getRules("blockquote"),a=e.push("table_open","table",1),a.map=b=[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(),s===r+2&&(a=e.push("tbody_open","tbody",1),a.map=_=[r+2,0]),a=e.push("tr_open","tr",1),a.map=[s,s+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},Ir=function(e,r,i,l){var o,t,c,f,u,s,p,h=!1,a=e.bMarks[r]+e.tShift[r],x=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||a+3>x||(o=e.src.charCodeAt(a),o!==126&&o!==96)||(u=a,a=e.skipChars(a,o),t=a-u,t<3)||(p=e.src.slice(u,a),c=e.src.slice(a,x),o===96&&c.indexOf(String.fromCharCode(o))>=0))return!1;if(l)return!0;for(f=r;f++,!(f>=i||(a=u=e.bMarks[f]+e.tShift[f],x=e.eMarks[f],a=4)&&(a=e.skipChars(a,o),!(a-u=4||e.src.charCodeAt(A++)!==62)return!1;if(l)return!0;for(f=a=e.sCount[r]+1,e.src.charCodeAt(A)===32?(A++,f++,a++,o=!1,C=!0):e.src.charCodeAt(A)===9?(C=!0,(e.bsCount[r]+a)%4===3?(A++,f++,a++,o=!1):o=!0):C=!1,x=[e.bMarks[r]],e.bMarks[r]=A;A=T,d=[e.sCount[r]],e.sCount[r]=a-f,v=[e.tShift[r]],e.tShift[r]=A-e.bMarks[r],m=e.md.block.ruler.getRules("blockquote"),_=e.parentType,e.parentType="blockquote",h=r+1;h=T));h++){if(e.src.charCodeAt(A++)===62&&!I){for(f=a=e.sCount[h]+1,e.src.charCodeAt(A)===32?(A++,f++,a++,o=!1,C=!0):e.src.charCodeAt(A)===9?(C=!0,(e.bsCount[h]+a)%4===3?(A++,f++,a++,o=!1):o=!0):C=!1,x.push(e.bMarks[h]),e.bMarks[h]=A;A=T,g.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(C?1:0),d.push(e.sCount[h]),e.sCount[h]=a-f,v.push(e.tShift[h]),e.tShift[h]=A-e.bMarks[h];continue}if(s)break;for(S=!1,c=0,u=m.length;c",M.map=p=[r,0],e.md.block.tokenize(e,r,h),M=e.push("blockquote_close","blockquote",-1),M.markup=">",e.lineMax=B,e.parentType=_,p[1]=e.line,c=0;c=4||(o=e.src.charCodeAt(u++),o!==42&&o!==45&&o!==95))return!1;for(t=1;u=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[r]-e.listIndent>=4&&e.sCount[r]=e.blkIndent&&(O=!0),(T=ye(e,r))>=0){if(p=!0,q=e.bMarks[r]+e.tShift[r],_=Number(e.src.slice(q,T-1)),O&&_!==1)return!1}else if((T=Ae(e,r))>=0)p=!1;else return!1;if(O&&e.skipSpaces(T)>=e.eMarks[r])return!1;if(b=e.src.charCodeAt(T-1),l)return!0;for(g=e.tokens.length,p?(y=e.push("ordered_list_open","ol",1),_!==1&&(y.attrs=[["start",_]])):y=e.push("bullet_list_open","ul",1),y.map=x=[r,0],y.markup=String.fromCharCode(b),v=r,H=!1,w=e.md.block.ruler.getRules("list"),m=e.parentType,e.parentType="list";v=d?u=1:u=C-s,u>4&&(u=1),f=s+u,y=e.push("list_item_open","li",1),y.markup=String.fromCharCode(b),y.map=h=[r,0],p&&(y.info=e.src.slice(q,T-1)),B=e.tight,I=e.tShift[r],M=e.sCount[r],S=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=f,e.tight=!0,e.tShift[r]=t-e.bMarks[r],e.sCount[r]=C,t>=d&&e.isEmpty(r+1)?e.line=Math.min(e.line+2,i):e.md.block.tokenize(e,r,i,!0),(!e.tight||H)&&(ke=!1),H=e.line-r>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=S,e.tShift[r]=I,e.sCount[r]=M,e.tight=B,y=e.push("list_item_close","li",-1),y.markup=String.fromCharCode(b),v=r=e.line,h[1]=v,t=e.bMarks[r],v>=i||e.sCount[v]=4)break;for(k=!1,c=0,a=w.length;c=4||e.src.charCodeAt(m)!==91)return!1;for(;++m3)&&!(e.sCount[I]<0)){for(d=!1,s=0,p=v.length;s`\\x00-\\x20]+",Nr="'[^']*'",Lr='"[^"]*"',Hr="(?:"+jr+"|"+Nr+"|"+Lr+")",Zr="(?:\\s+"+qr+"(?:\\s*=\\s*"+Hr+")?)",Ne="<[A-Za-z][A-Za-z0-9\\-]*"+Zr+"*\\s*\\/?>",Le="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ur="|",Gr="<[?][\\s\\S]*?[?]>",Wr="]*>",Qr="",Vr=new RegExp("^(?:"+Ne+"|"+Le+"|"+Ur+"|"+Gr+"|"+Wr+"|"+Qr+")"),Jr=new RegExp("^(?:"+Ne+"|"+Le+")");Y.HTML_TAG_RE=Vr;Y.HTML_OPEN_CLOSE_TAG_RE=Jr;var Yr=Br,Kr=Y.HTML_OPEN_CLOSE_TAG_RE,j=[[/^<(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,u=e.bMarks[r]+e.tShift[r],s=e.eMarks[r];if(e.sCount[r]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(u)!==60)return!1;for(f=e.src.slice(u,s),o=0;o=4||(o=e.src.charCodeAt(u),o!==35||u>=s))return!1;for(t=1,o=e.src.charCodeAt(++u);o===35&&u6||uu&&Ee(e.src.charCodeAt(c-1))&&(s=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(u,s).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,u,s,p,h,a=r+1,x,g=e.md.block.ruler.getRules("paragraph");if(e.sCount[r]-e.blkIndent>=4)return!1;for(x=e.parentType,e.parentType="paragraph";a3)){if(e.sCount[a]>=e.blkIndent&&(u=e.bMarks[a]+e.tShift[a],s=e.eMarks[a],u=s)))){p=h===61?1:2;break}if(!(e.sCount[a]<0)){for(o=!1,t=0,c=g.length;t3)&&!(e.sCount[u]<0)){for(l=!1,o=0,t=s.length;o0&&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,u,s,p,h=e;if(e>=r)return"";for(s=new Array(r-e),o=0;hi?s[o]=new Array(t-i+1).join(" ")+this.src.slice(f,u):s[o]=this.src.slice(f,u)}return s.join("")};z.prototype.Token=He;var on=z,ln=ue,V=[["table",Tr,["paragraph","reference"]],["code",wr],["fence",Ir,["paragraph","reference","blockquote","list"]],["blockquote",Rr,["paragraph","reference","blockquote","list"]],["hr",$r,["paragraph","reference","blockquote","list"]],["list",Or,["paragraph","reference","blockquote"]],["reference",Fr],["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[c]=u){n.line=r;break}for(l=0;l0||(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(un),!o)||(t=o[1],c=e.md.linkify.matchAtStart(e.src.slice(i-t.length)),!c)||(f=c.url,f=f.replace(/\*+$/,""),u=e.md.normalizeLink(f),!e.md.validateLink(u))?!1:(r||(e.pending=e.pending.slice(0,-t.length),s=e.push("link_open","a",1),s.attrs=[["href",u]],s.markup="linkify",s.info="auto",s=e.push("text","",0),s.content=e.md.normalizeLinkText(f),s=e.push("link_close","a",-1),s.markup="linkify",s.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 kn=function(e,r){var i,l,o,t,c,f=e.pos,u=e.posMax;if(e.src.charCodeAt(f)!==92||(f++,f>=u))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},dn=function(e,r){var i,l,o,t,c,f,u,s,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(Te(e,e.delimiters),r=0;r=g)return!1;if(b=f,u=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),u.ok){for(h=e.md.normalizeLink(u.str),e.md.validateLink(h)?f=u.pos:h="",b=f;f=g||e.src.charCodeAt(f)!==41)&&(_=!0),f++}if(_){if(typeof e.env.references=="undefined")return!1;if(f=0?o=e.src.slice(b,f++):f=t+1):f=t+1,o||(o=e.src.slice(c,t)),s=e.env.references[mn(o)],!s)return e.pos=x,!1;h=s.href,a=s.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=g,!0},gn=E.normalizeReference,te=E.isSpace,_n=function(e,r){var i,l,o,t,c,f,u,s,p,h,a,x,g,b="",_=e.pos,d=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(u=c+1,u=d)return!1;for(g=u,p=e.md.helpers.parseLinkDestination(e.src,u,e.posMax),p.ok&&(b=e.md.normalizeLink(p.str),e.md.validateLink(b)?u=p.pos:b=""),g=u;u=d||e.src.charCodeAt(u)!==41)return e.pos=_,!1;u++}else{if(typeof e.env.references=="undefined")return!1;if(u=0?t=e.src.slice(g,u++):u=c+1):u=c+1,t||(t=e.src.slice(f,c)),s=e.env.references[gn(t)],!s)return e.pos=_,!1;b=s.href,h=s.title}return r||(o=e.src.slice(f,c),e.md.inline.parse(o,e.md,e.env,x=[]),a=e.push("image","img",0),a.attrs=i=[["src",b],["alt",""]],a.children=x,a.content=o,h&&i.push(["title",h])),e.pos=u,e.posMax=d,!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,u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;for(c=e.pos,f=e.posMax;;){if(++u>=f||(t=e.src.charCodeAt(u),t===60))return!1;if(t===62)break}return i=e.src.slice(c+1,u),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=e.src.slice(c,c+l[0].length),yn(t.content)&&e.linkLevel++,En(t.content)&&e.linkLevel--),e.pos+=l[0].length,!0)},we=Fe,Tn=E.has,wn=E.isValidEntityCode,Ie=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)?Ie(l):Ie(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(we,o[1]))return r||(t=e.push("text_special","",0),t.content=we[o[1]],t.markup=o[0],t.info="entity"),e.pos+=o[0].length,!0;return!1};function Re(n,e){var r,i,l,o,t,c,f,u,s={},p=e.length;if(!!p){var h=0,a=-2,x=[];for(r=0;rt;i-=x[i]+1)if(o=e[i],o.marker===l.marker&&o.open&&o.end<0&&(f=!1,(o.close||l.open)&&(o.length+l.length)%3===0&&(o.length%3!==0||l.length%3!==0)&&(f=!0),!f)){u=i>0&&!e[i-1].open?x[i-1]+1:0,x[r]=r-i+u,x[i]=u,l.open=!1,o.end=r,o.close=!1,c=-1,a=-2;break}c!==-1&&(s[l.marker][(l.open?3:0)+(l.length||0)%3]=c)}}}var $n=function(e){var r,i=e.tokens_meta,l=e.tokens_meta.length;for(Re(e,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,u,s,p,h=!0,a=!0,x=this.posMax,g=this.src.charCodeAt(n);for(i=n>0?this.src.charCodeAt(n-1):32;r=o)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=Ze.toASCII(e.hostname)}catch{}return D.encode(D.format(e))}function Yn(n){var e=D.parse(n,!0);if(e.hostname&&(!e.protocol||Ue.indexOf(e.protocol)>=0))try{e.hostname=Ze.toUnicode(e.hostname)}catch{}return D.decode(D.format(e),D.decode.defaultChars+"%")}function R(n,e){if(!(this instanceof R))return new R(n,e);e||Z.isString(n)||(e=n||{},n="default"),this.inline=new Zn,this.block=new Hn,this.core=new Ln,this.renderer=new Nn,this.linkify=new Un,this.validateLink=Vn,this.normalizeLink=Jn,this.normalizeLinkText=Yn,this.utils=Z,this.helpers=Z.assign({},jn),this.options={},this.configure(n),e&&this.set(e)}R.prototype.set=function(n){return Z.assign(this.options,n),this};R.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};R.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};R.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};R.prototype.use=function(n){var e=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,e),this};R.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};R.prototype.render=function(n,e){return e=e||{},this.renderer.render(this.parse(n,e),this.options,e)};R.prototype.parseInline=function(n,e){var r=new this.core.State(n,this,e);return r.inlineMode=!0,this.core.process(r),r.tokens};R.prototype.renderInline=function(n,e){return e=e||{},this.renderer.render(this.parseInline(n,e),this.options,e)};var Kn=R,oi=Kn;export{oi as m};