import{t as p}from"./chunks/theme.DhB95Vid.js";import{v as s,am as i,R as u,w as c,p as l,a as f,C as d,a1 as m,k as h,S as g,l as A,r as v,ac as C,N as w,as as y,ag as P,ab as b,aa as R,u as S}from"./chunks/framework.DVkeSyfh.js";function r(e){if(e.extends){const t=r(e.extends);return{...t,...e,async enhanceApp(a){t.enhanceApp&&await t.enhanceApp(a),e.enhanceApp&&await e.enhanceApp(a)}}}return e}const n=r(p),E=v({name:"VitePressApp",setup(){const{site:e,lang:t,dir:a}=C();return w(()=>{y(()=>{document.documentElement.lang=t.value,document.documentElement.dir=a.value})}),e.value.router.prefetchLinks&&P(),b(),R(),n.setup&&n.setup(),()=>S(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),t=D();t.provide(u,e);const a=c(e.route);return t.provide(l,a),t.component("Content",f),t.component("ClientOnly",d),Object.defineProperties(t.config.globalProperties,{$frontmatter:{get(){return a.frontmatter.value}},$params:{get(){return a.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:t,router:e,siteData:m}),{app:t,router:e,data:a}}function D(){return A(E)}function _(){let e=s;return h(t=>{let a=g(t),o=null;return a&&(e&&(a=a.replace(/\.js$/,".lean.js")),o=import(a)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:t,data:a})=>{t.go().then(()=>{i(t.route,a.site),e.mount("#app")})});export{T as createApp};
