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