{"version":3,"sources":["webpack:///./node_modules/@bluekiri/alexandria/helpers/domHelpers.js","webpack:///./components/layout-logitravel-destination/client/js/components.js","webpack:///./components/layout-logitravel-destination/client/js/index.js"],"names":["module","exports","elementExist","element","document","querySelector","toNode","html","DOMParser","parseFromString","body","childNodes","COMPONENTS","loader","name","getCookies","getHeader","getTopButton","getVerticalTabs","getSectionArticle","resolveComponents","require","_require2","getVerticalTabsObserver","observerConfig","verticalTabs","_toConsumableArray","querySelectorAll","map","item","verticalTabsObserver","IntersectionObserver","entries","forEach","entry","intersectionRatio","filter","component","target","reduce","acc","then","type","dataset","default","concat","unobserve","observe","getSectionArticleObserver","sectionArticle","sectionArticleObserver","selector","arguments","length","undefined","config","_objectSpread","result","JSON","parse","__webpack_public_path__","publicPath","components","root","rootMargin","threshold","observer"],"mappings":";mJAQAA,EAAOC,QAAU,CACbC,aALiBC,KAAaC,SAASC,cAAcF,GAMrDG,OAJWC,IAAQ,IAAIC,WAAYC,gBAAgBF,EAAM,aAAaG,KAAKC,a,8FCC/E,IAwHMC,EAAa,CACf,CACIC,OAhHU,WACd,OAAO,4DAgHHC,KAAM,UAEV,CACID,OAtF2B,WAC/B,OAAO,4DAsFHC,KAAM,2BAEV,CACID,OAtEa,WACjB,OAAO,oEAsEHC,KAAM,aAEV,CACID,OAlCwB,WAC5B,OAAO,4DAkCHC,KAAM,wBAEV,CACID,OA5BkB,WACtB,OAAO,4DA4BHC,KAAM,kBAEV,CACID,OA5FQ,WACZ,OAAO,4DA4FHC,KAAM,YAEV,CACID,OAxDe,WACnB,OAAO,4DAwDHC,KAAM,gBAYdd,EAAOC,QAAU,CACbc,WA5Ie,WACf,OAAO,4DA4IPC,UAjKc,WACd,OAAO,oEAiKPC,aApIiB,WACjB,OAAO,uCAoIPC,gBAnFoB,WACpB,OAAO,sCAmFPC,kBA9FsB,WACtB,OAAO,6DA8FPC,kBAXJ,WACI,OAAOR,K,otBC7JXS,EAAQ,QAER,IAAQnB,EAAiBmB,EAAQ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,IAAYyB,MAAK,SAAAzC,GAAM,OAAIA,EAAO4C,YArF1C,K","file":"index.f7e90bcf0f282bea93a5.bundle.js","sourcesContent":["/* ==========================================================================\n Dom helpers\n ========================================================================== */\n\nconst elementExist = element => !!document.querySelector(element);\n\nconst toNode = html => new DOMParser().parseFromString(html, 'text/html').body.childNodes;\n\nmodule.exports = {\n elementExist,\n toNode\n};\n","/* ==========================================================================\n LayoutLogitravelDestination > Client > Components\n ========================================================================== */\n\n/**\n * Header\n */\nconst getHeader = () => {\n return import(\n /* webpackChunkName: \"header\" */\n '@bluekiri/alexandria-logitravel/components/header/client/js'\n );\n};\n\n/**\n * Footer\n */\nconst getFooter = () => {\n return import(\n /* webpackChunkName: \"footer\" */\n '@bluekiri/alexandria-logitravel/components/footer/client/js'\n );\n};\n\n/**\n * Cookies\n */\nconst getCookies = () => {\n return import(\n /* webpackChunkName: \"cookies\" */\n '@bluekiri/alexandria-contrib-components/components/cookies/client/js'\n );\n};\n\n/**\n * TopButton\n */\nconst getTopButton = () => {\n return import(\n /* webpackChunkName: \"top-button\" */\n '@bluekiri/alexandria-contrib-components/components/top-button/client/js'\n );\n};\n\n/**\n * Header banner destination\n */\nconst getHeaderBannerDestination = () => {\n return import(\n /* webpackChunkName: \"header-banner-destination\" */\n '@logitravel/alex-comp-mar/components/header-banner-destination/client/js'\n );\n};\n\n/**\n * Blog feed\n */\nconst getBlog = () => {\n return import(\n /* webpackChunkName: \"blog\" */\n '@logitravel/alex-comp-mar/components/blog-feed/client/js'\n );\n};\n\n/**\n * Text media\n */\nconst getTextMedia = () => {\n return import(\n /* webpackChunkName: \"text-media\" */\n '@logitravel/alex-comp-mar/components/text-media/client/js'\n );\n};\n\n/**\n * Section article\n */\nconst getSectionArticle = () => {\n return import(\n /* webpackChunkName: \"section-article\" */\n '@logitravel/alex-comp-mar/components/section-article/client/js'\n );\n};\n\n/**\n * Vertical tabs\n */\nconst getVerticalTabs = () => {\n return import(\n /* webpackChunkName: \"vertical-tabs\" */\n '@logitravel/alex-comp-mar/components/vertical-tabs/client/js'\n );\n};\n\n/**\n * Experiences\n */\nconst getExperiences = () => {\n return import(\n /* webpackChunkName: \"experiences\" */\n '@logitravel/alex-comp-mar/components/experiences/client/js'\n );\n};\n\n/**\n * Card selected carousel\n */\nconst getCardSelectedCarousel = () => {\n return import(\n /* webpackChunkName: \"card-selected-carousel\" */\n '@logitravel/alex-comp-mar/components/card-selected-carousel/client/js'\n );\n};\n\n/**\n * Card selected carousel\n */\nconst getAdviceCarousel = () => {\n return import(\n /* webpackChunkName: \"advice-carousel\" */\n '@logitravel/alex-comp-mar/components/advice-carousel/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getFooter,\n name: 'Footer'\n },\n {\n loader: getHeaderBannerDestination,\n name: 'HeaderBannerDestination'\n },\n {\n loader: getTextMedia,\n name: 'TextMedia'\n },\n {\n loader: getCardSelectedCarousel,\n name: 'CardSelectedCarousel'\n },\n {\n loader: getAdviceCarousel,\n name: 'AdviceCarousel'\n },\n {\n loader: getBlog,\n name: 'BlogFeed'\n },\n {\n loader: getExperiences,\n name: 'Experiences'\n }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\n/* Export */\nmodule.exports = {\n getCookies,\n getHeader,\n getTopButton,\n getVerticalTabs,\n getSectionArticle,\n resolveComponents\n};\n","/* ==========================================================================\n LayoutLogitravelDestination > Client\n ========================================================================== */\n\n/* Import modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst {\n resolveComponents,\n getCookies,\n getTopButton,\n getHeader,\n getVerticalTabs,\n getSectionArticle\n} = require('./components');\n\n(function LayoutLogitravelCampaigns(selector = '[data-component=\"LayoutLogitravelDestination\"]') {\n if (elementExist(selector)) {\n const element = document.querySelector(selector);\n\n const config = {\n ...(function getConfig() {\n if (!element.dataset.config) return '';\n\n const result = JSON.parse(element.dataset.config);\n element.dataset.config = '';\n return result;\n })()\n };\n\n /**\n * Setting public path to the webpack exposed variable\n */\n /* eslint-disable */\n __webpack_public_path__ = config.publicPath;\n /* eslint-enable */\n\n const components = resolveComponents()\n .filter(\n component =>\n component.name !== 'Header' ||\n component.name !== 'VerticalTabs' ||\n component.name !== 'SectionArticle'\n )\n .map(component => ({\n loader: component.loader,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n const observerConfig = {\n root: null, // avoiding 'root' or setting it to 'null' sets it to default value: viewport\n rootMargin: '0px',\n threshold: 0.15\n };\n\n /**\n * Observer to lazy load modules based on\n * currently viewed components in the viewport\n */\n const observer = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = components\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n if (module.default) module.default();\n observer.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n /**\n * Init observers on components\n */\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* Get VerticalTabs Observavble */\n getVerticalTabsObserver(observerConfig);\n\n /* Get SectionArticle Observavble */\n getSectionArticleObserver(observerConfig);\n\n /* Cookies */\n getCookies().then(module => module.default());\n\n /* TopButton */\n getTopButton().then(module => module.default());\n\n /* Header Logitravel INIT */\n getHeader().then(module => module.default);\n }\n})();\n\nfunction getVerticalTabsObserver(observerConfig) {\n const verticalTabs = [...document.querySelectorAll('[data-component=\"VerticalTabs\"]')].map(item => ({\n loader: getVerticalTabs,\n element: item\n }));\n\n /**\n * Since we have multiple of the same component, in this\n * layout the vertical tabs component will have its own\n * observer part to handle its dynamic init\n */\n const verticalTabsObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = verticalTabs\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n const { type } = entry.target.dataset;\n module.default(`[data-component=\"VerticalTabs\"][data-type=\"${type}\"]`);\n verticalTabsObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n verticalTabs.forEach(component => {\n verticalTabsObserver.observe(component.element);\n });\n}\n\nfunction getSectionArticleObserver(observerConfig) {\n const sectionArticle = [...document.querySelectorAll('[data-component=\"SectionArticle\"]')].map(item => ({\n loader: getSectionArticle,\n element: item\n }));\n\n /**\n * Since we have multiple of the same component, in this\n * layout the section article component will have its own\n * observer part to handle its dynamic init\n */\n const sectionArticleObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = sectionArticle\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n /**\n * Init component with its loader and then\n * unobserve from this entry so we dont\n * call the init of the component more\n * than once\n */\n loader().then(module => {\n const { type } = entry.target.dataset;\n module.default(`[data-component=\"SectionArticle\"][data-type=\"${type}\"]`);\n sectionArticleObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n sectionArticle.forEach(component => {\n sectionArticleObserver.observe(component.element);\n });\n}\n"],"sourceRoot":""}