import{align as Re}from"@mdit/plugin-align";import{attrs as Ie}from"@mdit/plugin-attrs";import{figure as De}from"@mdit/plugin-figure";import{footnote as Me}from"@mdit/plugin-footnote";import{imgLazyload as _e}from"@mdit/plugin-img-lazyload";import{imgMark as Ee}from"@mdit/plugin-img-mark";import{imgSize as Te,obsidianImageSize as Ne}from"@mdit/plugin-img-size";import{include as Ae}from"@mdit/plugin-include";import{katex as Ue}from"@mdit/plugin-katex";import{mark as Fe}from"@mdit/plugin-mark";import{createMathjaxInstance as Le,mathjax as ze}from"@mdit/plugin-mathjax";import{stylize as Ge}from"@mdit/plugin-stylize";import{sub as Je}from"@mdit/plugin-sub";import{sup as Ve}from"@mdit/plugin-sup";import{tasklist as Be}from"@mdit/plugin-tasklist";import{ensureLeadingSlash as H,resolveLocalePath as Y,isPlainObject as v,ensureEndingSlash as We,isArray as qe}from"@vuepress/shared";import{useSassPalettePlugin as He}from"vuepress-plugin-sass-palette";import{utoa as C,entries as T,keys as Ye,endsWith as Ke,deepAssign as F,fromEntries as K,isAbsoluteUrl as Q,Logger as Qe,checkVersion as Xe,getLocales as Ze,getBundlerName as et,addViteConfig as tt,addViteSsrNoExternal as nt,addCustomElement as L,MATHML_TAGS as X,addViteOptimizeDepsExclude as N,addViteSsrExternal as R,addViteOptimizeDepsInclude as Z,addChainWebpack as ot}from"vuepress-shared/node";import{hash as rt,logger as at,getDirname as st,path as z,colors as I}from"@vuepress/utils";import{container as P}from"@mdit/plugin-container";import{tab as ee}from"@mdit/plugin-tab";import{uml as te}from"@mdit/plugin-uml";import{createRequire as it}from"node:module";const ne=n=>{P(n,{name:"chart",openRender:(e,r)=>{const t=e[r].info.trimStart().slice(5).trim(),o=`chart-${r}`;let a="{}",s="";for(let i=r;i<e.length;i++){const{type:l,content:g,info:d}=e[i];if(l==="container_chart_close")break;g&&(l==="fence"&&(d==="json"?(a=C(g),s="json"):(d==="js"||d==="javascript")&&(a=C(g),s="js")),e[i].type="chart_empty",e[i].hidden=!0)}return`<ChartJS id="${o}" config="${a}" ${t?`title="${encodeURIComponent(t)}" `:""}type="${s}">`},closeRender:()=>"</ChartJS>"})},oe={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"},G=n=>e=>P(e,{name:n,openRender:(r,t)=>{var o;const a=r[t].info.trimStart().slice(n.length).trim();let s="";const i={};for(let l=t;l<r.length;l++){const{type:g,content:d,info:c}=r[l],b=c?((o=e.utils.unescapeAll(c).trim().match(/^([^ :[{]+)/))==null?void 0:o[1])||"text":"";if(g===`container_${n}_close`)break;d&&g==="fence"&&(b==="json"?s=C(d):i[b]=d)}return`
<CodeDemo id="code-demo-${t}" type="${n.split("-")[0]}"${a?` title="${encodeURIComponent(a)}"`:""}${s?` config="${s}"`:""} code="${C(JSON.stringify(i))}">
`},closeRender:()=>"</CodeDemo>"}),re=G("normal-demo"),ae=G("vue-demo"),se=G("react-demo"),ie=n=>{ee(n,{name:"code-tabs",tabsOpenRenderer:({active:e,data:r},t,o)=>{const{meta:a}=t[o],s=r.map(({title:i,id:l})=>({title:i,...l?{id:l}:{}}));return`<CodeTabs id="${o}" :data='${JSON.stringify(s).replace(/'/g,"&#39")}'${e!==-1?` :active="${e}"`:""}${a.id?` tab-id="${a.id}"`:""}>
`},tabsCloseRenderer:()=>`</CodeTabs>
`,tabOpenRenderer:({index:e},r,t)=>{let o=!1;for(let a=t;a<r.length;a++){const{block:s,type:i}=r[a];if(s){if(i==="code-tabs_tab_close")break;if(i==="fence"&&!o){o=!0;continue}r[a].type="code_tab_empty",r[a].hidden=!0}}return`<template #tab${e}="{ title, value, isActive }">
`},tabCloseRenderer:()=>`</template>
`})},le=(n,e)=>{const r=n[e],t=`echarts-${e}`,{content:o,info:a}=r,s=a.trim().split(":",2)[1];return`<ECharts id="${t}" config="${C(o)}"${s?` title="${encodeURIComponent(s)}"`:""}></ECharts>`},pe=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{info:a}=t[o];return a.split(":",2)[0]==="echarts"?le(t,o):e(...r)},n.renderer.rules.echarts=le,P(n,{name:"echarts",openRender:(r,t)=>{const o=r[t].info.trimStart().slice(7).trim(),a=`echarts-${t}`;let s="{}",i=!1;for(let l=t;l<r.length;l++){const{type:g,content:d,info:c}=r[l];if(g==="container_echarts_close")break;d&&(g==="fence"&&(c==="json"?s=d:(c==="js"||c==="javascript")&&(s=d,i=!0)),r[l].type="echarts_empty",r[l].hidden=!0)}return`<ECharts id="${a}" config="${C(s)}"${o?` title="${encodeURIComponent(o)}"`:""}${i?' type="js"':""}>`},closeRender:()=>"</ECharts>"})},me=(n,e)=>{const r=n[e],t=`flowchart-${e}`,{content:o,info:a}=r;return`<FlowChart id="${t}" code="${C(o)}" preset="${a.trim().split(":",2)[1]||"vue"}"></FlowChart>`},ce=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{info:a}=t[o],s=a.split(":",2)[0];return s==="flow"||s==="flowchart"?me(t,o):e(...r)},n.renderer.rules.flowchart=me},de=(n,e={})=>{["info","note","tip","warning","danger"].forEach(r=>{n.use(P,{name:r,openRender:(t,o,a,s)=>{var i;let l=t[o].info.trim().slice(r.length).trim();if(!l){const{filePathRelative:g}=s,d=H(g??""),c=Y(e,d);l=(i=e[c])==null?void 0:i[r]}return`<div class="hint-container ${r}">
<p class="hint-container-title">${l||r}</p>
`},closeRender:()=>`</div>
`})}),n.use(r=>P(r,{name:"details",openRender:(t,o,a,s)=>{var i;let l=t[o].info.trim().slice(7).trim();if(!l){const{filePathRelative:g}=s,d=H(g??""),c=Y(e,d);l=(i=e[c])==null?void 0:i.details}return`<details class="hint-container details"><summary>${l||"Details"}</summary>
`},closeRender:()=>`</details>
`}))},ue=(n,e)=>`<Mermaid id="mermaid-${e}" code="${C(n[e].content)}"></Mermaid>`,k=(n,e,r)=>`<Mermaid id="mermaid-${r}" code="${C(`${n}
${e.split(`
`).map(t=>t?`  ${t}`:"").join(`
`)}`)}"></Mermaid>`,fe=n=>{const e=n.renderer.rules.fence;n.renderer.rules.fence=(...r)=>{const[t,o]=r,{content:a,info:s}=t[o];return s.trim()==="mermaid"?ue(...r):s.trim()==="sequence"?k("sequenceDiagram",a,o):s.trim()==="class"?k("classDiagram",a,o):s.trim()==="state"?k("stateDiagram-v2",a,o):s.trim()==="er"?k("erDiagram",a,o):s.trim()==="journey"?k("journey",a,o):s.trim()==="gantt"?k("gantt",a,o):s.trim()==="pie"?k("pie",a,o):s.trim()==="git-graph"?k("gitGraph",a,o):s.trim()==="c4c"?k("C4Context",a,o):s.trim()==="mindmap"?k("mindmap",a,o):s.trim()==="timeline"?k("timeline",a,o):e(...r)},n.renderer.rules.mermaid=ue},lt=n=>n.replace(/&/gu,"&amp;").replace(/</gu,"&lt;").replace(/>/gu,"&gt;").replace(/"/gu,"&quot;").replace(/'/gu,"&#039;"),ge="@",pt=["file","import","setting"],mt=n=>(e,r,t,o)=>{let a=e.bMarks[r]+e.tShift[r],s=e.eMarks[r];if(e.src[a]!==":")return!1;let i=a+1;for(;i<=s&&e.src[i]===":";)i+=1;const l=i-a;if(l<3)return!1;const g=e.src.slice(a,i),d=e.src.slice(i,s),c=d.trimStart().split(" ",2)[0],b=d.trimStart().slice(n.length).trim();if(c.trim()!==n)return!1;if(o)return!0;let u=r,h=!1;for(;u<t&&(u+=1,a=e.bMarks[u]+e.tShift[u],s=e.eMarks[u],!(a<s&&e.sCount[u]<e.blkIndent));)if(e.src[a]===":"&&e.sCount[u]-e.blkIndent<4){for(i=a+1;i<=s&&e.src[i]===":";i++);if(i-a>=l&&(i=e.skipSpaces(i),i>=s)){h=!0;break}}const m=e.parentType,f=e.lineMax;e.parentType=`${n}`,e.lineMax=u-(h?1:0);const w=e.push(`${n}_open`,"template",1);w.markup=g,w.block=!0,w.info=b,w.map=[r,u-(h?1:0)],e.md.block.tokenize(e,r+1,u-(h?1:0));const D=e.push(`${n}_close`,"template",-1);return D.markup=e.src.slice(a,i),D.block=!0,e.parentType=m,e.lineMax=f,e.line=u+(h?1:0),!0},ct=n=>(e,r,t,o)=>{let a=e.bMarks[r]+e.tShift[r],s=e.eMarks[r];const i=`${ge}${n}`;if(e.src.charAt(a)!=="@")return!1;let l;for(l=0;l<i.length;l++)if(i[l]!==e.src[a+l])return!1;const g=e.src.slice(a,a+l),d=e.src.slice(a+l,s);if(o)return!0;let c=r,b=!1;for(;c<t&&(c+=1,a=e.bMarks[c]+e.tShift[c],s=e.eMarks[c],!(a<s&&e.sCount[c]<e.blkIndent));)if(e.src[a]===ge&&e.sCount[c]<=e.sCount[r]){let w=!0;for(l=0;l<i.length;l++)if(i[l]!==e.src[a+l]){w=!1;break}if(w){b=!0,c-=1;break}}const u=e.parentType,h=e.lineMax;e.parentType=`${n}`,e.lineMax=c;const m=e.push(`${n}_open`,"template",1);m.block=!0,m.markup=g,m.info=d.trim(),m.map=[r,c],e.md.block.tokenize(e,r+1,c);const f=e.push(`${n}_close`,"template",-1);return f.block=!0,f.markup="",e.parentType=u,e.lineMax=h,e.line=c+(b?1:0),!0},_=(n,{name:e="playground",component:r="Playground",propsGetter:t}={name:"playground",component:"Playground",propsGetter:o=>({key:o.key,title:o.title||"",files:encodeURIComponent(JSON.stringify(o.files)),settings:encodeURIComponent(JSON.stringify(o.settings||{}))})})=>{n.block.ruler.before("fence",`${e}`,mt(e),{alt:["paragraph","reference","blockquote","list"]}),pt.forEach(o=>{n.block.ruler.__rules__.find(({name:a})=>a==="marker")||n.block.ruler.before("fence","tab",ct(o),{alt:["paragraph","reference","blockquote","list"]})}),n.renderer.rules[`${e}_open`]=(o,a)=>{const{info:s}=o[a],i={key:rt(`playground${a}-${s}`),title:encodeURIComponent(s),settings:{},files:{}};let l=null,g=!1;for(let c=a;c<o.length;c++){const{block:b,type:u,info:h,content:m}=o[c];if(b){if(u===`${e}_close`)break;if(u===`${e}_open`)continue;if(u==="file_open"){if(!h)continue;l=h}else u==="import_open"&&(i.importMap=l=h||"import-map.json");if(u==="setting_open"&&(g=!0),u==="setting_close"&&(g=!1),u==="file_close"||u==="import_close"||u==="setting_close"||!m){o[c].type=`${e}_empty`,o[c].hidden=!0;continue}g?u==="fence"&&h==="json"&&(i.settings=JSON.parse(m.trim())):u==="fence"&&l&&(i.files[l]={ext:h,content:m}),o[c].type=`${e}_empty`,o[c].hidden=!0}}const d=t(i);return`<${r} ${T(d).map(([c,b])=>`${c}="${lt(b)}"`).join(" ")}>
`},n.renderer.rules[`${e}_close`]=()=>`</${r}>
`},dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",ut=(n,e,r)=>{if(n==null)return"";let t,o,a,s={},i={},l="",g="",d="",c=2,b=3,u=2,h=[],m=0,f=0;for(a=0;a<n.length;a+=1)if(l=n.charAt(a),Object.prototype.hasOwnProperty.call(s,l)||(s[l]=b++,i[l]=!0),g=d+l,Object.prototype.hasOwnProperty.call(s,g))d=g;else{if(Object.prototype.hasOwnProperty.call(i,d)){if(d.charCodeAt(0)<256){for(t=0;u>t;t++)m<<=1,f==e-1?(f=0,h.push(r(m)),m=0):f++;for(o=d.charCodeAt(0),t=0;8>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1}else{for(o=1,t=0;u>t;t++)m=m<<1|o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o=0;for(o=d.charCodeAt(0),t=0;16>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1}c--,c==0&&(c=Math.pow(2,u),u++),delete i[d]}else for(o=s[d],t=0;u>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1;c--,c==0&&(c=Math.pow(2,u),u++),s[g]=b++,d=String(l)}if(d!==""){if(Object.prototype.hasOwnProperty.call(i,d)){if(d.charCodeAt(0)<256){for(t=0;u>t;t++)m<<=1,f==e-1?(f=0,h.push(r(m)),m=0):f++;for(o=d.charCodeAt(0),t=0;8>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1}else{for(o=1,t=0;u>t;t++)m=m<<1|o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o=0;for(o=d.charCodeAt(0),t=0;16>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1}c--,c==0&&(c=Math.pow(2,u),u++),delete i[d]}else for(o=s[d],t=0;u>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1;c--,c==0&&(c=Math.pow(2,u),u++)}for(o=2,t=0;u>t;t++)m=m<<1|1&o,f==e-1?(f=0,h.push(r(m)),m=0):f++,o>>=1;for(;;){if(m<<=1,f==e-1){h.push(r(m));break}f++}return h.join("")},ft=n=>ut(n,6,e=>dt.charAt(e)),gt=[{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:"declaration",type:"boolean"},{name:"declarationMap",type:"boolean"},{name:"emitDeclarationOnly",type:"boolean"},{name:"sourceMap",type:"boolean"},{name:"inlineSourceMap",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:"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:"verbatimModuleSyntax",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:{node10:2,node:2,classic:1,node16:3,nodenext:99,bundler:100}},{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:"allowImportingTsExtensions",type:"boolean"},{name:"resolvePackageJsonExports",type:"boolean"},{name:"resolvePackageJsonImports",type:"boolean"},{name:"customConditions",type:"list"},{name:"sourceRoot",type:"string"},{name:"mapRoot",type:"string"},{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:"allowArbitraryExtensions",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}},{name:"ignoreDeprecations",type:"string"}],ye=(n,e={})=>{const r=`#code/${ft(n)}`,t=T(e).map(([o,a])=>{const s=gt.find(l=>l.name===o);if(!s||a===null||a===void 0)return"";const{type:i}=s;if(v(i)){const l=i[a];return(l==null?void 0:l.toString())||""}return`${o}=${encodeURIComponent(a)}`}).filter(o=>o.length).join("&");return`${t?`?${t}`:""}${r}`},he=({service:n="https://www.typescriptlang.org/play",...e}={})=>({name:"playground#ts",propsGetter:({title:r="",files:t,settings:o,key:a})=>{const s=Ye(t).filter(l=>Ke(l,".ts"));s.length!==1&&console.error("TS playground only support 1 ts file");const i=`${n}${ye(t[s[0]].content,F({},o||{},e))}`;return{key:a,title:r,link:encodeURIComponent(i)}}}),yt=["html","js","ts","vue","jsx","tsx","json"],be="https://sfc.vuejs.org/vue.runtime.esm-browser.js",$e="https://sfc.vuejs.org/server-renderer.esm-browser.js",ve=(n={})=>({name:"playground#vue",propsGetter:e=>{const{title:r="",files:t,settings:o,key:a}=e,s={service:"https://sfc.vuejs.org/",dev:!1,ssr:!1,...n,...o},i=K(T(t).filter(([,{ext:l}])=>yt.includes(l)).map(([l,{content:g}])=>{if(l==="import-map.json"){const d=JSON.parse(g);return[l,JSON.stringify(F({imports:{vue:be,...s.ssr?{"vue/server-renderer":$e}:{}}},d))]}return[l,g]}));return s.ssr&&!i["import-map.json"]&&(i["import-map.json"]=JSON.stringify({imports:{vue:be,"vue/server-renderer":$e}},null,2)),{key:a,title:r,link:encodeURIComponent(`${s.service}#${s.dev?"__DEV__":""}${s.ssr?"__SSR__":""}${Buffer.from(JSON.stringify(i)).toString("base64")}`)}}}),Ce=n=>{n.use(te,{name:"presentation",open:"slidestart",close:"slideend",render:(e,r)=>{const t=e[r],o=`presentation-${r}`,{content:a,info:s}=t;return`<Presentation id="${o}" code="${C(a)}" theme="${s.trim()||"auto"}"></Presentation>`}})},ke=n=>{ee(n,{name:"tabs",tabsOpenRenderer:({active:e,data:r},t,o)=>{const{meta:a}=t[o],s=r.map(({title:i,id:l})=>({title:i,...l?{id:l}:{}}));return`<Tabs id="${o}" :data='${JSON.stringify(s).replace(/'/g,"&#39")}'${e!==-1?` :active="${e}"`:""}${a.id?` tab-id="${a.id}"`:""}>
`},tabsCloseRenderer:()=>`</Tabs>
`,tabOpenRenderer:({index:e})=>`<template #tab${e}="{ title, value, isActive }">
`,tabCloseRenderer:()=>`</template>
`})},we=n=>{P(n,{name:"v-pre",openRender:()=>`<div v-pre>
`,closeRender:()=>`</div>
`})},J={showCompileOutput:!1,clearConsole:!1,ssr:!1},ht=["html","js","ts","vue","jsx","tsx","json"],bt=n=>Buffer.from(JSON.stringify(K(T(n).filter(([,{ext:e}])=>ht.includes(e)).map(([e,r])=>[e,r.content])))).toString("base64"),je=n=>{n.use(_,{name:"vue-playground",component:"VuePlayground",propsGetter:({title:e="",key:r,files:t,settings:o})=>({title:e,key:r,settings:encodeURIComponent(JSON.stringify(o||{})),files:encodeURIComponent(bt(t))})})},xe={"/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/":{info:"Information",note:"Notiz",tip:"Tips",warning:"Warnung",danger:"Gefahr",details:"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:"詳細"},"/tr/":{info:"Bilgi",note:"Not",tip:"Tavsiye",warning:"Uyarı",danger:"Tehlike",details:"Detay"},"/ko/":{info:"정보",note:"노트",tip:"팁",warning:"경고",danger:"위험",details:"세부사항"},"/fi/":{info:"Tietoa",note:"Huomautus",tip:"Vinkki",warning:"Varoitus",danger:"Vaara",details:"Yksityiskohdat"},"/hu/":{info:"Információ",note:"Megjegyzés",tip:"Tipp",warning:"Figyelem",danger:"Veszély",details:"Részletek"},"/id/":{info:"Pemberitahuan",note:"Catatan",tip:"Tips",warning:"Penting",danger:"Peringatan",details:"Rincian"},"/nl/":{info:"Info",note:"Notitie",tip:"Tips",warning:"Notitie",danger:"Waarschuwing",details:"Details"}},$t=(n,e)=>{const{linkCheck:r="dev"}=e;return typeof r=="boolean"?r:r==="always"||n.env.isDev&&r==="dev"||n.env.isBuild&&r==="build"||!1},Oe=(n,e)=>{const r=n.filePathRelative||n.path,{pages:t}=e,o=n.links.filter(({raw:s})=>s.match(/.md((?:\?|#).*)?$/)),a=[...o.filter(({raw:s})=>!Q(s)).filter(({relative:s})=>t.every(({filePathRelative:i})=>i!==decodeURI(s))),...o.filter(({raw:s})=>Q(s)).filter(({absolute:s})=>t.every(({filePathRelative:i})=>!i||`${e.options.base}${i}`!==decodeURI(s)))].map(({raw:s})=>s);a.length&&at.warn(`Broken links found in ${r}: ${a.join(", ")}`)},vt=st(import.meta.url),A="vuepress-plugin-md-enhance",U=new Qe(A),$=We(z.resolve(vt,"../client")),S=({options:n,deprecatedOption:e,newOption:r,msg:t="",scope:o=""})=>{if(e in n){if(U.warn(`${I.magenta(e)} is ${I.yellow("deprecated")}${o?` in ${o}`:""}, please use "${I.magenta(r)}" instead.${t?`
${t}`:""}`),r.includes(".")){const a=r.split(".");let s=n;a.forEach((i,l)=>{l!==a.length-1?(s[i]=s[i]||{},s=s[i]):s[i]=n[e]})}else n[r]=n[e];delete n[e]}},V=(n,e,r="",t="")=>{e in n&&(U.error(`"${I.magenta(e)}" is ${I.red("removed")}${t?`, please use ${I.magenta(t)} instead.`:" and no longer supported"}${r?`
${r}`:""}`),t||delete n[e])},Ct=n=>{S({options:n,deprecatedOption:"codegroup",newOption:"codetabs"}),S({options:n,deprecatedOption:"lazyload",newOption:"imgLazyload"}),S({options:n,deprecatedOption:"imageLazyload",newOption:"imgLazyload"}),S({options:n,deprecatedOption:"imageMark",newOption:"imgMark"}),S({options:n,deprecatedOption:"imageSize",newOption:"imgSize"}),S({options:n,deprecatedOption:"mdImport",newOption:"include"}),S({options:n,deprecatedOption:"tex",newOption:"katex"}),S({options:n,deprecatedOption:"vpre",newOption:"vPre"}),S({options:n,deprecatedOption:"imageTitle",newOption:"figure"}),V(n,"enableAll"),V(n,"lineNumbers"),V(n,"imageFix")},kt=n=>{n.use(P,{name:"demo",openRender:(e,r)=>{var t;const{info:o}=e[r],a=/\[(.*)\]/u.exec(o),s=/^ demo\s*(?:\[.*?\])?\s*(.*)\s*$/u.exec(o);let i="";const l={};for(let g=r;g<e.length;g++){const{type:d,content:c,info:b}=e[g],u=b?((t=n.utils.unescapeAll(b).trim().match(/^([^ :[{]+)/))==null?void 0:t[1])||"text":"";if(d==="container_demo_close")break;c&&d==="fence"&&(u==="json"?i=C(c):l[u]=c)}return`
<CodeDemo id="code-demo-${r}" type="${(a==null?void 0:a[1])||"normal"}"${s?` title="${encodeURIComponent(s[1])}"`:""}${i?` config="${i}"`:""} code="${C(JSON.stringify(l))}">
`},closeRender:()=>"</CodeDemo>"})},wt=n=>{n.use(P,{name:"code-group",openRender:(e,r,t,o)=>(U.warn(`Deprecated code-group syntax found${o.filePathRelative?`in ${o.filePathRelative}`:""}, you should use code tabs instead. See https://plugin-md-enhance.vuejs.press/guide/code-tabs.html`),`<CodeGroup>
`),closeRender:()=>`</CodeGroup>
`}),n.use(P,{name:"code-group-item",openRender:(e,r)=>{const{info:t}=e[r],o=t.split(":").pop()==="active";return`<CodeGroupItem title="${o?t.replace(/:active$/,""):t}"${o?" active":""}>
`},closeRender:()=>`</CodeGroupItem>
`})},jt=n=>{te(n,{name:"flowchart",open:"flowstart",close:"flowend",render:(e,r)=>{console.warn('"@flowstart ... @flowend" is deprecated, you should use ```flow ... ``` instead.');const t=e[r],o=`flowchart-${r}`,{content:a,info:s}=t;return`<FlowChart id="${o}" code="${C(a)}" preset="${s.trim()||"vue"}"></FlowChart>`}})},Pe=it(import.meta.url),xt=async(n,e,r=!0)=>{const t=[],o=[],a=(s,i=!1)=>s in e?!!e[s]:i&&"gfm"in e&&e.gfm||!1;return a("chart")&&(t.push(`import ChartJS from "${$}components/ChartJS.js";`),o.push('app.component("ChartJS", ChartJS)')),a("codetabs")&&(t.push(`import CodeTabs from "${$}components/CodeTabs.js";`),o.push('app.component("CodeTabs", CodeTabs);'),r&&(t.push(`import { hasGlobalComponent } from "${z.resolve(Pe.resolve("vuepress-shared/client"))}";`,`import { CodeGroup, CodeGroupItem } from "${$}compact/index.js";`),o.push('if(!hasGlobalComponent("CodeGroup", app)) app.component("CodeGroup", CodeGroup);','if(!hasGlobalComponent("CodeGroupItem", app)) app.component("CodeGroupItem", CodeGroupItem);'))),a("container")&&t.push(`import "${$}styles/container/index.scss";`),a("demo")&&(t.push(`import CodeDemo from "${$}components/CodeDemo.js";`),o.push('app.component("CodeDemo", CodeDemo);')),a("echarts")&&(t.push(`import ECharts from "${$}components/ECharts.js";`),o.push('app.component("ECharts", ECharts);')),a("figure",!0)&&t.push(`import "${$}styles/figure.scss";`),a("flowchart")&&(t.push(`import FlowChart from "${$}components/FlowChart.js";`),o.push('app.component("FlowChart", FlowChart);')),a("footnote",!0)&&t.push(`import "${$}styles/footnote.scss";`),a("imgMark",!0)&&t.push(`import "${$}styles/image-mark.scss"`),a("mermaid")&&(t.push(`import Mermaid from "${$}components/Mermaid.js";`),o.push('app.component("Mermaid", Mermaid);')),a("presentation")&&(t.push(`import Presentation from "${$}components/Presentation.js";`),o.push('app.component("Presentation", Presentation);')),a("playground")&&(t.push(`import Playground from "${$}components/Playground.js";`),o.push('app.component("Playground", Playground);')),a("tabs")&&(t.push(`import Tabs from "${$}components/Tabs.js";`),o.push('app.component("Tabs", Tabs);')),a("tasklist",!0)&&t.push(`import "${$}styles/tasklist.scss";`),a("katex")&&t.push(`import "${z.resolve(Pe.resolve("katex/dist/katex.min.css"))}";`,`import "${$}styles/katex.scss";`),a("vuePlayground")&&(t.push('import { defineAsyncComponent } from "vue";'),o.push(`app.component("VuePlayground", defineAsyncComponent(() => import("${$}components/VuePlayground.js")));
    `)),a("mathjax")&&t.push('import "./mathjax.css";'),n.writeTemp("md-enhance/config.js",`import { defineClientConfig } from "@vuepress/client";
${t.join(`
`)}

export default defineClientConfig({
  enhance: ({ app }) => {
${o.map(s=>`    ${s}`).join(`
`)}
  },
});
`)},Ot=`mjx-container {
  overflow-x: auto;
}
`,Pt=async(n,e)=>{await n.writeTemp("md-enhance/mathjax.css",`${e.outputStyle()}
${Ot}`)},St=async(n,e)=>{const r=["reveal","revealMarkdown",...e.map(t=>`reveal${t[0].toUpperCase()}${t.substring(1)}`)];await n.writeTemp("md-enhance/reveal.js",`import { ${r.join(", ")} } from "${$}reveal/index.js";

export const useReveal = () => [${r.map(t=>`${t}()`).join(", ")}];
`)},Rt=(n={gfm:!0},e=!0)=>r=>{e&&Ct(n),Xe(r,A,"2.0.0-beta.61"),r.env.isDebug&&U.info("Options:",n);const t=(p,y=!1)=>p in n?!!n[p]:y&&"gfm"in n&&n.gfm||!1,o=Ze({app:r,name:A,default:xe,config:n.locales}),a=t("chart"),s=t("echarts"),i=t("flowchart"),l=t("footnote",!0),g=t("imgMark",!0),d=t("include"),c=t("tasklist",!0),b=t("mermaid"),u=t("presentation"),h=t("katex"),m=t("mathjax"),f=t("vuePlayground"),w=$t(r,n),D={macros:{"\\liiiint":"\\int\\!\\!\\!\\iiint","\\iiiint":"\\int\\!\\!\\!\\!\\iiint","\\idotsint":"\\int\\!\\cdots\\!\\int"},...v(n.katex)?n.katex:{}},M=n.mathjax===!1?null:Le(v(n.mathjax)?n.mathjax:{}),B=v(n.presentation)&&qe(n.presentation.plugins)?n.presentation.plugins:[];He(r,{id:"hope"});let W=!1;return{name:A,define:()=>({MARKDOWN_ENHANCE_DELAY:n.delay||800,CODE_DEMO_OPTIONS:{...oe,...v(n.demo)?n.demo:{}},MERMAID_OPTIONS:v(n.mermaid)?n.mermaid:{},REVEAL_CONFIG:v(n.presentation)&&v(n.presentation.revealConfig)?n.presentation.revealConfig:{},VUE_PLAYGROUND_OPTIONS:v(n.vuePlayground)?F({},J,n.vuePlayground):J}),extendsBundlerOptions:(p,y)=>{var j,O,E;if(et(y)==="vite"){const x=(E=(O=(j=p.viteOptions)==null?void 0:j.build)==null?void 0:O.rollupOptions)==null?void 0:E.onwarn;tt(p,y,{build:{rollupOptions:{onwarn(q,Se){q.message.includes("Use of eval")||x==null||x(q,Se)}}}})}nt(p,y,["fflate","vuepress-shared"]),h&&D.output!=="html"?L(p,y,X):m&&(L(p,y,/^mjx-/),M!=null&&M.documentOptions.enableAssistiveMml&&L(p,y,X)),a&&(N(p,y,"chart.js/auto/auto.mjs"),R(p,y,"chart.js")),s&&(N(p,y,"echarts"),R(p,y,"echarts")),i&&(N(p,y,"flowchart.ts"),R(p,y,"flowchart.ts")),b&&(Z(p,y,"mermaid"),R(p,y,"mermaid")),u&&(N(p,y,["reveal.js/dist/reveal.esm.js","reveal.js/plugin/markdown/markdown.esm.js",...B.map(x=>`reveal.js/plugin/${x}/${x}.esm.js`)]),R(p,y,"reveal.js")),f&&(Z(p,y,"@vue/repl"),R(p,y,"@vue/repl"),ot(p,y,x=>{x.module.set("exprContextCritical",!1),x.module.set("unknownContextCritical",!1)}))},extendsMarkdown:p=>{if(t("gfm")&&(p.options.linkify=!0),t("attrs")&&p.use(Ie,v(n.attrs)?n.attrs:{}),t("align")&&p.use(Re),t("container")&&p.use(de,o),t("imgLazyload")&&p.use(_e),t("figure")&&p.use(De),g&&p.use(Ee,v(n.imgMark)?n.imgMark:{}),t("imgSize")&&p.use(Te),t("obsidianImgSize")&&p.use(Ne),t("sup")&&p.use(Ve),t("sub")&&p.use(Je),l&&p.use(Me),t("mark")&&p.use(Fe),c&&p.use(Be,[v(n.tasklist)?n.tasklist:{}]),(t("vPre")||e)&&p.use(we),h?p.use(Ue,D):m&&(p.use(ze,M),p.use(y=>{const j=y.render.bind(y);y.render=(O,E)=>{const x=j(O,E);return M.reset(),x}})),d&&p.use(Ae,{currentPath:y=>y.filePath,...v(n.include)?n.include:{}}),t("stylize")&&p.use(Ge,{config:n.stylize,localConfigGetter:y=>{var j;return((j=y.frontmatter)==null?void 0:j.stylize)||null}}),t("codetabs")&&(p.use(ie),e&&p.use(wt)),t("tabs")&&p.use(ke),i&&(p.use(ce),e&&p.use(jt)),a&&p.use(ne),s&&p.use(pe),t("demo")&&(p.use(re),p.use(ae),p.use(se),e&&p.use(kt)),b&&p.use(fe),u&&p.use(Ce),v(n.playground)){const{presets:y=[],config:j={}}=n.playground;y.forEach(O=>{O==="ts"?p.use(_,he(j.ts||{})):O==="vue"?p.use(_,ve(j.vue||{})):v(O)&&p.use(_,O)})}f&&p.use(je)},extendsPage:(p,y)=>{w&&W&&Oe(p,y),d&&p.deps.push(...p.markdownEnv.includedFiles)},onInitialized:p=>{W=!0,w&&p.pages.forEach(y=>Oe(y,p))},onPrepared:p=>Promise.all([m?Pt(p,M):Promise.resolve(),St(p,B)]).then(()=>{}),clientConfigFile:p=>xt(p,n,e)}};export{oe as CODE_DEMO_DEFAULT_SETTING,J as DEFAULT_VUE_PLAYGROUND_OPTIONS,ne as chart,ie as codeTabs,pe as echarts,ce as flowchart,he as getTSPlaygroundPreset,ye as getURL,ve as getVuePlaygroundPreset,de as hint,xe as markdownEnhanceLocales,Rt as mdEnhancePlugin,fe as mermaid,re as normalDemo,_ as playground,Ce as presentation,se as reactDemo,ke as tabs,we as vPre,ae as vueDemo,je as vuePlayground};
//# sourceMappingURL=index.js.map
