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AAM,CAACD,EAAkBmC,EAAkB,CAAG/B,CAAAA,EAAAA,EAAAA,QAAAA,IAW9C,MATAgC,CAAAA,EAAAA,EAAAA,SAAAA,EAAU,KACiB5B,KAAAA,IAArBR,GAEH,WAECmC,EAAkBE,CADD,MAAMrD,EAAAC,CAAA,OAAAC,IAAA,CAAAF,EAAAsD,CAAA,CAAAnD,IAAA,CAAAH,EAAA,YACIuD,SAAS,GACtC,IACF,EAAG,EAAE,EAEE,CAAEvC,iBAAAA,CAAiB,CAC5B,kFCVO,eAAe4B,EAAoBY,CAOzC,EACC,GAAM,CAAEpB,OAAAA,CAAM,CAAEU,UAAAA,CAAS,CAAEE,SAAAA,CAAQ,CAAEd,MAAAA,CAAK,CAAEuB,OAAAA,CAAM,CAAEZ,MAAAA,CAAK,CAAE,CAAGW,EACxD,CAAEE,8BAAAA,CAA6B,CAAE,CAAGC,CAAAA,EAAAA,EAAAA,CAAAA,IAGpCC,EAAOC,KAAKC,SAAS,CAAC,CAC1BhB,UAAAA,EACAE,SAAAA,EACAd,MAAAA,EACAuB,OAAAA,EACAZ,MAAAA,CACF,GAEA,MAAOkB,CAAAA,EAAAA,EAAAA,EAAAA,EAAoC,CACzCC,YAAa,CACXC,MAXQ,GAAiC1E,MAAA,CAA9BmE,EAA8B,gCAYzCQ,KAAM,CACJC,QAAS,CACP,kBAAmB/B,EACnB,eAAgB,kBAClB,EACAgC,OAAQ,OACRR,KAAAA,CACF,CACF,EACAS,eAAgB,EAClB,EACF","sources":["webpack://_N_E/./components/SkeletonLoader.tsx","webpack://_N_E/./components/modules/NearbyLocationsModule/LocationCardsWithMap/LocationCardLoader.tsx","webpack://_N_E/./components/modules/NearbyLocationsModule/LocationCardsWithMap/LocationCardsLoader.tsx","webpack://_N_E/./components/modules/NearbyLocationsModule/LocationCardsWithMap/LocationCardsWithMap.tsx","webpack://_N_E/./components/modules/NearbyLocationsModule/LocationCardsWithMap/index.ts","webpack://_N_E/./components/modules/NearbyLocationsModule/NearbyLocationsModule.tsx","webpack://_N_E/./hooks/useWebGL.ts","webpack://_N_E/./lib/locations/get-nearest-locations.ts"],"sourcesContent":["import clsx from 'clsx';\n\ntype SkeletonLoaderProps = {\n dataTestId?: string;\n className?: string;\n};\n\nexport function SkeletonLoader({ dataTestId, className }: SkeletonLoaderProps) {\n return (\n \n );\n}\n","import { SkeletonLoader } from '@/components/SkeletonLoader';\n\ntype LocationCardLoaderProps = {\n dataTestId: string;\n};\n\nexport default function LocationCardLoader({\n dataTestId,\n}: LocationCardLoaderProps) {\n return (\n
\n \n\n
\n
\n \n \n \n \n \n
\n\n \n
\n
\n );\n}\n","import LocationCardLoader from './LocationCardLoader';\n\ntype LocationCardsLoaderProps = {\n dataTestId: string;\n};\n\nexport default function LocationCardsLoader({\n dataTestId,\n}: LocationCardsLoaderProps) {\n return (\n <>\n \n \n );\n}\n","import dynamic from 'next/dynamic';\nimport { useState } from 'react';\n\nimport { Link } from '@/components/Link';\nimport { SkeletonLoader } from '@/components/SkeletonLoader';\nimport { SecondaryHeading } from '@/components/typography';\nimport { useWebGL } from '@/hooks/useWebGL';\nimport { SimpleLocationDto } from '@/lib/locations/dto';\nimport { getBackgroundSectionClassName } from '@/utils/marketing-landing-page';\n\nimport { BackgroundColors } from '../../types';\nimport LocationCardsLoader from './LocationCardsLoader';\n\nimport clsx from 'clsx';\n\nconst Map = dynamic(() => import('./Map'), {\n ssr: false,\n loading: () => (\n \n ),\n});\nconst LocationCard = dynamic(() => import('@/components/cards/LocationCard'), {\n ssr: false,\n});\n\ntype LocationCardsWithMapProps = {\n mapboxAccessToken: string;\n title?: string;\n locations: SimpleLocationDto[];\n backgroundColor?: BackgroundColors;\n isLoading: boolean;\n cardsListContainerClassName?: string;\n mapHidden?: boolean;\n allLocationsLinkLabel?: string;\n};\n\nexport function LocationCardsWithMap({\n title,\n locations,\n mapboxAccessToken,\n backgroundColor,\n isLoading,\n cardsListContainerClassName,\n mapHidden,\n allLocationsLinkLabel,\n}: LocationCardsWithMapProps) {\n const { isWebGLSupported } = useWebGL();\n const [hoveredMarkerSlug, setHoveredMarkerSlug] = useState();\n\n return (\n
\n \n {title && (\n \n {title}\n \n )}\n\n {mapboxAccessToken && isWebGLSupported !== false && !mapHidden && (\n <>\n
\n {isWebGLSupported === undefined || isLoading ? (\n \n ) : (\n \n )}\n
\n \n )}\n \n \n {isLoading ? (\n \n ) : (\n
    \n {locations.map((loc) => (\n setHoveredMarkerSlug(loc.slug)}\n onMouseLeave={() => setHoveredMarkerSlug(undefined)}\n key={loc.slug}\n >\n \n \n ))}\n
\n )}\n\n {allLocationsLinkLabel && (\n \n {allLocationsLinkLabel}\n \n )}\n \n \n \n
\n );\n}\n","export * from './LocationCardsWithMap';\n","'use client';\n\nimport { useLocale } from 'next-intl';\nimport { useState } from 'react';\n\nimport { useUserLocalization } from '@/hooks/useUserLocalization';\nimport { SimpleLocationDto } from '@/lib/locations/dto';\nimport { getNearestLocations } from '@/lib/locations/get-nearest-locations';\n\nimport { BackgroundColors } from '../types';\nimport { LocationCardsWithMap } from './LocationCardsWithMap';\n\ntype NearbyLocationsModuleProps = {\n title?: string;\n backgroundColor?: BackgroundColors;\n mapboxAccessToken: string;\n slugs?: string[];\n cardsListContainerClassName?: string;\n mapHidden?: boolean;\n allLocationsLinkLabel?: string;\n};\n\nexport default function NearbyLocationsModule({\n title,\n backgroundColor,\n mapboxAccessToken,\n slugs,\n cardsListContainerClassName,\n mapHidden,\n allLocationsLinkLabel,\n}: NearbyLocationsModuleProps) {\n const [isLoading, setLoading] = useState(true);\n const locale = useLocale();\n const [nearbyLocations, setNearbyLocations] = useState(\n []\n );\n\n useUserLocalization({\n onUserLocalizationChange: async ({ lnglat }) => {\n const nearestLocations = await getNearestLocations({\n locale,\n slugs,\n limit: 2,\n longitude: lnglat.lng,\n latitude: lnglat.lat,\n });\n\n setLoading(false);\n\n if (nearestLocations) {\n setNearbyLocations(nearestLocations);\n }\n },\n });\n\n if (!isLoading && nearbyLocations.length === 0) {\n return null;\n }\n\n return (\n \n );\n}\n","import { useEffect, useState } from 'react';\n\nexport function useWebGL() {\n const [isWebGLSupported, setWebGLsupported] = useState();\n\n useEffect(() => {\n if (isWebGLSupported !== undefined) return;\n\n (async () => {\n const mapboxgl = await import('mapbox-gl');\n setWebGLsupported(mapboxgl.supported());\n })();\n }, []);\n\n return { isWebGLSupported };\n}\n","import { getServerConfig } from '@/utils/config';\nimport { tryFetchToJson } from '@/utils/http-request';\n\nimport { LocationPhases, SimpleLocationDto } from './dto';\n\nexport async function getNearestLocations(props: {\n locale: string;\n longitude: number;\n latitude: number;\n phases?: LocationPhases[];\n slugs?: string[];\n limit: number;\n}): Promise {\n const { locale, longitude, latitude, slugs, phases, limit } = props;\n const { NEXT_PUBLIC_INVENTORY_API_URL } = getServerConfig();\n\n const url = `${NEXT_PUBLIC_INVENTORY_API_URL}/discovery/nearest-locations`;\n const body = JSON.stringify({\n longitude,\n latitude,\n slugs,\n phases,\n limit,\n });\n\n return tryFetchToJson({\n fetchParams: {\n input: url,\n init: {\n headers: {\n 'Accept-Language': locale,\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n body,\n },\n },\n skipFetchError: true,\n });\n}\n"],"names":["SkeletonLoader","param","dataTestId","className","react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__","jsx","div","clsx","datatest-id","LocationCardLoader","jsx_runtime","jsxs","concat","LocationCardsLoader","Fragment","ul","li","Map","dynamic","Promise","all","__webpack_require__","e","then","bind","ssr","loading","LocationCard","LocationCardsWithMap","title","locations","mapboxAccessToken","backgroundColor","isLoading","cardsListContainerClassName","mapHidden","allLocationsLinkLabel","isWebGLSupported","useWebGL","hoveredMarkerSlug","setHoveredMarkerSlug","useState","section","getBackgroundSectionClassName","SecondaryHeading","undefined","map","loc","slug","onMouseEnter","onMouseLeave","location","Link","href","NearbyLocationsModule","slugs","setLoading","locale","useLocale","nearbyLocations","setNearbyLocations","useUserLocalization","onUserLocalizationChange","lnglat","nearestLocations","getNearestLocations","limit","longitude","lng","latitude","lat","length","setWebGLsupported","useEffect","mapboxgl","t","supported","props","phases","NEXT_PUBLIC_INVENTORY_API_URL","getServerConfig","body","JSON","stringify","tryFetchToJson","fetchParams","input","init","headers","method","skipFetchError"],"sourceRoot":""}