var Ve=Object.defineProperty;var Je=(a,e,t)=>e in a?Ve(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var z=(a,e,t)=>Je(a,typeof e!="symbol"?e+"":e,t);import{_ as et,c as ze,o as ve,a as tt,p as nt}from"./main-D6qyxymd.js";function fe(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Z=fe();function Ae(a){Z=a}const Le=/[&<>"']/,it=new RegExp(Le.source,"g"),Ce=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ot=new RegExp(Ce.source,"g"),rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},$e=a=>rt[a];function I(a,e){if(e){if(Le.test(a))return a.replace(it,$e)}else if(Ce.test(a))return a.replace(ot,$e);return a}const st=/(^|[^\[])\^/g;function y(a,e){let t=typeof a=="string"?a:a.source;e=e||"";const n={replace:(i,o)=>{let r=typeof o=="string"?o:o.source;return r=r.replace(st,"$1"),t=t.replace(i,r),n},getRegex:()=>new RegExp(t,e)};return n}function Te(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}const X={exec:()=>null};function Ee(a,e){const t=a.replace(/\|/g,(o,r,s)=>{let l=!1,u=r;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function D(a,e,t){const n=a.length;if(n===0)return"";let i=0;for(;i<n&&a.charAt(n-i-1)===e;)i++;return a.slice(0,n-i)}function lt(a,e){if(a.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<a.length;n++)if(a[n]==="\\")n++;else if(a[n]===e[0])t++;else if(a[n]===e[1]&&(t--,t<0))return n;return-1}function Se(a,e,t,n){const i=e.href,o=e.title?I(e.title):null,r=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){n.state.inLink=!0;const s={type:"link",raw:t,href:i,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,s}return{type:"image",raw:t,href:i,title:o,text:I(r)}}function at(a,e){const t=a.match(/^(\s+)(?:```)/);if(t===null)return e;const n=t[1];return e.split(`
`).map(i=>{const o=i.match(/^\s+/);if(o===null)return i;const[r]=o;return r.length>=n.length?i.slice(n.length):i}).join(`
`)}class oe{constructor(e){z(this,"options");z(this,"rules");z(this,"lexer");this.options=e||Z}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:D(n,`
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=at(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=D(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:D(t[0],`
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=D(t[0],`
`).split(`
`),i="",o="";const r=[];for(;n.length>0;){let s=!1;const l=[];let u;for(u=0;u<n.length;u++)if(/^ {0,3}>/.test(n[u]))l.push(n[u]),s=!0;else if(!s)l.push(n[u]);else break;n=n.slice(u);const h=l.join(`
`),p=h.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
    $1`).replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i}
${h}`:h,o=o?`${o}
${p}`:p;const b=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,r,!0),this.lexer.state.top=b,n.length===0)break;const w=r[r.length-1];if((w==null?void 0:w.type)==="code")break;if((w==null?void 0:w.type)==="blockquote"){const f=w,S=f.raw+`
`+n.join(`
`),A=this.blockquote(S);r[r.length-1]=A,i=i.substring(0,i.length-f.raw.length)+A.raw,o=o.substring(0,o.length-f.text.length)+A.text;break}else if((w==null?void 0:w.type)==="list"){const f=w,S=f.raw+`
`+n.join(`
`),A=this.list(S);r[r.length-1]=A,i=i.substring(0,i.length-w.raw.length)+A.raw,o=o.substring(0,o.length-f.raw.length)+A.raw,n=S.substring(r[r.length-1].raw.length).split(`
`);continue}}return{type:"blockquote",raw:i,tokens:r,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,o={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const r=new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);let s=!1;for(;e;){let l=!1,u="",h="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let p=t[2].split(`
`,1)[0].replace(/^\t+/,W=>" ".repeat(3*W.length)),b=e.split(`
`,1)[0],w=!p.trim(),f=0;if(this.options.pedantic?(f=2,h=p.trimStart()):w?f=t[1].length+1:(f=t[2].search(/[^ ]/),f=f>4?1:f,h=p.slice(f),f+=t[1].length),w&&/^[ \t]*$/.test(b)&&(u+=b+`
`,e=e.substring(b.length+1),l=!0),!l){const W=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),V=new RegExp(`^ {0,${Math.min(3,f-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),E=new RegExp(`^ {0,${Math.min(3,f-1)}}(?:\`\`\`|~~~)`),O=new RegExp(`^ {0,${Math.min(3,f-1)}}#`),B=new RegExp(`^ {0,${Math.min(3,f-1)}}<(?:[a-z].*>|!--)`,"i");for(;e;){const N=e.split(`
`,1)[0];let k;if(b=N,this.options.pedantic?(b=b.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  "),k=b):k=b.replace(/\t/g,"    "),E.test(b)||O.test(b)||B.test(b)||W.test(b)||V.test(b))break;if(k.search(/[^ ]/)>=f||!b.trim())h+=`
`+k.slice(f);else{if(w||p.replace(/\t/g,"    ").search(/[^ ]/)>=4||E.test(p)||O.test(p)||V.test(p))break;h+=`
`+b}!w&&!b.trim()&&(w=!0),u+=N+`
`,e=e.substring(N.length+1),p=k.slice(f)}}o.loose||(s?o.loose=!0:/\n[ \t]*\n[ \t]*$/.test(u)&&(s=!0));let S=null,A;this.options.gfm&&(S=/^\[[ xX]\] /.exec(h),S&&(A=S[0]!=="[ ] ",h=h.replace(/^\[[ xX]\] +/,""))),o.items.push({type:"list_item",raw:u,task:!!S,checked:A,loose:!1,text:h,tokens:[]}),o.raw+=u}o.items[o.items.length-1].raw=o.items[o.items.length-1].raw.trimEnd(),o.items[o.items.length-1].text=o.items[o.items.length-1].text.trimEnd(),o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){const u=o.items[l].tokens.filter(p=>p.type==="space"),h=u.length>0&&u.some(p=>/\n.*\n/.test(p.raw));o.loose=h}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),i=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:o}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=Ee(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),o=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const s of i)/^ *-+: *$/.test(s)?r.align.push("right"):/^ *:-+: *$/.test(s)?r.align.push("center"):/^ *:-+ *$/.test(s)?r.align.push("left"):r.align.push(null);for(let s=0;s<n.length;s++)r.header.push({text:n[s],tokens:this.lexer.inline(n[s]),header:!0,align:r.align[s]});for(const s of o)r.rows.push(Ee(s,r.header.length).map((l,u)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:r.align[u]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:I(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/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:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const r=D(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=lt(t[2],"()");if(r>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],o="";if(this.options.pedantic){const r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);r&&(i=r[1],o=r[3])}else o=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),Se(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(/\s+/g," "),o=t[i.toLowerCase()];if(!o){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return Se(n,o,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...i[0]].length-1;let s,l,u=r,h=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+r);(i=p.exec(t))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(l=[...s].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&r%3&&!((r+l)%3)){h+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+h);const b=[...i[0]][0].length,w=e.slice(0,r+i.index+b+l);if(Math.min(r,l)%2){const S=w.slice(1,-1);return{type:"em",raw:w,text:S,tokens:this.lexer.inlineTokens(S)}}const f=w.slice(2,-2);return{type:"strong",raw:w,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),o=/^ /.test(n)&&/ $/.test(n);return i&&o&&(n=n.substring(1,n.length-1)),n=I(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=I(t[1]),i="mailto:"+n):(n=I(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,o;if(t[2]==="@")i=I(t[0]),o="mailto:"+i;else{let r;do r=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(r!==t[0]);i=I(t[0]),t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:i,href:o,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=I(t[0]),{type:"text",raw:t[0],text:n}}}}const ct=/^(?:[ \t]*(?:\n|$))+/,ht=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ut=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,G=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,pt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,He=/(?:[*+-]|\d{1,9}[.)])/,Be=y(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,He).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(),ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,dt=/^[^\n]+/,me=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ft=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",me).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gt=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,He).getRegex(),le="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",ke=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,mt=y("^ {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",ke).replace("tag",le).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qe=y(ge).replace("hr",G).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",le).getRegex(),kt=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qe).getRegex(),be={blockquote:kt,code:ht,def:ft,fences:ut,heading:pt,hr:G,html:mt,lheading:Be,list:gt,newline:ct,paragraph:qe,table:X,text:dt},_e=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",G).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",le).getRegex(),bt={...be,table:_e,paragraph:y(ge).replace("hr",G).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",_e).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",le).getRegex()},xt={...be,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ke).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:X,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(ge).replace("hr",G).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Be).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Oe=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,wt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pe=/^( {2,}|\\)\n(?!\s*$)/,yt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,K="\\p{P}\\p{S}",zt=y(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,K).getRegex(),vt=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,$t=y(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,K).getRegex(),Tt=y("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,K).getRegex(),Et=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,K).getRegex(),St=y(/\\([punct])/,"gu").replace(/punct/g,K).getRegex(),_t=y(/^<(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(),Rt=y(ke).replace("(?:-->|$)","-->").getRegex(),It=y("^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",Rt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),re=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,At=y(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",re).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=y(/^!?\[(label)\]\[(ref)\]/).replace("label",re).replace("ref",me).getRegex(),Ze=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",me).getRegex(),Lt=y("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",Ze).getRegex(),xe={_backpedal:X,anyPunctuation:St,autolink:_t,blockSkip:vt,br:Pe,code:wt,del:X,emStrongLDelim:$t,emStrongRDelimAst:Tt,emStrongRDelimUnd:Et,escape:Oe,link:At,nolink:Ze,punctuation:zt,reflink:Me,reflinkSearch:Lt,tag:It,text:yt,url:X},Ct={...xe,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",re).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re).getRegex()},de={...xe,escape:y(Oe).replace("])","~|])").getRegex(),url:y(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ht={...de,br:y(Pe).replace("{2,}","*").getRegex(),text:y(de.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},te={normal:be,gfm:bt,pedantic:xt},U={normal:xe,gfm:de,breaks:Ht,pedantic:Ct};class L{constructor(e){z(this,"tokens");z(this,"options");z(this,"state");z(this,"tokenizer");z(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Z,this.options.tokenizer=this.options.tokenizer||new oe,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:te.normal,inline:U.normal};this.options.pedantic?(t.block=te.pedantic,t.inline=U.pedantic):this.options.gfm&&(t.block=te.gfm,this.options.breaks?t.inline=U.breaks:t.inline=U.gfm),this.tokenizer.rules=t}static get rules(){return{block:te,inline:U}}static lex(e,t){return new L(t).lex(e)}static lexInline(e,t){return new L(t).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.options.pedantic&&(e=e.replace(/\t/g,"    ").replace(/^ +$/gm,""));let i,o,r;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(i=s.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
`+i.raw,o.text+=`
`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&(o.type==="paragraph"||o.type==="text")?(o.raw+=`
`+i.raw,o.text+=`
`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(r=e,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const l=e.slice(1);let u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(r=e.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(r))){o=t[t.length-1],n&&(o==null?void 0:o.type)==="paragraph"?(o.raw+=`
`+i.raw,o.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i),n=r.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),o=t[t.length-1],o&&o.type==="text"?(o.raw+=`
`+i.raw,o.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=o.text):t.push(i);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,o,r=e,s,l,u;if(this.tokens.links){const h=Object.keys(this.tokens.links);if(h.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)h.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(n=h.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,r,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let h=1/0;const p=e.slice(1);let b;this.options.extensions.startInline.forEach(w=>{b=w.call({lexer:this},p),typeof b=="number"&&b>=0&&(h=Math.min(h,b))}),h<1/0&&h>=0&&(o=e.substring(0,h+1))}if(n=this.tokenizer.inlineText(o)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),l=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return t}}class se{constructor(e){z(this,"options");z(this,"parser");this.options=e||Z}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const i=(r=(t||"").match(/^\S*/))==null?void 0:r[0],o=e.replace(/\n$/,"")+`
`;return i?'<pre><code class="language-'+I(i)+'">'+(n?o:I(o,!0))+`</code></pre>
`:"<pre><code>"+(n?o:I(o,!0))+`</code></pre>
`}blockquote({tokens:e}){return`<blockquote>
${this.parser.parse(e)}</blockquote>
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
`}hr(e){return`<hr>
`}list(e){const t=e.ordered,n=e.start;let i="";for(let s=0;s<e.items.length;s++){const l=e.items[s];i+=this.listitem(l)}const o=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+o+r+`>
`+i+"</"+o+`>
`}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
`}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let i="";for(let o=0;o<e.rows.length;o++){const r=e.rows[o];n="";for(let s=0;s<r.length;s++)n+=this.tablecell(r[s]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+i+`</table>
`}tablerow({text:e}){return`<tr>
${e}</tr>
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),o=Te(e);if(o===null)return i;e=o;let r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>",r}image({href:e,title:t,text:n}){const i=Te(e);if(i===null)return n;e=i;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${t}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}}class we{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class C{constructor(e){z(this,"options");z(this,"renderer");z(this,"textRenderer");this.options=e||Z,this.options.renderer=this.options.renderer||new se,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new we}static parse(e,t){return new C(t).parse(e)}static parseInline(e,t){return new C(t).parseInline(e)}parse(e,t=!0){let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const s=o,l=this.options.extensions.renderers[s.type].call({parser:this},s);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(s.type)){n+=l||"";continue}}const r=o;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 s=r,l=this.renderer.text(s);for(;i+1<e.length&&e[i+1].type==="text";)s=e[++i],l+=`
`+this.renderer.text(s);t?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l}]}):n+=l;continue}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}parseInline(e,t){t=t||this.renderer;let n="";for(let i=0;i<e.length;i++){const o=e[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]){const s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=s||"";continue}}const r=o;switch(r.type){case"escape":{n+=t.text(r);break}case"html":{n+=t.html(r);break}case"link":{n+=t.link(r);break}case"image":{n+=t.image(r);break}case"strong":{n+=t.strong(r);break}case"em":{n+=t.em(r);break}case"codespan":{n+=t.codespan(r);break}case"br":{n+=t.br(r);break}case"del":{n+=t.del(r);break}case"text":{n+=t.text(r);break}default:{const s='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return n}}class Y{constructor(e){z(this,"options");z(this,"block");this.options=e||Z}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?L.lex:L.lexInline}provideParser(){return this.block?C.parse:C.parseInline}}z(Y,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Bt{constructor(...e){z(this,"defaults",fe());z(this,"options",this.setOptions);z(this,"parse",this.parseMarkdown(!0));z(this,"parseInline",this.parseMarkdown(!1));z(this,"Parser",C);z(this,"Renderer",se);z(this,"TextRenderer",we);z(this,"Lexer",L);z(this,"Tokenizer",oe);z(this,"Hooks",Y);this.use(...e)}walkTokens(e,t){var i,o;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const s=r;for(const l of s.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of s.rows)for(const u of l)n=n.concat(this.walkTokens(u.tokens,t));break}case"list":{const s=r;n=n.concat(this.walkTokens(s.items,t));break}default:{const s=r;(o=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&o[s.type]?this.defaults.extensions.childTokens[s.type].forEach(l=>{const u=s[l].flat(1/0);n=n.concat(this.walkTokens(u,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const r=t.renderers[o.name];r?t.renderers[o.name]=function(...s){let l=o.renderer.apply(this,s);return l===!1&&(l=r.apply(this,s)),l}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[o.level];r?r.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),i.extensions=t),n.renderer){const o=this.defaults.renderer||new se(this.defaults);for(const r in n.renderer){if(!(r in o))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const s=r,l=n.renderer[s],u=o[s];o[s]=(...h)=>{let p=l.apply(o,h);return p===!1&&(p=u.apply(o,h)),p||""}}i.renderer=o}if(n.tokenizer){const o=this.defaults.tokenizer||new oe(this.defaults);for(const r in n.tokenizer){if(!(r in o))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const s=r,l=n.tokenizer[s],u=o[s];o[s]=(...h)=>{let p=l.apply(o,h);return p===!1&&(p=u.apply(o,h)),p}}i.tokenizer=o}if(n.hooks){const o=this.defaults.hooks||new Y;for(const r in n.hooks){if(!(r in o))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const s=r,l=n.hooks[s],u=o[s];Y.passThroughHooks.has(r)?o[s]=h=>{if(this.defaults.async)return Promise.resolve(l.call(o,h)).then(b=>u.call(o,b));const p=l.call(o,h);return u.call(o,p)}:o[s]=(...h)=>{let p=l.apply(o,h);return p===!1&&(p=u.apply(o,h)),p}}i.hooks=o}if(n.walkTokens){const o=this.defaults.walkTokens,r=n.walkTokens;i.walkTokens=function(s){let l=[];return l.push(r.call(this,s)),o&&(l=l.concat(o.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return L.lex(e,t??this.defaults)}parser(e,t){return C.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const o={...i},r={...this.defaults,...o},s=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&o.async===!1)return s(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 s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const l=r.hooks?r.hooks.provideLexer():e?L.lex:L.lexInline,u=r.hooks?r.hooks.provideParser():e?C.parse:C.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(h=>l(h,r)).then(h=>r.hooks?r.hooks.processAllTokens(h):h).then(h=>r.walkTokens?Promise.all(this.walkTokens(h,r.walkTokens)).then(()=>h):h).then(h=>u(h,r)).then(h=>r.hooks?r.hooks.postprocess(h):h).catch(s);try{r.hooks&&(n=r.hooks.preprocess(n));let h=l(n,r);r.hooks&&(h=r.hooks.processAllTokens(h)),r.walkTokens&&this.walkTokens(h,r.walkTokens);let p=u(h,r);return r.hooks&&(p=r.hooks.postprocess(p)),p}catch(h){return s(h)}}}onError(e,t){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+I(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const M=new Bt;function x(a,e){return M.parse(a,e)}x.options=x.setOptions=function(a){return M.setOptions(a),x.defaults=M.defaults,Ae(x.defaults),x};x.getDefaults=fe;x.defaults=Z;x.use=function(...a){return M.use(...a),x.defaults=M.defaults,Ae(x.defaults),x};x.walkTokens=function(a,e){return M.walkTokens(a,e)};x.parseInline=M.parseInline;x.Parser=C;x.parser=C.parse;x.Renderer=se;x.TextRenderer=we;x.Lexer=L;x.lexer=L.lex;x.Tokenizer=oe;x.Hooks=Y;x.parse=x;x.options;x.setOptions;x.use;x.walkTokens;x.parseInline;C.parse;L.lex;/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */var P=Object.assign||function(a){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(a[n]=t[n])}return a},ne=function(e){return e.tagName==="IMG"},qt=function(e){return NodeList.prototype.isPrototypeOf(e)},ie=function(e){return e&&e.nodeType===1},Re=function(e){var t=e.currentSrc||e.src;return t.substr(-4).toLowerCase()===".svg"},Ie=function(e){try{return Array.isArray(e)?e.filter(ne):qt(e)?[].slice.call(e).filter(ne):ie(e)?[e].filter(ne):typeof e=="string"?[].slice.call(document.querySelectorAll(e)).filter(ne):[]}catch{throw new TypeError(`The provided selector is invalid.
Expects a CSS selector, a Node element, a NodeList or an array.
See: https://github.com/francoischalifour/medium-zoom`)}},Ot=function(e){var t=document.createElement("div");return t.classList.add("medium-zoom-overlay"),t.style.background=e,t},Pt=function(e){var t=e.getBoundingClientRect(),n=t.top,i=t.left,o=t.width,r=t.height,s=e.cloneNode(),l=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,u=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;return s.removeAttribute("id"),s.style.position="absolute",s.style.top=n+l+"px",s.style.left=i+u+"px",s.style.width=o+"px",s.style.height=r+"px",s.style.transform="",s},F=function(e,t){var n=P({bubbles:!1,cancelable:!1,detail:void 0},t);if(typeof window.CustomEvent=="function")return new CustomEvent(e,n);var i=document.createEvent("CustomEvent");return i.initCustomEvent(e,n.bubbles,n.cancelable,n.detail),i},pe=function a(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=window.Promise||function(d){function g(){}d(g,g)},i=function(d){var g=d.target;if(g===J){f();return}E.indexOf(g)!==-1&&S({target:g})},o=function(){if(!(B||!c.original)){var d=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;Math.abs(N-d)>k.scrollOffset&&setTimeout(f,150)}},r=function(d){var g=d.key||d.keyCode;(g==="Escape"||g==="Esc"||g===27)&&f()},s=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=d;if(d.background&&(J.style.background=d.background),d.container&&d.container instanceof Object&&(g.container=P({},k.container,d.container)),d.template){var v=ie(d.template)?d.template:document.querySelector(d.template);g.template=v}return k=P({},k,g),E.forEach(function($){$.dispatchEvent(F("medium-zoom:update",{detail:{zoom:T}}))}),T},l=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return a(P({},k,d))},u=function(){for(var d=arguments.length,g=Array(d),v=0;v<d;v++)g[v]=arguments[v];var $=g.reduce(function(m,R){return[].concat(m,Ie(R))},[]);return $.filter(function(m){return E.indexOf(m)===-1}).forEach(function(m){E.push(m),m.classList.add("medium-zoom-image")}),O.forEach(function(m){var R=m.type,H=m.listener,j=m.options;$.forEach(function(q){q.addEventListener(R,H,j)})}),T},h=function(){for(var d=arguments.length,g=Array(d),v=0;v<d;v++)g[v]=arguments[v];c.zoomed&&f();var $=g.length>0?g.reduce(function(m,R){return[].concat(m,Ie(R))},[]):E;return $.forEach(function(m){m.classList.remove("medium-zoom-image"),m.dispatchEvent(F("medium-zoom:detach",{detail:{zoom:T}}))}),E=E.filter(function(m){return $.indexOf(m)===-1}),T},p=function(d,g){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return E.forEach(function($){$.addEventListener("medium-zoom:"+d,g,v)}),O.push({type:"medium-zoom:"+d,listener:g,options:v}),T},b=function(d,g){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return E.forEach(function($){$.removeEventListener("medium-zoom:"+d,g,v)}),O=O.filter(function($){return!($.type==="medium-zoom:"+d&&$.listener.toString()===g.toString())}),T},w=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=d.target,v=function(){var m={width:document.documentElement.clientWidth,height:document.documentElement.clientHeight,left:0,top:0,right:0,bottom:0},R=void 0,H=void 0;if(k.container)if(k.container instanceof Object)m=P({},m,k.container),R=m.width-m.left-m.right-k.margin*2,H=m.height-m.top-m.bottom-k.margin*2;else{var j=ie(k.container)?k.container:document.querySelector(k.container),q=j.getBoundingClientRect(),ae=q.width,Ne=q.height,je=q.left,Fe=q.top;m=P({},m,{width:ae,height:Ne,left:je,top:Fe})}R=R||m.width-k.margin*2,H=H||m.height-k.margin*2;var Q=c.zoomedHd||c.original,We=Re(Q)?R:Q.naturalWidth||R,Qe=Re(Q)?H:Q.naturalHeight||H,ee=Q.getBoundingClientRect(),De=ee.top,Ue=ee.left,ce=ee.width,he=ee.height,Xe=Math.min(Math.max(ce,We),R)/ce,Ye=Math.min(Math.max(he,Qe),H)/he,ue=Math.min(Xe,Ye),Ge=(-Ue+(R-ce)/2+k.margin+m.left)/ue,Ke=(-De+(H-he)/2+k.margin+m.top)/ue,ye="scale("+ue+") translate3d("+Ge+"px, "+Ke+"px, 0)";c.zoomed.style.transform=ye,c.zoomedHd&&(c.zoomedHd.style.transform=ye)};return new n(function($){if(g&&E.indexOf(g)===-1){$(T);return}var m=function ae(){B=!1,c.zoomed.removeEventListener("transitionend",ae),c.original.dispatchEvent(F("medium-zoom:opened",{detail:{zoom:T}})),$(T)};if(c.zoomed){$(T);return}if(g)c.original=g;else if(E.length>0){var R=E;c.original=R[0]}else{$(T);return}if(c.original.dispatchEvent(F("medium-zoom:open",{detail:{zoom:T}})),N=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,B=!0,c.zoomed=Pt(c.original),document.body.appendChild(J),k.template){var H=ie(k.template)?k.template:document.querySelector(k.template);c.template=document.createElement("div"),c.template.appendChild(H.content.cloneNode(!0)),document.body.appendChild(c.template)}if(c.original.parentElement&&c.original.parentElement.tagName==="PICTURE"&&c.original.currentSrc&&(c.zoomed.src=c.original.currentSrc),document.body.appendChild(c.zoomed),window.requestAnimationFrame(function(){document.body.classList.add("medium-zoom--opened")}),c.original.classList.add("medium-zoom-image--hidden"),c.zoomed.classList.add("medium-zoom-image--opened"),c.zoomed.addEventListener("click",f),c.zoomed.addEventListener("transitionend",m),c.original.getAttribute("data-zoom-src")){c.zoomedHd=c.zoomed.cloneNode(),c.zoomedHd.removeAttribute("srcset"),c.zoomedHd.removeAttribute("sizes"),c.zoomedHd.removeAttribute("loading"),c.zoomedHd.src=c.zoomed.getAttribute("data-zoom-src"),c.zoomedHd.onerror=function(){clearInterval(j),console.warn("Unable to reach the zoom image target "+c.zoomedHd.src),c.zoomedHd=null,v()};var j=setInterval(function(){c.zoomedHd.complete&&(clearInterval(j),c.zoomedHd.classList.add("medium-zoom-image--opened"),c.zoomedHd.addEventListener("click",f),document.body.appendChild(c.zoomedHd),v())},10)}else if(c.original.hasAttribute("srcset")){c.zoomedHd=c.zoomed.cloneNode(),c.zoomedHd.removeAttribute("sizes"),c.zoomedHd.removeAttribute("loading");var q=c.zoomedHd.addEventListener("load",function(){c.zoomedHd.removeEventListener("load",q),c.zoomedHd.classList.add("medium-zoom-image--opened"),c.zoomedHd.addEventListener("click",f),document.body.appendChild(c.zoomedHd),v()})}else v()})},f=function(){return new n(function(d){if(B||!c.original){d(T);return}var g=function v(){c.original.classList.remove("medium-zoom-image--hidden"),document.body.removeChild(c.zoomed),c.zoomedHd&&document.body.removeChild(c.zoomedHd),document.body.removeChild(J),c.zoomed.classList.remove("medium-zoom-image--opened"),c.template&&document.body.removeChild(c.template),B=!1,c.zoomed.removeEventListener("transitionend",v),c.original.dispatchEvent(F("medium-zoom:closed",{detail:{zoom:T}})),c.original=null,c.zoomed=null,c.zoomedHd=null,c.template=null,d(T)};B=!0,document.body.classList.remove("medium-zoom--opened"),c.zoomed.style.transform="",c.zoomedHd&&(c.zoomedHd.style.transform=""),c.template&&(c.template.style.transition="opacity 150ms",c.template.style.opacity=0),c.original.dispatchEvent(F("medium-zoom:close",{detail:{zoom:T}})),c.zoomed.addEventListener("transitionend",g)})},S=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},g=d.target;return c.original?f():w({target:g})},A=function(){return k},W=function(){return E},V=function(){return c.original},E=[],O=[],B=!1,N=0,k=t,c={original:null,zoomed:null,zoomedHd:null,template:null};Object.prototype.toString.call(e)==="[object Object]"?k=e:(e||typeof e=="string")&&u(e),k=P({margin:0,background:"#fff",scrollOffset:40,container:null,template:null},k);var J=Ot(k.background);document.addEventListener("click",i),document.addEventListener("keyup",r),document.addEventListener("scroll",o),window.addEventListener("resize",f);var T={open:w,close:f,toggle:S,update:s,clone:l,attach:u,detach:h,on:p,off:b,getOptions:A,getImages:W,getZoomedImage:V};return T};function Mt(a,e){e===void 0&&(e={});var t=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}}var Zt=".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";Mt(Zt);const Nt={props:{content:{type:Object,required:!0}},data(){return{figures:[],isZoomed:!1,zoomInstance:null}},computed:{isEditing(){return!1},html(){return x.parse(wwLib.wwLang.getText(this.content.text))},hasContent(){const a=wwLib.wwLang.getText(this.content.text);return a&&a.length},richTextStyle(){return{"--h1-fontSize":this.content.h1.fontSize,"--h1-fontFamily":this.content.h1.fontFamily,"--h1-fontWeight":this.content.h1.fontWeight,"--h1-textAlign":this.content.h1.textAlign,"--h1-color":this.content.h1.color,"--h1-lineHeight":this.content.h1.lineHeight,"--h1-margin-top":this.content.h1.marginTop,"--h1-margin-bottom":this.content.h1.marginBottom,"--h2-fontSize":this.content.h2.fontSize,"--h2-fontFamily":this.content.h2.fontFamily,"--h2-fontWeight":this.content.h2.fontWeight,"--h2-textAlign":this.content.h2.textAlign,"--h2-color":this.content.h2.color,"--h2-lineHeight":this.content.h2.lineHeight,"--h2-margin-top":this.content.h2.marginTop,"--h2-margin-bottom":this.content.h2.marginBottom,"--h3-fontSize":this.content.h3.fontSize,"--h3-fontFamily":this.content.h3.fontFamily,"--h3-fontWeight":this.content.h3.fontWeight,"--h3-textAlign":this.content.h3.textAlign,"--h3-color":this.content.h3.color,"--h3-lineHeight":this.content.h3.lineHeight,"--h3-margin-top":this.content.h3.marginTop,"--h3-margin-bottom":this.content.h3.marginBottom,"--h4-fontSize":this.content.h4.fontSize,"--h4-fontFamily":this.content.h4.fontFamily,"--h4-fontWeight":this.content.h4.fontWeight,"--h4-textAlign":this.content.h4.textAlign,"--h4-color":this.content.h4.color,"--h4-lineHeight":this.content.h4.lineHeight,"--h4-margin-top":this.content.h4.marginTop,"--h4-margin-bottom":this.content.h4.marginBottom,"--p-fontSize":this.content.p.fontSize,"--p-fontFamily":this.content.p.fontFamily,"--p-fontWeight":this.content.p.fontWeight,"--p-textAlign":this.content.p.textAlign,"--p-color":this.content.p.color,"--p-lineHeight":this.content.p.lineHeight,"--p-margin-top":this.content.p.marginTop,"--p-margin-bottom":this.content.p.marginBottom,"--a-fontSize":this.content.a.fontSize,"--a-fontFamily":this.content.a.fontFamily,"--a-fontWeight":this.content.a.fontWeight,"--a-textAlign":this.content.a.textAlign,"--a-color":this.content.a.color,"--a-lineHeight":this.content.a.lineHeight,"--a-underline":this.content.a.isUnderline?"underline":"none","--blockquote-color":this.content.blockquote.color,"--blockquote-borderColor":this.content.blockquote.borderColor,"--blockquote-margin-top":this.content.blockquote.marginTop,"--blockquote-margin-bottom":this.content.blockquote.marginBottom,"--img-width":this.content.img.width,"--img-margin-top":this.content.img.marginTop,"--img-margin-bottom":this.content.img.marginBottom,"--iframe-width":this.content.iframe.width,"--iframe-height":this.content.iframe.height,"--iframe-margin-top":this.content.iframe.marginTop,"--iframe-margin-bottom":this.content.iframe.marginBottom}}},watch:{"content.text"(){this.init()},"content.zoomEffect"(){this.content.zoomEffect||(this.zoomInstance&&this.zoomInstance.detach(),this.zoomInstance=null)},"content.zoomBackgroundColor"(){this.zoomInstance&&this.zoomInstance.detach();const a=parseInt(this.content.zoomMargin.slice(0,-2)),e=this.content.zoomBackgroundColor;this.zoomInstance=pe("[img-zoomable]",{margin:a,background:e})},"content.zoomMargin"(){this.zoomInstance&&this.zoomInstance.detach();const a=parseInt(this.content.zoomMargin.slice(0,-2)),e=this.content.zoomBackgroundColor;this.zoomInstance=pe("[img-zoomable]",{margin:a,background:e})}},mounted(){this.content.zoomEffect&&this.init()},methods:{init(){if(this.content.zoomEffect){this.figures=this.$el.querySelectorAll("img");for(let a of this.figures)a.setAttribute("img-zoomable","");this.zoomInstance&&this.zoomInstance.detach(),this.zoomInstance=pe("[img-zoomable]",{margin:parseInt(this.content.zoomMargin.slice(0,-2)),background:this.content.zoomBackgroundColor})}}}},jt={class:"ww-rich-text-temp"},Ft=["innerHTML"];function Wt(a,e,t,n,i,o){return ve(),ze("div",jt,[o.hasContent?(ve(),ze("div",{key:0,class:"ww-rich-text-temp",style:nt(o.richTextStyle),"ww-responsive":"richtext",innerHTML:o.html},null,12,Ft)):tt("",!0)])}const Ut=et(Nt,[["render",Wt],["__scopeId","data-v-8101d53d"]]);export{Ut as e};
