import"./index-kuiGTNrJ.js";import{I as c,a as u,b as y}from"./tmagic-dep-DSKLZ87U.js";import{u as p,a as f,b as d,_ as w}from"./plugin-vueexport-helper-CYignUIG.js";const D=e=>{if(e.cssFile&&u(e.cssFile),Array.isArray(e.cssFiles)&&e.cssFiles.map(s=>u(s.url)),e.css){const s=window.document.createElement("style");s.innerHTML=e.css,window.document.head.appendChild(s)}},V=e=>{Array.isArray(e.jsFiles)&&e.jsFiles.map(s=>y(s.url))},_=VueDemi.defineComponent({name:"tmagic-page",props:{config:{type:Object,required:!0},model:{type:Object,default:()=>({})}},setup(e){const s=VueDemi.inject("app");(s==null?void 0:s.jsEngine)==="browser"&&(D(e.config),V(e.config));const o=p({componentType:"container",app:s}),{style:r,className:m}=f(e),l=()=>{window.location.reload()};return VueDemi.watch(()=>e.config,async(i,a)=>{const t=d({config:{...i,[c]:!0}},s);if(i.id!==(a==null?void 0:a.id)&&(t==null||t.registerMethod({refresh:l}),t==null||t.emit("created")),await VueDemi.nextTick(),i.id!==(a==null?void 0:a.id)){t==null||t.emit("mounted");const n=d({config:{...a,[c]:!0}},s);n==null||n.emit("destroy")}},{immediate:!0}),{style:r,className:m,containerComponent:o,IS_DSL_NODE_KEY:c}}});function h(e,s,o,r,m,l){return Vue.openBlock(),Vue.createBlock(Vue.resolveDynamicComponent(e.containerComponent),{class:Vue.normalizeClass(e.className),style:Vue.normalizeStyle(e.style),"data-tmagic-id":e.config.id,config:{...e.config,[e.IS_DSL_NODE_KEY]:!1}},null,8,["class","style","data-tmagic-id","config"])}const S=w(_,[["render",h]]);export{S as default};
//# sourceMappingURL=index-ipxzptdy.js.map
