import '@/assets/style/default.css'
import '@/assets/style/fonts.css'

import axios from '@/init/axios-init'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import * as components from '@/components/global/'
import { PDFPlugin } from 'vue3-pdfmake'

import App from './App.vue'
import router from './router'
import $ from 'jquery'

declare global {
  interface JQuery {
    summernote(options?: any): JQuery;
    summernote(method: string, ...params: any[]): JQuery;
  }
}

window.$ = $
window.jQuery = $

const app = createApp(App)


const axiosInstance = axios.create({
  withCredentials: true
})
app.config.globalProperties.$axios = { ...axiosInstance }

for (const key in components) {
  const component = components[key as keyof typeof components]
  app.component(key, component)
}
app.use(createPinia())
app.use(PDFPlugin)
app.use(router)
app.mount('#app')
