{"version":3,"sources":["webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-home-cru/client/js/index.js","webpack:///./node_modules/@logitravel/alex-comp-cru/components/main-home-cru/client/js/components.js"],"names":["require","elementExist","_require2","resolveComponents","getClickToCall","getMkO2oAjax","getHeaderCarousel","getSearcherCruises","getProductListSorter","getCarouselBanners","getProductListSorterObserver","observerConfig","element","productListSorters","_toConsumableArray","querySelectorAll","map","item","loader","productListSorterObserver","IntersectionObserver","entries","forEach","entry","intersectionRatio","filter","component","target","reduce","acc","then","module","type","dataset","default","concat","error","console","unobserve","observe","exports","selector","arguments","length","undefined","document","querySelector","config","_objectSpread","result","JSON","parse","publicPath","__webpack_public_path__","components","name","root","rootMargin","threshold","observer","_components$filter$re","mod","getFeatures","COMPONENTS"],"mappings":";8wBAKAA,EAAQ,QAER,IAAQC,EAAiBD,EAAQ,QAAzBC,aAERC,EAQIF,EAAQ,QAPRG,EAAiBD,EAAjBC,kBACAC,EAAcF,EAAdE,eACAC,EAAYH,EAAZG,aACAC,EAAiBJ,EAAjBI,kBACAC,EAAkBL,EAAlBK,mBACAC,EAAoBN,EAApBM,qBACAC,EAAkBP,EAAlBO,mBAsGJ,SAASC,EAA6BC,EAAgBC,GAClD,IAAMC,EAAqBC,EAAIF,EAAQG,iBAAiB,yCAAyCC,KAAI,SAAAC,GAAI,MAAK,CAC1GC,OAAQV,EACRI,QAASK,MAQPE,EAA4B,IAAIC,sBAAqB,SAAAC,GACvDA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BN,EAVmBL,EACdY,QAAO,SAAAC,GAAS,OAAIA,EAAUd,UAAYW,EAAMI,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXX,UAUCY,MAAK,SAAAC,GACV,IAAQC,EAAST,EAAMI,OAAOM,QAAtBD,KACR,IACID,EAAOG,QAAQ,mDAADC,OAAoDH,EAAI,OACxE,MAAOI,GACLC,QAAQD,MAAM,yBAADD,OAA0BC,IAG3CjB,EAA0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AAQT,EAAoB8C,KAAM,mBACpC,CAAErC,OAAQ4C,EAAaP,KAAM,aAUjCxB,EAAOS,QAAU,CACbrC,kBALJ,WACI,OAAO4D,GAKP3D,eA5NmB,WACnB,OAAO,4DA4NPC,aAvEiB,WACjB,OAAO,6DAuEPC,kBAtQsB,WACtB,OAAO,6DAsQPC,mBAvLuB,WACvB,OAAO,oEAuLPC,qBA5CyB,WACzB,OAAO,6DA4CPC,qBACAqD","file":"main-home-cru.4485a68f9059af3030ef.bundle.js","sourcesContent":["/* ==========================================================================\n MainHomeCru > Client\n ========================================================================== */\n\n/* Modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst {\n resolveComponents,\n getClickToCall,\n getMkO2oAjax,\n getHeaderCarousel,\n getSearcherCruises,\n getProductListSorter,\n getCarouselBanners\n} = require('./components');\n\n/**\n * MainHomeCru component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function MainHomeCru(selector = '[data-component=\"MainHomeCru\"]') {\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 if (config.publicPath) __webpack_public_path__ = config.publicPath;\n /* eslint-enable */\n\n const components = resolveComponents()\n .map(component => ({\n loader: component.loader,\n name: component.name,\n element: document.querySelector(`[data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /* Observer Config */\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, name } = 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 try {\n module.default();\n } catch (error) {\n console.error(`Error loading module: ${error}`);\n }\n\n if (name === 'ShippingLineRxjs')\n try {\n /* MkO2oAjax */\n getMkO2oAjax().then(mod => mod.default());\n } catch (error) {\n console.error(`Error loading module: ${error}`);\n }\n\n observer.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /* HeaderCarousel */\n getHeaderCarousel().then(module => module.default());\n\n /* SearcherCruises */\n getSearcherCruises().then(module => module.default());\n\n /* ClickToCall */\n getClickToCall().then(module => module.default());\n\n /* CarouselBanners */\n getCarouselBanners().then(module => module.default());\n\n /* ProductListSorter */\n getProductListSorterObserver(observerConfig, element);\n }\n};\n\nfunction getProductListSorterObserver(observerConfig, element) {\n const productListSorters = [...element.querySelectorAll('[data-component=\"ProductListSorter\"]')].map(item => ({\n loader: getProductListSorter,\n element: item\n }));\n\n /**\n * Since we can have multiple of the same component, in this\n * layout the productListSorter component will have its own\n * observer part to handle its dynamic init\n */\n const productListSorterObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = productListSorters\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 try {\n module.default(`[data-component=\"ProductListSorter\"][data-type=\"${type}\"]`);\n } catch (error) {\n console.error(`Error loading module: ${error}`);\n }\n\n productListSorterObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n productListSorters.forEach(component => {\n productListSorterObserver.observe(component.element);\n });\n}\n","/**\n * HeaderCarousel\n */\nconst getHeaderCarousel = () => {\n return import(\n /* webpackChunkName: \"header-carousel-rxjs\" */\n '@bluekiri/alexandria-contrib-components/components/header-carousel-rxjs/client/js'\n );\n};\n\n/**\n * BreadcrumbsIdCru\n */\nconst getBreadcrumbsIdCru = () => {\n return import(\n /* webpackChunkName: \"breadcrumbs-id-cru\" */\n '../../../breadcrumbs-id-cru/client/js'\n );\n};\n\n/**\n * MasonryCarousel\n */\nconst getMasonryCarousel = () => {\n return import(\n /* webpackChunkName: \"masonry-carousel\" */\n '@bluekiri/alexandria-contrib-components/components/masonry-carousel/client/js'\n );\n};\n\n/**\n * TextHtmlCollapse\n */\nconst getTextHtmlCollapse = () => {\n return import(\n /* webpackChunkName: \"text-html-collapse\" */\n '@bluekiri/alexandria-contrib-components/components/text-html-collapse/client/js'\n );\n};\n\n/**\n * ClickToCall\n */\nconst getClickToCall = () => {\n return import(\n /* webpackChunkName: \"click-to-call\" */\n '@bluekiri/alexandria-contrib-components/components/click-to-call/client/js'\n );\n};\n\n/**\n * ImagesList\n */\nconst getImagesList = () => {\n return import(\n /* webpackChunkName: \"images-list\" */\n '@bluekiri/alex-liverpool/components/images-list/client/js'\n );\n};\n\n/**\n * CarouselBanners\n */\nconst getCarouselBanners = () => {\n return import(\n /* webpackChunkName: \"carousel-banners\" */\n '@logitravel/alex-aubergine/components/carousel-offers-aub/client/js'\n );\n};\n\n/**\n * BlogFeed\n */\nconst getBlogFeed = () => {\n return import(\n /* webpackChunkName: \"blog-feed\" */\n '../../../blog-feed/client/js'\n );\n};\n\n/**\n * SearcherCruises\n */\nconst getSearcherCruises = () => {\n return import(\n /* webpackChunkName: \"searcher-cruises\" */\n '../../../searcher-cruises/client/js'\n );\n};\n\n/**\n * NewsletterAgent\n */\nconst getNewsletterAgent = () => {\n return import(\n /* webpackChunkName: \"newsletter-agent\" */\n '../../../newsletter-agent/client/js'\n );\n};\n\n/**\n * Links\n */\nconst getLinks = () => {\n return import(\n /* webpackChunkName: \"links\" */\n '../../../links/client/js'\n );\n};\n\n/**\n * ProductListImages\n */\nconst getProductListImages = () => {\n return import(\n /* webpackChunkName: \"product-list-images\" */\n '../../../product-list-images/client/js'\n );\n};\n\n/**\n * ShippingLine\n */\nconst getShippingLine = () => {\n return import(\n /* webpackChunkName: \"shipping-line\" */\n '../../../shipping-line-rxjs/client/js'\n );\n};\n\n/**\n * TextImage\n */\nconst getTextImage = () => {\n return import(\n /* webpackChunkName: \"text-image\" */\n '../../../text-image/client/js'\n );\n};\n\n/**\n * SpecialOffers\n */\nconst getSpecialOffers = () => {\n return import(\n /* webpackChunkName: \"special-offers\" */\n '../../../special-offers/client/js'\n );\n};\n\n/**\n * TabsCarousel\n */\nconst getTabsCarousel = () => {\n return import(\n /* webpackChunkName: \"tabs-carousel\" */\n '../../../tabs-carousel/client/js'\n );\n};\n\n/**\n * TabsCarousel\n */\nconst getFeatures = () => {\n return import(\n /* webpackChunkName: \"features\" */\n '../../../features/client/js'\n );\n};\n\n/**\n * TabsLinks\n */\nconst getTabsLinks = () => {\n return import(\n /* webpackChunkName: \"tabs-links\" */\n '../../../tabs-links/client/js'\n );\n};\n\n/**\n * Advice\n */\nconst getAdvice = () => {\n return import(\n /* webpackChunkName: \"advice\" */\n '../../../advice/client/js'\n );\n};\n\n/**\n * MkO2oAjax\n */\nconst getMkO2oAjax = () => {\n return import(\n /* webpackChunkName: \"mk-o2o-ajax\" */\n '../../../mk-o2o-ajax/client/js'\n );\n};\n\n/**\n * SmyServices\n */\nconst getSmyServices = () => {\n return import(\n /* webpackChunkName: \"smy-services\" */\n '../../../smy-services/client/js'\n );\n};\n\n/**\n * InformationListColumnsImage\n */\nconst getInformationListColumnsImage = () => {\n return import(\n /* webpackChunkName: \"information-list-columns-image\" */\n '../../../information-list-columns-image/client/js'\n );\n};\n\n/**\n * ProductListSorter\n */\nconst getProductListSorter = () => {\n return import(\n /* webpackChunkName: \"product-list-sorter\" */\n '../../../product-list-sorter/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n { loader: getBreadcrumbsIdCru, name: 'BreadcrumbsIdCru' },\n { loader: getMasonryCarousel, name: 'MasonryCarousel' },\n { loader: getTextHtmlCollapse, name: 'TextHtmlCollapse' },\n { loader: getBlogFeed, name: 'BlogFeed' },\n { loader: getNewsletterAgent, name: 'NewsletterAgent' },\n { loader: getLinks, name: 'Links' },\n { loader: getProductListImages, name: 'ProductListImages' },\n { loader: getShippingLine, name: 'ShippingLineRxjs' },\n { loader: getTextImage, name: 'TextImage' },\n { loader: getSpecialOffers, name: 'SpecialOffers' },\n { loader: getTabsCarousel, name: 'TabsCarousel' },\n { loader: getTabsLinks, name: 'TabsLinks' },\n { loader: getAdvice, name: 'Advice' },\n { loader: getInformationListColumnsImage, name: 'InformationListColumnsImage' },\n { loader: getSmyServices, name: 'SmyServices' },\n { loader: getImagesList, name: 'ImagesList' },\n { loader: getCarouselBanners, name: 'CarouselBanners' },\n { loader: getFeatures, name: 'Features' }\n];\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\nmodule.exports = {\n resolveComponents,\n getClickToCall,\n getMkO2oAjax,\n getHeaderCarousel,\n getSearcherCruises,\n getProductListSorter,\n getCarouselBanners,\n getFeatures\n};\n"],"sourceRoot":""}