import '/@/design/index.less';
import 'virtual:windi.css';
import 'virtual:svg-icons-register';
import { createApp } from 'vue';
import { initAppConfigStore } from '/@/logics/initAppConfig';
import { setupErrorHandle } from '/@/logics/error-handle';
import { router, setupRouter } from '/@/router';
import { setupRouterGuard } from '/@/router/guard';
import App from './App.vue';
import { setupStore } from '/@/store';
import { setupGlobDirectives } from '/@/directives';
import { setupI18n } from '/@/locales/setupI18n';
import { registerGlobComp } from '/@/components/registerGlobComp';
import '/@/assets/iconfont/iconfont';
import { useWebSecurityPolicy } from './hooks/web/useWebSecurityPolicy';
import 'core-js/es/array/at';
// import WujieVue from "wujie-vue3";
import './common.less';
import eventBus from '/@/utils/eventBus';
window.eventBus = eventBus;
eventBus.on('minapp', (e) => {
  console.log('minapp', e);
});
if (import.meta.env.DEV) {
  import('ant-design-vue/dist/antd.less');
}
import VueExcelEditor from 'vue3-excel-editor'
async function bootstrap() {
  useWebSecurityPolicy();
  const app = createApp(App);
  app.use(VueExcelEditor)
  setupStore(app);
  initAppConfigStore();
  registerGlobComp(app);
  await setupI18n(app);
  setupRouter(app);
  setupRouterGuard(router);
  setupGlobDirectives(app);
  setupErrorHandle(app);
  await router.isReady();
  app.mount('#app', true);
}
void bootstrap();
