2 lines
998 B
JavaScript

import{A as App$2,g as getUrlParam,R as ReactDOM}from"./index.144d287e.js";import{r as react,A as AppContent,R as React}from"./Text.000ec384.js";import{e as entry}from"./components.js";var App$1="";function App(){var t,r;const e=react.exports.useContext(AppContent);if(!((t=e==null?void 0:e.page)!=null&&t.data))return null;const n=e.resolveComponent("page");return React.createElement(n,{config:(r=e==null?void 0:e.page)==null?void 0:r.data})}const getLocalConfig=()=>{const configStr=localStorage.getItem("magicUiConfig");if(!configStr)return[];try{return[eval(`(${configStr})`)]}catch(e){return[]}},app=new App$2({config:((getUrlParam("localPreview")?getLocalConfig():window.magicUiConfig)||[])[0]||{},curPage:getUrlParam("page")});Object.keys(entry.components).forEach(e=>app.registerComponent(e,entry.components[e]));ReactDOM.render(React.createElement(React.StrictMode,null,React.createElement(AppContent.Provider,{value:app},React.createElement(App,null))),document.getElementById("root"));