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