{"version":3,"file":"componentSearchBar-CMF6poDb.js","sources":["../../../../SPAs/POCViteVue/src/components/organisms/SearchBar/mainSearchBar.ts"],"sourcesContent":["import { createApp } from 'vue'\r\nimport { createPinia } from 'pinia';\r\nimport piniaPluginPersistedstate from 'pinia-plugin-persistedstate';\r\n\r\n// Select the App you want to run on main, each individual are on /appName/App.vue\r\nimport SearchBar from './SearchBar.vue';\r\n\r\nimport dayjs from 'dayjs';\r\nimport dayjsLocales from '../../../services/dayjs-locales.service';\r\nimport localeData from 'dayjs/plugin/localeData';\r\nimport isoWeek from 'dayjs/plugin/isoWeek';\r\nimport isSameOrBefore from 'dayjs/plugin/isSameOrBefore';\r\nimport isBetween from 'dayjs/plugin/isBetween';\r\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\r\nimport weekOfYear from 'dayjs/plugin/weekOfYear';\r\n\r\nlet locale = document.documentElement.lang;\r\n\r\nasync function loadLocale() {\r\n if (!dayjsLocales[locale]) {\r\n locale = 'default';\r\n }\r\n\r\n const localeData = await dayjsLocales[locale]().then(() => dayjs.locale(locale));\r\n dayjs.locale(localeData);\r\n}\r\n\r\n\r\nconst pinia = createPinia();\r\npinia.use(piniaPluginPersistedstate);\r\nconst revueForm = document.getElementById('revue-form')\r\nconst app = createApp(SearchBar);\r\n\r\nasync function initApp() {\r\n await loadLocale();\r\n dayjs.extend(localeData);\r\n dayjs.extend(isoWeek);\r\n dayjs.extend(isSameOrBefore);\r\n dayjs.extend(customParseFormat);\r\n dayjs.extend(isBetween)\r\n dayjs.extend(weekOfYear)\r\n dayjs.localeData();\r\n\r\n app.config.globalProperties.$dayjs = dayjs;\r\n\r\n app.use(pinia)\r\n\r\n if (revueForm) {\r\n app.mount(\"#search-bar\");\r\n // if the user is using an apple mobile device, we need to mount the search bar immediately\r\n // for some reason, those devices requires two presses to open the modal, and not one like other browsers\r\n // we now also mount immediately as this script is loaded in later\r\n }\r\n}\r\n\r\ninitApp();\r\n"],"names":["locale","loadLocale","dayjsLocales","localeData","dayjs","pinia","createPinia","piniaPluginPersistedstate","revueForm","app","createApp","SearchBar","initApp","isoWeek","isSameOrBefore","customParseFormat","isBetween","weekOfYear"],"mappings":"meAgBA,IAAIA,EAAS,SAAS,gBAAgB,KAEtC,eAAeC,GAAa,CACrBC,EAAaF,CAAM,IACbA,EAAA,WAGLG,MAAAA,EAAa,MAAMD,EAAaF,CAAM,EAAI,EAAA,KAAK,IAAMI,EAAM,OAAOJ,CAAM,CAAC,EAC/EI,EAAM,OAAOD,CAAU,CACzB,CAGA,MAAME,EAAQC,EAAY,EAC1BD,EAAM,IAAIE,CAAyB,EACnC,MAAMC,EAAY,SAAS,eAAe,YAAY,EAChDC,EAAMC,EAAUC,CAAS,EAE/B,eAAeC,GAAU,CACvB,MAAMX,EAAW,EACjBG,EAAM,OAAOD,CAAU,EACvBC,EAAM,OAAOS,CAAO,EACpBT,EAAM,OAAOU,CAAc,EAC3BV,EAAM,OAAOW,CAAiB,EAC9BX,EAAM,OAAOY,CAAS,EACtBZ,EAAM,OAAOa,CAAU,EACvBb,EAAM,WAAW,EAEbK,EAAA,OAAO,iBAAiB,OAASL,EAErCK,EAAI,IAAIJ,CAAK,EAETG,GACFC,EAAI,MAAM,aAAa,CAK3B,CAEAG,EAAQ"}