var V=Object.defineProperty;var C=Object.getOwnPropertySymbols;var W=Object.prototype.hasOwnProperty,Z=Object.prototype.propertyIsEnumerable;var E=(o,e,t)=>e in o?V(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,g=(o,e)=>{for(var t in e||(e={}))W.call(e,t)&&E(o,t,e[t]);if(C)for(var t of C(e))Z.call(e,t)&&E(o,t,e[t]);return o};var f=(o,e,t)=>new Promise((_,r)=>{var l=n=>{try{i(t.next(n))}catch(c){r(c)}},s=n=>{try{i(t.throw(n))}catch(c){r(c)}},i=n=>n.done?_(n.value):Promise.resolve(n.value).then(l,s);i((t=t.apply(o,e)).next())});import{useRoute as j}from"./vue-router-DhSsrCnR.js";import{w as z}from"./@vueuse--GEK18_Y.js";import{O as I,k as J,E as U,R as D,Z as P,C as G,a as k}from"./Editor-BMuQppe5-CHXZ3yZL.js";import"./element-plus-DzGjmbPT.js";import"./vxe-B6nyV_6w.js";import{E as K,a as v,n as S,l as L}from"./utils-PnTZyUOd.js";import{d as M,b as Q,az as A,e as X,c as Y,o as ee}from"./vue-BCeUdUZW.js";import{_ as te}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./monaco-editor-xcHgnT1C.js";import"./@element-plus-icons-vue-Wht5hDuw.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-DKzs-0ke.js";import"./dayjs-C1e0w4cr.js";import"./marked-BQZxLJfc.js";import"./lodash-es-BOeLjWVX.js";import"./shared-CcA2kMdO.js";const ae=M({__name:"index",setup(o){return f(this,null,function*(){let e,t;const _=j(),r=Q(),l=new I(J(S)),s=([e,t]=A(()=>l.getExtension().catch(()=>null)),e=yield e,t(),e||{}),i=U({loading:L,notify:S,useTitle:z,alert:v,access:s==null?void 0:s.access}),n=D(g({alert:v},s==null?void 0:s.__ACCESS__)),c=s?([e,t]=A(()=>new K(s).load()),e=yield e,t(),e):{},{__BASE_PATH__:h="/",history:B="hash",base:w="/",pageRouteName:y="page",remote:R,auth:b,checkVersion:T=!0,enhance:F,platform:q="web"}=s||{},H=()=>B==="hash",N=a=>a==="/"?"":(a.startsWith("/")&&(a=a.substring(1)),a.endsWith("/")||(a=a+"/"),a);P.set("Switcher",{props:{onClick:a=>{const u=a.platform==="uniapp",p=location.pathname;let m=p===`${h}__vtj__/`?h:p;const d=a.currentFile;if(d&&d.type==="page"&&a.homepage!==d.id){const O=s.pageBasePath?`/${y}`:"",x=`${N(w)}${u?`pages${O}`:y}/${d.id}`;m=H()?`${m}#/${x}`:`${m}${x}`}window.open(m,"VTJProject")}}}),P.set("Previewer",{props:{path:(a,u)=>{const p=location.pathname;return u.platform==="uniapp"?`${p}uni/#/pages/${a.id}`:`${p}#/preview/${a.id}`}}});const $=new G(g({container:r,service:l,materialPath:h,pageBasePath:w==="/"?"":w,adapter:i,access:n,remote:R,auth:b,checkVersion:T,enhance:F,project:{platform:q}},c));return $.ready(()=>f(null,null,function*(){yield k(300),$.openFile(_.query.id)})),X(()=>_.query.id,a=>f(null,null,function*(){yield k(300),$.openFile(a)})),(a,u)=>(ee(),Y("div",{class:"designer",ref_key:"container",ref:r},null,512))})}}),ye=te(ae,[["__scopeId","data-v-b20f3eda"]]);export{ye as default};
