{"version":3,"file":"assets/js/chunks/ROUTE_ITINERARY_HP_BY_MODE.02c2f2390869c83a3031.js","mappings":"0QAYO,MAAMA,EAAeC,IAItB,IAHJC,QAAQ,KAAEC,GACVC,OAAO,SAAEC,EAAQ,SAAEC,GACnBC,cAAc,OAAEC,EAAM,UAAEC,IACzBR,EACC,MAAMS,EAASC,EAAAA,EAA6BR,GAE5C,IAAKO,EAAQ,MAAM,IAAIE,EAAAA,EAAkB,YAAYT,mBAOrD,OANAE,GAASQ,EAAAA,EAAAA,IAAeH,IAEM,QAAXF,IAAqBM,EAAAA,EAAAA,IAAgBL,EAAUM,QAAQV,GAASW,EAAAA,EAAAA,OAEnFX,GAASY,EAAAA,EAAAA,OAEFC,QAAQC,UAAUC,MAAK,KACX,GAOjB,EASJ,WAAeC,EAAAA,EAAAA,GAAmB,CAChCrB,eACAsB,WAAYC,EAAAA,EACZC,aATF,WACE,G,iECpCa,MAAMZ,UAA0Ba,MAC7CC,WAAAA,GAAoC,IAAxBC,EAACC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,mBACdG,MAAMJ,GACNK,KAAKC,cAAgBN,EACrBK,KAAKE,KAAO,oBACZF,KAAKG,KAP4B,GAQnC,E","sources":["webpack://web-pwa/./src/routes/itinerary/itineraryHPByMode.route.js","webpack://web-pwa/./src/domain/error/PageNotFoundError.js"],"sourcesContent":["import { resetItinerary, setCurrentMode } from '../../store/itinerary/itinerarySlice'\nimport { handleRouteLoading } from '../routeService'\nimport * as itineraryHPPage from '../../domain/itinerary/itineraryHP.page'\nimport PageNotFoundError from '../../domain/error/PageNotFoundError'\nimport { activateGeoIp } from '../../store/map/mapSlice'\nimport { loadSeoItinerarySummaryData } from '../../store/seo/seo-itinerary.actions'\nimport { isPagelessRoute } from '../../domain/router/routeUtils'\nimport { searchFirstCities } from '../../store/seo/seo-address.actions'\nimport { loadSeoItineraryHPFaq } from '../../store/seo/seo-faq.actions'\nimport { SEO_MODES_TO_MULTIPATH_MODES } from '../../store/itinerary/itinerary.constants'\nimport { COUNT_CITIES_FOOTER_OTHER } from '../../domain/seo/seo.constants'\n\nexport const onRouteEnter = ({\n params: { mode },\n store: { dispatch, getState },\n routeContext: { action, prevRoute }\n}) => {\n const modeId = SEO_MODES_TO_MULTIPATH_MODES[mode]\n\n if (!modeId) throw new PageNotFoundError(`Le mode \"${mode}\" est inconnu.`)\n dispatch(setCurrentMode(modeId))\n\n if (__BROWSER__ && action === 'POP' && !isPagelessRoute(prevRoute.route)) dispatch(resetItinerary())\n\n dispatch(activateGeoIp())\n\n return Promise.resolve().then(() => {\n if (__SERVER__) {\n loadSeoItinerarySummaryData()(dispatch, getState)\n return Promise.all([\n searchFirstCities({ limit: COUNT_CITIES_FOOTER_OTHER })(dispatch, getState),\n loadSeoItineraryHPFaq(mode)(dispatch, getState)\n ])\n }\n })\n}\n\nfunction onRouteLeave() {\n /*\n - exécuter itineraryHP.onRouteLeave\n */\n}\n\nexport default handleRouteLoading({\n onRouteEnter,\n renderPage: itineraryHPPage.renderPage,\n onRouteLeave\n})\n","export const PageNotFoundErrorCode = 404\n\nexport default class PageNotFoundError extends Error {\n constructor(e = 'Page non trouvée') {\n super(e)\n this.originalError = e\n this.name = 'PageNotFoundError'\n this.type = PageNotFoundErrorCode\n }\n}\n"],"names":["onRouteEnter","_ref","params","mode","store","dispatch","getState","routeContext","action","prevRoute","modeId","SEO_MODES_TO_MULTIPATH_MODES","PageNotFoundError","setCurrentMode","isPagelessRoute","route","resetItinerary","activateGeoIp","Promise","resolve","then","handleRouteLoading","renderPage","itineraryHPPage","onRouteLeave","Error","constructor","e","arguments","length","undefined","super","this","originalError","name","type"],"sourceRoot":""}