tmagic-editor/docs/assets/app.B3MGcKp5.js
2026-06-04 09:22:54 +00:00

2 lines
1.4 KiB
JavaScript

import{R as p}from"./chunks/theme.WuWAEVfw.js";import{aG as o,aU as i,aV as u,aW as c,aX as l,aY as f,aZ as d,a_ as m,a$ as h,b0 as g,b1 as A,y as b,ay as y,o as w,w as v,b2 as C,b3 as P,b4 as R,aa as E}from"./chunks/framework.V2ssSR2R.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=b({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=y();return w(()=>{v(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),P(),R(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=D(),a=_();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function _(){return A(S)}function D(){let e=o;return h(a=>{let t=g(a),s=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),s=import(t)),o&&(e=!1),s},n.NotFound)}o&&T().then(({app:e,router:a,data:t})=>{a.go(location.href,{initialLoad:!0}).then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};