(function(E,z){typeof exports=="object"&&typeof module<"u"?module.exports=z():typeof define=="function"&&define.amd?define(z):(E=typeof globalThis<"u"?globalThis:E||self,E.RevealMarkdown=z())})(this,function(){"use strict";var Te=Object.defineProperty;var Re=(E,z,C)=>z in E?Te(E,z,{enumerable:!0,configurable:!0,writable:!0,value:C}):E[z]=C;var te=(E,z,C)=>Re(E,typeof z!="symbol"?z+"":z,C);function E(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let z=E();function C(o){z=o}const Z=/[&<>"']/,ne=new RegExp(Z.source,"g"),H=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ie=new RegExp(H.source,"g"),se={"&":"&","<":"<",">":">",'"':""","'":"'"},j=o=>se[o];function A(o,n){if(n){if(Z.test(o))return o.replace(ne,j)}else if(H.test(o))return o.replace(ie,j);return o}const re=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function F(o){return o.replace(re,(n,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const le=/(^|[^\[])\^/g;function $(o,n){o=typeof o=="string"?o:o.source,n=n||"";const t={replace:(e,i)=>(i=i.source||i,i=i.replace(le,"$1"),o=o.replace(e,i),t),getRegex:()=>new RegExp(o,n)};return t}const ae=/[^\w:]/g,oe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Q(o,n,t){if(o){let e;try{e=decodeURIComponent(F(t)).replace(ae,"").toLowerCase()}catch{return null}if(e.indexOf("javascript:")===0||e.indexOf("vbscript:")===0||e.indexOf("data:")===0)return null}n&&!oe.test(t)&&(t=pe(n,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}const M={},ce=/^[^:]+:\/*[^/]*$/,he=/^([^:]+:)[\s\S]*$/,ue=/^([^:]+:\/*[^/]*)[\s\S]*$/;function pe(o,n){M[" "+o]||(ce.test(o)?M[" "+o]=o+"/":M[" "+o]=D(o,"/",!0)),o=M[" "+o];const t=o.indexOf(":")===-1;return n.substring(0,2)==="//"?t?n:o.replace(he,"$1")+n:n.charAt(0)==="/"?t?n:o.replace(ue,"$1")+n:o+n}const P={exec:function(){}};function V(o,n){const t=o.replace(/\|/g,(s,l,a)=>{let h=!1,w=l;for(;--w>=0&&a[w]==="\\";)h=!h;return h?"|":" |"}),e=t.split(/ \|/);let i=0;if(e[0].trim()||e.shift(),e.length>0&&!e[e.length-1].trim()&&e.pop(),e.length>n)e.splice(n);else for(;e.length1;)n&1&&(t+=o),n>>=1,o+=o;return t+o}function G(o,n,t,e){const i=n.href,s=n.title?A(n.title):null,l=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){e.state.inLink=!0;const a={type:"link",raw:t,href:i,title:s,text:l,tokens:e.inlineTokens(l)};return e.state.inLink=!1,a}return{type:"image",raw:t,href:i,title:s,text:A(l)}}function de(o,n){const t=o.match(/^(\s+)(?:```)/);if(t===null)return n;const e=t[1];return n.split(` `).map(i=>{const s=i.match(/^\s+/);if(s===null)return i;const[l]=s;return l.length>=e.length?i.slice(e.length):i}).join(` `)}class B{constructor(n){this.options=n||z}space(n){const t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){const t=this.rules.block.code.exec(n);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:D(e,` `)}}}fences(n){const t=this.rules.block.fences.exec(n);if(t){const e=t[0],i=de(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:i}}}heading(n){const t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(/#$/.test(e)){const i=D(e,"#");(this.options.pedantic||!i||/ $/.test(i))&&(e=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){const t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:t[0]}}blockquote(n){const t=this.rules.block.blockquote.exec(n);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,""),i=this.lexer.state.top;this.lexer.state.top=!0;const s=this.lexer.blockTokens(e);return this.lexer.state.top=i,{type:"blockquote",raw:t[0],tokens:s,text:e}}}list(n){let t=this.rules.block.list.exec(n);if(t){let e,i,s,l,a,h,w,x,b,c,r,m,g=t[1].trim();const y=g.length>1,p={type:"list",raw:"",ordered:y,start:y?+g.slice(0,-1):"",loose:!1,items:[]};g=y?`\\d{1,9}\\${g.slice(-1)}`:`\\${g}`,this.options.pedantic&&(g=y?g:"[*+-]");const k=new RegExp(`^( {0,3}${g})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;n&&(m=!1,!(!(t=k.exec(n))||this.rules.block.hr.test(n)));){if(e=t[0],n=n.substring(e.length),x=t[2].split(` `,1)[0].replace(/^\t+/,T=>" ".repeat(3*T.length)),b=n.split(` `,1)[0],this.options.pedantic?(l=2,r=x.trimLeft()):(l=t[2].search(/[^ ]/),l=l>4?1:l,r=x.slice(l),l+=t[1].length),h=!1,!x&&/^ *$/.test(b)&&(e+=b+` `,n=n.substring(b.length+1),m=!0),!m){const T=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),S=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),I=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;n&&(c=n.split(` `,1)[0],b=c,this.options.pedantic&&(b=b.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(R.test(b)||I.test(b)||T.test(b)||S.test(n)));){if(b.search(/[^ ]/)>=l||!b.trim())r+=` `+b.slice(l);else{if(h||x.search(/[^ ]/)>=4||R.test(x)||I.test(x)||S.test(x))break;r+=` `+b}!h&&!b.trim()&&(h=!0),e+=c+` `,n=n.substring(c.length+1),x=b.slice(l)}}p.loose||(w?p.loose=!0:/\n *\n *$/.test(e)&&(w=!0)),this.options.gfm&&(i=/^\[[ xX]\] /.exec(r),i&&(s=i[0]!=="[ ] ",r=r.replace(/^\[[ xX]\] +/,""))),p.items.push({type:"list_item",raw:e,task:!!i,checked:s,loose:!1,text:r}),p.raw+=e}p.items[p.items.length-1].raw=e.trimRight(),p.items[p.items.length-1].text=r.trimRight(),p.raw=p.raw.trimRight();const _=p.items.length;for(a=0;a<_;a++)if(this.lexer.state.top=!1,p.items[a].tokens=this.lexer.blockTokens(p.items[a].text,[]),!p.loose){const T=p.items[a].tokens.filter(R=>R.type==="space"),S=T.length>0&&T.some(R=>/\n.*\n/.test(R.raw));p.loose=S}if(p.loose)for(a=0;a<_;a++)p.items[a].loose=!0;return p}}html(n){const t=this.rules.block.html.exec(n);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};if(this.options.sanitize){const i=this.options.sanitizer?this.options.sanitizer(t[0]):A(t[0]);e.type="paragraph",e.text=i,e.tokens=this.lexer.inline(i)}return e}}def(n){const t=this.rules.block.def.exec(n);if(t){const e=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:i,title:s}}}table(n){const t=this.rules.block.table.exec(n);if(t){const e={type:"table",header:V(t[1]).map(i=>({text:i})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(e.header.length===e.align.length){e.raw=t[0];let i=e.align.length,s,l,a,h;for(s=0;s({text:w}));for(i=e.header.length,l=0;l/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):A(t[0]):t[0]}}link(n){const t=this.rules.inline.link.exec(n);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;const l=D(e.slice(0,-1),"\\");if((e.length-l.length)%2===0)return}else{const l=fe(t[2],"()");if(l>-1){const h=(t[0].indexOf("!")===0?5:4)+t[1].length+l;t[2]=t[2].substring(0,l),t[0]=t[0].substring(0,h).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);l&&(i=l[1],s=l[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i=i.slice(1):i=i.slice(1,-1)),G(t,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let i=(e[2]||e[1]).replace(/\s+/g," ");if(i=t[i.toLowerCase()],!i){const s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return G(e,i,e[0],this.lexer)}}emStrong(n,t,e=""){let i=this.rules.inline.emStrong.lDelim.exec(n);if(!i||i[3]&&e.match(/[\p{L}\p{N}]/u))return;const s=i[1]||i[2]||"";if(!s||s&&(e===""||this.rules.inline.punctuation.exec(e))){const l=i[0].length-1;let a,h,w=l,x=0;const b=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(b.lastIndex=0,t=t.slice(-1*n.length+l);(i=b.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(h=a.length,i[3]||i[4]){w+=h;continue}else if((i[5]||i[6])&&l%3&&!((l+h)%3)){x+=h;continue}if(w-=h,w>0)continue;h=Math.min(h,h+w+x);const c=n.slice(0,l+i.index+(i[0].length-a.length)+h);if(Math.min(l,h)%2){const m=c.slice(1,-1);return{type:"em",raw:c,text:m,tokens:this.lexer.inlineTokens(m)}}const r=c.slice(2,-2);return{type:"strong",raw:c,text:r,tokens:this.lexer.inlineTokens(r)}}}}codespan(n){const t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(/\n/g," ");const i=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return i&&s&&(e=e.substring(1,e.length-1)),e=A(e,!0),{type:"codespan",raw:t[0],text:e}}}br(n){const t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n){const t=this.rules.inline.del.exec(n);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(n,t){const e=this.rules.inline.autolink.exec(n);if(e){let i,s;return e[2]==="@"?(i=A(this.options.mangle?t(e[1]):e[1]),s="mailto:"+i):(i=A(e[1]),s=i),{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}url(n,t){let e;if(e=this.rules.inline.url.exec(n)){let i,s;if(e[2]==="@")i=A(this.options.mangle?t(e[0]):e[0]),s="mailto:"+i;else{let l;do l=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])[0];while(l!==e[0]);i=A(e[0]),e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:i,href:s,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(n,t){const e=this.rules.inline.text.exec(n);if(e){let i;return this.lexer.state.inRawBlock?i=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):A(e[0]):e[0]:i=A(this.options.smartypants?t(e[0]):e[0]),{type:"text",raw:e[0],text:i}}}}const d={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:P,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};d._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,d._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,d.def=$(d.def).replace("label",d._label).replace("title",d._title).getRegex(),d.bullet=/(?:[*+-]|\d{1,9}[.)])/,d.listItemStart=$(/^( *)(bull) */).replace("bull",d.bullet).getRegex(),d.list=$(d.list).replace(/bull/g,d.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+d.def.source+")").getRegex(),d._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",d._comment=/|$)/,d.html=$(d.html,"i").replace("comment",d._comment).replace("tag",d._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),d.paragraph=$(d._paragraph).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").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",")|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.blockquote=$(d.blockquote).replace("paragraph",d.paragraph).getRegex(),d.normal={...d},d.gfm={...d.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"},d.gfm.table=$(d.gfm.table).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.gfm.paragraph=$(d._paragraph).replace("hr",d.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",d.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",d._tag).getRegex(),d.pedantic={...d.normal,html:$(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",d._comment).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:$(d.normal._paragraph).replace("hr",d.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",d.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const u={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:P,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:P,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",u.punctuation=$(u.punctuation).replace(/punctuation/g,u._punctuation).getRegex(),u.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,u.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,u._comment=$(d._comment).replace("(?:-->|$)","-->").getRegex(),u.emStrong.lDelim=$(u.emStrong.lDelim).replace(/punct/g,u._punctuation).getRegex(),u.emStrong.rDelimAst=$(u.emStrong.rDelimAst,"g").replace(/punct/g,u._punctuation).getRegex(),u.emStrong.rDelimUnd=$(u.emStrong.rDelimUnd,"g").replace(/punct/g,u._punctuation).getRegex(),u._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,u._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,u._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])?)+(?![-_])/,u.autolink=$(u.autolink).replace("scheme",u._scheme).replace("email",u._email).getRegex(),u._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,u.tag=$(u.tag).replace("comment",u._comment).replace("attribute",u._attribute).getRegex(),u._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,u._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,u._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,u.link=$(u.link).replace("label",u._label).replace("href",u._href).replace("title",u._title).getRegex(),u.reflink=$(u.reflink).replace("label",u._label).replace("ref",d._label).getRegex(),u.nolink=$(u.nolink).replace("ref",d._label).getRegex(),u.reflinkSearch=$(u.reflinkSearch,"g").replace("reflink",u.reflink).replace("nolink",u.nolink).getRegex(),u.normal={...u},u.pedantic={...u.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:$(/^!?\[(label)\]\((.*?)\)/).replace("label",u._label).getRegex(),reflink:$(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",u._label).getRegex()},u.gfm={...u.normal,escape:$(u.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(e="x"+e.toString(16)),n+="&#"+e+";";return n}class L{constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||z,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};const t={block:d.normal,inline:u.normal};this.options.pedantic?(t.block=d.pedantic,t.inline=u.pedantic):this.options.gfm&&(t.block=d.gfm,this.options.breaks?t.inline=u.breaks:t.inline=u.gfm),this.tokenizer.rules=t}static get rules(){return{block:d,inline:u}}static lex(n,t){return new L(t).lex(n)}static lexInline(n,t){return new L(t).inlineTokens(n)}lex(n){n=n.replace(/\r\n|\r/g,` `),this.blockTokens(n,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(n,t=[]){this.options.pedantic?n=n.replace(/\t/g," ").replace(/^ +$/gm,""):n=n.replace(/^( *)(\t+)/gm,(a,h,w)=>h+" ".repeat(w.length));let e,i,s,l;for(;n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(e=a.call({lexer:this},n,t))?(n=n.substring(e.raw.length),t.push(e),!0):!1))){if(e=this.tokenizer.space(n)){n=n.substring(e.raw.length),e.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(e);continue}if(e=this.tokenizer.code(n)){n=n.substring(e.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` `+e.raw,i.text+=` `+e.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(e);continue}if(e=this.tokenizer.fences(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.heading(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.hr(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.blockquote(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.list(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.html(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.def(n)){n=n.substring(e.raw.length),i=t[t.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=` `+e.raw,i.text+=` `+e.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[e.tag]||(this.tokens.links[e.tag]={href:e.href,title:e.title});continue}if(e=this.tokenizer.table(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.lheading(n)){n=n.substring(e.raw.length),t.push(e);continue}if(s=n,this.options.extensions&&this.options.extensions.startBlock){let a=1/0;const h=n.slice(1);let w;this.options.extensions.startBlock.forEach(function(x){w=x.call({lexer:this},h),typeof w=="number"&&w>=0&&(a=Math.min(a,w))}),a<1/0&&a>=0&&(s=n.substring(0,a+1))}if(this.state.top&&(e=this.tokenizer.paragraph(s))){i=t[t.length-1],l&&i.type==="paragraph"?(i.raw+=` `+e.raw,i.text+=` `+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(e),l=s.length!==n.length,n=n.substring(e.raw.length);continue}if(e=this.tokenizer.text(n)){n=n.substring(e.raw.length),i=t[t.length-1],i&&i.type==="text"?(i.raw+=` `+e.raw,i.text+=` `+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(e);continue}if(n){const a="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(n,t=[]){return this.inlineQueue.push({src:n,tokens:t}),t}inlineTokens(n,t=[]){let e,i,s,l=n,a,h,w;if(this.tokens.links){const x=Object.keys(this.tokens.links);if(x.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)x.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,a.index)+"["+X("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,a.index)+"["+X("a",a[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,a.index+a[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;n;)if(h||(w=""),h=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(x=>(e=x.call({lexer:this},n,t))?(n=n.substring(e.raw.length),t.push(e),!0):!1))){if(e=this.tokenizer.escape(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.tag(n)){n=n.substring(e.raw.length),i=t[t.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):t.push(e);continue}if(e=this.tokenizer.link(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(e.raw.length),i=t[t.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):t.push(e);continue}if(e=this.tokenizer.emStrong(n,l,w)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.codespan(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.br(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.del(n)){n=n.substring(e.raw.length),t.push(e);continue}if(e=this.tokenizer.autolink(n,W)){n=n.substring(e.raw.length),t.push(e);continue}if(!this.state.inLink&&(e=this.tokenizer.url(n,W))){n=n.substring(e.raw.length),t.push(e);continue}if(s=n,this.options.extensions&&this.options.extensions.startInline){let x=1/0;const b=n.slice(1);let c;this.options.extensions.startInline.forEach(function(r){c=r.call({lexer:this},b),typeof c=="number"&&c>=0&&(x=Math.min(x,c))}),x<1/0&&x>=0&&(s=n.substring(0,x+1))}if(e=this.tokenizer.inlineText(s,ke)){n=n.substring(e.raw.length),e.raw.slice(-1)!=="_"&&(w=e.raw.slice(-1)),h=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):t.push(e);continue}if(n){const x="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return t}}class U{constructor(n){this.options=n||z}code(n,t,e){const i=(t||"").match(/\S*/)[0];if(this.options.highlight){const s=this.options.highlight(n,i);s!=null&&s!==n&&(e=!0,n=s)}return n=n.replace(/\n$/,"")+` `,i?'
'+(e?n:A(n,!0))+`
`:"
"+(e?n:A(n,!0))+`
`}blockquote(n){return`
${n}
`}html(n){return n}heading(n,t,e,i){if(this.options.headerIds){const s=this.options.headerPrefix+i.slug(e);return`${n} `}return`${n} `}hr(){return this.options.xhtml?`
`:`
`}list(n,t,e){const i=t?"ol":"ul",s=t&&e!==1?' start="'+e+'"':"";return"<"+i+s+`> `+n+" `}listitem(n){return`
  • ${n}
  • `}checkbox(n){return" "}paragraph(n){return`

    ${n}

    `}table(n,t){return t&&(t=`${t}`),` `+n+` `+t+`
    `}tablerow(n){return` ${n} `}tablecell(n,t){const e=t.header?"th":"td";return(t.align?`<${e} align="${t.align}">`:`<${e}>`)+n+` `}strong(n){return`${n}`}em(n){return`${n}`}codespan(n){return`${n}`}br(){return this.options.xhtml?"
    ":"
    "}del(n){return`${n}`}link(n,t,e){if(n=Q(this.options.sanitize,this.options.baseUrl,n),n===null)return e;let i='",i}image(n,t,e){if(n=Q(this.options.sanitize,this.options.baseUrl,n),n===null)return e;let i=`${e}":">",i}text(n){return n}}class J{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,t,e){return""+e}image(n,t,e){return""+e}br(){return""}}class K{constructor(){this.seen={}}serialize(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(n,t){let e=n,i=0;if(this.seen.hasOwnProperty(e)){i=this.seen[n];do i++,e=n+"-"+i;while(this.seen.hasOwnProperty(e))}return t||(this.seen[n]=i,this.seen[e]=0),e}slug(n,t={}){const e=this.serialize(n);return this.getNextSafeSlug(e,t.dryrun)}}class v{constructor(n){this.options=n||z,this.options.renderer=this.options.renderer||new U,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new J,this.slugger=new K}static parse(n,t){return new v(t).parse(n)}static parseInline(n,t){return new v(t).parseInline(n)}parse(n,t=!0){let e="",i,s,l,a,h,w,x,b,c,r,m,g,y,p,k,_,T,S,R;const I=n.length;for(i=0;i0&&k.tokens[0].type==="paragraph"?(k.tokens[0].text=S+" "+k.tokens[0].text,k.tokens[0].tokens&&k.tokens[0].tokens.length>0&&k.tokens[0].tokens[0].type==="text"&&(k.tokens[0].tokens[0].text=S+" "+k.tokens[0].tokens[0].text)):k.tokens.unshift({type:"text",text:S}):p+=S),p+=this.parse(k.tokens,y),c+=this.renderer.listitem(p,T,_);e+=this.renderer.list(c,m,g);continue}case"html":{e+=this.renderer.html(r.text);continue}case"paragraph":{e+=this.renderer.paragraph(this.parseInline(r.tokens));continue}case"text":{for(c=r.tokens?this.parseInline(r.tokens):r.text;i+1{if(e.message+=` Please report this to https://github.com/markedjs/marked.`,o){const i="

    An error occurred:

    "+A(e.message+"",!0)+"
    ";if(n)return Promise.resolve(i);if(t){t(null,i);return}return i}if(n)return Promise.reject(e);if(t){t(e);return}throw e}}function Y(o,n){return(t,e,i)=>{typeof e=="function"&&(i=e,e=null);const s={...e};e={...f.defaults,...s};const l=me(e.silent,e.async,i);if(typeof t>"u"||t===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(ge(e),e.hooks&&(e.hooks.options=e),i){const a=e.highlight;let h;try{e.hooks&&(t=e.hooks.preprocess(t)),h=o(t,e)}catch(b){return l(b)}const w=function(b){let c;if(!b)try{e.walkTokens&&f.walkTokens(h,e.walkTokens),c=n(h,e),e.hooks&&(c=e.hooks.postprocess(c))}catch(r){b=r}return e.highlight=a,b?l(b):i(null,c)};if(!a||a.length<3||(delete e.highlight,!h.length))return w();let x=0;f.walkTokens(h,function(b){b.type==="code"&&(x++,setTimeout(()=>{a(b.text,b.lang,function(c,r){if(c)return w(c);r!=null&&r!==b.text&&(b.text=r,b.escaped=!0),x--,x===0&&w()})},0))}),x===0&&w();return}if(e.async)return Promise.resolve(e.hooks?e.hooks.preprocess(t):t).then(a=>o(a,e)).then(a=>e.walkTokens?Promise.all(f.walkTokens(a,e.walkTokens)).then(()=>a):a).then(a=>n(a,e)).then(a=>e.hooks?e.hooks.postprocess(a):a).catch(l);try{e.hooks&&(t=e.hooks.preprocess(t));const a=o(t,e);e.walkTokens&&f.walkTokens(a,e.walkTokens);let h=n(a,e);return e.hooks&&(h=e.hooks.postprocess(h)),h}catch(a){return l(a)}}}function f(o,n,t){return Y(L.lex,v.parse)(o,n,t)}f.options=f.setOptions=function(o){return f.defaults={...f.defaults,...o},C(f.defaults),f},f.getDefaults=E,f.defaults=z,f.use=function(...o){const n=f.defaults.extensions||{renderers:{},childTokens:{}};o.forEach(t=>{const e={...t};if(e.async=f.defaults.async||e.async||!1,t.extensions&&(t.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if(i.renderer){const s=n.renderers[i.name];s?n.renderers[i.name]=function(...l){let a=i.renderer.apply(this,l);return a===!1&&(a=s.apply(this,l)),a}:n.renderers[i.name]=i.renderer}if(i.tokenizer){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");n[i.level]?n[i.level].unshift(i.tokenizer):n[i.level]=[i.tokenizer],i.start&&(i.level==="block"?n.startBlock?n.startBlock.push(i.start):n.startBlock=[i.start]:i.level==="inline"&&(n.startInline?n.startInline.push(i.start):n.startInline=[i.start]))}i.childTokens&&(n.childTokens[i.name]=i.childTokens)}),e.extensions=n),t.renderer){const i=f.defaults.renderer||new U;for(const s in t.renderer){const l=i[s];i[s]=(...a)=>{let h=t.renderer[s].apply(i,a);return h===!1&&(h=l.apply(i,a)),h}}e.renderer=i}if(t.tokenizer){const i=f.defaults.tokenizer||new B;for(const s in t.tokenizer){const l=i[s];i[s]=(...a)=>{let h=t.tokenizer[s].apply(i,a);return h===!1&&(h=l.apply(i,a)),h}}e.tokenizer=i}if(t.hooks){const i=f.defaults.hooks||new O;for(const s in t.hooks){const l=i[s];O.passThroughHooks.has(s)?i[s]=a=>{if(f.defaults.async)return Promise.resolve(t.hooks[s].call(i,a)).then(w=>l.call(i,w));const h=t.hooks[s].call(i,a);return l.call(i,h)}:i[s]=(...a)=>{let h=t.hooks[s].apply(i,a);return h===!1&&(h=l.apply(i,a)),h}}e.hooks=i}if(t.walkTokens){const i=f.defaults.walkTokens;e.walkTokens=function(s){let l=[];return l.push(t.walkTokens.call(this,s)),i&&(l=l.concat(i.call(this,s))),l}}f.setOptions(e)})},f.walkTokens=function(o,n){let t=[];for(const e of o)switch(t=t.concat(n.call(f,e)),e.type){case"table":{for(const i of e.header)t=t.concat(f.walkTokens(i.tokens,n));for(const i of e.rows)for(const s of i)t=t.concat(f.walkTokens(s.tokens,n));break}case"list":{t=t.concat(f.walkTokens(e.items,n));break}default:f.defaults.extensions&&f.defaults.extensions.childTokens&&f.defaults.extensions.childTokens[e.type]?f.defaults.extensions.childTokens[e.type].forEach(function(i){t=t.concat(f.walkTokens(e[i],n))}):e.tokens&&(t=t.concat(f.walkTokens(e.tokens,n)))}return t},f.parseInline=Y(L.lexInline,v.parseInline),f.Parser=v,f.parser=v.parse,f.Renderer=U,f.TextRenderer=J,f.Lexer=L,f.lexer=L.lex,f.Tokenizer=B,f.Slugger=K,f.Hooks=O,f.parse=f,f.options,f.setOptions,f.use,f.walkTokens,f.parseInline,v.parse,L.lex;/*! * The reveal.js markdown plugin. Handles parsing of * markdown inside of presentations as well as loading * of external markdown documents. */const xe=`\r? ---\r? `,be=null,we="^s*notes?:",_e="\\.element\\s*?(.+?)$",ye="\\.slide:\\s*?(\\S.+?)$",ee="__SCRIPT_END__",N=/\[\s*((\d*):)?\s*([\s\d,|-]*)\]/,$e={"&":"&","<":"<",">":">",'"':""","'":"'"};return()=>{let o;function n(c){let m=(c.querySelector("[data-template]")||c.querySelector("script")||c).textContent;m=m.replace(new RegExp(ee,"g"),"<\/script>");const g=m.match(/^\n?(\s*)/)[1].length,y=m.match(/^\n?(\t*)/)[1].length;return y>0?m=m.replace(new RegExp("\\n?\\t{"+y+"}(.*)","g"),function(p,k){return` `+k}):g>1&&(m=m.replace(new RegExp("\\n? {"+g+"}(.*)","g"),function(p,k){return` `+k})),m}function t(c){const r=c.attributes,m=[];for(let g=0,y=r.length;g'+f(m[1].trim())+""),c=c.replace(/<\/script>/g,ee),'