import { createApp } from 'vue' import { createPinia } from 'pinia' import './style.css' import App from './App.vue' import router from './router' import i18n from './i18n' import { displayVersion } from '@/utils/version' // Clipboard polyfill for HTTP (non-secure) contexts where navigator.clipboard is unavailable if (!navigator.clipboard) { Object.defineProperty(navigator, 'clipboard', { value: { async writeText(text: string) { const ta = document.createElement('textarea') ta.value = text ta.style.cssText = 'position:fixed;opacity:0' document.body.appendChild(ta) ta.select() document.execCommand('copy') document.body.removeChild(ta) }, async readText() { return '' }, }, }) } import { useToast } from '@/composables/useToast' const app = createApp(App) const pinia = createPinia() app.use(pinia) app.use(router) app.use(i18n) // Global version formatter — normalizes version labels to a single "v" prefix // (some sources already carry one, which produced "vv1.2.3"). Use `$ver(x)` in // templates instead of hard-coding a `v` prefix. app.config.globalProperties.$ver = displayVersion app.config.errorHandler = (err, _instance, info) => { console.error('[Vue Error]', err, info) const { error } = useToast() error('Something went wrong. Please refresh the page.') } app.mount('#app')