import router from './router.js';
import {setupErrorBuffer} from './store/notification.js'
import {createApp} from 'vue'
import {createPinia} from 'pinia';
import App from './App.vue'

import {
    PhArchive,
    PhArrowCounterClockwise,
    PhBoat,
    PhBug,
    PhCalculator,
    PhCheck,
    PhClipboard,
    PhCloudArrowUp,
    PhDesktop,
    PhDownload,
    PhFile,
    PhFloppyDisk,
    PhHardDrives,
    PhLock,
    PhLockOpen,
    PhMagnifyingGlass,
    PhPencilSimple,
    PhPlus,
    PhSealCheck,
    PhShuffle,
    PhStack,
    PhStar,
    PhTrain,
    PhTrash,
    PhTruck,
    PhTruckTrailer,
    PhUpload,
    PhWarning,
    PhX,
    PhExclamationMark, PhMapPin, PhEmpty, PhShippingContainer, PhPackage, PhVectorThree, PhTag
} from "@phosphor-icons/vue";
import {setupSessionRefresh} from "@/store/activeuser.js";


const app = createApp(App);
const pinia = createPinia();
app.use(pinia);

app.config.globalProperties.backendUrl = 'http://localhost:8080/api/';

app.component('PhPlus', PhPlus);
app.component('PhDownload', PhDownload);
app.component('PhUpload', PhUpload);
app.component('PhMagnifyingGlass', PhMagnifyingGlass);
app.component('PhTrash', PhTrash);
app.component('PhArchive', PhArchive);
app.component('PhFloppyDisk', PhFloppyDisk);
app.component('PhArrowCounterClockwise', PhArrowCounterClockwise );
app.component('PhCheck', PhCheck);
app.component('PhWarning', PhWarning);
app.component('PhLock', PhLock);
app.component('PhLockOpen', PhLockOpen);
app.component('PhTruckTrailer', PhTruckTrailer);
app.component('PhTruck', PhTruck);
app.component('PhBoat', PhBoat);
app.component('PhTrain', PhTrain);
app.component('PhEmpty', PhEmpty);
app.component('PhShippingContainer', PhShippingContainer);
app.component('PhPencilSimple', PhPencilSimple);
app.component('PhX', PhX);
app.component('PhCloudArrowUp', PhCloudArrowUp);
app.component('PhSealCheck', PhSealCheck);
app.component('PhCalculator', PhCalculator);
app.component('PhStar', PhStar);
app.component('PhBug', PhBug);
app.component('PhShuffle', PhShuffle);
app.component('PhStack', PhStack );
app.component('PhFile', PhFile);
app.component("PhDesktop", PhDesktop );
app.component("PhHardDrives", PhHardDrives );
app.component("PhClipboard", PhClipboard );
app.component("PhExclamationMark", PhExclamationMark );
app.component("PhMapPin", PhMapPin);
app.component("PhPackage", PhPackage);
app.component("PhVectorThree", PhVectorThree);
app.component("PhTag", PhTag);


app.use(router);


setupErrorBuffer()
setupSessionRefresh();

app.mount('#app');
