import '@/themes/index.scss';

import Loader, { bridgeLoader, debugLoader, launchLoader } from '@/loader';
import { platformIsAIO }                                   from '@/platform';

import './polyfill'

import App from './App.vue';

(async function start() {
  try {
    /* prettier-ignore */
    await Loader(
      App,
      debugLoader('debug', !platformIsAIO()),
      bridgeLoader(),
      launchLoader('#app'),
    );
  } catch (error: any) {
    const { Dialog } = await import('@/platform/dialog.ui');
    await Dialog.show({
      title: '请联系管理员',
      message: error.message,
      theme: 'round-button',
      showCancelButton: false,
      confirmButtonText: '刷新',
      overlay: false,
    });
    await start();
  }
})();
