From ce9424249f1c6d5c9de488dc1c3a65ab3fe68b44 Mon Sep 17 00:00:00 2001 From: Ordinary Hacker Date: Wed, 2 Jul 2025 12:04:11 -0600 Subject: [PATCH] Added support for mathematical expressions with KaTeX integration --- .../{index-DXVBtf7Z.js => index-CYOMgM8Q.js} | 42 +++++++------- dist/index.html | 57 +++++++++++-------- index.html | 55 +++++++++++------- src/main.js | 23 +++++++- 4 files changed, 108 insertions(+), 69 deletions(-) rename dist/assets/{index-DXVBtf7Z.js => index-CYOMgM8Q.js} (87%) diff --git a/dist/assets/index-DXVBtf7Z.js b/dist/assets/index-CYOMgM8Q.js similarity index 87% rename from dist/assets/index-DXVBtf7Z.js rename to dist/assets/index-CYOMgM8Q.js index 3a56388..b4ffbf0 100644 --- a/dist/assets/index-DXVBtf7Z.js +++ b/dist/assets/index-CYOMgM8Q.js @@ -1,29 +1,29 @@ -var zn=Object.defineProperty;var $n=(u,e,t)=>e in u?zn(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var S=(u,e,t)=>$n(u,typeof e!="symbol"?e+"":e,t);import*as Bn from"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/+esm";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=t(r);fetch(r.href,i)}})();const Q=class Q{};S(Q,"localStorage",window.localStorage),S(Q,"sessionStorage",window.sessionStorage),S(Q,"createKey",function(e,t){return this.getMD5Hash([e,t].join("-"))}),S(Q,"getItem",function(e,t){var n=this.createKey(e,t),r=JSON.parse(sessionStorage.getItem(n))||JSON.parse(localStorage.getItem(n));if(r){var i=r.value,o=Number(r.expire),a=new Date().getTime();if(o){if(o>a)return i;deleteItem(e,t)}else return i}}),S(Q,"setItem",function(e,t,n,r){var i={namespace:e,key:t,value:n};r?(i.expire=r.getTime(),localStorage.setItem(this.createKey(e,t),JSON.stringify(i))):sessionStorage.setItem(this.createKey(e,t),JSON.stringify(i))}),S(Q,"deleteItem",function(e,t){sessionStorage.removeItem(this.createKey(e,t)),localStorage.removeItem(this.createKey(e,t))}),S(Q,"getInstance",function(e){return{getItem:function(t){return Q.getItem(e,t)},setItem:function(t,n,r){Q.setItem(e,t,n,r)},deleteItem:function(t){Q.deleteItem(e,t)}}}),S(Q,"getMD5Hash",function(e){var t=new Array(0,3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745),n=new Array(new Array(0,7,1),new Array(1,12,2),new Array(2,17,3),new Array(3,22,4),new Array(4,7,5),new Array(5,12,6),new Array(6,17,7),new Array(7,22,8),new Array(8,7,9),new Array(9,12,10),new Array(10,17,11),new Array(11,22,12),new Array(12,7,13),new Array(13,12,14),new Array(14,17,15),new Array(15,22,16)),r=new Array(new Array(1,5,17),new Array(6,9,18),new Array(11,14,19),new Array(0,20,20),new Array(5,5,21),new Array(10,9,22),new Array(15,14,23),new Array(4,20,24),new Array(9,5,25),new Array(14,9,26),new Array(3,14,27),new Array(8,20,28),new Array(13,5,29),new Array(2,9,30),new Array(7,14,31),new Array(12,20,32)),i=new Array(new Array(5,4,33),new Array(8,11,34),new Array(11,16,35),new Array(14,23,36),new Array(1,4,37),new Array(4,11,38),new Array(7,16,39),new Array(10,23,40),new Array(13,4,41),new Array(0,11,42),new Array(3,16,43),new Array(6,23,44),new Array(9,4,45),new Array(12,11,46),new Array(15,16,47),new Array(2,23,48)),o=new Array(new Array(0,6,49),new Array(7,10,50),new Array(14,15,51),new Array(5,21,52),new Array(12,6,53),new Array(3,10,54),new Array(10,15,55),new Array(1,21,56),new Array(8,6,57),new Array(15,10,58),new Array(6,15,59),new Array(13,21,60),new Array(4,6,61),new Array(11,10,62),new Array(2,15,63),new Array(9,21,64));function a(w,T,I){return w&T|~w&I}function p(w,T,I){return w&I|T&~I}function l(w,T,I){return w^T^I}function c(w,T,I){return T^(w|~I)}var x=new Array(new Array(a,n),new Array(p,r),new Array(l,i),new Array(c,o));function m(w){return String.fromCharCode(w&255)+String.fromCharCode(w>>>8&255)+String.fromCharCode(w>>>16&255)+String.fromCharCode(w>>>24&255)}function k(w){for(;w<0;)w+=4294967296;for(;w>4294967295;)w-=4294967296;return w}function R(w,T,I,A,M){var z,G,b,y,v,d,N,D,q;z=A[0],G=A[1],b=A[2],y=A[3],v=M[0],d=M[1],N=M[2],q=I(T[G],T[b],T[y]),D=T[z]+q+w[v]+t[N],D=k(D),D=D<>>32-d,D+=T[G],T[z]=k(D)}function E(w){var T,I,A,M,z,G,b,y,v,d,N,D,q;if(A=new Array(1732584193,4023233417,2562383102,271733878),z=w.length,G=z&63,b=G<56?56-G:120-G,b>0)for(w+="€",d=0;d>4&15),I+="0123456789abcdef".charAt(A&15);return I}return B(e)});let Te=Q;function wt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ge=wt();function fn(u){ge=u}const Ne={exec:()=>null};function L(u,e=""){let t=typeof u=="string"?u:u.source;const n={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Z.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}const Z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},Un=/^(?:[ \t]*(?:\n|$))+/,Hn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yt=/(?:[*+-]|\d{1,9}[.)])/,dn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gn=L(dn).replace(/bull/g,yt).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/).replace(/\|table/g,"").getRegex(),Wn=L(dn).replace(/bull/g,yt).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),At=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qn=/^[^\n]+/,Tt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yn=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jn=L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yt).getRegex(),Je="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",_t=/|$))/,Zn=L("^ {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|$))","i").replace("comment",_t).replace("tag",Je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mn=L(At).replace("hr",ze).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Xn=L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mn).getRegex(),St={blockquote:Xn,code:Hn,def:Yn,fences:Fn,heading:Gn,hr:ze,html:Zn,lheading:gn,list:jn,newline:Un,paragraph:mn,table:Ne,text:qn},Qt=L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ze).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Vn={...St,lheading:Wn,table:Qt,paragraph:L(At).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qt).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",Je).getRegex()},Kn={...St,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_t).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:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L(At).replace("hr",ze).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",gn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bn=/^( {2,}|\\)\n(?!\s*$)/,er=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,wn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sr=L(wn,"u").replace(/punct/g,et).getRegex(),or=L(wn,"u").replace(/punct/g,kn).getRegex(),yn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ar=L(yn,"gu").replace(/notPunctSpace/g,xn).replace(/punctSpace/g,Et).replace(/punct/g,et).getRegex(),lr=L(yn,"gu").replace(/notPunctSpace/g,rr).replace(/punctSpace/g,nr).replace(/punct/g,kn).getRegex(),cr=L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xn).replace(/punctSpace/g,Et).replace(/punct/g,et).getRegex(),ur=L(/\\(punct)/,"gu").replace(/punct/g,et).getRegex(),pr=L(/^<(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(),hr=L(_t).replace("(?:-->|$)","-->").getRegex(),fr=L("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",hr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ve=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dr=L(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ve).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),An=L(/^!?\[(label)\]\[(ref)\]/).replace("label",Ve).replace("ref",Tt).getRegex(),Tn=L(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tt).getRegex(),gr=L("reflink|nolink(?!\\()","g").replace("reflink",An).replace("nolink",Tn).getRegex(),Rt={_backpedal:Ne,anyPunctuation:ur,autolink:pr,blockSkip:ir,br:bn,code:Jn,del:Ne,emStrongLDelim:sr,emStrongRDelimAst:ar,emStrongRDelimUnd:cr,escape:Qn,link:dr,nolink:Tn,punctuation:tr,reflink:An,reflinkSearch:gr,tag:fr,text:er,url:Ne},mr={...Rt,link:L(/^!?\[(label)\]\((.*?)\)/).replace("label",Ve).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ve).getRegex()},bt={...Rt,emStrongRDelimAst:lr,emStrongLDelim:or,url:L(/^((?: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]*?(?:(?=[\\":">",'"':""","'":"'"},Jt=u=>xr[u];function ae(u,e){if(e){if(Z.escapeTest.test(u))return u.replace(Z.escapeReplace,Jt)}else if(Z.escapeTestNoEncode.test(u))return u.replace(Z.escapeReplaceNoEncode,Jt);return u}function en(u){try{u=encodeURI(u).replace(Z.percentDecode,"%")}catch{return null}return u}function tn(u,e){var i;const t=u.replace(Z.findPipe,(o,a,p)=>{let l=!1,c=a;for(;--c>=0&&p[c]==="\\";)l=!l;return l?"|":" |"}),n=t.split(Z.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.lengthe in u?zn(u,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[e]=t;var S=(u,e,t)=>$n(u,typeof e!="symbol"?e+"":e,t);import*as Bn from"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/+esm";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function t(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(r){if(r.ep)return;r.ep=!0;const i=t(r);fetch(r.href,i)}})();const Q=class Q{};S(Q,"localStorage",window.localStorage),S(Q,"sessionStorage",window.sessionStorage),S(Q,"createKey",function(e,t){return this.getMD5Hash([e,t].join("-"))}),S(Q,"getItem",function(e,t){var n=this.createKey(e,t),r=JSON.parse(sessionStorage.getItem(n))||JSON.parse(localStorage.getItem(n));if(r){var i=r.value,o=Number(r.expire),a=new Date().getTime();if(o){if(o>a)return i;deleteItem(e,t)}else return i}}),S(Q,"setItem",function(e,t,n,r){var i={namespace:e,key:t,value:n};r?(i.expire=r.getTime(),localStorage.setItem(this.createKey(e,t),JSON.stringify(i))):sessionStorage.setItem(this.createKey(e,t),JSON.stringify(i))}),S(Q,"deleteItem",function(e,t){sessionStorage.removeItem(this.createKey(e,t)),localStorage.removeItem(this.createKey(e,t))}),S(Q,"getInstance",function(e){return{getItem:function(t){return Q.getItem(e,t)},setItem:function(t,n,r){Q.setItem(e,t,n,r)},deleteItem:function(t){Q.deleteItem(e,t)}}}),S(Q,"getMD5Hash",function(e){var t=new Array(0,3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745),n=new Array(new Array(0,7,1),new Array(1,12,2),new Array(2,17,3),new Array(3,22,4),new Array(4,7,5),new Array(5,12,6),new Array(6,17,7),new Array(7,22,8),new Array(8,7,9),new Array(9,12,10),new Array(10,17,11),new Array(11,22,12),new Array(12,7,13),new Array(13,12,14),new Array(14,17,15),new Array(15,22,16)),r=new Array(new Array(1,5,17),new Array(6,9,18),new Array(11,14,19),new Array(0,20,20),new Array(5,5,21),new Array(10,9,22),new Array(15,14,23),new Array(4,20,24),new Array(9,5,25),new Array(14,9,26),new Array(3,14,27),new Array(8,20,28),new Array(13,5,29),new Array(2,9,30),new Array(7,14,31),new Array(12,20,32)),i=new Array(new Array(5,4,33),new Array(8,11,34),new Array(11,16,35),new Array(14,23,36),new Array(1,4,37),new Array(4,11,38),new Array(7,16,39),new Array(10,23,40),new Array(13,4,41),new Array(0,11,42),new Array(3,16,43),new Array(6,23,44),new Array(9,4,45),new Array(12,11,46),new Array(15,16,47),new Array(2,23,48)),o=new Array(new Array(0,6,49),new Array(7,10,50),new Array(14,15,51),new Array(5,21,52),new Array(12,6,53),new Array(3,10,54),new Array(10,15,55),new Array(1,21,56),new Array(8,6,57),new Array(15,10,58),new Array(6,15,59),new Array(13,21,60),new Array(4,6,61),new Array(11,10,62),new Array(2,15,63),new Array(9,21,64));function a(k,T,I){return k&T|~k&I}function p(k,T,I){return k&I|T&~I}function l(k,T,I){return k^T^I}function c(k,T,I){return T^(k|~I)}var x=new Array(new Array(a,n),new Array(p,r),new Array(l,i),new Array(c,o));function m(k){return String.fromCharCode(k&255)+String.fromCharCode(k>>>8&255)+String.fromCharCode(k>>>16&255)+String.fromCharCode(k>>>24&255)}function w(k){for(;k<0;)k+=4294967296;for(;k>4294967295;)k-=4294967296;return k}function R(k,T,I,A,N){var z,G,b,y,D,d,v,O,q;z=A[0],G=A[1],b=A[2],y=A[3],D=N[0],d=N[1],v=N[2],q=I(T[G],T[b],T[y]),O=T[z]+q+k[D]+t[v],O=w(O),O=O<>>32-d,O+=T[G],T[z]=w(O)}function E(k){var T,I,A,N,z,G,b,y,D,d,v,O,q;if(A=new Array(1732584193,4023233417,2562383102,271733878),z=k.length,G=z&63,b=G<56?56-G:120-G,b>0)for(k+="€",d=0;d>4&15),I+="0123456789abcdef".charAt(A&15);return I}return B(e)});let Te=Q;function kt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let ge=kt();function fn(u){ge=u}const Ne={exec:()=>null};function L(u,e=""){let t=typeof u=="string"?u:u.source;const n={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(Z.caret,"$1"),t=t.replace(r,o),n},getRegex:()=>new RegExp(t,e)};return n}const Z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:u=>new RegExp(`^( {0,3}${u})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}#`),htmlBeginRegex:u=>new RegExp(`^ {0,${Math.min(3,u-1)}}<(?:[a-z].*>|!--)`,"i")},Un=/^(?:[ \t]*(?:\n|$))+/,Hn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ze=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Gn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yt=/(?:[*+-]|\d{1,9}[.)])/,dn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,gn=L(dn).replace(/bull/g,yt).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/).replace(/\|table/g,"").getRegex(),Wn=L(dn).replace(/bull/g,yt).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/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),At=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qn=/^[^\n]+/,Tt=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yn=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jn=L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yt).getRegex(),Je="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",_t=/|$))/,Zn=L("^ {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|$))","i").replace("comment",_t).replace("tag",Je).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mn=L(At).replace("hr",ze).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Xn=L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",mn).getRegex(),St={blockquote:Xn,code:Hn,def:Yn,fences:Fn,heading:Gn,hr:ze,html:Zn,lheading:gn,list:jn,newline:Un,paragraph:mn,table:Ne,text:qn},Qt=L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ze).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",Je).getRegex(),Vn={...St,lheading:Wn,table:Qt,paragraph:L(At).replace("hr",ze).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qt).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",Je).getRegex()},Kn={...St,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",_t).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:Ne,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L(At).replace("hr",ze).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",gn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Qn=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Jn=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bn=/^( {2,}|\\)\n(?!\s*$)/,er=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,kn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,sr=L(kn,"u").replace(/punct/g,et).getRegex(),or=L(kn,"u").replace(/punct/g,wn).getRegex(),yn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ar=L(yn,"gu").replace(/notPunctSpace/g,xn).replace(/punctSpace/g,Et).replace(/punct/g,et).getRegex(),lr=L(yn,"gu").replace(/notPunctSpace/g,rr).replace(/punctSpace/g,nr).replace(/punct/g,wn).getRegex(),cr=L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,xn).replace(/punctSpace/g,Et).replace(/punct/g,et).getRegex(),ur=L(/\\(punct)/,"gu").replace(/punct/g,et).getRegex(),pr=L(/^<(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(),hr=L(_t).replace("(?:-->|$)","-->").getRegex(),fr=L("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",hr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ve=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dr=L(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Ve).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),An=L(/^!?\[(label)\]\[(ref)\]/).replace("label",Ve).replace("ref",Tt).getRegex(),Tn=L(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tt).getRegex(),gr=L("reflink|nolink(?!\\()","g").replace("reflink",An).replace("nolink",Tn).getRegex(),Rt={_backpedal:Ne,anyPunctuation:ur,autolink:pr,blockSkip:ir,br:bn,code:Jn,del:Ne,emStrongLDelim:sr,emStrongRDelimAst:ar,emStrongRDelimUnd:cr,escape:Qn,link:dr,nolink:Tn,punctuation:tr,reflink:An,reflinkSearch:gr,tag:fr,text:er,url:Ne},mr={...Rt,link:L(/^!?\[(label)\]\((.*?)\)/).replace("label",Ve).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ve).getRegex()},bt={...Rt,emStrongRDelimAst:lr,emStrongLDelim:or,url:L(/^((?: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]*?(?:(?=[\\":">",'"':""","'":"'"},Jt=u=>xr[u];function ae(u,e){if(e){if(Z.escapeTest.test(u))return u.replace(Z.escapeReplace,Jt)}else if(Z.escapeTestNoEncode.test(u))return u.replace(Z.escapeReplaceNoEncode,Jt);return u}function en(u){try{u=encodeURI(u).replace(Z.percentDecode,"%")}catch{return null}return u}function tn(u,e){var i;const t=u.replace(Z.findPipe,(o,a,p)=>{let l=!1,c=a;for(;--c>=0&&p[c]==="\\";)l=!l;return l?"|":" |"}),n=t.split(Z.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!((i=n.at(-1))!=null&&i.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length{const o=i.match(t.other.beginningSpace);if(o===null)return i;const[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(` `)}class Ke{constructor(e){S(this,"options");S(this,"rules");S(this,"lexer");this.options=e||ge}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(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Ie(n,` -`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=wr(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Ie(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.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:Ie(t[0],` +`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=kr(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const r=Ie(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.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:Ie(t[0],` `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Ie(t[0],` `).split(` `),r="",i="";const o=[];for(;n.length>0;){let a=!1;const p=[];let l;for(l=0;l1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let l=!1,c="",x="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let m=t[2].split(` -`,1)[0].replace(this.rules.other.listReplaceTabs,T=>" ".repeat(3*T.length)),k=e.split(` -`,1)[0],R=!m.trim(),E=0;if(this.options.pedantic?(E=2,x=m.trimStart()):R?E=t[1].length+1:(E=t[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,x=m.slice(E),E+=t[1].length),R&&this.rules.other.blankLine.test(k)&&(c+=k+` -`,e=e.substring(k.length+1),l=!0),!l){const T=this.rules.other.nextBulletRegex(E),I=this.rules.other.hrRegex(E),A=this.rules.other.fencesBeginRegex(E),M=this.rules.other.headingBeginRegex(E),z=this.rules.other.htmlBeginRegex(E);for(;e;){const G=e.split(` -`,1)[0];let b;if(k=G,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),b=k):b=k.replace(this.rules.other.tabCharGlobal," "),A.test(k)||M.test(k)||z.test(k)||T.test(k)||I.test(k))break;if(b.search(this.rules.other.nonSpaceChar)>=E||!k.trim())x+=` -`+b.slice(E);else{if(R||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(m)||M.test(m)||I.test(m))break;x+=` -`+k}!R&&!k.trim()&&(R=!0),c+=G+` -`,e=e.substring(G.length+1),m=b.slice(E)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let B=null,w;this.options.gfm&&(B=this.rules.other.listIsTask.exec(x),B&&(w=B[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:c,task:!!B,checked:w,loose:!1,text:x,tokens:[]}),i.raw+=c}const p=i.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;lm.type==="space"),x=c.length>0&&c.some(m=>this.rules.other.anyLine.test(m.raw));i.loose=x}if(i.loose)for(let l=0;l" ".repeat(3*T.length)),w=e.split(` +`,1)[0],R=!m.trim(),E=0;if(this.options.pedantic?(E=2,x=m.trimStart()):R?E=t[1].length+1:(E=t[2].search(this.rules.other.nonSpaceChar),E=E>4?1:E,x=m.slice(E),E+=t[1].length),R&&this.rules.other.blankLine.test(w)&&(c+=w+` +`,e=e.substring(w.length+1),l=!0),!l){const T=this.rules.other.nextBulletRegex(E),I=this.rules.other.hrRegex(E),A=this.rules.other.fencesBeginRegex(E),N=this.rules.other.headingBeginRegex(E),z=this.rules.other.htmlBeginRegex(E);for(;e;){const G=e.split(` +`,1)[0];let b;if(w=G,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),b=w):b=w.replace(this.rules.other.tabCharGlobal," "),A.test(w)||N.test(w)||z.test(w)||T.test(w)||I.test(w))break;if(b.search(this.rules.other.nonSpaceChar)>=E||!w.trim())x+=` +`+b.slice(E);else{if(R||m.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||A.test(m)||N.test(m)||I.test(m))break;x+=` +`+w}!R&&!w.trim()&&(R=!0),c+=G+` +`,e=e.substring(G.length+1),m=b.slice(E)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let B=null,k;this.options.gfm&&(B=this.rules.other.listIsTask.exec(x),B&&(k=B[0]!=="[ ] ",x=x.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:c,task:!!B,checked:k,loose:!1,text:x,tokens:[]}),i.raw+=c}const p=i.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l=0;lm.type==="space"),x=c.length>0&&c.some(m=>this.rules.other.anyLine.test(m.raw));i.loose=x}if(i.loose)for(let l=0;l({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[c]})));return o}}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:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=Ie(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=kr(t[2],"()");if(o>-1){const p=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,p).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),nn(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return nn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let a,p,l=o,c=0;const x=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,t=t.slice(-1*e.length+o);(r=x.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(p=[...a].length,r[3]||r[4]){l+=p;continue}else if((r[5]||r[6])&&o%3&&!((o+p)%3)){c+=p;continue}if(l-=p,l>0)continue;p=Math.min(p,p+l+c);const m=[...r[0]][0].length,k=e.slice(0,o+r.index+m+p);if(Math.min(o,p)%2){const E=k.slice(1,-1);return{type:"em",raw:k,text:E,tokens:this.lexer.inlineTokens(E)}}const R=k.slice(2,-2);return{type:"strong",raw:k,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{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,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class ee{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"tokenizer");S(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ge,this.options.tokenizer=this.options.tokenizer||new Ke,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={other:Z,block:Ye.normal,inline:Le.normal};this.options.pedantic?(t.block=Ye.pedantic,t.inline=Le.pedantic):this.options.gfm&&(t.block=Ye.gfm,this.options.breaks?t.inline=Le.breaks:t.inline=Le.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ye,inline:Le}}static lex(e,t){return new ee(t).lex(e)}static lexInline(e,t){return new ee(t).inlineTokens(e)}lex(e){e=e.replace(Z.carriageReturn,` +`?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:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const o=Ie(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=wr(t[2],"()");if(o>-1){const p=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,p).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),nn(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return nn(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let a,p,l=o,c=0;const x=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(x.lastIndex=0,t=t.slice(-1*e.length+o);(r=x.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(p=[...a].length,r[3]||r[4]){l+=p;continue}else if((r[5]||r[6])&&o%3&&!((o+p)%3)){c+=p;continue}if(l-=p,l>0)continue;p=Math.min(p,p+l+c);const m=[...r[0]][0].length,w=e.slice(0,o+r.index+m+p);if(Math.min(o,p)%2){const E=w.slice(1,-1);return{type:"em",raw:w,text:E,tokens:this.lexer.inlineTokens(E)}}const R=w.slice(2,-2);return{type:"strong",raw:w,text:R,tokens:this.lexer.inlineTokens(R)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{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,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class ee{constructor(e){S(this,"tokens");S(this,"options");S(this,"state");S(this,"tokenizer");S(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ge,this.options.tokenizer=this.options.tokenizer||new Ke,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={other:Z,block:Ye.normal,inline:Le.normal};this.options.pedantic?(t.block=Ye.pedantic,t.inline=Le.pedantic):this.options.gfm&&(t.block=Ye.gfm,this.options.breaks?t.inline=Le.breaks:t.inline=Le.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ye,inline:Le}}static lex(e,t){return new ee(t).lex(e)}static lexInline(e,t){return new ee(t).inlineTokens(e)}lex(e){e=e.replace(Z.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let t=0;t(a=l.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const l=t.at(-1);a.raw.length===1&&l!==void 0?l.raw+=` `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="paragraph"||(l==null?void 0:l.type)==="text"?(l.raw+=` `+a.raw,l.text+=` @@ -33,7 +33,7 @@ ${x}`:x;const m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block `+a.raw,l.text+=` `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(a),n=p.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);const l=t.at(-1);(l==null?void 0:l.type)==="text"?(l.raw+=` `+a.raw,l.text+=` -`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(a);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,p,l;let n=e,r=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,o="";for(;e;){i||(o=""),i=!1;let c;if((p=(a=this.options.extensions)==null?void 0:a.inline)!=null&&p.some(m=>(c=m.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const m=t.at(-1);c.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=c.raw,m.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let x=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0;const k=e.slice(1);let R;this.options.extensions.startInline.forEach(E=>{R=E.call({lexer:this},k),typeof R=="number"&&R>=0&&(m=Math.min(m,R))}),m<1/0&&m>=0&&(x=e.substring(0,m+1))}if(c=this.tokenizer.inlineText(x)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),i=!0;const m=t.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=c.raw,m.text+=c.text):t.push(c);continue}if(e){const m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return t}}class Qe{constructor(e){S(this,"options");S(this,"parser");this.options=e||ge}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(Z.notSpaceStart))==null?void 0:o[0],i=e.replace(Z.endingNewline,"")+` +`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(a);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,p,l;let n=e,r=null;if(this.tokens.links){const c=Object.keys(this.tokens.links);if(c.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)c.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i=!1,o="";for(;e;){i||(o=""),i=!1;let c;if((p=(a=this.options.extensions)==null?void 0:a.inline)!=null&&p.some(m=>(c=m.call({lexer:this},e,t))?(e=e.substring(c.raw.length),t.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);const m=t.at(-1);c.type==="text"&&(m==null?void 0:m.type)==="text"?(m.raw+=c.raw,m.text+=c.text):t.push(c);continue}if(c=this.tokenizer.emStrong(e,n,o)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),t.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),t.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),t.push(c);continue}let x=e;if((l=this.options.extensions)!=null&&l.startInline){let m=1/0;const w=e.slice(1);let R;this.options.extensions.startInline.forEach(E=>{R=E.call({lexer:this},w),typeof R=="number"&&R>=0&&(m=Math.min(m,R))}),m<1/0&&m>=0&&(x=e.substring(0,m+1))}if(c=this.tokenizer.inlineText(x)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(o=c.raw.slice(-1)),i=!0;const m=t.at(-1);(m==null?void 0:m.type)==="text"?(m.raw+=c.raw,m.text+=c.text):t.push(c);continue}if(e){const m="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return t}}class Qe{constructor(e){S(this,"options");S(this,"parser");this.options=e||ge}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(Z.notSpaceStart))==null?void 0:o[0],i=e.replace(Z.endingNewline,"")+` `;return r?'
'+(n?i:ae(i,!0))+`
`:"
"+(n?i:ae(i,!0))+`
`}blockquote({tokens:e}){return`
@@ -52,9 +52,9 @@ ${this.parser.parse(e)}
${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${ae(e,!0)}`}br(e){return"
"}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),i=en(e);if(i===null)return r;e=i;let o='
",o}image({href:e,title:t,text:n}){const r=en(e);if(r===null)return ae(n);e=r;let i=`${n}{const l=a[p].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let p=i.renderer.apply(this,a);return p===!1&&(p=o.apply(this,a)),p}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new Qe(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,p=n.renderer[a],l=i[a];i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Ke(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,p=n.tokenizer[a],l=i[a];i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new Pe;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,p=n.hooks[a],l=i[a];Pe.passThroughHooks.has(o)?i[a]=c=>{if(this.defaults.async)return Promise.resolve(p.call(i,c)).then(m=>l.call(i,m));const x=p.call(i,c);return l.call(i,x)}:i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(a){let p=[];return p.push(o.call(this,a)),i&&(p=p.concat(i.call(this,a))),p}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ee.lex(e,t??this.defaults)}parser(e,t){return te.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const i={...r},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const p=o.hooks?o.hooks.provideLexer():e?ee.lex:ee.lexInline,l=o.hooks?o.hooks.provideParser():e?te.parse:te.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(c=>p(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>l(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(a);try{o.hooks&&(n=o.hooks.preprocess(n));let c=p(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let x=l(c,o);return o.hooks&&(x=o.hooks.postprocess(x)),x}catch(c){return a(c)}}}onError(e,t){return n=>{if(n.message+=` -Please report this to https://github.com/markedjs/marked.`,e){const r="

An error occurred:

"+ae(n.message+"",!0)+"
";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}const de=new yr;function C(u,e){return de.parse(u,e)}C.options=C.setOptions=function(u){return de.setOptions(u),C.defaults=de.defaults,fn(C.defaults),C};C.getDefaults=wt;C.defaults=ge;C.use=function(...u){return de.use(...u),C.defaults=de.defaults,fn(C.defaults),C};C.walkTokens=function(u,e){return de.walkTokens(u,e)};C.parseInline=de.parseInline;C.Parser=te;C.parser=te.parse;C.Renderer=Qe;C.TextRenderer=Lt;C.Lexer=ee;C.lexer=ee.lex;C.Tokenizer=Ke;C.Hooks=Pe;C.parse=C;C.options;C.setOptions;C.use;C.walkTokens;C.parseInline;te.parse;ee.lex;/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:_n,setPrototypeOf:rn,isFrozen:Ar,getPrototypeOf:Tr,getOwnPropertyDescriptor:_r}=Object;let{freeze:X,seal:ne,create:Sn}=Object,{apply:xt,construct:kt}=typeof Reflect<"u"&&Reflect;X||(X=function(e){return e});ne||(ne=function(e){return e});xt||(xt=function(e,t,n){return e.apply(t,n)});kt||(kt=function(e,t){return new e(...t)});const je=V(Array.prototype.forEach),Sr=V(Array.prototype.lastIndexOf),sn=V(Array.prototype.pop),Ce=V(Array.prototype.push),Er=V(Array.prototype.splice),Xe=V(String.prototype.toLowerCase),ht=V(String.prototype.toString),on=V(String.prototype.match),ve=V(String.prototype.replace),Rr=V(String.prototype.indexOf),Lr=V(String.prototype.trim),ie=V(Object.prototype.hasOwnProperty),j=V(RegExp.prototype.test),De=Ir(TypeError);function V(u){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Xe;rn&&rn(u,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const i=t(r);i!==r&&(Ar(e)||(e[n]=i),r=i)}u[r]=!0}return u}function Cr(u){for(let e=0;e/gm),Nr=ne(/\$\{[\w\W]*/gm),Pr=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),zr=ne(/^aria-[\-\w]+$/),En=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$r=ne(/^(?:\w+script|data):/i),Br=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rn=ne(/^html$/i),Ur=ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var pn=Object.freeze({__proto__:null,ARIA_ATTR:zr,ATTR_WHITESPACE:Br,CUSTOM_ELEMENT:Ur,DATA_ATTR:Pr,DOCTYPE_NAME:Rn,ERB_EXPR:Mr,IS_ALLOWED_URI:En,IS_SCRIPT_OR_DATA:$r,MUSTACHE_EXPR:Or,TMPLIT_EXPR:Nr});const Me={element:1,text:3,progressingInstruction:7,comment:8,document:9},Hr=function(){return typeof window>"u"?null:window},Fr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},hn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ln(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hr();const e=g=>Ln(g);if(e.version="3.2.5",e.removed=[],!u||!u.document||u.document.nodeType!==Me.document||!u.Element)return e.isSupported=!1,e;let{document:t}=u;const n=t,r=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:a,Element:p,NodeFilter:l,NamedNodeMap:c=u.NamedNodeMap||u.MozNamedAttrMap,HTMLFormElement:x,DOMParser:m,trustedTypes:k}=u,R=p.prototype,E=Oe(R,"cloneNode"),B=Oe(R,"remove"),w=Oe(R,"nextSibling"),T=Oe(R,"childNodes"),I=Oe(R,"parentNode");if(typeof o=="function"){const g=t.createElement("template");g.content&&g.content.ownerDocument&&(t=g.content.ownerDocument)}let A,M="";const{implementation:z,createNodeIterator:G,createDocumentFragment:b,getElementsByTagName:y}=t,{importNode:v}=n;let d=hn();e.isSupported=typeof _n=="function"&&typeof I=="function"&&z&&z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:N,ERB_EXPR:D,TMPLIT_EXPR:q,DATA_ATTR:J,ARIA_ATTR:re,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:me}=pn;let{IS_ALLOWED_URI:$e}=pn,P=null;const It=_({},[...an,...ft,...dt,...gt,...ln]);let H=null;const Ct=_({},[...cn,...mt,...un,...Ze]);let $=Object.seal(Sn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,tt=null,vt=!0,nt=!0,Dt=!1,Ot=!0,be=!1,rt=!0,he=!1,it=!1,st=!1,xe=!1,Be=!1,Ue=!1,Mt=!0,Nt=!1;const In="user-content-";let ot=!0,Se=!1,ke={},we=null;const Pt=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let zt=null;const $t=_({},["audio","video","img","source","image","track"]);let at=null;const Bt=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),He="http://www.w3.org/1998/Math/MathML",Fe="http://www.w3.org/2000/svg",ce="http://www.w3.org/1999/xhtml";let ye=ce,lt=!1,ct=null;const Cn=_({},[He,Fe,ce],ht);let Ge=_({},["mi","mo","mn","ms","mtext"]),We=_({},["annotation-xml"]);const vn=_({},["title","style","font","a","script"]);let Ee=null;const Dn=["application/xhtml+xml","text/html"],On="text/html";let U=null,Ae=null;const Mn=t.createElement("form"),Ut=function(s){return s instanceof RegExp||s instanceof Function},ut=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ae&&Ae===s)){if((!s||typeof s!="object")&&(s={}),s=fe(s),Ee=Dn.indexOf(s.PARSER_MEDIA_TYPE)===-1?On:s.PARSER_MEDIA_TYPE,U=Ee==="application/xhtml+xml"?ht:Xe,P=ie(s,"ALLOWED_TAGS")?_({},s.ALLOWED_TAGS,U):It,H=ie(s,"ALLOWED_ATTR")?_({},s.ALLOWED_ATTR,U):Ct,ct=ie(s,"ALLOWED_NAMESPACES")?_({},s.ALLOWED_NAMESPACES,ht):Cn,at=ie(s,"ADD_URI_SAFE_ATTR")?_(fe(Bt),s.ADD_URI_SAFE_ATTR,U):Bt,zt=ie(s,"ADD_DATA_URI_TAGS")?_(fe($t),s.ADD_DATA_URI_TAGS,U):$t,we=ie(s,"FORBID_CONTENTS")?_({},s.FORBID_CONTENTS,U):Pt,_e=ie(s,"FORBID_TAGS")?_({},s.FORBID_TAGS,U):{},tt=ie(s,"FORBID_ATTR")?_({},s.FORBID_ATTR,U):{},ke=ie(s,"USE_PROFILES")?s.USE_PROFILES:!1,vt=s.ALLOW_ARIA_ATTR!==!1,nt=s.ALLOW_DATA_ATTR!==!1,Dt=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=s.SAFE_FOR_TEMPLATES||!1,rt=s.SAFE_FOR_XML!==!1,he=s.WHOLE_DOCUMENT||!1,xe=s.RETURN_DOM||!1,Be=s.RETURN_DOM_FRAGMENT||!1,Ue=s.RETURN_TRUSTED_TYPE||!1,st=s.FORCE_BODY||!1,Mt=s.SANITIZE_DOM!==!1,Nt=s.SANITIZE_NAMED_PROPS||!1,ot=s.KEEP_CONTENT!==!1,Se=s.IN_PLACE||!1,$e=s.ALLOWED_URI_REGEXP||En,ye=s.NAMESPACE||ce,Ge=s.MATHML_TEXT_INTEGRATION_POINTS||Ge,We=s.HTML_INTEGRATION_POINTS||We,$=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&Ut(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&Ut(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),be&&(nt=!1),Be&&(xe=!0),ke&&(P=_({},ln),H=[],ke.html===!0&&(_(P,an),_(H,cn)),ke.svg===!0&&(_(P,ft),_(H,mt),_(H,Ze)),ke.svgFilters===!0&&(_(P,dt),_(H,mt),_(H,Ze)),ke.mathMl===!0&&(_(P,gt),_(H,un),_(H,Ze))),s.ADD_TAGS&&(P===It&&(P=fe(P)),_(P,s.ADD_TAGS,U)),s.ADD_ATTR&&(H===Ct&&(H=fe(H)),_(H,s.ADD_ATTR,U)),s.ADD_URI_SAFE_ATTR&&_(at,s.ADD_URI_SAFE_ATTR,U),s.FORBID_CONTENTS&&(we===Pt&&(we=fe(we)),_(we,s.FORBID_CONTENTS,U)),ot&&(P["#text"]=!0),he&&_(P,["html","head","body"]),P.table&&(_(P,["tbody"]),delete _e.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=s.TRUSTED_TYPES_POLICY,M=A.createHTML("")}else A===void 0&&(A=Fr(k,r)),A!==null&&typeof M=="string"&&(M=A.createHTML(""));X&&X(s),Ae=s}},Ht=_({},[...ft,...dt,...vr]),Ft=_({},[...gt,...Dr]),Nn=function(s){let h=I(s);(!h||!h.tagName)&&(h={namespaceURI:ye,tagName:"template"});const f=Xe(s.tagName),O=Xe(h.tagName);return ct[s.namespaceURI]?s.namespaceURI===Fe?h.namespaceURI===ce?f==="svg":h.namespaceURI===He?f==="svg"&&(O==="annotation-xml"||Ge[O]):!!Ht[f]:s.namespaceURI===He?h.namespaceURI===ce?f==="math":h.namespaceURI===Fe?f==="math"&&We[O]:!!Ft[f]:s.namespaceURI===ce?h.namespaceURI===Fe&&!We[O]||h.namespaceURI===He&&!Ge[O]?!1:!Ft[f]&&(vn[f]||!Ht[f]):!!(Ee==="application/xhtml+xml"&&ct[s.namespaceURI]):!1},se=function(s){Ce(e.removed,{element:s});try{I(s).removeChild(s)}catch{B(s)}},qe=function(s,h){try{Ce(e.removed,{attribute:h.getAttributeNode(s),from:h})}catch{Ce(e.removed,{attribute:null,from:h})}if(h.removeAttribute(s),s==="is")if(xe||Be)try{se(h)}catch{}else try{h.setAttribute(s,"")}catch{}},Gt=function(s){let h=null,f=null;if(st)s=""+s;else{const F=on(s,/^[\r\n\t ]+/);f=F&&F[0]}Ee==="application/xhtml+xml"&&ye===ce&&(s=''+s+"");const O=A?A.createHTML(s):s;if(ye===ce)try{h=new m().parseFromString(O,Ee)}catch{}if(!h||!h.documentElement){h=z.createDocument(ye,"template",null);try{h.documentElement.innerHTML=lt?M:O}catch{}}const W=h.body||h.documentElement;return s&&f&&W.insertBefore(t.createTextNode(f),W.childNodes[0]||null),ye===ce?y.call(h,he?"html":"body")[0]:he?h.documentElement:W},Wt=function(s){return G.call(s.ownerDocument||s,s,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},pt=function(s){return s instanceof x&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof c)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},qt=function(s){return typeof a=="function"&&s instanceof a};function ue(g,s,h){je(g,f=>{f.call(e,s,h,Ae)})}const Yt=function(s){let h=null;if(ue(d.beforeSanitizeElements,s,null),pt(s))return se(s),!0;const f=U(s.nodeName);if(ue(d.uponSanitizeElement,s,{tagName:f,allowedTags:P}),s.hasChildNodes()&&!qt(s.firstElementChild)&&j(/<[/\w!]/g,s.innerHTML)&&j(/<[/\w!]/g,s.textContent)||s.nodeType===Me.progressingInstruction||rt&&s.nodeType===Me.comment&&j(/<[/\w]/g,s.data))return se(s),!0;if(!P[f]||_e[f]){if(!_e[f]&&Zt(f)&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f)))return!1;if(ot&&!we[f]){const O=I(s)||s.parentNode,W=T(s)||s.childNodes;if(W&&O){const F=W.length;for(let K=F-1;K>=0;--K){const oe=E(W[K],!0);oe.__removalCount=(s.__removalCount||0)+1,O.insertBefore(oe,w(s))}}}return se(s),!0}return s instanceof p&&!Nn(s)||(f==="noscript"||f==="noembed"||f==="noframes")&&j(/<\/no(script|embed|frames)/i,s.innerHTML)?(se(s),!0):(be&&s.nodeType===Me.text&&(h=s.textContent,je([N,D,q],O=>{h=ve(h,O," ")}),s.textContent!==h&&(Ce(e.removed,{element:s.cloneNode()}),s.textContent=h)),ue(d.afterSanitizeElements,s,null),!1)},jt=function(s,h,f){if(Mt&&(h==="id"||h==="name")&&(f in t||f in Mn))return!1;if(!(nt&&!tt[h]&&j(J,h))){if(!(vt&&j(re,h))){if(!H[h]||tt[h]){if(!(Zt(s)&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,s)||$.tagNameCheck instanceof Function&&$.tagNameCheck(s))&&($.attributeNameCheck instanceof RegExp&&j($.attributeNameCheck,h)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(h))||h==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f))))return!1}else if(!at[h]){if(!j($e,ve(f,pe,""))){if(!((h==="src"||h==="xlink:href"||h==="href")&&s!=="script"&&Rr(f,"data:")===0&&zt[s])){if(!(Dt&&!j(le,ve(f,pe,"")))){if(f)return!1}}}}}}return!0},Zt=function(s){return s!=="annotation-xml"&&on(s,me)},Xt=function(s){ue(d.beforeSanitizeAttributes,s,null);const{attributes:h}=s;if(!h||pt(s))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let O=h.length;for(;O--;){const W=h[O],{name:F,namespaceURI:K,value:oe}=W,Re=U(F);let Y=F==="value"?oe:Lr(oe);if(f.attrName=Re,f.attrValue=Y,f.keepAttr=!0,f.forceKeepAttr=void 0,ue(d.uponSanitizeAttribute,s,f),Y=f.attrValue,Nt&&(Re==="id"||Re==="name")&&(qe(F,s),Y=In+Y),rt&&j(/((--!?|])>)|<\/(style|title)/i,Y)){qe(F,s);continue}if(f.forceKeepAttr||(qe(F,s),!f.keepAttr))continue;if(!Ot&&j(/\/>/i,Y)){qe(F,s);continue}be&&je([N,D,q],Kt=>{Y=ve(Y,Kt," ")});const Vt=U(s.nodeName);if(jt(Vt,Re,Y)){if(A&&typeof k=="object"&&typeof k.getAttributeType=="function"&&!K)switch(k.getAttributeType(Vt,Re)){case"TrustedHTML":{Y=A.createHTML(Y);break}case"TrustedScriptURL":{Y=A.createScriptURL(Y);break}}try{K?s.setAttributeNS(K,F,Y):s.setAttribute(F,Y),pt(s)?se(s):sn(e.removed)}catch{}}}ue(d.afterSanitizeAttributes,s,null)},Pn=function g(s){let h=null;const f=Wt(s);for(ue(d.beforeSanitizeShadowDOM,s,null);h=f.nextNode();)ue(d.uponSanitizeShadowNode,h,null),Yt(h),Xt(h),h.content instanceof i&&g(h.content);ue(d.afterSanitizeShadowDOM,s,null)};return e.sanitize=function(g){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,f=null,O=null,W=null;if(lt=!g,lt&&(g=""),typeof g!="string"&&!qt(g))if(typeof g.toString=="function"){if(g=g.toString(),typeof g!="string")throw De("dirty is not a string, aborting")}else throw De("toString is not a function");if(!e.isSupported)return g;if(it||ut(s),e.removed=[],typeof g=="string"&&(Se=!1),Se){if(g.nodeName){const oe=U(g.nodeName);if(!P[oe]||_e[oe])throw De("root node is forbidden and cannot be sanitized in-place")}}else if(g instanceof a)h=Gt(""),f=h.ownerDocument.importNode(g,!0),f.nodeType===Me.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?h=f:h.appendChild(f);else{if(!xe&&!be&&!he&&g.indexOf("<")===-1)return A&&Ue?A.createHTML(g):g;if(h=Gt(g),!h)return xe?null:Ue?M:""}h&&st&&se(h.firstChild);const F=Wt(Se?g:h);for(;O=F.nextNode();)Yt(O),Xt(O),O.content instanceof i&&Pn(O.content);if(Se)return g;if(xe){if(Be)for(W=b.call(h.ownerDocument);h.firstChild;)W.appendChild(h.firstChild);else W=h;return(H.shadowroot||H.shadowrootmode)&&(W=v.call(n,W,!0)),W}let K=he?h.outerHTML:h.innerHTML;return he&&P["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&j(Rn,h.ownerDocument.doctype.name)&&(K=" -`+K),be&&je([N,D,q],oe=>{K=ve(K,oe," ")}),A&&Ue?A.createHTML(K):K},e.setConfig=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ut(g),it=!0},e.clearConfig=function(){Ae=null,it=!1},e.isValidAttribute=function(g,s,h){Ae||ut({});const f=U(g),O=U(s);return jt(f,O,h)},e.addHook=function(g,s){typeof s=="function"&&Ce(d[g],s)},e.removeHook=function(g,s){if(s!==void 0){const h=Sr(d[g],s);return h===-1?void 0:Er(d[g],h,1)[0]}return sn(d[g])},e.removeHooks=function(g){d[g]=[]},e.removeAllHooks=function(){d=hn()},e}var Gr=Ln();const Wr=()=>{let u=!1,e=!1;const t="com.markdownlivepreview",n="last_state",r="scroll_bar_settings",i="Are you sure you want to reset? Your changes will be lost.",o=`# Markdown syntax guide +`+this.renderer.text(l);t?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{const l='Token with "'+p.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(e,t=this.renderer){var r,i;let n="";for(let o=0;o{const l=a[p].flat(1/0);n=n.concat(this.walkTokens(l,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let p=i.renderer.apply(this,a);return p===!1&&(p=o.apply(this,a)),p}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),n.renderer){const i=this.defaults.renderer||new Qe(this.defaults);for(const o in n.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,p=n.renderer[a],l=i[a];i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x||""}}r.renderer=i}if(n.tokenizer){const i=this.defaults.tokenizer||new Ke(this.defaults);for(const o in n.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,p=n.tokenizer[a],l=i[a];i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x}}r.tokenizer=i}if(n.hooks){const i=this.defaults.hooks||new Pe;for(const o in n.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,p=n.hooks[a],l=i[a];Pe.passThroughHooks.has(o)?i[a]=c=>{if(this.defaults.async)return Promise.resolve(p.call(i,c)).then(m=>l.call(i,m));const x=p.call(i,c);return l.call(i,x)}:i[a]=(...c)=>{let x=p.apply(i,c);return x===!1&&(x=l.apply(i,c)),x}}r.hooks=i}if(n.walkTokens){const i=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(a){let p=[];return p.push(o.call(this,a)),i&&(p=p.concat(i.call(this,a))),p}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ee.lex(e,t??this.defaults)}parser(e,t){return te.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const i={...r},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return a(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 a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const p=o.hooks?o.hooks.provideLexer():e?ee.lex:ee.lexInline,l=o.hooks?o.hooks.provideParser():e?te.parse:te.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(c=>p(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>l(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(a);try{o.hooks&&(n=o.hooks.preprocess(n));let c=p(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let x=l(c,o);return o.hooks&&(x=o.hooks.postprocess(x)),x}catch(c){return a(c)}}}onError(e,t){return n=>{if(n.message+=` +Please report this to https://github.com/markedjs/marked.`,e){const r="

An error occurred:

"+ae(n.message+"",!0)+"
";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}}const de=new yr;function C(u,e){return de.parse(u,e)}C.options=C.setOptions=function(u){return de.setOptions(u),C.defaults=de.defaults,fn(C.defaults),C};C.getDefaults=kt;C.defaults=ge;C.use=function(...u){return de.use(...u),C.defaults=de.defaults,fn(C.defaults),C};C.walkTokens=function(u,e){return de.walkTokens(u,e)};C.parseInline=de.parseInline;C.Parser=te;C.parser=te.parse;C.Renderer=Qe;C.TextRenderer=Lt;C.Lexer=ee;C.lexer=ee.lex;C.Tokenizer=Ke;C.Hooks=Pe;C.parse=C;C.options;C.setOptions;C.use;C.walkTokens;C.parseInline;te.parse;ee.lex;/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:_n,setPrototypeOf:rn,isFrozen:Ar,getPrototypeOf:Tr,getOwnPropertyDescriptor:_r}=Object;let{freeze:X,seal:ne,create:Sn}=Object,{apply:xt,construct:wt}=typeof Reflect<"u"&&Reflect;X||(X=function(e){return e});ne||(ne=function(e){return e});xt||(xt=function(e,t,n){return e.apply(t,n)});wt||(wt=function(e,t){return new e(...t)});const je=V(Array.prototype.forEach),Sr=V(Array.prototype.lastIndexOf),sn=V(Array.prototype.pop),Ce=V(Array.prototype.push),Er=V(Array.prototype.splice),Xe=V(String.prototype.toLowerCase),ht=V(String.prototype.toString),on=V(String.prototype.match),ve=V(String.prototype.replace),Rr=V(String.prototype.indexOf),Lr=V(String.prototype.trim),ie=V(Object.prototype.hasOwnProperty),j=V(RegExp.prototype.test),De=Ir(TypeError);function V(u){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Xe;rn&&rn(u,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const i=t(r);i!==r&&(Ar(e)||(e[n]=i),r=i)}u[r]=!0}return u}function Cr(u){for(let e=0;e/gm),Nr=ne(/\$\{[\w\W]*/gm),Pr=ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),zr=ne(/^aria-[\-\w]+$/),En=ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),$r=ne(/^(?:\w+script|data):/i),Br=ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Rn=ne(/^html$/i),Ur=ne(/^[a-z][.\w]*(-[.\w]+)+$/i);var pn=Object.freeze({__proto__:null,ARIA_ATTR:zr,ATTR_WHITESPACE:Br,CUSTOM_ELEMENT:Ur,DATA_ATTR:Pr,DOCTYPE_NAME:Rn,ERB_EXPR:Mr,IS_ALLOWED_URI:En,IS_SCRIPT_OR_DATA:$r,MUSTACHE_EXPR:Or,TMPLIT_EXPR:Nr});const Me={element:1,text:3,progressingInstruction:7,comment:8,document:9},Hr=function(){return typeof window>"u"?null:window},Fr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},hn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ln(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hr();const e=g=>Ln(g);if(e.version="3.2.5",e.removed=[],!u||!u.document||u.document.nodeType!==Me.document||!u.Element)return e.isSupported=!1,e;let{document:t}=u;const n=t,r=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:a,Element:p,NodeFilter:l,NamedNodeMap:c=u.NamedNodeMap||u.MozNamedAttrMap,HTMLFormElement:x,DOMParser:m,trustedTypes:w}=u,R=p.prototype,E=Oe(R,"cloneNode"),B=Oe(R,"remove"),k=Oe(R,"nextSibling"),T=Oe(R,"childNodes"),I=Oe(R,"parentNode");if(typeof o=="function"){const g=t.createElement("template");g.content&&g.content.ownerDocument&&(t=g.content.ownerDocument)}let A,N="";const{implementation:z,createNodeIterator:G,createDocumentFragment:b,getElementsByTagName:y}=t,{importNode:D}=n;let d=hn();e.isSupported=typeof _n=="function"&&typeof I=="function"&&z&&z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:q,DATA_ATTR:J,ARIA_ATTR:re,IS_SCRIPT_OR_DATA:le,ATTR_WHITESPACE:pe,CUSTOM_ELEMENT:me}=pn;let{IS_ALLOWED_URI:$e}=pn,P=null;const It=_({},[...an,...ft,...dt,...gt,...ln]);let H=null;const Ct=_({},[...cn,...mt,...un,...Ze]);let $=Object.seal(Sn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),_e=null,tt=null,vt=!0,nt=!0,Dt=!1,Ot=!0,be=!1,rt=!0,he=!1,it=!1,st=!1,xe=!1,Be=!1,Ue=!1,Mt=!0,Nt=!1;const In="user-content-";let ot=!0,Se=!1,we={},ke=null;const Pt=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let zt=null;const $t=_({},["audio","video","img","source","image","track"]);let at=null;const Bt=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),He="http://www.w3.org/1998/Math/MathML",Fe="http://www.w3.org/2000/svg",ce="http://www.w3.org/1999/xhtml";let ye=ce,lt=!1,ct=null;const Cn=_({},[He,Fe,ce],ht);let Ge=_({},["mi","mo","mn","ms","mtext"]),We=_({},["annotation-xml"]);const vn=_({},["title","style","font","a","script"]);let Ee=null;const Dn=["application/xhtml+xml","text/html"],On="text/html";let U=null,Ae=null;const Mn=t.createElement("form"),Ut=function(s){return s instanceof RegExp||s instanceof Function},ut=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ae&&Ae===s)){if((!s||typeof s!="object")&&(s={}),s=fe(s),Ee=Dn.indexOf(s.PARSER_MEDIA_TYPE)===-1?On:s.PARSER_MEDIA_TYPE,U=Ee==="application/xhtml+xml"?ht:Xe,P=ie(s,"ALLOWED_TAGS")?_({},s.ALLOWED_TAGS,U):It,H=ie(s,"ALLOWED_ATTR")?_({},s.ALLOWED_ATTR,U):Ct,ct=ie(s,"ALLOWED_NAMESPACES")?_({},s.ALLOWED_NAMESPACES,ht):Cn,at=ie(s,"ADD_URI_SAFE_ATTR")?_(fe(Bt),s.ADD_URI_SAFE_ATTR,U):Bt,zt=ie(s,"ADD_DATA_URI_TAGS")?_(fe($t),s.ADD_DATA_URI_TAGS,U):$t,ke=ie(s,"FORBID_CONTENTS")?_({},s.FORBID_CONTENTS,U):Pt,_e=ie(s,"FORBID_TAGS")?_({},s.FORBID_TAGS,U):{},tt=ie(s,"FORBID_ATTR")?_({},s.FORBID_ATTR,U):{},we=ie(s,"USE_PROFILES")?s.USE_PROFILES:!1,vt=s.ALLOW_ARIA_ATTR!==!1,nt=s.ALLOW_DATA_ATTR!==!1,Dt=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=s.SAFE_FOR_TEMPLATES||!1,rt=s.SAFE_FOR_XML!==!1,he=s.WHOLE_DOCUMENT||!1,xe=s.RETURN_DOM||!1,Be=s.RETURN_DOM_FRAGMENT||!1,Ue=s.RETURN_TRUSTED_TYPE||!1,st=s.FORCE_BODY||!1,Mt=s.SANITIZE_DOM!==!1,Nt=s.SANITIZE_NAMED_PROPS||!1,ot=s.KEEP_CONTENT!==!1,Se=s.IN_PLACE||!1,$e=s.ALLOWED_URI_REGEXP||En,ye=s.NAMESPACE||ce,Ge=s.MATHML_TEXT_INTEGRATION_POINTS||Ge,We=s.HTML_INTEGRATION_POINTS||We,$=s.CUSTOM_ELEMENT_HANDLING||{},s.CUSTOM_ELEMENT_HANDLING&&Ut(s.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=s.CUSTOM_ELEMENT_HANDLING.tagNameCheck),s.CUSTOM_ELEMENT_HANDLING&&Ut(s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=s.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&($.allowCustomizedBuiltInElements=s.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),be&&(nt=!1),Be&&(xe=!0),we&&(P=_({},ln),H=[],we.html===!0&&(_(P,an),_(H,cn)),we.svg===!0&&(_(P,ft),_(H,mt),_(H,Ze)),we.svgFilters===!0&&(_(P,dt),_(H,mt),_(H,Ze)),we.mathMl===!0&&(_(P,gt),_(H,un),_(H,Ze))),s.ADD_TAGS&&(P===It&&(P=fe(P)),_(P,s.ADD_TAGS,U)),s.ADD_ATTR&&(H===Ct&&(H=fe(H)),_(H,s.ADD_ATTR,U)),s.ADD_URI_SAFE_ATTR&&_(at,s.ADD_URI_SAFE_ATTR,U),s.FORBID_CONTENTS&&(ke===Pt&&(ke=fe(ke)),_(ke,s.FORBID_CONTENTS,U)),ot&&(P["#text"]=!0),he&&_(P,["html","head","body"]),P.table&&(_(P,["tbody"]),delete _e.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=s.TRUSTED_TYPES_POLICY,N=A.createHTML("")}else A===void 0&&(A=Fr(w,r)),A!==null&&typeof N=="string"&&(N=A.createHTML(""));X&&X(s),Ae=s}},Ht=_({},[...ft,...dt,...vr]),Ft=_({},[...gt,...Dr]),Nn=function(s){let h=I(s);(!h||!h.tagName)&&(h={namespaceURI:ye,tagName:"template"});const f=Xe(s.tagName),M=Xe(h.tagName);return ct[s.namespaceURI]?s.namespaceURI===Fe?h.namespaceURI===ce?f==="svg":h.namespaceURI===He?f==="svg"&&(M==="annotation-xml"||Ge[M]):!!Ht[f]:s.namespaceURI===He?h.namespaceURI===ce?f==="math":h.namespaceURI===Fe?f==="math"&&We[M]:!!Ft[f]:s.namespaceURI===ce?h.namespaceURI===Fe&&!We[M]||h.namespaceURI===He&&!Ge[M]?!1:!Ft[f]&&(vn[f]||!Ht[f]):!!(Ee==="application/xhtml+xml"&&ct[s.namespaceURI]):!1},se=function(s){Ce(e.removed,{element:s});try{I(s).removeChild(s)}catch{B(s)}},qe=function(s,h){try{Ce(e.removed,{attribute:h.getAttributeNode(s),from:h})}catch{Ce(e.removed,{attribute:null,from:h})}if(h.removeAttribute(s),s==="is")if(xe||Be)try{se(h)}catch{}else try{h.setAttribute(s,"")}catch{}},Gt=function(s){let h=null,f=null;if(st)s=""+s;else{const F=on(s,/^[\r\n\t ]+/);f=F&&F[0]}Ee==="application/xhtml+xml"&&ye===ce&&(s=''+s+"");const M=A?A.createHTML(s):s;if(ye===ce)try{h=new m().parseFromString(M,Ee)}catch{}if(!h||!h.documentElement){h=z.createDocument(ye,"template",null);try{h.documentElement.innerHTML=lt?N:M}catch{}}const W=h.body||h.documentElement;return s&&f&&W.insertBefore(t.createTextNode(f),W.childNodes[0]||null),ye===ce?y.call(h,he?"html":"body")[0]:he?h.documentElement:W},Wt=function(s){return G.call(s.ownerDocument||s,s,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},pt=function(s){return s instanceof x&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof c)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},qt=function(s){return typeof a=="function"&&s instanceof a};function ue(g,s,h){je(g,f=>{f.call(e,s,h,Ae)})}const Yt=function(s){let h=null;if(ue(d.beforeSanitizeElements,s,null),pt(s))return se(s),!0;const f=U(s.nodeName);if(ue(d.uponSanitizeElement,s,{tagName:f,allowedTags:P}),s.hasChildNodes()&&!qt(s.firstElementChild)&&j(/<[/\w!]/g,s.innerHTML)&&j(/<[/\w!]/g,s.textContent)||s.nodeType===Me.progressingInstruction||rt&&s.nodeType===Me.comment&&j(/<[/\w]/g,s.data))return se(s),!0;if(!P[f]||_e[f]){if(!_e[f]&&Zt(f)&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f)))return!1;if(ot&&!ke[f]){const M=I(s)||s.parentNode,W=T(s)||s.childNodes;if(W&&M){const F=W.length;for(let K=F-1;K>=0;--K){const oe=E(W[K],!0);oe.__removalCount=(s.__removalCount||0)+1,M.insertBefore(oe,k(s))}}}return se(s),!0}return s instanceof p&&!Nn(s)||(f==="noscript"||f==="noembed"||f==="noframes")&&j(/<\/no(script|embed|frames)/i,s.innerHTML)?(se(s),!0):(be&&s.nodeType===Me.text&&(h=s.textContent,je([v,O,q],M=>{h=ve(h,M," ")}),s.textContent!==h&&(Ce(e.removed,{element:s.cloneNode()}),s.textContent=h)),ue(d.afterSanitizeElements,s,null),!1)},jt=function(s,h,f){if(Mt&&(h==="id"||h==="name")&&(f in t||f in Mn))return!1;if(!(nt&&!tt[h]&&j(J,h))){if(!(vt&&j(re,h))){if(!H[h]||tt[h]){if(!(Zt(s)&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,s)||$.tagNameCheck instanceof Function&&$.tagNameCheck(s))&&($.attributeNameCheck instanceof RegExp&&j($.attributeNameCheck,h)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(h))||h==="is"&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&j($.tagNameCheck,f)||$.tagNameCheck instanceof Function&&$.tagNameCheck(f))))return!1}else if(!at[h]){if(!j($e,ve(f,pe,""))){if(!((h==="src"||h==="xlink:href"||h==="href")&&s!=="script"&&Rr(f,"data:")===0&&zt[s])){if(!(Dt&&!j(le,ve(f,pe,"")))){if(f)return!1}}}}}}return!0},Zt=function(s){return s!=="annotation-xml"&&on(s,me)},Xt=function(s){ue(d.beforeSanitizeAttributes,s,null);const{attributes:h}=s;if(!h||pt(s))return;const f={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:H,forceKeepAttr:void 0};let M=h.length;for(;M--;){const W=h[M],{name:F,namespaceURI:K,value:oe}=W,Re=U(F);let Y=F==="value"?oe:Lr(oe);if(f.attrName=Re,f.attrValue=Y,f.keepAttr=!0,f.forceKeepAttr=void 0,ue(d.uponSanitizeAttribute,s,f),Y=f.attrValue,Nt&&(Re==="id"||Re==="name")&&(qe(F,s),Y=In+Y),rt&&j(/((--!?|])>)|<\/(style|title)/i,Y)){qe(F,s);continue}if(f.forceKeepAttr||(qe(F,s),!f.keepAttr))continue;if(!Ot&&j(/\/>/i,Y)){qe(F,s);continue}be&&je([v,O,q],Kt=>{Y=ve(Y,Kt," ")});const Vt=U(s.nodeName);if(jt(Vt,Re,Y)){if(A&&typeof w=="object"&&typeof w.getAttributeType=="function"&&!K)switch(w.getAttributeType(Vt,Re)){case"TrustedHTML":{Y=A.createHTML(Y);break}case"TrustedScriptURL":{Y=A.createScriptURL(Y);break}}try{K?s.setAttributeNS(K,F,Y):s.setAttribute(F,Y),pt(s)?se(s):sn(e.removed)}catch{}}}ue(d.afterSanitizeAttributes,s,null)},Pn=function g(s){let h=null;const f=Wt(s);for(ue(d.beforeSanitizeShadowDOM,s,null);h=f.nextNode();)ue(d.uponSanitizeShadowNode,h,null),Yt(h),Xt(h),h.content instanceof i&&g(h.content);ue(d.afterSanitizeShadowDOM,s,null)};return e.sanitize=function(g){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=null,f=null,M=null,W=null;if(lt=!g,lt&&(g=""),typeof g!="string"&&!qt(g))if(typeof g.toString=="function"){if(g=g.toString(),typeof g!="string")throw De("dirty is not a string, aborting")}else throw De("toString is not a function");if(!e.isSupported)return g;if(it||ut(s),e.removed=[],typeof g=="string"&&(Se=!1),Se){if(g.nodeName){const oe=U(g.nodeName);if(!P[oe]||_e[oe])throw De("root node is forbidden and cannot be sanitized in-place")}}else if(g instanceof a)h=Gt(""),f=h.ownerDocument.importNode(g,!0),f.nodeType===Me.element&&f.nodeName==="BODY"||f.nodeName==="HTML"?h=f:h.appendChild(f);else{if(!xe&&!be&&!he&&g.indexOf("<")===-1)return A&&Ue?A.createHTML(g):g;if(h=Gt(g),!h)return xe?null:Ue?N:""}h&&st&&se(h.firstChild);const F=Wt(Se?g:h);for(;M=F.nextNode();)Yt(M),Xt(M),M.content instanceof i&&Pn(M.content);if(Se)return g;if(xe){if(Be)for(W=b.call(h.ownerDocument);h.firstChild;)W.appendChild(h.firstChild);else W=h;return(H.shadowroot||H.shadowrootmode)&&(W=D.call(n,W,!0)),W}let K=he?h.outerHTML:h.innerHTML;return he&&P["!doctype"]&&h.ownerDocument&&h.ownerDocument.doctype&&h.ownerDocument.doctype.name&&j(Rn,h.ownerDocument.doctype.name)&&(K=" +`+K),be&&je([v,O,q],oe=>{K=ve(K,oe," ")}),A&&Ue?A.createHTML(K):K},e.setConfig=function(){let g=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ut(g),it=!0},e.clearConfig=function(){Ae=null,it=!1},e.isValidAttribute=function(g,s,h){Ae||ut({});const f=U(g),M=U(s);return jt(f,M,h)},e.addHook=function(g,s){typeof s=="function"&&Ce(d[g],s)},e.removeHook=function(g,s){if(s!==void 0){const h=Sr(d[g],s);return h===-1?void 0:Er(d[g],h,1)[0]}return sn(d[g])},e.removeHooks=function(g){d[g]=[]},e.removeAllHooks=function(){d=hn()},e}var Gr=Ln();const Wr=()=>{let u=!1,e=!1;const t="com.markdownlivepreview",n="last_state",r="scroll_bar_settings",i="Are you sure you want to reset? Your changes will be lost.",o=`# Markdown syntax guide ## Headers @@ -64,10 +64,10 @@ Please report this to https://github.com/markedjs/marked.`,e){const r="

An err ## Emphasis -*This text will be italic* +*This text will be italic* _This will also be italic_ -**This text will be bold** +**This text will be bold** __This will also be bold__ _You **can** combine them_ @@ -123,4 +123,4 @@ alert(message); ## Inline code This web site is using \`markedjs/marked\`. -`;self.MonacoEnvironment={getWorker(b,y){return new Proxy({},{get:()=>()=>{}})}};let a=()=>{let b=Bn.editor.create(document.querySelector("#editor"),{fontSize:14,language:"markdown",minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible"},wordWrap:"on",hover:{enabled:!1},quickSuggestions:!1,suggestOnTriggerCharacters:!1,folding:!1});return b.onDidChangeModelContent(()=>{b.getValue()!=o&&(u=!0);let v=b.getValue();p(v),w(v)}),b.onDidScrollChange(y=>{if(!e)return;const v=y.scrollTop,d=y.scrollHeight,N=b.getLayoutInfo().height,D=d-N,q=v/D;let J=document.querySelector("#preview"),re=(J.scrollHeight-J.clientHeight)*q;J.scrollTo(0,re)}),b},p=b=>{let y={headerIds:!1,mangle:!1},v=C.parse(b,y),d=Gr.sanitize(v);document.querySelector("#output").innerHTML=d},l=()=>{let b=z.getValue()!=o;if(u||b){var y=window.confirm(i);if(!y)return}c(o),document.querySelectorAll(".column").forEach(v=>{v.scrollTo({top:0})})},c=b=>{z.setValue(b),z.revealPosition({lineNumber:1,column:1}),z.focus(),u=!1},x=b=>{let y=document.querySelector("#sync-scroll-checkbox");y.checked=b,e=b,y.addEventListener("change",v=>{let d=v.currentTarget.checked;e=d,I(d)})},m=(b,y,v)=>{navigator.clipboard.writeText(b).then(()=>{y()},()=>{})},k=()=>{let b=document.querySelector("#copy-button a");b.innerHTML="Copied!",setTimeout(()=>{b.innerHTML="Copy"},1e3)},R=()=>{document.querySelector("#reset-button").addEventListener("click",b=>{b.preventDefault(),l()})},E=b=>{document.querySelector("#copy-button").addEventListener("click",y=>{y.preventDefault();let v=b.getValue();m(v,()=>{k()})})},B=()=>Te.getItem(t,n),w=b=>{let y=new Date(2099,1,1);Te.setItem(t,n,b,y)},T=()=>Te.getItem(t,r),I=b=>{let y=new Date(2099,1,1);Te.setItem(t,r,b,y)},A=()=>{let b=.5;const y=document.getElementById("split-divider"),v=document.getElementById("edit"),d=document.getElementById("preview"),N=document.getElementById("container");let D=!1;y.addEventListener("mouseenter",()=>{y.classList.add("hover")}),y.addEventListener("mouseleave",()=>{D||y.classList.remove("hover")}),y.addEventListener("mousedown",()=>{D=!0,y.classList.add("active"),document.body.style.cursor="col-resize"}),y.addEventListener("dblclick",()=>{const J=N.getBoundingClientRect().width,re=y.offsetWidth,le=(J-re)/2;v.style.width=le+"px",d.style.width=le+"px"}),document.addEventListener("mousemove",q=>{if(!D)return;document.body.style.userSelect="none";const J=N.getBoundingClientRect(),re=J.width,le=q.clientX-J.left,pe=y.offsetWidth,me=100,$e=re-me-pe,P=Math.max(me,Math.min(le,$e));v.style.width=P+"px",d.style.width=re-P-pe+"px",b=P/(re-pe)}),document.addEventListener("mouseup",()=>{D&&(D=!1,y.classList.remove("active"),y.classList.remove("hover"),document.body.style.cursor="default",document.body.style.userSelect="")}),window.addEventListener("resize",()=>{const J=N.getBoundingClientRect().width,re=y.offsetWidth,le=J-re,pe=le*b,me=le*(1-b);v.style.width=pe+"px",d.style.width=me+"px"})},M=B(),z=a();c(M||o),R(),E(z);let G=T()||!1;x(G),A()};window.addEventListener("load",()=>{Wr()}); +`;self.MonacoEnvironment={getWorker(b,y){return new Proxy({},{get:()=>()=>{}})}};let a=()=>{let b=Bn.editor.create(document.querySelector("#editor"),{fontSize:14,language:"markdown",minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,scrollbar:{vertical:"visible",horizontal:"visible"},wordWrap:"on",hover:{enabled:!1},quickSuggestions:!1,suggestOnTriggerCharacters:!1,folding:!1});return b.onDidChangeModelContent(()=>{b.getValue()!=o&&(u=!0);let D=b.getValue();p(D),k(D)}),b.onDidScrollChange(y=>{if(!e)return;const D=y.scrollTop,d=y.scrollHeight,v=b.getLayoutInfo().height,O=d-v,q=D/O;let J=document.querySelector("#preview"),re=(J.scrollHeight-J.clientHeight)*q;J.scrollTo(0,re)}),b},p=b=>{let y={headerIds:!1,mangle:!1},D=C.parse(b,y),d=Gr.sanitize(D);const v=document.querySelector("#output");v.innerHTML=d,window.renderMathInElement&&renderMathInElement(v,{delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1}],throwOnError:!1})},l=()=>{let b=z.getValue()!=o;if(u||b){var y=window.confirm(i);if(!y)return}c(o),document.querySelectorAll(".column").forEach(D=>{D.scrollTo({top:0})})},c=b=>{z.setValue(b),z.revealPosition({lineNumber:1,column:1}),z.focus(),u=!1},x=b=>{let y=document.querySelector("#sync-scroll-checkbox");y.checked=b,e=b,y.addEventListener("change",D=>{let d=D.currentTarget.checked;e=d,I(d)})},m=(b,y,D)=>{navigator.clipboard.writeText(b).then(()=>{y()},()=>{})},w=()=>{let b=document.querySelector("#copy-button a");b.innerHTML="Copied!",setTimeout(()=>{b.innerHTML="Copy"},1e3)},R=()=>{document.querySelector("#reset-button").addEventListener("click",b=>{b.preventDefault(),l()})},E=b=>{document.querySelector("#copy-button").addEventListener("click",y=>{y.preventDefault();let D=b.getValue();m(D,()=>{w()})})},B=()=>Te.getItem(t,n),k=b=>{let y=new Date(2099,1,1);Te.setItem(t,n,b,y)},T=()=>Te.getItem(t,r),I=b=>{let y=new Date(2099,1,1);Te.setItem(t,r,b,y)},A=()=>{let b=.5;const y=document.getElementById("split-divider"),D=document.getElementById("edit"),d=document.getElementById("preview"),v=document.getElementById("container");let O=!1;y.addEventListener("mouseenter",()=>{y.classList.add("hover")}),y.addEventListener("mouseleave",()=>{O||y.classList.remove("hover")}),y.addEventListener("mousedown",()=>{O=!0,y.classList.add("active"),document.body.style.cursor="col-resize"}),y.addEventListener("dblclick",()=>{const J=v.getBoundingClientRect().width,re=y.offsetWidth,le=(J-re)/2;D.style.width=le+"px",d.style.width=le+"px"}),document.addEventListener("mousemove",q=>{if(!O)return;document.body.style.userSelect="none";const J=v.getBoundingClientRect(),re=J.width,le=q.clientX-J.left,pe=y.offsetWidth,me=100,$e=re-me-pe,P=Math.max(me,Math.min(le,$e));D.style.width=P+"px",d.style.width=re-P-pe+"px",b=P/(re-pe)}),document.addEventListener("mouseup",()=>{O&&(O=!1,y.classList.remove("active"),y.classList.remove("hover"),document.body.style.cursor="default",document.body.style.userSelect="")}),window.addEventListener("resize",()=>{const J=v.getBoundingClientRect().width,re=y.offsetWidth,le=J-re,pe=le*b,me=le*(1-b);D.style.width=pe+"px",d.style.width=me+"px"})},N=B(),z=a();c(N||o),R(),E(z);let G=T()||!1;x(G),A()};window.addEventListener("load",()=>{Wr()}); diff --git a/dist/index.html b/dist/index.html index 8470464..0b29e26 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1,56 +1,67 @@ - + + Markdown Live Preview + + - Markdown Live Preview - + + + + + + - + -

-
- -
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
diff --git a/index.html b/index.html index afbee53..22becd6 100644 --- a/index.html +++ b/index.html @@ -1,55 +1,66 @@ - + + Markdown Live Preview + + + - Markdown Live Preview + + + + - + -
-
- -
-
-
-
+
+
+
+
-
+
-
-
-
-
+
+
+
+
diff --git a/src/main.js b/src/main.js index 2aa4626..6e13667 100644 --- a/src/main.js +++ b/src/main.js @@ -23,10 +23,10 @@ const init = () => { ## Emphasis -*This text will be italic* +*This text will be italic* _This will also be italic_ -**This text will be bold** +**This text will be bold** __This will also be bold__ _You **can** combine them_ @@ -145,8 +145,25 @@ This web site is using ${"`"}markedjs/marked${"`"}. mangle: false }; let html = marked.parse(markdown, options); + + // Sanitize first let sanitized = DOMPurify.sanitize(html); - document.querySelector('#output').innerHTML = sanitized; + + // Inject sanitized HTML into the DOM + const outputElement = document.querySelector('#output'); + outputElement.innerHTML = sanitized; + + // Render math using KaTeX + if (window.renderMathInElement) { + renderMathInElement(outputElement, { + // These delimiters match LaTeX-style math in Markdown + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: false } + ], + throwOnError: false + }); + } }; // Reset input text