{"version":3,"file":"use-timezones-list-4mLmBxQI.js","sources":["../../../app/frontend/vue/src/composables/use-timezones-list.js"],"sourcesContent":["import { computed, onMounted } from 'vue';\nimport { TIME_ZONE_LIST_PATH, useFetch } from '@front/composables/useFetch';\n\nconst {\n data: timezones, execute, isFinished, isFetching,\n} = useFetch(TIME_ZONE_LIST_PATH, {\n initialData: [],\n immediate: false,\n}).json();\n\nconst timezonesMap = computed(() => timezones.value?.reduce((acc, value) => {\n acc[value.id] = value.locale;\n\n return acc;\n}, {}) || {});\n\nexport const useTimezonesList = () => {\n /*\n * Нужно для облегчения тестирования.\n * Чтобы при импорте не вызывался fetch.\n * */\n onMounted(() => {\n if (!isFetching.value && !isFinished.value) {\n execute();\n }\n });\n\n return {\n timezones,\n timezonesMap,\n isTimezonesFinished: isFinished,\n isTimezonesFetching: isFetching,\n };\n};\n"],"names":["data","timezones","execute","isFinished","isFetching","useFetch","TIME_ZONE_LIST_PATH","initialData","immediate","json","timezonesMap","computed","_a","value","reduce","acc","id","locale","useTimezonesList","onMounted","isTimezonesFinished","isTimezonesFetching"],"mappings":"gIAGA,MACEA,KAAMC,EAAAC,QAAWA,EAAAC,WAASA,EAAAC,WAAYA,GACpCC,EAASC,EAAqB,CAChCC,YAAa,GACbC,WAAW,IACVC,OAEGC,EAAeC,GAAS,WAAM,OAAA,OAAAC,EAAAX,EAAUY,YAAV,EAAAD,EAAiBE,QAAO,CAACC,EAAKF,KAC5DE,EAAAF,EAAMG,IAAMH,EAAMI,OAEfF,IACN,CAAE,KAAK,CAAA,CAAA,IAEGG,EAAmB,KAK9BC,GAAU,KACHf,EAAWS,OAAUV,EAAWU,UAEpC,IAGI,CACLZ,YACAS,eACAU,oBAAqBjB,EACrBkB,oBAAqBjB"}