UNPKG

code-server

Version:

Run VS Code on a remote server.

73 lines • 52.5 kB
import{c as $e,d as Se}from"./chunk-EIVI6XHZ.js";import{r as Q}from"./chunk-5FA4L7EO.js";import{H as N,K as G,M as ye,N as Te,u as we}from"./chunk-XL5YO2U3.js";import{b as H,h as R}from"./chunk-3CEAP2V5.js";import{a as x}from"./chunk-6LQNQPBM.js";import{a as me,c as be}from"./chunk-OOJM4CTU.js";var ve=me((U,K)=>{(function(r){"use strict";var e=function(){},n=r.requestAnimationFrame||r.webkitRequestAnimationFrame||r.mozRequestAnimationFrame||r.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function s(){var c=this;c.reads=[],c.writes=[],c.raf=n.bind(r),e("initialized",c)}s.prototype={constructor:s,runTasks:function(c){e("run tasks");for(var p;p=c.shift();)p()},measure:function(c,p){e("measure");var h=p?c.bind(p):c;return this.reads.push(h),t(this),h},mutate:function(c,p){e("mutate");var h=p?c.bind(p):c;return this.writes.push(h),t(this),h},clear:function(c){return e("clear",c),i(this.reads,c)||i(this.writes,c)},extend:function(c){if(e("extend",c),typeof c!="object")throw new Error("expected object");var p=Object.create(this);return a(p,c),p.fastdom=this,p.initialize&&p.initialize(),p},catch:null};function t(c){c.scheduled||(c.scheduled=!0,c.raf(l.bind(null,c)),e("flush scheduled"))}function l(c){e("flush");var p=c.writes,h=c.reads,u;try{e("flushing reads",h.length),c.runTasks(h),e("flushing writes",p.length),c.runTasks(p)}catch(f){u=f}if(c.scheduled=!1,(h.length||p.length)&&t(c),u)if(e("task errored",u.message),c.catch)c.catch(u);else throw u}function i(c,p){var h=c.indexOf(p);return!!~h&&!!c.splice(h,1)}function a(c,p){for(var h in p)p.hasOwnProperty(h)&&(c[h]=p[h])}var o=r.fastdom=r.fastdom||new s;typeof define=="function"?define(function(){return o}):typeof K=="object"&&(K.exports=o)})(typeof window<"u"?window:typeof U<"u"?U:globalThis)});var ze=me((Vt,X)=>{(function(){var r={initialize:function(){this._tasks=new Map},mutate:function(n,s){return e(this,"mutate",n,s)},measure:function(n,s){return e(this,"measure",n,s)},clear:function(n){var s=this._tasks,t=s.get(n);this.fastdom.clear(t),s.delete(n)}};function e(n,s,t,l){var i=n._tasks,a=n.fastdom,o,c=new Promise(function(p,h){o=a[s](function(){i.delete(c);try{p(l?t.call(l):t())}catch(u){h(u)}},l)});return i.set(c,o),c}(typeof define)[0]=="f"?define(function(){return r}):(typeof X)[0]=="o"?X.exports=r:window.fastdomPromised=r})()});function Re(r){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var s=Array.from(typeof r=="string"?[r]:r);s[s.length-1]=s[s.length-1].replace(/\r?\n([\t ]*)$/,"");var t=s.reduce(function(a,o){var c=o.match(/\n([\t ]+|(?!\s).)/g);return c?a.concat(c.map(function(p){var h,u;return(u=(h=p.match(/[\t ]/g))===null||h===void 0?void 0:h.length)!==null&&u!==void 0?u:0})):a},[]);if(t.length){var l=new RegExp(`
[	 ]{`+Math.min.apply(Math,t)+"}","g");s=s.map(function(a){return a.replace(l,`
`)})}s[0]=s[0].replace(/^\r?\n/,"");var i=s[0];return e.forEach(function(a,o){var c=i.match(/(?:^|\n)( *)$/),p=c?c[1]:"",h=a;typeof a=="string"&&a.includes(`
`)&&(h=String(a).split(`
`).map(function(u,f){return f===0?u:""+p+u}).join(`
`)),i+=h+s[o+1]}),i}var Ge=be(ve(),1),Qe=be(ze(),1);function ee(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S=ee();function Be(r){S=r}var P={exec:()=>null};function d(r,e=""){let n=typeof r=="string"?r:r.source,s={replace:(t,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(b.caret,"$1"),n=n.replace(t,i),s},getRegex:()=>new RegExp(n,e)};return s}var at=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),b={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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,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:r=>new RegExp(`^( {0,3}${r})((?:[	 ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},ot=/^(?:[ \t]*(?:\n|$))+/,ct=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,pt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ht=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,te=/(?:[*+-]|\d{1,9}[.)])/,Ce=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Me=d(Ce).replace(/bull/g,te).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(),ut=d(Ce).replace(/bull/g,te).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(),re=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ft=/^[^\n]+/,ne=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,gt=d(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ne).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),dt=d(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,te).getRegex(),q="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",se=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,kt=d("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",se).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qe=d(re).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),xt=d(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qe).getRegex(),ie={blockquote:xt,code:ct,def:gt,fences:pt,heading:ht,hr:E,html:kt,lheading:Me,list:dt,newline:ot,paragraph:qe,table:P,text:ft},Ae=d("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}	)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),mt={...ie,lheading:ut,table:Ae,paragraph:d(re).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ae).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex()},bt={...ie,html:d(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:d(re).replace("hr",E).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Me).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Oe=/^( {2,}|\\)\n(?!\s*$)/,Tt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,O=/[\p{P}\p{S}]/u,le=/[\s\p{P}\p{S}]/u,je=/[^\s\p{P}\p{S}]/u,$t=d(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,le).getRegex(),Fe=/(?!~)[\p{P}\p{S}]/u,St=/(?!~)[\s\p{P}\p{S}]/u,Rt=/(?:[^\s\p{P}\p{S}]|~)/u,vt=d(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",at?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),We=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,zt=d(We,"u").replace(/punct/g,O).getRegex(),At=d(We,"u").replace(/punct/g,Fe).getRegex(),Ze="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Lt=d(Ze,"gu").replace(/notPunctSpace/g,je).replace(/punctSpace/g,le).replace(/punct/g,O).getRegex(),_t=d(Ze,"gu").replace(/notPunctSpace/g,Rt).replace(/punctSpace/g,St).replace(/punct/g,Fe).getRegex(),Pt=d("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,je).replace(/punctSpace/g,le).replace(/punct/g,O).getRegex(),Et=d(/\\(punct)/,"gu").replace(/punct/g,O).getRegex(),It=d(/^<(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(),Bt=d(se).replace("(?:-->|$)","-->").getRegex(),Ct=d("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Bt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),B=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Mt=d(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",B).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),De=d(/^!?\[(label)\]\[(ref)\]/).replace("label",B).replace("ref",ne).getRegex(),He=d(/^!?\[(ref)\](?:\[\])?/).replace("ref",ne).getRegex(),qt=d("reflink|nolink(?!\\()","g").replace("reflink",De).replace("nolink",He).getRegex(),Le=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ae={_backpedal:P,anyPunctuation:Et,autolink:It,blockSkip:vt,br:Oe,code:yt,del:P,emStrongLDelim:zt,emStrongRDelimAst:Lt,emStrongRDelimUnd:Pt,escape:wt,link:Mt,nolink:He,punctuation:$t,reflink:De,reflinkSearch:qt,tag:Ct,text:Tt,url:P},Ot={...ae,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",B).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",B).getRegex()},V={...ae,emStrongRDelimAst:_t,emStrongLDelim:At,url:d(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Le).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:d(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Le).getRegex()},jt={...V,br:d(Oe).replace("{2,}","*").getRegex(),text:d(V.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I={normal:ie,gfm:mt,pedantic:bt},A={normal:ae,gfm:V,breaks:jt,pedantic:Ot},Ft={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},_e=r=>Ft[r];function T(r,e){if(e){if(b.escapeTest.test(r))return r.replace(b.escapeReplace,_e)}else if(b.escapeTestNoEncode.test(r))return r.replace(b.escapeReplaceNoEncode,_e);return r}function Pe(r){try{r=encodeURI(r).replace(b.percentDecode,"%")}catch{return null}return r}function Ee(r,e){let n=r.replace(b.findPipe,(l,i,a)=>{let o=!1,c=i;for(;--c>=0&&a[c]==="\\";)o=!o;return o?"|":" |"}),s=n.split(b.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(b.slashPipe,"|");return s}function L(r,e,n){let s=r.length;if(s===0)return"";let t=0;for(;t<s;){let l=r.charAt(s-t-1);if(l===e&&!n)t++;else if(l!==e&&n)t++;else break}return r.slice(0,s-t)}function Wt(r,e){if(r.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<r.length;s++)if(r[s]==="\\")s++;else if(r[s]===e[0])n++;else if(r[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Ie(r,e,n,s,t){let l=e.href,i=e.title||null,a=r[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:r[0].charAt(0)==="!"?"image":"link",raw:n,href:l,title:i,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,o}function Zt(r,e,n){let s=r.match(n.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
`).map(l=>{let i=l.match(n.other.beginningSpace);if(i===null)return l;let[a]=i;return a.length>=t.length?l.slice(t.length):l}).join(`
`)}var C=class{options;rules;lexer;constructor(r){this.options=r||S}space(r){let e=this.rules.block.newline.exec(r);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(r){let e=this.rules.block.code.exec(r);if(e){let n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:L(n,`
`)}}}fences(r){let e=this.rules.block.fences.exec(r);if(e){let n=e[0],s=Zt(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(r){let e=this.rules.block.heading.exec(r);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=L(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(r){let e=this.rules.block.hr.exec(r);if(e)return{type:"hr",raw:L(e[0],`
`)}}blockquote(r){let e=this.rules.block.blockquote.exec(r);if(e){let n=L(e[0],`
`).split(`
`),s="",t="",l=[];for(;n.length>0;){let i=!1,a=[],o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))a.push(n[o]),i=!0;else if(!i)a.push(n[o]);else break;n=n.slice(o);let c=a.join(`
`),p=c.replace(this.rules.other.blockquoteSetextReplace,`
    $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
${c}`:c,t=t?`${t}
${p}`:p;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,l,!0),this.lexer.state.top=h,n.length===0)break;let u=l.at(-1);if(u?.type==="code")break;if(u?.type==="blockquote"){let f=u,g=f.raw+`
`+n.join(`
`),m=this.blockquote(g);l[l.length-1]=m,s=s.substring(0,s.length-f.raw.length)+m.raw,t=t.substring(0,t.length-f.text.length)+m.text;break}else if(u?.type==="list"){let f=u,g=f.raw+`
`+n.join(`
`),m=this.list(g);l[l.length-1]=m,s=s.substring(0,s.length-u.raw.length)+m.raw,t=t.substring(0,t.length-f.raw.length)+m.raw,n=g.substring(l.at(-1).raw.length).split(`
`);continue}}return{type:"blockquote",raw:s,tokens:l,text:t}}}list(r){let e=this.rules.block.list.exec(r);if(e){let n=e[1].trim(),s=n.length>1,t={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let l=this.rules.other.listItemRegex(n),i=!1;for(;r;){let o=!1,c="",p="";if(!(e=l.exec(r))||this.rules.block.hr.test(r))break;c=e[0],r=r.substring(c.length);let h=e[2].split(`
`,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),u=r.split(`
`,1)[0],f=!h.trim(),g=0;if(this.options.pedantic?(g=2,p=h.trimStart()):f?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=h.slice(g),g+=e[1].length),f&&this.rules.other.blankLine.test(u)&&(c+=u+`
`,r=r.substring(u.length+1),o=!0),!o){let Z=this.rules.other.nextBulletRegex(g),de=this.rules.other.hrRegex(g),ke=this.rules.other.fencesBeginRegex(g),xe=this.rules.other.headingBeginRegex(g),lt=this.rules.other.htmlBeginRegex(g);for(;r;){let D=r.split(`
`,1)[0],z;if(u=D,this.options.pedantic?(u=u.replace(this.rules.other.listReplaceNesting,"  "),z=u):z=u.replace(this.rules.other.tabCharGlobal,"    "),ke.test(u)||xe.test(u)||lt.test(u)||Z.test(u)||de.test(u))break;if(z.search(this.rules.other.nonSpaceChar)>=g||!u.trim())p+=`
`+z.slice(g);else{if(f||h.replace(this.rules.other.tabCharGlobal,"    ").search(this.rules.other.nonSpaceChar)>=4||ke.test(h)||xe.test(h)||de.test(h))break;p+=`
`+u}!f&&!u.trim()&&(f=!0),c+=D+`
`,r=r.substring(D.length+1),h=z.slice(g)}}t.loose||(i?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let m=null,ge;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(ge=m[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:c,task:!!m,checked:ge,loose:!1,text:p,tokens:[]}),t.raw+=c}let a=t.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let o=0;o<t.items.length;o++)if(this.lexer.state.top=!1,t.items[o].tokens=this.lexer.blockTokens(t.items[o].text,[]),!t.loose){let c=t.items[o].tokens.filter(h=>h.type==="space"),p=c.length>0&&c.some(h=>this.rules.other.anyLine.test(h.raw));t.loose=p}if(t.loose)for(let o=0;o<t.items.length;o++)t.items[o].loose=!0;return t}}html(r){let e=this.rules.block.html.exec(r);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(r){let e=this.rules.block.def.exec(r);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:t}}}table(r){let e=this.rules.block.table.exec(r);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Ee(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
`):[],l={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?l.align.push("right"):this.rules.other.tableAlignCenter.test(i)?l.align.push("center"):this.rules.other.tableAlignLeft.test(i)?l.align.push("left"):l.align.push(null);for(let i=0;i<n.length;i++)l.header.push({text:n[i],tokens:this.lexer.inline(n[i]),header:!0,align:l.align[i]});for(let i of t)l.rows.push(Ee(i,l.header.length).map((a,o)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:l.align[o]})));return l}}lheading(r){let e=this.rules.block.lheading.exec(r);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(r){let e=this.rules.block.paragraph.exec(r);if(e){let n=e[1].charAt(e[1].length-1)===`
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(r){let e=this.rules.block.text.exec(r);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(r){let e=this.rules.inline.escape.exec(r);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(r){let e=this.rules.inline.tag.exec(r);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(r){let e=this.rules.inline.link.exec(r);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let l=L(n.slice(0,-1),"\\");if((n.length-l.length)%2===0)return}else{let l=Wt(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],t=l[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),Ie(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(r,e){let n;if((n=this.rules.inline.reflink.exec(r))||(n=this.rules.inline.nolink.exec(r))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let l=n[0].charAt(0);return{type:"text",raw:l,text:l}}return Ie(n,t,n[0],this.lexer,this.rules)}}emStrong(r,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(r);if(!(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!n||this.rules.inline.punctuation.exec(n))){let t=[...s[0]].length-1,l,i,a=t,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*r.length+t);(s=c.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){a+=i;continue}else if((s[5]||s[6])&&t%3&&!((t+i)%3)){o+=i;continue}if(a-=i,a>0)continue;i=Math.min(i,i+a+o);let p=[...s[0]][0].length,h=r.slice(0,t+s.index+p+i);if(Math.min(t,i)%2){let f=h.slice(1,-1);return{type:"em",raw:h,text:f,tokens:this.lexer.inlineTokens(f)}}let u=h.slice(2,-2);return{type:"strong",raw:h,text:u,tokens:this.lexer.inlineTokens(u)}}}}codespan(r){let e=this.rules.inline.code.exec(r);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),t=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&t&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(r){let e=this.rules.inline.br.exec(r);if(e)return{type:"br",raw:e[0]}}del(r){let e=this.rules.inline.del.exec(r);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(r){let e=this.rules.inline.autolink.exec(r);if(e){let n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(r){let e;if(e=this.rules.inline.url.exec(r)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(r){let e=this.rules.inline.text.exec(r);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},w=class Y{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||S,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:b,block:I.normal,inline:A.normal};this.options.pedantic?(n.block=I.pedantic,n.inline=A.pedantic):this.options.gfm&&(n.block=I.gfm,this.options.breaks?n.inline=A.breaks:n.inline=A.gfm),this.tokenizer.rules=n}static get rules(){return{block:I,inline:A}}static lex(e,n){return new Y(n).lex(e)}static lexInline(e,n){return new Y(n).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal,"    ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(i=>(t=i.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let i=n.at(-1);t.raw.length===1&&i!==void 0?i.raw+=`
`:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+t.raw,i.text+=`
`+t.text,this.inlineQueue.at(-1).src=i.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let i=n.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+t.raw,i.text+=`
`+t.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},n.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}let l=e;if(this.options.extensions?.startBlock){let i=1/0,a=e.slice(1),o;this.options.extensions.startBlock.forEach(c=>{o=c.call({lexer:this},a),typeof o=="number"&&o>=0&&(i=Math.min(i,o))}),i<1/0&&i>=0&&(l=e.substring(0,i+1))}if(this.state.top&&(t=this.tokenizer.paragraph(l))){let i=n.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+t.raw,i.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(t),s=l.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let i=n.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
`)?"":`
`)+t.raw,i.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):n.push(t);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,t=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)o.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l;for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)l=t[2]?t[2].length:0,s=s.slice(0,t.index+l)+"["+"a".repeat(t[0].length-l-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,a="";for(;e;){i||(a=""),i=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,n))?(e=e.substring(o.raw.length),n.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=n.at(-1);o.type==="text"&&p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):n.push(o);continue}if(o=this.tokenizer.emStrong(e,s,a)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),n.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),n.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),n.push(o);continue}let c=e;if(this.options.extensions?.startInline){let p=1/0,h=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(p=Math.min(p,u))}),p<1/0&&p>=0&&(c=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(c)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(a=o.raw.slice(-1)),i=!0;let p=n.at(-1);p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):n.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},M=class{options;parser;constructor(r){this.options=r||S}space(r){return""}code({text:r,lang:e,escaped:n}){let s=(e||"").match(b.notSpaceStart)?.[0],t=r.replace(b.endingNewline,"")+`
`;return s?'<pre><code class="language-'+T(s)+'">'+(n?t:T(t,!0))+`</code></pre>
`:"<pre><code>"+(n?t:T(t,!0))+`</code></pre>
`}blockquote({tokens:r}){return`<blockquote>
${this.parser.parse(r)}</blockquote>
`}html({text:r}){return r}def(r){return""}heading({tokens:r,depth:e}){return`<h${e}>${this.parser.parseInline(r)}</h${e}>
`}hr(r){return`<hr>
`}list(r){let e=r.ordered,n=r.start,s="";for(let i=0;i<r.items.length;i++){let a=r.items[i];s+=this.listitem(a)}let t=e?"ol":"ul",l=e&&n!==1?' start="'+n+'"':"";return"<"+t+l+`>
`+s+"</"+t+`>
`}listitem(r){let e="";if(r.task){let n=this.checkbox({checked:!!r.checked});r.loose?r.tokens[0]?.type==="paragraph"?(r.tokens[0].text=n+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&r.tokens[0].tokens[0].type==="text"&&(r.tokens[0].tokens[0].text=n+" "+T(r.tokens[0].tokens[0].text),r.tokens[0].tokens[0].escaped=!0)):r.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(r.tokens,!!r.loose),`<li>${e}</li>
`}checkbox({checked:r}){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:r}){return`<p>${this.parser.parseInline(r)}</p>
`}table(r){let e="",n="";for(let t=0;t<r.header.length;t++)n+=this.tablecell(r.header[t]);e+=this.tablerow({text:n});let s="";for(let t=0;t<r.rows.length;t++){let l=r.rows[t];n="";for(let i=0;i<l.length;i++)n+=this.tablecell(l[i]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+s+`</table>
`}tablerow({text:r}){return`<tr>
${r}</tr>
`}tablecell(r){let e=this.parser.parseInline(r.tokens),n=r.header?"th":"td";return(r.align?`<${n} align="${r.align}">`:`<${n}>`)+e+`</${n}>
`}strong({tokens:r}){return`<strong>${this.parser.parseInline(r)}</strong>`}em({tokens:r}){return`<em>${this.parser.parseInline(r)}</em>`}codespan({text:r}){return`<code>${T(r,!0)}</code>`}br(r){return"<br>"}del({tokens:r}){return`<del>${this.parser.parseInline(r)}</del>`}link({href:r,title:e,tokens:n}){let s=this.parser.parseInline(n),t=Pe(r);if(t===null)return s;r=t;let l='<a href="'+r+'"';return e&&(l+=' title="'+T(e)+'"'),l+=">"+s+"</a>",l}image({href:r,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let t=Pe(r);if(t===null)return T(n);r=t;let l=`<img src="${r}" alt="${n}"`;return e&&(l+=` title="${T(e)}"`),l+=">",l}text(r){return"tokens"in r&&r.tokens?this.parser.parseInline(r.tokens):"escaped"in r&&r.escaped?r.text:T(r.text)}},oe=class{strong({text:r}){return r}em({text:r}){return r}codespan({text:r}){return r}del({text:r}){return r}html({text:r}){return r}text({text:r}){return r}link({text:r}){return""+r}image({text:r}){return""+r}br(){return""}},y=class J{options;renderer;textRenderer;constructor(e){this.options=e||S,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new oe}static parse(e,n){return new J(n).parse(e)}static parseInline(e,n){return new J(n).parseInline(e)}parse(e,n=!0){let s="";for(let t=0;t<e.length;t++){let l=e[t];if(this.options.extensions?.renderers?.[l.type]){let a=l,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let i=l;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let a=i,o=this.renderer.text(a);for(;t+1<e.length&&e[t+1].type==="text";)a=e[++t],o+=`
`+this.renderer.text(a);n?s+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):s+=o;continue}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,n=this.renderer){let s="";for(let t=0;t<e.length;t++){let l=e[t];if(this.options.extensions?.renderers?.[l.type]){let a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=a||"";continue}}let i=l;switch(i.type){case"escape":{s+=n.text(i);break}case"html":{s+=n.html(i);break}case"link":{s+=n.link(i);break}case"image":{s+=n.image(i);break}case"strong":{s+=n.strong(i);break}case"em":{s+=n.em(i);break}case"codespan":{s+=n.codespan(i);break}case"br":{s+=n.br(i);break}case"del":{s+=n.del(i);break}case"text":{s+=n.text(i);break}default:{let a='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},_=class{options;block;constructor(r){this.options=r||S}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(r){return r}postprocess(r){return r}processAllTokens(r){return r}emStrongMask(r){return r}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},Dt=class{defaults=ee();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=M;TextRenderer=oe;Lexer=w;Tokenizer=C;Hooks=_;constructor(...r){this.use(...r)}walkTokens(r,e){let n=[];for(let s of r)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let l of t.header)n=n.concat(this.walkTokens(l.tokens,e));for(let l of t.rows)for(let i of l)n=n.concat(this.walkTokens(i.tokens,e));break}case"list":{let t=s;n=n.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(l=>{let i=t[l].flat(1/0);n=n.concat(this.walkTokens(i,e))}):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...r){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let l=e.renderers[t.name];l?e.renderers[t.name]=function(...i){let a=t.renderer.apply(this,i);return a===!1&&(a=l.apply(this,i)),a}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[t.level];l?l.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),n.renderer){let t=this.defaults.renderer||new M(this.defaults);for(let l in n.renderer){if(!(l in t))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,a=n.renderer[i],o=t[i];t[i]=(...c)=>{let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p||""}}s.renderer=t}if(n.tokenizer){let t=this.defaults.tokenizer||new C(this.defaults);for(let l in n.tokenizer){if(!(l in t))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,a=n.tokenizer[i],o=t[i];t[i]=(...c)=>{let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.tokenizer=t}if(n.hooks){let t=this.defaults.hooks||new _;for(let l in n.hooks){if(!(l in t))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,a=n.hooks[i],o=t[i];_.passThroughHooks.has(l)?t[i]=c=>{if(this.defaults.async&&_.passThroughHooksRespectAsync.has(l))return(async()=>{let h=await a.call(t,c);return o.call(t,h)})();let p=a.call(t,c);return o.call(t,p)}:t[i]=(...c)=>{if(this.defaults.async)return(async()=>{let h=await a.apply(t,c);return h===!1&&(h=await o.apply(t,c)),h})();let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.hooks=t}if(n.walkTokens){let t=this.defaults.walkTokens,l=n.walkTokens;s.walkTokens=function(i){let a=[];return a.push(l.call(this,i)),t&&(a=a.concat(t.call(this,i))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,e){return w.lex(r,e??this.defaults)}parser(r,e){return y.parse(r,e??this.defaults)}parseMarkdown(r){return(e,n)=>{let s={...n},t={...this.defaults,...s},l=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return l(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 e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=r),t.async)return(async()=>{let i=t.hooks?await t.hooks.preprocess(e):e,a=await(t.hooks?await t.hooks.provideLexer():r?w.lex:w.lexInline)(i,t),o=t.hooks?await t.hooks.processAllTokens(a):a;t.walkTokens&&await Promise.all(this.walkTokens(o,t.walkTokens));let c=await(t.hooks?await t.hooks.provideParser():r?y.parse:y.parseInline)(o,t);return t.hooks?await t.hooks.postprocess(c):c})().catch(l);try{t.hooks&&(e=t.hooks.preprocess(e));let i=(t.hooks?t.hooks.provideLexer():r?w.lex:w.lexInline)(e,t);t.hooks&&(i=t.hooks.processAllTokens(i)),t.walkTokens&&this.walkTokens(i,t.walkTokens);let a=(t.hooks?t.hooks.provideParser():r?y.parse:y.parseInline)(i,t);return t.hooks&&(a=t.hooks.postprocess(a)),a}catch(i){return l(i)}}}onError(r,e){return n=>{if(n.message+=`
Please report this to https://github.com/markedjs/marked.`,r){let s="<p>An error occurred:</p><pre>"+T(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},$=new Dt;function k(r,e){return $.parse(r,e)}k.options=k.setOptions=function(r){return $.setOptions(r),k.defaults=$.defaults,Be(k.defaults),k};k.getDefaults=ee;k.defaults=S;k.use=function(...r){return $.use(...r),k.defaults=$.defaults,Be(k.defaults),k};k.walkTokens=function(r,e){return $.walkTokens(r,e)};k.parseInline=$.parseInline;k.Parser=y;k.parser=y.parse;k.Renderer=M;k.TextRenderer=oe;k.Lexer=w;k.lexer=w.lex;k.Tokenizer=C;k.Hooks=_;k.parse=k;var Yt=k.options,Jt=k.setOptions,er=k.use,tr=k.walkTokens,rr=k.parseInline;var nr=y.parse,sr=w.lex;var pe=typeof performance<"u"&&typeof performance.now=="function",v=x(()=>pe?performance.now():0,"now"),ce="\u{1F9DC} ",Ht="Mermaid render",Nt="Mermaid",Gt={parse:"tertiary",prepare:"secondary",measure:"primary",layout:"primary-dark",layoutCore:"error",draw:"primary-light",paint:"secondary-dark",serialize:"tertiary-dark",render:"primary-light"},kr=class{constructor(){this.enabled=!1,this.autoPrint=!0,this.records=[],this.maxRecords=200,this.roots=[],this.stack=[],this.buckets={}}static{x(this,"Profiler")}enable(){return this.enabled=!0,this}disable(){return this.enabled=!1,this}start(r){this.enabled&&(this.roots=[],this.stack=[],this.buckets={},this.begin(r))}tickSync(r,e){if(!this.enabled)return e();let n=v();try{return e()}finally{this.buckets[r]=(this.buckets[r]??0)+(v()-n)}}async tick(r,e){if(!this.enabled)return e();let n=v();try{return await e()}finally{this.buckets[r]=(this.buckets[r]??0)+(v()-n)}}stop(){if(!this.enabled)return;for(;this.stack.length>0;)this.end();let r=this.roots.at(-1),e=this.runLabel??r?.name;return r&&(this.records.push({label:e??r.name,tree:r,buckets:{...this.buckets}}),this.records.length>this.maxRecords&&this.records.splice(0,this.records.length-this.maxRecords),this.autoPrint&&this.printSummary(r,e)),this.runLabel=void 0,r}begin(r){if(!this.enabled)return;let e={name:r,start:v(),duration:-1,children:[]},n=this.stack.at(-1);if(n?n.children.push(e):this.roots.push(e),this.stack.push(e),pe&&typeof performance.mark=="function")try{performance.mark(`${ce}${r} \u25B6`)}catch{}}end(){if(!this.enabled)return;let r=this.stack.pop();if(!r)return;let e=v();if(r.duration=e-r.start,pe&&typeof performance.measure=="function")try{performance.measure(`${ce}${r.name}`,{start:r.start,end:e,detail:{devtools:{dataType:"track-entry",track:Ht,trackGroup:Nt,color:Gt[r.name]??"primary",tooltipText:`${r.name} \u2014 ${r.duration.toFixed(1)} ms`}}})}catch{}}async span(r,e){if(!this.enabled)return e();this.begin(r);try{return await e()}finally{this.end()}}report(){return this.records.at(-1)?.tree??this.roots.at(-1)}clear(){this.records.length=0,this.roots=[],this.stack=[],this.runLabel=void 0}reset(){this.roots=[],this.stack=[]}printSummary(r=this.report(),e){if(!r)return;let n=r.duration,s=e&&e!==r.name?`${r.name} [${e}]`:r.name,t=["ms        %    phase"],l=x((a,o)=>{let c="  ".repeat(o),p=a.duration.toFixed(1).padStart(8),h=n>0?`${(a.duration/n*100).toFixed(0).padStart(3)}%`:"   -";t.push(`${p}  ${h}  ${c}${a.name}`);for(let u of a.children)l(u,o+1);if(a.children.length>0){let u=a.children.reduce((g,m)=>g+m.duration,0),f=a.duration-u;if(f>.5){let g=f.toFixed(1).padStart(8);t.push(`${g}       ${c}  (self)`)}}},"walk");l(r,0);let i=Object.keys(this.buckets);if(i.length>0){t.push("\u2014\u2014 buckets (summed) \u2014\u2014");for(let a of i)t.push(`${this.buckets[a].toFixed(1).padStart(8)}       ${a}`)}console.log(`${ce}mermaid render profile \xB7 ${s}
${t.join(`
`)}`)}};globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};var Qt=Ge.default.extend({raf(r){typeof queueMicrotask=="function"?queueMicrotask(r):setTimeout(r,0)}}).extend(Qe.default),Ut=Qt;function Ue(r,{markdownAutoWrap:e}){let s=r.replace(/<br\/>/g,`
`).replace(/\n{2,}/g,`
`);return Re(s)}x(Ue,"preprocessMarkdown");function Ke(r){return r.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(n=>({content:n,type:"normal"}))??[])}x(Ke,"nonMarkdownToLines");function Xe(r,e={}){let n=Ue(r,e),s=k.lexer(n),t=[[]],l=0;function i(a,o="normal"){a.type==="text"?a.text.split(`
`).forEach((p,h)=>{h!==0&&(l++,t.push([])),p.split(" ").forEach(u=>{u=u.replace(/&#39;/g,"'"),u&&t[l].push({content:u,type:o})})}):a.type==="strong"||a.type==="em"?a.tokens.forEach(c=>{i(c,a.type)}):a.type==="html"&&t[l].push({content:a.text,type:"normal"})}return x(i,"processNode"),s.forEach(a=>{a.type==="paragraph"?a.tokens?.forEach(o=>{i(o)}):a.type==="html"?t[l].push({content:a.text,type:"normal"}):t[l].push({content:a.raw,type:"normal"})}),t}x(Xe,"markdownToLines");function Ve(r){return r?`<p>${r.replace(/\\n|\n/g,"<br />")}</p>`:""}x(Ve,"nonMarkdownToHTML");function Ye(r,{markdownAutoWrap:e}={}){let n=k.lexer(r);function s(t){return t.type==="text"?e===!1?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):t.type==="strong"?`<strong>${t.tokens?.map(s).join("")}</strong>`:t.type==="em"?`<em>${t.tokens?.map(s).join("")}</em>`:t.type==="paragraph"?`<p>${t.tokens?.map(s).join("")}</p>`:t.type==="space"?"":t.type==="html"?`${t.text}`:t.type==="escape"?t.text:(H.warn(`Unsupported markdown: ${t.type}`),t.raw)}return x(s,"output"),n.map(s).join("")}x(Ye,"markdownToHTML");function Je(r){return Intl.Segmenter?[...new Intl.Segmenter().segment(r)].map(e=>e.segment):[...r]}x(Je,"splitTextToChars");function et(r,e){let n=Je(e.content);return fe(r,[],n,e.type)}x(et,"splitWordToFitWidth");function fe(r,e,n,s){if(n.length===0)return[{content:e.join(""),type:s},{content:"",type:s}];let[t,...l]=n,i=[...e,t];return r([{content:i.join(""),type:s}])?fe(r,i,l,s):(e.length===0&&t&&(e.push(t),n.shift()),[{content:e.join(""),type:s},{content:n.join(""),type:s}])}x(fe,"splitWordToFitWidthRecursion");function tt(r,e){if(r.some(({content:n})=>n.includes(`
`)))throw new Error("splitLineToFitWidth does not support newlines in the line");return j(r,e)}x(tt,"splitLineToFitWidth");function j(r,e,n=[],s=[]){if(r.length===0)return s.length>0&&n.push(s),n.length>0?n:[];let t="";r[0].content===" "&&(t=" ",r.shift());let l=r.shift()??{content:" ",type:"normal"},i=[...s];if(t!==""&&i.push({content:t,type:"normal"}),i.push(l),e(i))return j(r,e,n,i);if(s.length>0)n.push(s),r.unshift(l);else if(l.content){let[a,o]=et(e,l);n.push([a]),o.content&&r.unshift(o)}return j(r,e,n)}x(j,"splitLineToFitWidthRecursion");function he(r,e){e&&r.attr("style",e)}x(he,"applyStyle");var Ne=16384;async function rt(r,e,n,s,t=!1,l=we()){let i=r.append("foreignObject");i.attr("width",`${Math.min(10*n,Ne)}px`),i.attr("height",`${Math.min(10*n,Ne)}px`);let a=i.append("xhtml:div"),o=G(e.label)?await ye(e.label.replace(Te.lineBreakRegex,`
`),l):N(e.label,l),c=e.isNode?"nodeLabel":"edgeLabel",p=a.append("span");return p.html(o),he(p,e.labelStyle),p.attr("class",`${c} ${s}`),he(a,e.labelStyle),a.style("display","table-cell"),a.style("white-space","nowrap"),a.style("line-height","1.5"),n!==Number.POSITIVE_INFINITY&&(a.style("max-width",n+"px"),a.style("text-align","center")),a.attr("xmlns","http://www.w3.org/1999/xhtml"),t&&a.attr("class","labelBkg"),(await Ut.measure(()=>a.node().getBoundingClientRect())).width===n&&(a.style("display","table"),a.style("white-space","break-spaces"),a.style("width",n+"px")),i.node()}x(rt,"addHtmlSpan");function F(r,e,n,s=!1){let t=r.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*n-.1+"em").attr("dy",n+"em");return s&&t.attr("text-anchor","middle"),t}x(F,"createTspan");function nt(r,e,n){let s=r.append("text"),t=F(s,1,e);W(t,n);let l=t.node().getComputedTextLength();return s.remove(),l}x(nt,"computeWidthOfText");function Kt(r,e,n){let s=r.append("text"),t=F(s,1,e);W(t,[{content:n,type:"normal"}]);let l=t.node()?.getBoundingClientRect();return l&&s.remove(),l}x(Kt,"computeDimensionOfText");function st(r,e,n,s=!1,t=!1){let i=e.append("g"),a=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");t&&o.attr("text-anchor","middle");let c=0;for(let p of n){let h=x(f=>nt(i,1.1,f)<=r,"checkWidth"),u=h(p)?[p]:tt(p,h);for(let f of u){let g=F(o,c,1.1,t);W(g,f),c++}}if(s){let p=o.node().getBBox(),h=2;return a.attr("x",p.x-h).attr("y",p.y-h).attr("width",p.width+2*h).attr("height",p.height+2*h),i.node()}else return o.node()}x(st,"createFormattedText");function ue(r){let e=/&(amp|lt|gt);/g;return r.replace(e,(n,s)=>{switch(s){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return n}})}x(ue,"decodeHTMLEntities");function W(r,e){r.text(""),e.forEach((n,s)=>{let t=r.append("tspan").attr("font-style",n.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",n.type==="strong"?"bold":"normal");s===0?t.text(ue(n.content)):t.text(" "+ue(n.content))})}x(W,"updateTextContentAndStyles");async function it(r,e={}){let n=[];r.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(t,l,i)=>(n.push((async()=>{let a=`${l}:${i}`;return await $e(a)?await Se(a,void 0,{class:"label-icon"}):`<i class='${N(t,e).replace(":"," ")}'></i>`})()),t));let s=await Promise.all(n);return r.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>s.shift()??"")}x(it,"replaceIconSubstring");var wr=x(async(r,e="",{style:n="",isTitle:s=!1,classes:t="",useHtmlLabels:l=!0,markdown:i=!0,isNode:a=!0,width:o=200,addSvgBackground:c=!1}={},p)=>{if(H.debug("XYZ createText",e,n,s,t,l,a,"addSvgBackground: ",c),l){let h=i?Ye(e,p):Ve(e),u=await it(Q(h),p),f=e.replace(/\\\\/g,"\\"),g={isNode:a,label:G(e)?f:u,labelStyle:n.replace("fill:","color:")};return await rt(r,g,o,t,c,p)}else{let h=Q(e.replace(/<br\s*\/?>/g,"<br/>")),u=i?Xe(h.replace("<br>","<br/>"),p):Ke(h),f=st(o,r,u,e?c:!1,!a);if(a){/stroke:/.exec(n)&&(n=n.replace("stroke:","lineColor:"));let g=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(f).attr("style",g)}else{let g=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");R(f).select("rect").attr("style",g.replace(/background:/g,"fill:"));let m=n.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(f).select("text").attr("style",m)}return s?R(f).selectAll("tspan.text-outer-tspan").classed("title-row",!0):R(f).selectAll("tspan.text-outer-tspan").classed("row",!0),f}},"createText");export{Re as a,Ut as b,Kt as c,wr as d};