{"version":3,"file":"D-oltSCR.js","sources":["../../../../layouts/home.vue"],"sourcesContent":["<script setup lang='ts'>\nimport type { IPublicDirectStore } from '@/stores/appdata-public-direct';\nimport { useAppDataStore } from '@/stores/appdata';\n\nconst route = useRoute();\nconst store = useAppDataStore() as IPublicDirectStore;\nconst user = useUser();\n\nconst parseSlug = async () => {\n const slugParts = route.params.slug || [];\n\n const areaId = Number(slugParts[1]) || 0;\n const categoryId = Number(slugParts[3]) || 0;\n\n if (!areaId) {\n if (store.areas.length === 0) {\n await store.loadAreas();\n }\n\n await navigateTo(`/${store.areas[0].slug}/${store.areas[0].id}`, { replace: true });\n parseSlug();\n return;\n }\n\n if (store.areaId !== areaId) {\n store.setAreaName(slugParts[0] || '');\n store.setAreaId(Number(slugParts[1]) || 0);\n\n store.categories = [];\n }\n\n if (!categoryId) {\n // reset the category id and name cos we're dealing with a new area\n store.setCategoryId(null);\n store.setCategoryName('');\n\n await store.loadCategories();\n await navigateTo(`/${slugParts[0]}/${slugParts[1]}/${store.categories[0].slug}/${store.categories[0].id}`, { replace: true });\n parseSlug();\n\n return;\n } else if (store.categories.length === 0) {\n await store.loadCategories();\n }\n\n if (store.categoryId !== categoryId) {\n store.setCategoryName(slugParts[2] || '');\n store.setCategoryId(Number(slugParts[3]) || 0);\n }\n};\n\nonMounted(async () => {\n await store.loadAreas();\n parseSlug();\n});\n\nwatch(() => route.params.slug, parseSlug, { deep: true });\n\n</script>\n\n<template>\n <div class=\"layout-main-wrapper font-primary font-normal flex flex-col flex-1\" :class=\"[user && 'pb-20 md:pb-0']\">\n <AppTopbar class=\"\" />\n <div class=\"layout-main-container w-full pr-0 pl-0\">\n <div class=\"layout-main h-full\">\n <slot />\n </div>\n </div>\n\n <AppFooter class=\"hidden md:block\" />\n </div>\n</template>\n\n<style lang=\"scss\" scoped>\n\n</style>\n"],"names":["route","useRoute","store","useAppDataStore","user","useUser","parseSlug","slugParts","areaId","categoryId","navigateTo","onMounted","watch"],"mappings":"ggBAIA,M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