{"version":3,"file":"DRqSWUFt.js","sources":["../../../../src/middleware/validate-agent.ts"],"sourcesContent":["import type {Agent} from \"~/models/old/Agent\";\nimport {USERS_SERVICE} from \"~/data/ServicesConstants\";\n\nexport default defineNuxtRouteMiddleware(async (to) => {\n if (import.meta.server) return\n try {\n const axiosRequest = await useNuxtApp().$getApi(USERS_SERVICE)\n const {data} = await axiosRequest.get(`/agent/${to.params.slug}`)\n const agent = useState('agent')\n if (!data) {\n return navigateTo('/404')\n }\n agent.value = data\n } catch (error) {\n return navigateTo('/404')\n }\n\n\n})"],"names":["validateAgent","defineNuxtRouteMiddleware","to","__temp","__restore","axiosRequest","__executeAsync","useNuxtApp","USERS_SERVICE","data","agent","useState","navigateTo"],"mappings":"wEAII,MAAwBA,EAAAC,EAAA,MAAAC,GAAA,CAAA,IAAAC,EAAAC,EAEpB,GAAA,CACM,MAAAC,GAAe,CAAAF,EAAAC,CAAA,EAAAE,EAAA,IAAAC,IAAiB,QAAUC,CAAU,CAAA,EAAML,iBAC1D,CAAA,KAAAM,OAA+BL,CAAA,EAAAE,EAAA,IAAAD,EAAA,IAAA,UAAAH,EAAA,OAAA,IAAA,EAAA,CAAA,EAAAC,EAAA,MAAAA,EAAAC,IAAAD,GAC1BO,EAAAC,EAAA,OAAA,EACP,GAAA,CAAAF,EACJ,OAAAG,EAAA,MAAA,UAEYH,CACZ,OACJ,OAAAG,EAAA,MAAA,CAGH"}