import{logger as Qe,path as w,fs as Q,hash as Ze,getDirname as Z}from"@vuepress/utils";import{useSassPalettePlugin as et}from"vuepress-plugin-sass-palette";import{Logger as tt,utoa as j,deepAssign as G,getLocales as nt,addCustomElement as ee,addViteOptimizeDepsExclude as L,addViteSsrExternal as T,addViteOptimizeDepsInclude as te,chainWebpack as ot}from"vuepress-shared";import S from"markdown-it/lib/token.js";import rt from"markdown-it/lib/helpers/parse_link_label.js";import{ensureLeadingSlash as ne,resolveLocalePath as oe,ensureEndingSlash as st}from"@vuepress/shared";import{createRequire as at}from"node:module";import re from"katex";import it from"juice";import{mathjax as lt}from"mathjax-full/js/mathjax.js";import{TeX as ct}from"mathjax-full/js/input/tex.js";import{CHTML as pt}from"mathjax-full/js/output/chtml.js";import{SVG as mt}from"mathjax-full/js/output/svg.js";import{liteAdaptor as ut}from"mathjax-full/js/adaptors/liteAdaptor.js";import{RegisterHTMLHandler as ft}from"mathjax-full/js/handlers/html.js";import{AllPackages as dt}from"mathjax-full/js/input/tex/AllPackages.js";const ht=["math","maction","maligngroup","malignmark","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mlongdiv","mmutiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mscarries","mscarry","msgroup","msline","mspace","msqrt","msrow","mstack","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","semantics","annotation","annotation-xml"],F=new tt("vuepress-plugin-md-enhance"),gt=(e,t)=>{const{linkCheck:o="dev"}=t;return typeof o=="boolean"?o:o==="always"||e.env.isDev&&o==="dev"||e.env.isBuild&&o==="build"||!1},se=(e,t)=>{const o=e.filePathRelative||e.path,{pages:n}=t,r=e.links.filter(({raw:i})=>i.match(/.md((?:\?|#).*)?$/)),a=[...r.filter(({raw:i})=>!i.startsWith("/")).filter(({relative:i})=>n.every(({filePathRelative:s})=>s!==i)),...r.filter(({raw:i})=>i.startsWith("/")).filter(({absolute:i})=>n.every(({filePathRelative:s})=>!s||`${t.options.base}${s}`!==i))].map(({raw:i})=>i);a.length&&Qe.warn(`Broken links found in ${o}: ${a.join(", ")}`)},J=({options:e,deprecatedOption:t,newOption:o,msg:n="",scope:r=""})=>{if(t in e){if(F.warn(`"${t}" is deprecated${r?` in ${r}`:""}, please use "${o}" instead.${n?`
${n}`:""}`),o.includes(".")){const a=o.split(".");let i=e;a.forEach((s,l)=>{l!==a.length-1?(i[s]=i[s]||{},i=i[s]):i[s]=e[t]})}else e[o]=e[t];delete e[t]}},W=(e,t,o="",n="")=>{t in e&&(F.error(`"${t}" is removed${n?`, please use ${n} instead.`:" and no longer supported"}${o?`
${o}`:""}`),n||delete e[t])},bt=e=>{J({options:e,deprecatedOption:"codegroup",newOption:"codetabs"}),J({options:e,deprecatedOption:"mdImport",newOption:"include"}),J({options:e,deprecatedOption:"tex",newOption:"katex"}),W(e,"enableAll"),W(e,"lineNumbers"),W(e,"imageFix")},M=(e,{name:t,marker:o=":",validate:n=i=>i.trim().split(" ",2)[0]===t,openRender:r=(i,s,l,c,u)=>(i[s].attrJoin("class",t),u.renderToken(i,s,l)),closeRender:a=(i,s,l,c,u)=>u.renderToken(i,s,l)}={name:""})=>{const i=o[0],s=o.length,l=(c,u,m,b)=>{let p=c.bMarks[u]+c.tShift[u],h=c.eMarks[u];if(i!==c.src[p])return!1;let f=p+1;for(;f<=h&&o[(f-p)%s]===c.src[f];)f+=1;const g=Math.floor((f-p)/s);if(g<3)return!1;f-=(f-p)%s;const v=c.src.slice(p,f),$=c.src.slice(f,h);if(!n($,v))return!1;if(b)return!0;let k=u,d=!1;for(;k<m&&(k+=1,p=c.bMarks[k]+c.tShift[k],h=c.eMarks[k],!(p<h&&c.sCount[k]<c.blkIndent));)if(i===c.src[p]&&c.sCount[k]-c.blkIndent<4){for(f=p+1;f<=h&&o[(f-p)%s]===c.src[f];f++);if(Math.floor((f-p)/s)>=g&&(f-=(f-p)%s,f=c.skipSpaces(f),f>=h)){d=!0;break}}const y=c.parentType,x=c.lineMax;c.parentType="container",c.lineMax=k;const _=c.push(`container_${t}_open`,"div",1);_.markup=v,_.block=!0,_.info=$,_.map=[u,k],c.md.block.tokenize(c,u+1,k);const R=c.push(`container_${t}_close`,"div",-1);return R.markup=c.src.slice(p,f),R.block=!0,c.parentType=y,c.lineMax=x,c.line=k+(d?1:0),!0};e.block.ruler.before("fence",`container_${t}`,l,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules[`container_${t}_open`]=r,e.renderer.rules[`container_${t}_close`]=a},ae=e=>{["left","center","right","justify"].forEach(t=>e.use(o=>M(o,{name:t,openRender:()=>`<div style="text-align:${t}">
`})))},yt=/[^\t\n\f />"'=]/,kt=" ",$t="=",ie=".",vt="#",A=(e,t,{left:o,right:n,allowed:r})=>{let a="",i="",s=!0,l=!1;const c=[];for(let u=t+o.length;u<e.length;u++){if(e.slice(u,u+n.length)===n){a!==""&&c.push([a,i]);break}const m=e.charAt(u);if(m===$t&&s){s=!1;continue}if(m===ie&&a===""){e.charAt(u+1)===ie?(a="css-module",u+=1):a="class",s=!1;continue}if(m===vt&&a===""){a="id",s=!1;continue}if(m==='"'&&i===""){l=!0;continue}if(m==='"'&&l){l=!1;continue}if(m===kt&&!l){if(a==="")continue;c.push([a,i]),a="",i="",s=!0;continue}if(!(s&&m.search(yt)===-1)){if(s){a+=m;continue}i+=m}}return r.length?c.filter(([u])=>r.some(m=>m instanceof RegExp?m.test(u):m===u)):c},I=(e,t)=>{t&&e.forEach(o=>{const[n,r]=o;n==="class"?t.attrJoin("class",r):n==="css-module"?t.attrJoin("css-module",r):t.attrPush(o)})},O=(e,{left:t,right:o})=>n=>{const r=t.length,a=o.length,i=r+1+a;if(!n||typeof n!="string"||n.length<i)return!1;const s=p=>{const h=p.charAt(r)===".",f=p.charAt(r)==="#";return h||f?p.length>=i+1:p.length>=i};let l,c,u,m;const b=i-a;switch(e){case"start":u=n.slice(0,r),l=u===t?0:-1,c=l===-1?-1:n.indexOf(o,b),m=n.charAt(c+a),m&&o.indexOf(m)!==-1&&(c=-1);break;case"end":l=n.lastIndexOf(t),c=l===-1?-1:n.indexOf(o,l+b),c=c===n.length-a?c:-1;break;case"only":u=n.slice(0,r),l=u===t?0:-1,u=n.slice(n.length-a),c=u===o?n.length-a:-1;break}return l!==-1&&c!==-1&&s(n.substring(l,c+a))},_t=(e,{left:t,right:o})=>{const n=U(t),r=U(o),a=e.search(new RegExp(`[ \\n]?${n}[^${n}${r}]+${r}$`));return a!==-1?e.slice(0,a):e},E=(e,t)=>{if(e[t].type==="softbreak")return null;if(e[t].nesting===0)return e[t];const o=e[t].level,n=e[t].type.replace("_close","_open");for(;t>=0;--t)if(e[t].type===n&&e[t].level===o)return e[t];return null},Ct=(e,t)=>t>=0?e[t]:e[e.length+t],xt=e=>Array.isArray(e)&&Boolean(e.length)&&e.every(t=>typeof t=="object"),wt=e=>Array.isArray(e)&&Boolean(e.length)&&e.every(t=>typeof t=="function"),U=e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),jt=e=>[{name:"fenced code blocks",tests:[{shift:0,block:!0,info:O("end",e)}],transform:(t,o)=>{const n=t[o];let r="";const a=n.info.match(/{(?:[\d,-]+)}/);a&&(n.info=n.info.replace(a[0],""),r=a[0]);const i=n.info.lastIndexOf(e.left),s=A(n.info,i,e);I(s,n),n.info=`${_t(n.info,e)} ${r}`}},{name:"inline nesting 0",tests:[{shift:0,type:"inline",children:[{shift:-1,type:t=>t==="image"||t==="code_inline"},{shift:0,type:"text",content:O("start",e)}]}],transform:(t,o,n)=>{const r=t[o].children[n],a=r.content.indexOf(e.right),i=t[o].children[n-1],s=A(r.content,0,e);I(s,i),r.content.length===a+e.right.length?t[o].children.splice(n,1):r.content=r.content.slice(a+e.right.length)}},{name:"tables",tests:[{shift:0,type:"table_close"},{shift:1,type:"paragraph_open"},{shift:2,type:"inline",content:O("only",e)}],transform:(t,o)=>{const n=t[o+2],r=E(t,o),a=A(n.content,0,e);I(a,r),t.splice(o+1,3)}},{name:"inline attributes",tests:[{shift:0,type:"inline",children:[{shift:-1,nesting:-1},{shift:0,type:"text",content:O("start",e)}]}],transform:(t,o,n)=>{const r=t[o].children[n],{content:a}=r,i=A(a,0,e),s=E(t[o].children,n-1);I(i,s),r.content=a.slice(a.indexOf(e.right)+e.right.length)}},{name:"list softbreak",tests:[{shift:-2,type:"list_item_open"},{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:O("only",e)}]}],transform:(t,o,n)=>{const r=t[o].children[n],a=A(r.content,0,e);let i=o-2;for(;t[i-1]&&t[i-1].type!=="ordered_list_open"&&t[i-1].type!=="bullet_list_open";)i--;I(a,t[i-1]),t[o].children=t[o].children.slice(0,-2)}},{name:"list double softbreak",tests:[{shift:0,type:t=>t==="bullet_list_close"||t==="ordered_list_close"},{shift:1,type:"paragraph_open"},{shift:2,type:"inline",content:O("only",e),children:t=>t.length===1},{shift:3,type:"paragraph_close"}],transform:(t,o)=>{const n=t[o+2],r=A(n.content,0,e),a=E(t,o);I(r,a),t.splice(o+1,3)}},{name:"list item end",tests:[{shift:-2,type:"list_item_open"},{shift:0,type:"inline",children:[{position:-1,type:"text",content:O("end",e)}]}],transform:(t,o,n)=>{const r=t[o].children[n],{content:a}=r,i=A(a,a.lastIndexOf(e.left),e);I(i,t[o-2]);const s=a.slice(0,a.lastIndexOf(e.left));r.content=s[s.length-1]===" "?s.slice(0,-1):s}},{name:`
{.a} softbreak then curly in start`,tests:[{shift:0,type:"inline",children:[{position:-2,type:"softbreak"},{position:-1,type:"text",content:O("only",e)}]}],transform:(t,o,n)=>{const r=t[o].children[n],a=A(r.content,0,e);let i=o+1;for(;t[i+1]&&t[i+1].nesting===-1;)i++;const s=E(t,i);I(a,s),t[o].children=t[o].children.slice(0,-2)}},{name:"horizontal rule",tests:[{shift:0,type:"paragraph_open"},{shift:1,type:"inline",children:t=>t.length===1,content:t=>t.match(new RegExp(`^ {0,3}[-*_]{3,} ?${U(e.left)}[^${U(e.right)}]`))!==null},{shift:2,type:"paragraph_close"}],transform:(t,o)=>{const n=t[o];n.type="hr",n.tag="hr",n.nesting=0;const{content:r}=t[o+1],a=r.lastIndexOf(e.left),i=A(r,a,e);I(i,n),n.markup=r,t.splice(o+1,2)}},{name:"end of block",tests:[{shift:0,type:"inline",children:[{position:-1,content:O("end",e),type:t=>t!=="code_inline"&&t!=="math_inline"}]}],transform:(t,o,n)=>{const r=t[o].children[n],{content:a}=r,i=A(a,a.lastIndexOf(e.left),e);let s=o+1;for(;t[s+1]&&t[s+1].nesting===-1;)s++;const l=E(t,s);I(i,l);const c=a.slice(0,a.lastIndexOf(e.left));r.content=c[c.length-1]===" "?c.slice(0,-1):c}}],B=(e,t,o)=>{var n,r;const a={match:!1,pos:null},i=o.shift!==void 0?t+o.shift:o.position;if(o.shift!==void 0&&i<0)return a;const s=Ct(e,i);if(s===void 0)return a;for(const l of Object.keys(o)){if(l==="shift"||l==="position")continue;if(s[l]===void 0)return a;if(l==="children"&&xt(o.children)){if(((n=s.children)==null?void 0:n.length)===0)return a;let u;const m=o.children,b=s.children;if(m!=null&&m.every(p=>p.position!==void 0)){if(u=m.every(p=>B(b,p.position,p).match),u){const p=((r=m[m.length-1])==null?void 0:r.position)||0;a.pos=p>=0?p:b.length+p}}else for(let p=0;p<b.length;p++)if(u=m.every(h=>B(b,p,h).match),u){a.pos=p;break}if(u===!1)return a;continue}const c=o[l];switch(typeof c){case"boolean":case"number":case"string":if(s[l]!==c)return a;break;case"function":if(!c(s[l]))return a;break;case"object":if(wt(c)){if(c.every(u=>u(s[l]))===!1)return a;break}continue;default:throw new Error(`Unknown type of pattern test (key: ${l}). Test should be of type boolean, number, string, function or array of functions.`)}}return a.match=!0,a},le=(e,{left:t="{",right:o="}",allowed:n=[]}={})=>{const r=jt({left:t,right:o,allowed:n}),a=i=>{const s=i.tokens;for(let l=0;l<s.length;l++)for(let c=0;c<r.length;c++){const u=r[c];let m=null;u.tests.every(b=>{const p=B(s,l,b);return p.pos!==null&&(m=p.pos),p.match})&&(u.transform(s,l,m),(u.name==="inline attributes"||u.name==="inline nesting 0")&&c--)}};e.core.ruler.before("linkify","curly_attributes",a)},ce=e=>{M(e,{name:"chart",openRender:(t,o)=>{const n=t[o].info.trimStart().slice(5).trim(),r=`chart-${o}`;let a="{}",i="";for(let s=o;s<t.length;s++){const{type:l,content:c,info:u}=t[s];if(l==="container_chart_close")break;!c||(l==="fence"&&(u==="json"?(a=j(c),i="json"):(u==="js"||u==="javascript")&&(a=j(c),i="js")),t[s].type="chart_empty",t[s].hidden=!0)}return`<ChartJS id="${r}" config="${a}" ${n?`title="${encodeURIComponent(n)}" `:""}type="${i}">`},closeRender:()=>"</ChartJS>"})},pe={useBabel:!1,jsLib:[],cssLib:[],codepenLayout:"left",codepenEditors:"101",babel:"https://unpkg.com/@babel/standalone/babel.min.js",vue:"https://unpkg.com/vue/dist/vue.global.prod.js",react:"https://unpkg.com/react/umd/react.production.min.js",reactDOM:"https://unpkg.com/react-dom/umd/react-dom.production.min.js"},V=e=>t=>M(t,{name:e,openRender:(o,n)=>{const r=o[n].info.trimStart().slice(e.length).trim();let a="";const i={};for(let s=n;s<o.length;s++){const{type:l,content:c,info:u}=o[s];if(l===`container_${e}_close`)break;!c||l==="fence"&&(u==="json"?a=j(c):i[u]=c)}return`
<CodeDemo id="code-demo-${n}" type="${e.split("-")[0]}"${r?` title="${encodeURIComponent(r)}"`:""}${a?` config="${a}"`:""} code="${j(JSON.stringify(i))}">
`},closeRender:()=>"</CodeDemo>"}),me=V("normal-demo"),ue=V("vue-demo"),fe=V("react-demo"),q=(e,{name:t,component:o,getter:n}={name:"tabs",component:"Tabs",getter:()=>[]})=>{const r="@tab",a=(s,l,c,u)=>{let m=s.bMarks[l]+s.tShift[l],b=s.eMarks[l];if(s.src[m]!==":")return!1;let p=m+1;for(;p<=b&&s.src[p]===":";)p+=1;const h=p-m;if(h<3)return!1;const f=s.src.slice(m,p),g=s.src.slice(p,b),[v,$=""]=g.split("#",2);if(v.trim()!==t)return!1;if(u)return!0;let k=l,d=!1;for(;k<c&&(k+=1,m=s.bMarks[k]+s.tShift[k],b=s.eMarks[k],!(m<b&&s.sCount[k]<s.blkIndent));)if(s.src[m]===":"&&s.sCount[k]-s.blkIndent<4){for(p=m+1;p<=b&&s.src[p]===":";p++);if(p-m>=h&&(p=s.skipSpaces(p),p>=b)){d=!0;break}}const y=s.parentType,x=s.lineMax;s.parentType=`${t}_tabs`,s.lineMax=k-(d?1:0);const _=s.push(`${t}_tabs_open`,o,1);_.markup=f,_.block=!0,_.info=v,_.meta={id:$.trim()},_.map=[l,k-(d?1:0)],s.md.block.tokenize(s,l+1,k-(d?1:0));const R=s.push(`${t}_tabs_close`,o,-1);return R.markup=s.src.slice(m,p),R.block=!0,s.parentType=y,s.lineMax=x,s.line=k+(d?1:0),!0},i=(s,l,c,u)=>{let m=s.bMarks[l]+s.tShift[l],b=s.eMarks[l];if(s.src.charAt(m)!=="@")return!1;let p;for(p=0;p<r.length;p++)if(r[p]!==s.src[m+p])return!1;const h=s.src.slice(m,m+p),f=s.src.slice(m+p,b);if(u)return!0;let g=l,v=!1;for(;g<c&&(g+=1,m=s.bMarks[g]+s.tShift[g],b=s.eMarks[g],!(m<b&&s.sCount[g]<s.blkIndent));)if(s.src[m]==="@"&&s.sCount[g]<=s.sCount[l]){let R=!0;for(p=0;p<r.length;p++)if(r[p]!==s.src[m+p]){R=!1;break}if(R){v=!0,g-=1;break}}const $=s.parentType,k=s.lineMax;s.parentType="tab",s.lineMax=g;const d=s.push("tab_open","template",1),[y,x]=f.replace(/^:active/,"").split("#",2);d.block=!0,d.markup=h,d.info=y.trim(),d.meta={active:f.includes(":active")},x&&(d.meta.value=x.trim()),d.map=[l,g],s.md.block.tokenize(s,l+1,g);const _=s.push("tab_close","template",-1);return _.block=!0,_.markup="",s.parentType=$,s.lineMax=k,s.line=g+(v?1:0),!0};e.block.ruler.before("fence",`${t}_tabs`,a,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.__rules__.find(({name:s})=>s==="tab")||e.block.ruler.before("fence","tab",i,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules[`${t}_tabs_open`]=(s,l,c,u,m)=>{const{meta:b}=s[l],p=[],h=n(s,l,c,u,m);let f=-1,g=!1;for(let $=l;$<s.length;$++){const{block:k,meta:d,type:y,info:x}=s[$];if(k){if(y===`${t}_tabs_close`)break;if(y===`${t}_tabs_open`)continue;if(y==="tab_open"){d.active&&(f=p.length),s[$].attrPush([`#tab${p.length}`,"{ title, value, isActive }"]),g=!0,p.push({title:x,...d.value?{value:d.value}:{}});continue}if(y==="tab_close")continue;g||(s[$].type=`${t}_tabs_empty`,s[$].hidden=!0)}}const v=p.map(($,k)=>({...$,...h[k]}));return`<${o} id="${l}" :data='${JSON.stringify(v).replace(/'/g,"&#39")}'${f!==-1?` :active="${f}"`:""}${b.id?` tab-id="${b.id}"`:""}>
`},e.renderer.rules[`${t}_tabs_close`]=()=>`</${o}>
`},de=e=>{q(e,{name:"code-tabs",component:"CodeTabs",getter:(t,o)=>{let n=!1,r=!1;const a=[];for(let i=o;i<t.length;i++){const{block:s,type:l}=t[i];if(s){if(l==="code-tabs_tabs_close")break;if(l==="tab_close"){n=!1;continue}if(l==="tab_open"){n=!0,r=!1;continue}if(n&&l==="fence"&&!r){r=!0;continue}t[i].type="code_tab_empty",t[i].hidden=!0}}return a}})},he=(e,t)=>{const o=e[t],n=`echarts-${t}`,{content:r,info:a}=o,i=a.trim().split(":",2)[1];return`<ECharts id="${n}" config="${j(r)}"${i?` title="${encodeURIComponent(i)}"`:""}></ECharts>`},ge=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...o)=>{const[n,r]=o,{info:a}=n[r];return a.split(":",2)[0]==="echarts"?he(n,r):t(...o)},e.renderer.rules.echarts=he,M(e,{name:"echarts",openRender:(o,n)=>{const r=o[n].info.trimStart().slice(7).trim(),a=`echarts-${n}`;let i="{}",s=!1;for(let l=n;l<o.length;l++){const{type:c,content:u,info:m}=o[l];if(c==="container_echarts_close")break;!u||(c==="fence"&&(m==="json"?i=u:(m==="js"||m==="javascript")&&(i=u,s=!0)),o[l].type="echarts_empty",o[l].hidden=!0)}return`<ECharts id="${a}" config="${j(i)}"${r?` title="${encodeURIComponent(r)}"`:""}${s?' type="js"':""}>`},closeRender:()=>"</ECharts>"})},be=(e,t)=>{const o=e[t],n=`flowchart-${t}`,{content:r,info:a}=o;return`<FlowChart id="${n}" code="${j(r)}" preset="${a.trim().split(":",2)[1]||"vue"}"></FlowChart>`},ye=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...o)=>{const[n,r]=o,{info:a}=n[r],i=a.split(":",2)[0];return i==="flow"||i==="flowchart"?be(n,r):t(...o)},e.renderer.rules.flowchart=be},z=(e,t)=>e[t].meta.subId>0?`:${e[t].meta.subId}`:"",St=(e,t,o,n)=>`${typeof n.docId=="string"?`-${n.docId}-`:""}${(e[t].meta.id+1).toString()}`,Mt=(e,t)=>`[${(e[t].meta.id+1).toString()}${z(e,t)}]`,At=(e,t,o,n,r)=>{const a=r.rules.footnoteAnchorName(e,t,o,n,r),i=r.rules.footnoteCaption(e,t,o,n,r);return`<sup class="footnote-ref"><a href="#footnote${a}">${i}</a><a class="footnote-anchor" id="footnote-ref${a}${z(e,t)}" /></sup>`},It=(e,t,o)=>`${o.xhtmlOut?`<hr class="footnotes-sep" />
`:`<hr class="footnotes-sep">
`}<section class="footnotes">
<ol class="footnotes-list">
`,Ot=()=>`</ol>
</section>
`,Pt=(e,t,o,n,r)=>`<li id="footnote${r.rules.footnoteAnchorName(e,t,o,n,r)}${z(e,t)}" class="footnote-item">`,Rt=()=>`</li>
`,Tt=(e,t,o,n,r)=>` <a href="#footnote-ref${r.rules.footnoteAnchorName(e,t,o,n,r)}${z(e,t)}" class="footnote-backref">↩︎</a>`,Et=(e,t,o,n)=>{let r,a,i,s;const l=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];if(l+4>c||e.src.charAt(l)!=="["||e.src.charAt(l+1)!=="^")return!1;for(r=l+2;r<c;r++){if(e.src.charAt(r)===" ")return!1;if(e.src.charAt(r)==="]")break}if(r===l+2||r+1>=c||e.src.charAt(++r)!==":")return!1;if(n)return!0;r+=1,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={});const u=e.src.slice(l+2,r-2);e.env.footnotes.refs[`:${u}`]=-1,a=new S("footnoteReferenceOpen","",1),a.meta={label:u},a.level=e.level++,e.tokens.push(a);const m=e.bMarks[t],b=e.tShift[t],p=e.sCount[t],h=e.parentType,f=r,g=e.sCount[t]+r-(e.bMarks[t]+e.tShift[t]);for(i=e.sCount[t]+r-(e.bMarks[t]+e.tShift[t]);r<c;){if(s=e.src.charAt(r),s==="	")i+=4-i%4;else if(s===" ")i+=1;else break;r+=1}return e.tShift[t]=r-f,e.sCount[t]=i-g,e.bMarks[t]=f,e.blkIndent+=4,e.parentType="footnote",e.sCount[t]<e.blkIndent&&(e.sCount[t]+=e.blkIndent),e.md.block.tokenize(e,t,o),e.parentType=h,e.blkIndent-=4,e.tShift[t]=b,e.sCount[t]=p,e.bMarks[t]=m,a=new S("footnoteReferenceClose","",-1),a.level=--e.level,e.tokens.push(a),!0},Dt=(e,t)=>{let o,n,r;const a=e.posMax,i=e.pos;if(i+2>=a||e.src.charAt(i)!=="^"||e.src.charAt(i+1)!=="[")return!1;const s=i+2,l=rt(e,i+1);return l<0?!1:(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.md.inline.parse(e.src.slice(s,l),e.md,e.env,r=[]),n=e.push("footnoteRef","",0),n.meta={id:o},e.env.footnotes.list[o]={content:e.src.slice(s,l),tokens:r}),e.pos=l+1,e.posMax=a,!0)},Nt=(e,t)=>{let o,n,r,a;const i=e.posMax,s=e.pos;if(s+3>i||!e.env.footnotes||!e.env.footnotes.refs||e.src.charAt(s)!=="["||e.src.charAt(s+1)!=="^")return!1;for(o=s+2;o<i;o++){if(e.src.charAt(o)===" "||e.src.charAt(o)===`
`)return!1;if(e.src.charAt(o)==="]")break}if(o===s+2||o>=i)return!1;o+=1;const l=e.src.slice(s+2,o-1);return typeof e.env.footnotes.refs[`:${l}`]>"u"?!1:(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[`:${l}`]<0?(n=e.env.footnotes.list.length,e.env.footnotes.list[n]={label:l,count:0},e.env.footnotes.refs[`:${l}`]=n):n=e.env.footnotes.refs[`:${l}`],r=e.env.footnotes.list[n].count,e.env.footnotes.list[n].count=e.env.footnotes.list[n].count+1,a=e.push("footnoteRef","",0),a.meta={id:n,subId:r,label:l}),e.pos=o,e.posMax=i,!0)},Lt=e=>{let t,o,n,r,a,i=!1;const s={};if(!e.env.footnotes||(e.tokens=e.tokens.filter(c=>c.type==="footnoteReferenceOpen"?(i=!0,r=[],a=c.meta.label,!1):c.type==="footnoteReferenceClose"?(i=!1,s[`:${a}`]=r,!1):(i&&r.push(c),!i)),!e.env.footnotes.list))return!1;const{list:l}=e.env.footnotes;o=new S("footnoteBlockOpen","",1),e.tokens.push(o);for(let c=0,{length:u}=l;c<u;c++){o=new S("footnoteOpen","",1),o.meta={id:c,label:l[c].label},e.tokens.push(o),l[c].tokens?(n=[],o=new S("paragraph_open","p",1),o.block=!0,n.push(o),o=new S("inline","",0),o.children=l[c].tokens,o.content=l[c].content,n.push(o),o=new S("paragraph_close","p",-1),o.block=!0,n.push(o)):l[c].label?n=s[`:${l[c].label}`]:n=[],n&&(e.tokens=e.tokens.concat(n)),e.tokens[e.tokens.length-1].type==="paragraph_close"?t=e.tokens.pop()||null:t=null;for(let m=0;m<(Number(l[c].count)>0?l[c].count:1);m++)o=new S("footnoteAnchor","",0),o.meta={id:c,subId:m,label:l[c].label},e.tokens.push(o);t&&e.tokens.push(t),o=new S("footnoteClose","",-1),e.tokens.push(o)}return o=new S("footnoteBlockClose","",-1),e.tokens.push(o),!0},ke=e=>{e.renderer.rules.footnoteRef=At,e.renderer.rules.footnoteBlockOpen=It,e.renderer.rules.footnoteBlockClose=Ot,e.renderer.rules.footnoteOpen=Pt,e.renderer.rules.footnoteClose=Rt,e.renderer.rules.footnoteAnchor=Tt,e.renderer.rules.footnoteCaption=Mt,e.renderer.rules.footnoteAnchorName=St,e.block.ruler.before("reference","footnoteDef",Et,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnoteInline",Dt),e.inline.ruler.after("footnoteInline","footnoteRef",Nt),e.core.ruler.after("inline","footnoteTail",Lt)},$e=(e,t={})=>{["info","note","tip","warning","danger"].forEach(o=>{e.use(M,{name:o,openRender:(n,r,a,i)=>{var s;let l=n[r].info.trim().slice(o.length).trim();if(!l){const{filePathRelative:c}=i,u=ne(c??""),m=oe(t,u);l=(s=t[m])==null?void 0:s[o]}return`<div class="custom-container ${o}">
<p class="custom-container-title">${l||o}</p>
`},closeRender:()=>`</div>
`})}),e.use(o=>M(o,{name:"details",openRender:(n,r,a,i)=>{var s;let l=n[r].info.trim().slice(7).trim();if(!l){const{filePathRelative:c}=i,u=ne(c??""),m=oe(t,u);l=(s=t[m])==null?void 0:s.details}return`<details class="custom-container details"><summary>${l||"Details"}</summary>
`},closeRender:()=>`</details>
`}))},ve=(e,{light:t=["gh-light-mode-only","light"],dark:o=["gh-dark-mode-only","dark"]}={})=>{const n=e.renderer.rules.image;e.renderer.rules.image=(r,a,i,s,l)=>{const c=r[a],u=c.attrGet("src");return u&&(t.some(m=>u.endsWith(`#${m}`))?(c.attrSet("data-mode","lightmode-only"),c.attrSet("src",u.replace(/#.*?$/,""))):o.some(m=>u.endsWith(`#${m}`))&&(c.attrSet("data-mode","darkmode-only"),c.attrSet("src",u.replace(/#.*?$/,"")))),n(r,a,i,s,l)}},_e=(e,t,o)=>{let n;const r=t,a={ok:!1,pos:t,value:""};for(n=e.charCodeAt(t);t<o&&n>=48&&n<=57||n===37;)n=e.charCodeAt(++t);return a.ok=!0,a.pos=t,a.value=e.slice(r,t),a},Ft=(e,t,o)=>{const n={ok:!1,pos:0,width:"",height:""};if(t>=o||e.charAt(t)!=="=")return n;t+=1;const r=e.charCodeAt(t);if(r!==120&&(r<48||r>57))return n;const a=_e(e,t,o);if(t=a.pos,e.charAt(t)!=="x")return n;t+=1;const i=_e(e,t,o);return t=i.pos,n.width=a.value,n.height=i.value,n.pos=t,n.ok=!0,n},Ut=(e,t)=>{const o=e.env,n=e.pos,r=e.posMax;if(e.src.charAt(e.pos)!=="!"||e.src.charAt(e.pos+1)!=="[")return!1;const a=e.pos+2,i=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(i<0)return!1;let s=i+1,l,c="",u="",m="",b="";if(s<r&&e.src.charAt(s)==="("){for(s+=1;s<r&&(l=e.src.charCodeAt(s),!(!e.md.utils.isSpace(l)&&l!==10));s++);if(s>=r)return!1;let p;p=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),p.ok&&(c=e.md.normalizeLink(p.str),e.md.validateLink(c)?s=p.pos:c="");const h=s;for(;s<r&&(l=e.src.charCodeAt(s),!(!e.md.utils.isSpace(l)&&l!==10));s++);if(p=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<r&&h!==s&&p.ok)for(u=p.str,s=p.pos;s<r&&(l=e.src.charCodeAt(s),!(!e.md.utils.isSpace(l)&&l!==10));s++);else u="";if(s-1>=0&&(l=e.src.charCodeAt(s-1),l===32&&(p=Ft(e.src,s,e.posMax),p.ok)))for(m=p.width,b=p.height,s=p.pos;s<r&&(l=e.src.charCodeAt(s),!(l!==32&&l!==10));s++);if(s>=r||e.src.charAt(s)!==")")return e.pos=n,!1;s+=1}else{let p="";if(typeof o.references>"u")return!1;if(s<r&&e.src.charAt(s)==="["){const f=s+1;s=e.md.helpers.parseLinkLabel(e,s),s>=0?p=e.src.slice(f,s++):s=i+1}else s=i+1;p||(p=e.src.slice(a,i));const h=o.references[e.md.utils.normalizeReference(p)];if(!h)return e.pos=n,!1;c=h.href,u=h.title||""}if(!t){const p=e.src.slice(a,i),h=[];e.md.inline.parse(p,e.md,e.env,h);const f=e.push("image","img",0);f.attrs=[["src",c],["alt",""]],u&&f.attrs.push(["title",u]),m!==""&&f.attrs.push(["width",m]),b!==""&&f.attrs.push(["height",b]),f.children=h,f.content=p}return e.pos=s,e.posMax=r,!0},Ce=e=>{e.inline.ruler.before("emphasis","image",Ut)},xe=(e,{light:t=["gh-light-mode-only","light"],dark:o=["gh-dark-mode-only","dark"]}={})=>{const n=e.renderer.rules.image;e.renderer.rules.image=(r,a,i,s,l)=>{const c=r[a],u=c.attrGet("src"),m=c.attrGet("title");u&&(t.some(p=>u.endsWith(`#${p}`))?(c.attrSet("data-mode","lightmode-only"),c.attrSet("src",u.replace(/#.*?$/,""))):o.some(p=>u.endsWith(`#${p}`))&&(c.attrSet("data-mode","darkmode-only"),c.attrSet("src",u.replace(/#.*?$/,""))));const b=n(r,a,i,s,l);return m?`<figure>${b}<figcaption>${m}</figcaption></figure>`:b}},we=(e,t)=>{const o=t>0?e.src.charAt(t-1):"",n=t+1<=e.posMax?e.src.charAt(t+1):"";return{canOpen:n!==" "&&n!=="	",canClose:!(o===" "||o==="	"||/[0-9]/u.exec(n))}},zt=(e,t)=>{let o,n,r,a;if(e.src[e.pos]!=="$")return!1;if(r=we(e,e.pos),!r.canOpen)return t||(e.pending+="$"),e.pos+=1,!0;const i=e.pos+1;for(o=i;(o=e.src.indexOf("$",o))!==-1;){for(n=o-1;e.src[n]==="\\";)n-=1;if((o-n)%2===1)break;o+=1}return o===-1?(t||(e.pending+="$"),e.pos=i,!0):o-i===0?(t||(e.pending+="$$"),e.pos=i+1,!0):(r=we(e,o),r.canClose?(t||(a=e.push("math_inline","math",0),a.markup="$",a.content=e.src.slice(i,o)),e.pos=o+1,!0):(t||(e.pending+="$"),e.pos=i,!0))},Gt=(e,t,o,n)=>{let r,a,i,s,l=!1,c=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(c+2>u||e.src.slice(c,c+2)!=="$$")return!1;if(c+=2,r=e.src.slice(c,u),n)return!0;for(r.trim().endsWith("$$")&&(r=r.trim().slice(0,-2),l=!0),i=t;!l&&(i+=1,!(i>=o||(c=e.bMarks[i]+e.tShift[i],u=e.eMarks[i],c<u&&e.tShift[i]<e.blkIndent)));)e.src.slice(c,u).trim().endsWith("$$")&&(s=e.src.slice(0,u).lastIndexOf("$$"),a=e.src.slice(c,s),l=!0);e.line=i+1;const m=e.push("math_block","math",0);return m.block=!0,m.content=(r!=null&&r.trim()?`
${r}
`:`
`)+e.getLines(t+1,i,e.tShift[t],!0)+(a!=null&&a.trim()?a:""),m.map=[t,e.line],m.markup="$$",!0},H=(e,t)=>{const{render:o}=t||{};if(typeof o!="function")return console.error('markdown-it tex: "render" option should be a function');e.inline.ruler.after("escape","math_inline",zt),e.block.ruler.after("blockquote","math_block",Gt,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=(n,r)=>o(n[r].content,!1),e.renderer.rules.math_block=(n,r)=>o(n[r].content,!0)},Jt=/\r\n?|\n/g,je=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/gu,Se=(e,t,o)=>{const n=e.attrIndex(t),r=[t,o];n<0?e.attrPush(r):e.attrs[n]=r},Wt=(e,t)=>{const o=e[t].level-1;for(let n=t-1;n>=0;n--)if(e[n].level===o)return n;return-1},Bt=e=>(e==null?void 0:e.type)==="inline",Vt=e=>(e==null?void 0:e.type)==="paragraph_open",qt=e=>(e==null?void 0:e.type)==="list_item_open",D=e=>e.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#039;"),Ht=at(import.meta.url),Xt=(e,t)=>{try{return re.renderToString(e,{...t,displayMode:!1})}catch(o){return t.throwOnError&&console.warn(o),`<span class='katex-error' title='${D(o.toString())}'>${D(e)}</span>`}},Yt=(e,t)=>{try{return`<p class='katex-block'>${re.renderToString(e,{...t,displayMode:!0,strict:o=>o==="newLineInDisplayMode"?"ignore":"warn"})}</p>
`}catch(o){return t.throwOnError&&console.warn(o),`<p class='katex-block katex-error' title='${D(o.toString())}'>${D(e)}</p>
`}},Me=(e,t={})=>{const{mhchem:o=!1,...n}=t;o&&Ht("katex/contrib/mhchem");const r={throwOnError:!1,...n};e.use(H,{render:(a,i)=>i?Yt(a,r):Xt(a,r)})},Kt=(e,t,o)=>{const n=ut();ft(n);const r=lt.document(e,t),a=n.outerHTML(r.convert(e,{display:o})),i=n.outerHTML(t.OutputJax.styleSheet(r));return it(a+i)},Ae=(e,t={})=>{const o={InputJax:new ct({packages:dt,...t.tex}),OutputJax:t.output==="chtml"?new pt({...t.chtml}):new mt({fontCache:"none",...t.svg})};e.use(H,{render:(n,r)=>Kt(n,o,r)})},Ie=e=>{const t=e.renderer.rules.image;e.renderer.rules.image=(o,n,r,a,i)=>(o[n].attrSet("loading","lazy"),t(o,n,r,a,i))},Qt=(e,t)=>{const o=e.pos,n=e.src.charAt(o);if(t||n!=="=")return!1;const r=e.scanDelims(e.pos,!0);let{length:a}=r;if(a<2)return!1;let i;a%2&&(i=e.push("text","",0),i.content=n,a-=1);for(let s=0;s<a;s+=2)i=e.push("text","",0),i.content=`${n}${n}`,(r.can_open||r.can_close)&&e.delimiters.push({marker:61,length:0,jump:s/2,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0},Oe=(e,t)=>{let o;const n=[],r=t.length;for(let a=0;a<r;a++){const i=t[a];if(i.marker===61&&i.end!==-1){const s=t[i.end];o=e.tokens[i.token],o.type="mark_open",o.tag="mark",o.nesting=1,o.markup="==",o.content="",o=e.tokens[s.token],o.type="mark_close",o.tag="mark",o.nesting=-1,o.markup="==",o.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="="&&n.push(s.token-1)}}for(;n.length;){const a=n.pop();let i=a+1;for(;i<e.tokens.length&&e.tokens[i].type==="mark_close";)i+=1;i-=1,a!==i&&(o=e.tokens[i],e.tokens[i]=e.tokens[a],e.tokens[a]=o)}},Pe=e=>{e.inline.ruler.before("emphasis","mark",Qt),e.inline.ruler2.before("emphasis","mark",t=>{const o=t.tokens_meta||[];Oe(t,t.delimiters);for(let n=0;n<o.length;n++){const r=o[n];r!=null&&r.delimiters&&Oe(t,r.delimiters)}return!0})},Zt=/^@include\(([^)]*?)(?:\{(\d+)?-(\d+)?\})?\)$/,Re=({filePath:e,lineStart:t,lineEnd:o},{cwd:n,includedFiles:r,resolvedPath:a})=>{let i=e;if(!w.isAbsolute(e)){if(!n)return console.error(`Include: Error when resolving path: ${e}`),`
Error when resolving path
`;i=w.resolve(n,e)}if(r.push(i),!Q.existsSync(i))return console.error(`Include: ${i} not found`),`
File not found
`;const s=Q.readFileSync(i).toString().replace(Jt,`
`).split(`
`).slice(t&&t-1,o);if(a&&i.endsWith(".md")){const l=w.dirname(i);s.unshift(`@include-push(${l})`),s.push("@include-pop()")}return s.join(`
`).replace(/\n?$/,`
`)},X=(e,t,{cwd:o,includedFiles:n})=>e.split(`
`).map(r=>{if(r.startsWith("@include")){const a=r.match(Zt);if(a){const[,i,s,l]=a,c=t.getPath(i),u=t.resolveImagePath||t.resolveLinkPath,m=Re({filePath:c,lineStart:s?Number.parseInt(s,10):0,lineEnd:l?Number.parseInt(l,10):void 0},{cwd:o,includedFiles:n,resolvedPath:u});return t.deep&&c.endsWith(".md")?X(m,t,{cwd:w.isAbsolute(c)?w.dirname(c):o?w.resolve(o,w.dirname(c)):null,includedFiles:n}):m}}return r}).join(`
`),Te=e=>t=>{const o=t.env,n=o.includedFiles||(o.includedFiles=[]);t.src=X(t.src,e,{cwd:o.filePath?w.dirname(o.filePath):null,includedFiles:n})},en=/^@include-push\(([^)]*?)\)$/,tn=/^@include-pop\(\)$/,nn=(e,t,o,n)=>{const r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],i=e.src.slice(r,a);let s=i.startsWith("@include-push");if(s){const l=i.match(en);if(l){if(n)return!0;const[,c]=l;e.line=t+1;const u=e.push("include_push","",0);u.map=[t,e.line],u.info=c,u.markup="incPush"}else s=!1}return s},on=(e,t,o,n)=>{const r=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],i=e.src.slice(r,a);let s=i.startsWith("@include-pop");if(s)if(i.match(tn)){if(n)return!0;e.line=t+1;const l=e.push("include_pop","",0);l.map=[t,e.line],l.markup="incPop"}else s=!1;return s},Ee=(e,t,o,n)=>{var r;const a=t.attrIndex(e),i=(r=t.attrs)==null?void 0:r[a][1];if((i==null?void 0:i.startsWith("."))&&Array.isArray(n)){const{length:s}=n;if(s){const l=w.relative(w.dirname(o),n[s-1]);t.attrs[a][1]=`.${w.sep}${w.join(l,i)}`}}},De=(e,{getPath:t=a=>a,deep:o=!1,resolveLinkPath:n=!0,resolveImagePath:r=!0}={})=>{if(e.core.ruler.after("normalize","md_import",Te({getPath:t,deep:o,resolveLinkPath:n,resolveImagePath:r})),r||n){if(e.block.ruler.before("table","md_include_push",nn,{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.before("table","md_include_pop",on,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.include_push=(a,i,s,l)=>{const c=a[i];return(l.includedPaths||(l.includedPaths=[])).push(c.info),""},e.renderer.rules.include_pop=(a,i,s,l)=>{const c=l.includedPaths;return Array.isArray(c)?c.pop():console.error("Include: include_pop failed, no include_push."),""},r){const a=e.renderer.rules.image;e.renderer.rules.image=(i,s,l,c,u)=>{const m=i[s];return c.filePath&&Ee("src",m,c.filePath,c.includedPaths),a(i,s,l,c,u)}}if(n){const a=e.renderer.rules.link_open||((i,s,l,c,u)=>u.renderToken(i,s,l));e.renderer.rules.link_open=(i,s,l,c,u)=>{const m=i[s];return c.filePath&&Ee("href",m,c.filePath,c.includedPaths),a(i,s,l,c,u)}}}},Ne=(e,t)=>{const o=e[t],n=`mermaid-${t}`,{content:r}=o;return`<Mermaid id="${n}" code="${j(r)}"></Mermaid>`},P=(e,t,o)=>`<Mermaid id="mermaid-${o}" code="${j(`${e}
${t.split(`
`).map(n=>n?`  ${n}`:"").join(`
`)}`)}"></Mermaid>`,Le=e=>{const t=e.renderer.rules.fence;e.renderer.rules.fence=(...o)=>{const[n,r]=o,{content:a,info:i}=n[r];return i.trim()==="mermaid"?Ne(...o):i.trim()==="sequence"?P("sequenceDiagram",a,r):i.trim()==="class"?P("classDiagram",a,r):i.trim()==="state"?P("stateDiagram-v2",a,r):i.trim()==="er"?P("erDiagram",a,r):i.trim()==="journey"?P("journey",a,r):i.trim()==="gantt"?P("gantt",a,r):i.trim()==="pie"?P("pie",a,r):i.trim()==="git-graph"?P("gitGraph",a,r):i.trim()==="c4c"?P("C4Context",a,r):t(...o)},e.renderer.rules.mermaid=Ne},Fe="@",rn=["file","import","setting"],sn=e=>(t,o,n,r)=>{let a=t.bMarks[o]+t.tShift[o],i=t.eMarks[o];if(t.src[a]!==":")return!1;let s=a+1;for(;s<=i&&t.src[s]===":";)s+=1;const l=s-a;if(l<3)return!1;const c=t.src.slice(a,s),u=t.src.slice(s,i),m=u.trimStart().split(" ",2)[0],b=u.trimStart().slice(e.length).trim();if(m.trim()!==e)return!1;if(r)return!0;let p=o,h=!1;for(;p<n&&(p+=1,a=t.bMarks[p]+t.tShift[p],i=t.eMarks[p],!(a<i&&t.sCount[p]<t.blkIndent));)if(t.src[a]===":"&&t.sCount[p]-t.blkIndent<4){for(s=a+1;s<=i&&t.src[s]===":";s++);if(s-a>=l&&(s=t.skipSpaces(s),s>=i)){h=!0;break}}const f=t.parentType,g=t.lineMax;t.parentType=`${e}`,t.lineMax=p-(h?1:0);const v=t.push(`${e}_open`,"template",1);v.markup=c,v.block=!0,v.info=b,v.map=[o,p-(h?1:0)],t.md.block.tokenize(t,o+1,p-(h?1:0));const $=t.push(`${e}_close`,"template",-1);return $.markup=t.src.slice(a,s),$.block=!0,t.parentType=f,t.lineMax=g,t.line=p+(h?1:0),!0},an=e=>(t,o,n,r)=>{let a=t.bMarks[o]+t.tShift[o],i=t.eMarks[o];const s=`${Fe}${e}`;if(t.src.charAt(a)!=="@")return!1;let l;for(l=0;l<s.length;l++)if(s[l]!==t.src[a+l])return!1;const c=t.src.slice(a,a+l),u=t.src.slice(a+l,i);if(r)return!0;let m=o,b=!1;for(;m<n&&(m+=1,a=t.bMarks[m]+t.tShift[m],i=t.eMarks[m],!(a<i&&t.sCount[m]<t.blkIndent));)if(t.src[a]===Fe&&t.sCount[m]<=t.sCount[o]){let v=!0;for(l=0;l<s.length;l++)if(s[l]!==t.src[a+l]){v=!1;break}if(v){b=!0,m-=1;break}}const p=t.parentType,h=t.lineMax;t.parentType=`${e}`,t.lineMax=m;const f=t.push(`${e}_open`,"template",1);f.block=!0,f.markup=c,f.info=u.trim(),f.map=[o,m],t.md.block.tokenize(t,o+1,m);const g=t.push(`${e}_close`,"template",-1);return g.block=!0,g.markup="",t.parentType=p,t.lineMax=h,t.line=m+(b?1:0),!0},N=(e,{name:t="playground",component:o="Playground",propsGetter:n}={name:"playground",component:"Playground",propsGetter:r=>({key:r.key,title:r.title||"",files:encodeURIComponent(JSON.stringify(r.files)),settings:encodeURIComponent(JSON.stringify(r.settings||{}))})})=>{e.block.ruler.before("fence",`${t}`,sn(t),{alt:["paragraph","reference","blockquote","list"]}),rn.forEach(r=>{e.block.ruler.__rules__.find(({name:a})=>a==="marker")||e.block.ruler.before("fence","tab",an(r),{alt:["paragraph","reference","blockquote","list"]})}),e.renderer.rules[`${t}_open`]=(r,a)=>{const{info:i}=r[a],s={key:Ze(`playground${a}-${i}`),title:encodeURIComponent(i),settings:{},files:{}};let l=null,c=!1;for(let m=a;m<r.length;m++){const{block:b,type:p,info:h,content:f}=r[m];if(b){if(p===`${t}_close`)break;if(p===`${t}_open`)continue;if(p==="file_open"){if(!h)continue;l=h}else p==="import_open"&&(s.importMap=l=h||"import-map.json");if(p==="setting_open"&&(c=!0),p==="setting_close"&&(c=!1),p==="file_close"||p==="import_close"||p==="setting_close"||!f){r[m].type=`${t}_empty`,r[m].hidden=!0;continue}if(c){p==="fence"&&h==="json"&&(s.settings=JSON.parse(f.trim()));continue}p==="fence"&&l&&(s.files[l]={ext:h,content:f}),r[m].type=`${t}_empty`,r[m].hidden=!0}}const u=n(s);return`<${o} ${Object.entries(u).map(([m,b])=>`${m}="${D(b)}"`).join(" ")}>
`},e.renderer.rules[`${t}_close`]=()=>`</${o}>
`},ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",cn=(e,t,o)=>{if(e==null)return"";let n,r,a,i={},s={},l="",c="",u="",m=2,b=3,p=2,h=[],f=0,g=0;for(a=0;a<e.length;a+=1)if(l=e.charAt(a),Object.prototype.hasOwnProperty.call(i,l)||(i[l]=b++,s[l]=!0),c=u+l,Object.prototype.hasOwnProperty.call(i,c))u=c;else{if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(n=0;p>n;n++)f<<=1,g==t-1?(g=0,h.push(o(f)),f=0):g++;for(r=u.charCodeAt(0),n=0;8>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1}else{for(r=1,n=0;p>n;n++)f=f<<1|r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r=0;for(r=u.charCodeAt(0),n=0;16>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1}m--,m==0&&(m=Math.pow(2,p),p++),delete s[u]}else for(r=i[u],n=0;p>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1;m--,m==0&&(m=Math.pow(2,p),p++),i[c]=b++,u=String(l)}if(u!==""){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(n=0;p>n;n++)f<<=1,g==t-1?(g=0,h.push(o(f)),f=0):g++;for(r=u.charCodeAt(0),n=0;8>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1}else{for(r=1,n=0;p>n;n++)f=f<<1|r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r=0;for(r=u.charCodeAt(0),n=0;16>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1}m--,m==0&&(m=Math.pow(2,p),p++),delete s[u]}else for(r=i[u],n=0;p>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1;m--,m==0&&(m=Math.pow(2,p),p++)}for(r=2,n=0;p>n;n++)f=f<<1|1&r,g==t-1?(g=0,h.push(o(f)),f=0):g++,r>>=1;for(;;){if(f<<=1,g==t-1){h.push(o(f));break}g++}return h.join("")},pn=e=>cn(e,6,t=>ln.charAt(t)),mn=[{name:"help",type:"boolean"},{name:"help",type:"boolean"},{name:"watch",type:"boolean"},{name:"preserveWatchOutput",type:"boolean"},{name:"listFiles",type:"boolean"},{name:"explainFiles",type:"boolean"},{name:"listEmittedFiles",type:"boolean"},{name:"pretty",type:"boolean"},{name:"traceResolution",type:"boolean"},{name:"diagnostics",type:"boolean"},{name:"extendedDiagnostics",type:"boolean"},{name:"generateCpuProfile",type:"string"},{name:"generateTrace",type:"string"},{name:"incremental",type:"boolean"},{name:"assumeChangesOnlyAffectDirectDependencies",type:"boolean"},{name:"locale",type:"string"},{name:"all",type:"boolean"},{name:"version",type:"boolean"},{name:"init",type:"boolean"},{name:"project",type:"string"},{name:"build",type:"boolean"},{name:"showConfig",type:"boolean"},{name:"listFilesOnly",type:"boolean"},{name:"target",type:{es3:0,es5:1,es6:2,es2015:2,es2016:3,es2017:4,es2018:5,es2019:6,es2020:7,es2021:8,es2022:9,esnext:99}},{name:"module",type:{none:0,commonjs:1,amd:2,system:4,umd:3,es6:5,es2015:5,es2020:6,es2022:7,esnext:99,node16:100,nodenext:199}},{name:"lib",type:"list"},{name:"allowJs",type:"boolean"},{name:"checkJs",type:"boolean"},{name:"jsx",type:{preserve:1,"react-native":3,react:2,"react-jsx":4,"react-jsxdev":5}},{name:"declaration",type:"boolean"},{name:"declarationMap",type:"boolean"},{name:"emitDeclarationOnly",type:"boolean"},{name:"sourceMap",type:"boolean"},{name:"outFile",type:"string"},{name:"outDir",type:"string"},{name:"rootDir",type:"string"},{name:"composite",type:"boolean"},{name:"tsBuildInfoFile",type:"string"},{name:"removeComments",type:"boolean"},{name:"noEmit",type:"boolean"},{name:"importHelpers",type:"boolean"},{name:"importsNotUsedAsValues",type:{remove:0,preserve:1,error:2}},{name:"downlevelIteration",type:"boolean"},{name:"isolatedModules",type:"boolean"},{name:"strict",type:"boolean"},{name:"noImplicitAny",type:"boolean"},{name:"strictNullChecks",type:"boolean"},{name:"strictFunctionTypes",type:"boolean"},{name:"strictBindCallApply",type:"boolean"},{name:"strictPropertyInitialization",type:"boolean"},{name:"noImplicitThis",type:"boolean"},{name:"useUnknownInCatchVariables",type:"boolean"},{name:"alwaysStrict",type:"boolean"},{name:"noUnusedLocals",type:"boolean"},{name:"noUnusedParameters",type:"boolean"},{name:"exactOptionalPropertyTypes",type:"boolean"},{name:"noImplicitReturns",type:"boolean"},{name:"noFallthroughCasesInSwitch",type:"boolean"},{name:"noUncheckedIndexedAccess",type:"boolean"},{name:"noImplicitOverride",type:"boolean"},{name:"noPropertyAccessFromIndexSignature",type:"boolean"},{name:"moduleResolution",type:{node:2,classic:1,node16:3,nodenext:99}},{name:"baseUrl",type:"string"},{name:"paths",type:"object"},{name:"rootDirs",type:"list"},{name:"typeRoots",type:"list"},{name:"types",type:"list"},{name:"allowSyntheticDefaultImports",type:"boolean"},{name:"esModuleInterop",type:"boolean"},{name:"preserveSymlinks",type:"boolean"},{name:"allowUmdGlobalAccess",type:"boolean"},{name:"moduleSuffixes",type:"list"},{name:"sourceRoot",type:"string"},{name:"mapRoot",type:"string"},{name:"inlineSourceMap",type:"boolean"},{name:"inlineSources",type:"boolean"},{name:"experimentalDecorators",type:"boolean"},{name:"emitDecoratorMetadata",type:"boolean"},{name:"jsxFactory",type:"string"},{name:"jsxFragmentFactory",type:"string"},{name:"jsxImportSource",type:"string"},{name:"resolveJsonModule",type:"boolean"},{name:"out",type:"string"},{name:"reactNamespace",type:"string"},{name:"skipDefaultLibCheck",type:"boolean"},{name:"charset",type:"string"},{name:"emitBOM",type:"boolean"},{name:"newLine",type:{crlf:0,lf:1}},{name:"noErrorTruncation",type:"boolean"},{name:"noLib",type:"boolean"},{name:"noResolve",type:"boolean"},{name:"stripInternal",type:"boolean"},{name:"disableSizeLimit",type:"boolean"},{name:"disableSourceOfProjectReferenceRedirect",type:"boolean"},{name:"disableSolutionSearching",type:"boolean"},{name:"disableReferencedProjectLoad",type:"boolean"},{name:"noImplicitUseStrict",type:"boolean"},{name:"noEmitHelpers",type:"boolean"},{name:"noEmitOnError",type:"boolean"},{name:"preserveConstEnums",type:"boolean"},{name:"declarationDir",type:"string"},{name:"skipLibCheck",type:"boolean"},{name:"allowUnusedLabels",type:"boolean"},{name:"allowUnreachableCode",type:"boolean"},{name:"suppressExcessPropertyErrors",type:"boolean"},{name:"suppressImplicitAnyIndexErrors",type:"boolean"},{name:"forceConsistentCasingInFileNames",type:"boolean"},{name:"maxNodeModuleJsDepth",type:"number"},{name:"noStrictGenericChecks",type:"boolean"},{name:"useDefineForClassFields",type:"boolean"},{name:"preserveValueImports",type:"boolean"},{name:"keyofStringsOnly",type:"boolean"},{name:"plugins",type:"list"},{name:"moduleDetection",type:{auto:2,legacy:1,force:3}}],Ue=(e,t={})=>{const o=`#code/${pn(e)}`,n=Object.entries(t).map(([r,a])=>{const i=mn.find(l=>l.name===r);if(!i||a===null||a===void 0)return"";const{type:s}=i;if(typeof s=="object"){const l=s[a];return(l==null?void 0:l.toString())||""}return`${r}=${encodeURIComponent(a)}`}).filter(r=>r.length).join("&");return`${n?`?${n}`:""}${o}`},ze=({service:e="https://www.typescriptlang.org/play",...t}={})=>({name:"playground#ts",propsGetter:({title:o="",files:n,settings:r,key:a})=>{const i=Object.keys(n).filter(l=>l.endsWith(".ts"));i.length!==1&&console.error("TS playground only support 1 ts file");const s=`${e}${Ue(n[i[0]].content,G({},r||{},t))}`;return{key:a,title:o,link:encodeURIComponent(s)}}}),un=["html","js","ts","vue","jsx","tsx","json"],Ge=(e={})=>({name:"playground#vue",propsGetter:t=>{const{title:o="",files:n,settings:r,key:a}=t,i={service:"https://sfc.vuejs.org/",dev:!1,ssr:!1,...e,...r};return{key:a,title:o,link:encodeURIComponent(`${i.service}#${i.dev?"__DEV__":""}${i.ssr?"__SSR__":""}${Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(n).filter(([,{ext:s}])=>un.includes(s)).map(([s,{content:l}])=>{if(s==="import-map.json"){const c=JSON.parse(l);return[s,JSON.stringify(G({},{imports:{vue:"https://sfc.vuejs.org/vue.runtime.esm-browser.js",...i.ssr?{"vue/server-renderer":"https://sfc.vuejs.org/server-renderer.esm-browser.js"}:{}}},c))]}return[s,l]})))).toString("base64")}`)}}}),Y=(e,{name:t,open:o,close:n,render:r}={name:"uml",open:"start",close:"end",render:(a,i)=>{const s=a[i],{content:l,info:c,type:u}=s;return`<div class="${u}" title="${c}">${l}</div>`}})=>{const a=`@${o}`,i=`@${n}`,s=(l,c,u,m)=>{let b,p=!1,h=l.bMarks[c]+l.tShift[c],f=l.eMarks[c];if(l.src.charAt(h)!=="@")return!1;for(b=0;b<a.length;++b)if(a[b]!==l.src[h+b])return!1;const g=l.src.slice(h,h+b),v=l.src.slice(h+b,f);if(m)return!0;let $=c;for(;$<u&&(h=l.bMarks[$]+l.tShift[$],f=l.eMarks[$],!(h<f&&l.sCount[$]<l.blkIndent));){if(l.src.charAt(h)==="@"&&l.sCount[$]<=l.sCount[c]){let y=!0;for(b=0;b<i.length;++b)if(i[b]!==l.src[h+b]){y=!1;break}if(y&&l.skipSpaces(h+b)>=f){p=!0;break}}$+=1}const k=l.src.split(`
`).slice(c+1,$).join(`
`),d=l.push(t,"fence",0);return d.block=!0,d.info=v,d.content=k,d.map=[c,$],d.markup=g,l.line=$+(p?1:0),!0};e.block.ruler.before("fence",t,s,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules[t]=r},Je=e=>{e.use(Y,{name:"presentation",open:"slidestart",close:"slideend",render:(t,o)=>{const n=t[o],r=`presentation-${o}`,{content:a,info:i}=n;return`<Presentation id="${r}" code="${j(a)}" theme="${i.trim()||"auto"}"></Presentation>`}})},fn=(e,t)=>{let o,n;const r=e.posMax,a=e.pos;if(e.src.charAt(a)!=="~"||t||a+2>=r)return!1;for(e.pos=a+1;e.pos<r;){if(e.src.charAt(e.pos)==="~"){o=!0;break}e.md.inline.skipToken(e)}if(!o||a+1===e.pos)return e.pos=a,!1;const i=e.src.slice(a+1,e.pos);return/(^|[^\\])(\\\\)*\s/u.exec(i)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,n=e.push("sub_open","sub",1),n.markup="~",n=e.push("text","",0),n.content=i.replace(je,"$1"),n=e.push("sub_close","sub",-1),n.markup="~",e.pos=e.posMax+1,e.posMax=r,!0)},We=e=>{e.inline.ruler.after("emphasis","sub",fn)},dn=(e,t)=>{let o,n;const r=e.posMax,a=e.pos;if(e.src.charAt(a)!=="^"||t||a+2>=r)return!1;for(e.pos=a+1;e.pos<r;){if(e.src.charAt(e.pos)==="^"){o=!0;break}e.md.inline.skipToken(e)}if(!o||a+1===e.pos)return e.pos=a,!1;const i=e.src.slice(a+1,e.pos);return/(^|[^\\])(\\\\)*\s/u.exec(i)?(e.pos=a,!1):(e.posMax=e.pos,e.pos=a+1,n=e.push("sup_open","sup",1),n.markup="^",n=e.push("text","",0),n.content=i.replace(je,"$1"),n=e.push("sup_close","sup",-1),n.markup="^",e.pos=e.posMax+1,e.posMax=r,!0)},Be=e=>{e.inline.ruler.after("emphasis","sup",dn)},hn=e=>/^\[[xX \u00A0]\][ \u00A0]/.test(e.content),gn=(e,t)=>Bt(e[t])&&Vt(e[t-1])&&qt(e[t-2])&&hn(e[t]),bn=(e,t,o=!0)=>{const n=new S("checkbox_input","input",0);return n.attrs=[["type","checkbox"],["class","task-list-item-checkbox"],["id",t]],/^\[[xX]\][ \u00A0]/.test(e.content)&&n.attrs.push(["checked","checked"]),o&&n.attrs.push(["disabled","disabled"]),n},yn=e=>{const t=new S("label_open","label",1);return t.attrs=[["class","task-list-item-label"],["for",e]],t},kn=()=>new S("label_close","label",-1),$n=(e,t,o)=>{const n=`task-item-${t.env.tasklists++}`;e.children=e.children||[],e.children[0].content=e.children[0].content.slice(3),o.label&&(e.children.unshift(yn(n)),e.children.push(kn())),e.children.unshift(bn(e,n,o.disabled))},Ve=(e,{disabled:t=!0,label:o=!0}={})=>{e.core.ruler.after("inline","github-task-lists",n=>{const r=n.tokens;n.env.tasklists||(n.env.tasklists=0);for(let a=2;a<r.length;a++)gn(r,a)&&($n(r[a],n,{disabled:t,label:o}),Se(r[a-2],"class","task-list-item"),Se(r[Wt(r,a-2)],"class","task-list-container"));return!0})},qe=e=>{M(e,{name:"v-pre",openRender:()=>`<div v-pre>
`,closeRender:()=>`</div>
`})},vn=(e,t,o=[])=>{for(let n=1,r=e.length;n<r-1;n++){const a=e[n],{content:i,type:s}=a;if(s!=="text"||o.includes(i))continue;const l=t.find(({matcher:m})=>typeof m=="string"?m===i:m.test(i)),c=e[n-1],u=e[n+1];if(l&&c.tag===u.tag&&c.nesting===1&&u.nesting===-1){const m=l.replacer({tag:c.tag,content:a.content,attrs:Object.fromEntries(c.attrs||[])});m&&(c.tag=u.tag=m.tag,c.attrs=Object.entries(m.attrs),a.content=m.content),n+=2}}},He=(e,t=[])=>{Object.keys(t).length!=0&&e.core.ruler.push("stylize_tag",({env:o,tokens:n})=>{const{noStylize:r}=o.frontmatter||{};n.forEach(({type:a,children:i})=>{a==="inline"&&vn(i||[],t,r)})})},K={autoResize:!0,showCode:!1,showCompileOutput:!1,showImportMap:!0,clearConsole:!1,layout:"vertical",ssr:!1},_n=["html","js","ts","vue","jsx","tsx","json"],Cn=e=>Buffer.from(JSON.stringify(Object.fromEntries(Object.entries(e).filter(([,{ext:t}])=>_n.includes(t)).map(([t,o])=>[t,o.content])))).toString("base64"),Xe=e=>{e.use(N,{name:"vue-playground",component:"VuePlayground",propsGetter:({title:t="",key:o,files:n,settings:r})=>({title:t,key:o,settings:encodeURIComponent(JSON.stringify(r||{})),files:encodeURIComponent(Cn(n))})})},xn=e=>{e.use(M,{name:"demo",openRender:(t,o)=>{const{info:n}=t[o],r=/\[(.*)\]/u.exec(n),a=/^ demo\s*(?:\[.*?\])?\s*(.*)\s*$/u.exec(n);let i="";const s={};for(let l=o;l<t.length;l++){const{type:c,content:u,info:m}=t[l];if(c==="container_demo_close")break;!u||c==="fence"&&(m==="json"?i=j(u):s[m]=u)}return`
<CodeDemo id="code-demo-${o}" type="${(r==null?void 0:r[1])||"normal"}"${a?` title="${encodeURIComponent(a[1])}"`:""}${i?` config="${i}"`:""} code="${j(JSON.stringify(s))}">
`},closeRender:()=>"</CodeDemo>"})},wn=e=>{e.use(M,{name:"code-group",openRender:(t,o,n,r)=>(F.warn(`Deprecated code-group syntax found${r.filePathRelative?`in ${r.filePathRelative}`:""}`),`<CodeGroup>
`),closeRender:()=>`</CodeGroup>
`}),e.use(M,{name:"code-group-item",openRender:(t,o)=>{const{info:n}=t[o],r=n.split(":").pop()==="active";return`<CodeGroupItem title="${r?n.replace(/:active$/,""):n}"${r?" active":""}>
`},closeRender:()=>`</CodeGroupItem>
`})},jn=e=>{Y(e,{name:"flowchart",open:"flowstart",close:"flowend",render:(t,o)=>{console.warn('"@flowstart ... @flowend" is deprecated, you should use ```flow ... ``` instead.');const n=t[o],r=`flowchart-${o}`,{content:a,info:i}=n;return`<FlowChart id="${r}" code="${j(a)}" preset="${i.trim()||"vue"}"></FlowChart>`}})},Ye={"/en/":{info:"Info",note:"Note",tip:"Tips",warning:"Note",danger:"Warning",details:"Details"},"/zh/":{info:"相关信息",note:"注",tip:"提示",warning:"注意",danger:"警告",details:"详情"},"/zh-tw/":{info:"相關信息",note:"注",tip:"提示",warning:"注意",danger:"警告",details:"詳情"},"/de-at/":{info:"Information",note:"Note",tip:"Tips",warning:"Notiz",danger:"Warnung",details:"Details"},"/vi/":{info:"Thông tin",note:"Note",tip:"Tips",warning:"Lưu ý",danger:"Cẩn thận",details:"Chi tiết"},"/uk/":{info:"Інформація",note:"Note",tip:"Поради",warning:"Примітка",danger:"Увага",details:"Деталь"},"/ru/":{info:"Инфо",note:"Заметка",tip:"Совет",warning:"Примечание",danger:"Предупреждение",details:"Подробности"},"/br/":{info:"Informativo",note:"Note",tip:"Dicas",warning:"Avisos",danger:"Cuidado",details:"Detalhe"},"/pl/":{info:"Info",note:"Notatka",tip:"Porady",warning:"Notatka",danger:"Ostrzeżenie",details:"Dane"},"/sk/":{info:"Info",note:"Poznámka",tip:"Tip",warning:"Upozornenie",danger:"Pozor",details:"Podrobnosti"},"/fr/":{info:"Info",note:"Note",tip:"Conseil",warning:"Note",danger:"Avertissement",details:"Details"},"/es/":{info:"Información",note:"Nota",tip:"Consejos",warning:"Aviso",danger:"Advertencia",details:"Detalles"},"/ja/":{info:"関連情報",note:"注",tip:"ヒント",warning:"注意",danger:"警告",details:"詳細"}},Sn=Z(import.meta.url),C=st(w.resolve(Sn,"../client")),Mn=async(e,t,o=!1)=>{let n="",r="";const a=(i,s=!1)=>i in t?Boolean(t[i]):s&&"gfm"in t&&t.gfm||!1;return a("chart")&&(n+=`import ChartJS from "${C}components/ChartJS.js";
`,r+=`app.component("ChartJS", ChartJS);
`),a("codetabs")&&(n+=`import CodeTabs from "${C}components/CodeTabs.js";
`,r+=`app.component("CodeTabs", CodeTabs);
`,o&&(n+=`import { CodeGroup, CodeGroupItem } from "${C}compact/index.js";
`,r+=`app.component("CodeGroup", CodeGroup);
`,r+=`app.component("CodeGroupItem", CodeGroupItem);
`)),a("container")&&(n+=`import "${C}styles/container/index.scss";
`),a("demo")&&(n+=`import CodeDemo from "${C}components/CodeDemo.js";
`,r+=`app.component("CodeDemo", CodeDemo);
`),a("echarts")&&(n+=`import ECharts from "${C}components/ECharts.js";
`,r+=`app.component("ECharts", ECharts);
`),a("flowchart")&&(n+=`import FlowChart from "${C}components/FlowChart.js";
`,r+=`app.component("FlowChart", FlowChart);
`),a("footnote",!0)&&(n+=`import "${C}styles/footnote.scss";
`),a("imageMark",!0)&&(n+=`import "${C}styles/image-mark.scss";
`),a("imageTitle",!0)&&(n+=`import "${C}styles/image-title.scss";
`),a("mermaid")&&(n+=`import Mermaid from "${C}components/Mermaid.js";
`,r+=`app.component("Mermaid", Mermaid);
`),a("presentation")&&(n+=`import Presentation from "${C}components/Presentation.js";
`,r+=`app.component("Presentation", Presentation);
`),a("playground")&&(n+=`import Playground from "${C}components/Playground.js";
`,r+=`app.component("Playground", Playground);
`),a("tabs")&&(n+=`import Tabs from "${C}components/Tabs.js";
`,r+=`app.component("Tabs", Tabs);
`),a("tasklist",!0)&&(n+=`import "${C}styles/tasklist.scss";
`),a("katex")&&(n+=`import "${C}styles/katex.scss";
`),a("vuePlayground")&&(r+=`const VuePlayground = defineAsyncComponent(() => import("${C}components/VuePlayground.js"));
app.component("VuePlayground", VuePlayground);
`),e.writeTemp("md-enhance/config.js",`import { defineClientConfig } from "@vuepress/client";
import { defineAsyncComponent } from "vue";
${n}

export default defineClientConfig({
  enhance: ({ app }) => {
${r.split(`
`).map(i=>`    ${i}`).join(`
`)}
  }
});`)},An=async(e,t)=>{const o=["reveal","revealMarkdown",...t.map(n=>`reveal${n[0].toUpperCase()}${n.substring(1)}`)];await e.writeTemp("md-enhance/reveal.js",`import { ${o.join(", ")} } from "${C}reveal/index.js";

export const useReveal = () => [${o.map(n=>`${n}()`).join(", ")}
];`)},In=Z(import.meta.url),Ke=(e={gfm:!0},t=!1)=>o=>{t&&bt(e),o.env.isDebug&&F.info(`Options: ${e.toString()}`);const n=(d,y=!1)=>d in e?Boolean(e[d]):y&&"gfm"in e&&e.gfm||!1,r=nt({app:o,name:"md-enhance",default:Ye,config:e.locales}),a=n("chart"),i=n("echarts"),s=n("flowchart"),l=n("footnote",!0),c=n("imageMark",!0),u=n("tasklist",!0),m=n("mermaid"),b=n("presentation"),p=n("katex"),h=n("mathjax"),f=n("vuePlayground"),g=gt(o,e),v={macros:{"\\liiiint":"\\int\\!\\!\\!\\iiint","\\iiiint":"\\int\\!\\!\\!\\!\\iiint","\\idotsint":"\\int\\!\\cdots\\!\\int"},...typeof e.katex=="object"?e.katex:{}},$=typeof e.presentation=="object"&&Array.isArray(e.presentation.plugins)?e.presentation.plugins:[];et(o,{id:"hope"});let k=!1;return{name:"vuepress-plugin-md-enhance",define:()=>({MARKDOWN_ENHANCE_DELAY:e.delay||500,CODE_DEMO_OPTIONS:{...pe,...typeof e.demo=="object"?e.demo:{}},MERMAID_OPTIONS:typeof e.mermaid=="object"?e.mermaid:{},REVEAL_CONFIG:typeof e.presentation=="object"&&typeof e.presentation.revealConfig=="object"?e.presentation.revealConfig:{},VUE_PLAYGROUND_OPTIONS:typeof e.vuePlayground=="object"?G({},K,e.vuePlayground):K}),alias:{"vuepress-plugin-md-enhance/SlidePage":w.resolve(In,"../client/SlidePage.js")},extendsBundlerOptions:(d,y)=>{p&&v.output!=="html"?ee({app:y,config:d},ht):h&&ee({app:y,config:d},/^mjx-/),a&&(L({app:y,config:d},"chart.js/auto/auto.mjs"),T({app:y,config:d},"chart.js")),i&&(L({app:y,config:d},"echarts"),T({app:y,config:d},"echarts")),s&&(te({app:y,config:d},"flowchart.js/src/flowchart.parse.js"),T({app:y,config:d},"flowchart.js")),m&&(L({app:y,config:d},"mermaid"),T({app:y,config:d},"mermaid")),b&&(L({app:y,config:d},["reveal.js/dist/reveal.esm.js","reveal.js/plugin/markdown/markdown.esm.js",...$.map(x=>`reveal.js/plugin/${x}/${x}.esm.js`)]),T({app:y,config:d},"reveal.js")),f&&(te({app:y,config:d},"@vue/repl"),T({app:y,config:d},"@vue/repl"),ot({app:y,config:d},x=>{x.module.set("exprContextCritical",!1),x.module.set("unknownContextCritical",!1)}))},extendsMarkdown:d=>{if(n("gfm")&&(d.options.linkify=!0),n("attrs")&&d.use(le,typeof e.attrs=="object"?e.attrs:{}),n("align")&&d.use(ae),n("container")&&d.use($e,r),n("lazyLoad")&&d.use(Ie),n("imageTitle")&&d.use(xe),c&&d.use(ve,typeof e.imageMark=="object"?e.imageMark:{}),n("imageSize")&&d.use(Ce),n("sup")&&d.use(Be),n("sub")&&d.use(We),l&&d.use(ke),n("mark")&&d.use(Pe),u&&d.use(Ve,[typeof e.tasklist=="object"?e.tasklist:{}]),(n("vpre")||t)&&d.use(qe),p?d.use(Me,v):h&&d.use(Ae,typeof e.mathjax=="object"?e.mathjax:{}),n("include")&&d.use(De,typeof e.include=="object"?e.include:{}),n("stylize")&&d.use(He,e.stylize),n("codetabs")&&(d.use(de),t&&d.use(wn)),n("tabs")&&d.use(q),s&&(d.use(ye),t&&d.use(jn)),a&&d.use(ce),i&&d.use(ge),n("demo")&&(d.use(me),d.use(ue),d.use(fe),t&&d.use(xn)),m&&d.use(Le),b&&d.use(Je),typeof e.playground=="object"){const{presets:y=[],config:x={}}=e.playground;y.forEach(_=>{_==="ts"?d.use(N,ze(x.ts||{})):_==="vue"?d.use(N,Ge(x.vue||{})):typeof _=="object"&&d.use(N,_)})}f&&d.use(Xe)},extendsPage:(d,y)=>{g&&k&&se(d,y)},onInitialized:async d=>{k=!0,g&&d.pages.forEach(y=>se(y,d)),await An(d,$)},clientConfigFile:d=>Mn(d,e,t)}};export{pe as CODE_DEMO_DEFAULT_SETTING,K as DEFAULT_VUE_PLAYGROUND_OPTIONS,ae as align,le as attrs,ce as chart,de as codeTabs,M as container,Te as createIncludeCoreRule,Ke as default,ge as echarts,ye as flowchart,ke as footnote,ze as getTSPlaygroundPreset,Ue as getURL,Ge as getVuePlaygroundPreset,Re as handleInclude,$e as hint,ve as imageMark,Ce as imageSize,xe as imageTitle,De as include,Me as katex,Ie as lazyLoad,Pe as mark,Ye as markdownEnhanceLocales,Ae as mathjax,Ke as mdEnhancePlugin,Le as mermaid,me as normalDemo,N as playground,Je as presentation,fe as reactDemo,X as resolveInclude,He as stylize,We as sub,Be as sup,q as tabs,Ve as tasklist,H as tex,Y as uml,qe as vPre,ue as vueDemo,Xe as vuePlayground};
//# sourceMappingURL=index.js.map
