{"version":3,"sources":["webpack:///./components/layout-home-byl/client/js/index.js","webpack:///./components/layout-home-byl/client/js/components.js"],"names":["require","elementExist","resolveComponents","getCookies","getCardGalleryCollectionByl","getCarousel","getCampaigns","getCardGalleryCollectionBylObserver","observerConfig","element","cardGalleryCollectionByl","querySelectorAll","map","item","loader","cardGalleryCollectionBylObserver","IntersectionObserver","entries","forEach","entry","intersectionRatio","filter","component","target","reduce","acc","then","module","type","dataset","unobserve","observe","getCarouselObserver","bannerProductCardCarousel","bannerProductCardCarouselObserver","getCampaignsObserver","tabsBannerProductCardCarousel","tabsBannerProductCardCarouselObserver","selector","document","querySelector","config","result","JSON","parse","__webpack_public_path__","publicPath","components","name","root","rootMargin","threshold","observer","setTimeout","window","dispatchEvent","Event","getSearchers","COMPONENTS","searchers","push","Object","keys","exports"],"mappings":";okDAKAA,EAAQ,KAER,IAAQC,EAAiBD,EAAQ,IAAzBC,aAER,EAMID,EAAQ,KALRE,EADJ,EACIA,kBACAC,EAFJ,EAEIA,WACAC,EAHJ,EAGIA,4BACAC,EAJJ,EAIIA,YACAC,EALJ,EAKIA,aAmGJ,SAASC,EAAoCC,EAAgBC,GACzD,IAAMC,EAA2B,EAAID,EAAQE,iBAAiB,gDAAgDC,KAC1G,SAAAC,GAAI,MAAK,CACLC,OAAQV,EACRK,QAASI,MASXE,EAAmC,IAAIC,sBAAqB,SAAAC,GAC9DA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BN,EAVmBJ,EACdW,QAAO,SAAAC,GAAS,OAAIA,EAAUb,UAAYU,EAAMI,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXX,UAUCY,MAAK,SAAAC,GACV,IAAQC,EAAST,EAAMI,OAAOM,QAAtBD,KACRD,EAAM,QAAN,iEAAyEC,EAAzE,OACAb,EAAiCe,UAAUX,EAAMI,gBAI9Df,GAEHE,EAAyBQ,SAAQ,SAAAI,GAC7BP,EAAiCgB,QAAQT,EAAUb,YAI3D,SAASuB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yDAoHHkC,KAAM,aAEV,CACIlC,OAtJkB,WACtB,OAAO,yDAsJHkC,KAAM,kBAEV,CACIlC,OAhJgB,WACpB,OAAO,mCAgJHkC,KAAM,gBAEV,CACIlC,OApE0B,WAC9B,OAAO,yDAoEHkC,KAAM,0BAEV,CACIlC,OA9DgB,WACpB,OAAO,yDA8DHkC,KAAM,gBAEV,CACIlC,OAxDY,WAChB,OAAO,yDAwDHkC,KAAM,eAEV,CACIlC,OAlDsB,WAC1B,OAAO,yDAkDHkC,KAAM,sBAEV,CACIlC,OA5CqB,WACzB,OAAO,yDA4CHkC,KAAM,sBAIRW,EAAYF,IACblB,SAASC,cAAc,kCAGxBkB,EAAWE,KAAK,CACZ9C,OAtIiB,WACrB,OAAO,yDAsIHkC,KAAM,kBAJVa,OAAOC,KAAKH,GAAWzC,SAAQ,SAAAL,GAAI,OAAI6C,EAAWE,KAAK,CAAE9C,OAAQ6C,EAAU9C,GAAOmC,KAAMnC,OAgB5Fc,EAAOoC,QAAU,CACb5D,WA9Je,WACf,OAAO,yDA8JPC,4BAvHgC,WAChC,OAAO,yDAuHPC,YAlIgB,WAChB,OAAO,yDAkIPC,aA7IiB,WACjB,OAAO,yDA6IPJ,kBAVJ,WACI,OAAOwD,M","file":"index.bundle.js","sourcesContent":["/* ==========================================================================\n LayoutHomeByl > Client\n ========================================================================== */\n\n/* Import modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst {\n resolveComponents,\n getCookies,\n getCardGalleryCollectionByl,\n getCarousel,\n getCampaigns\n} = require('./components');\n\n/**\n * LayoutHomeByl component\n * @param {selector} String selector for the component in the client side.\n */\n(function LayoutHomeByl(selector = '[data-component=LayoutHomeByl]') {\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 .map(component => ({\n loader: component.loader,\n element:\n document.querySelector(`${selector} > [data-component=\"${component.name}\"]`) ||\n document.querySelector(`${selector} > main [data-component=\"${component.name}\"]`)\n }))\n .filter(component => component.element);\n\n /**\n * Config observer\n */\n const observerConfig = {\n root: null, // avoiding 'root' or setting it to 'null' sets it to default value: viewport\n rootMargin: '1000px',\n threshold: 0\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 const { component, type } = entry.target.dataset;\n module.default(`[data-component=\"${component}\"]${type ? `[data-type=\"${type}\"]` : ''}`);\n\n setTimeout(() => window.dispatchEvent(new Event('resize')), 1000);\n\n observer.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n components.forEach(component => {\n observer.observe(component.element);\n });\n\n /**\n * Init card gallery collections\n */\n getCardGalleryCollectionBylObserver(observerConfig, element);\n\n /**\n * Init banner carousel collections\n */\n getCarouselObserver(observerConfig, element);\n\n /**\n * Init tabs banner carousel collections\n */\n getCampaignsObserver(observerConfig, element);\n\n /* Cookies */\n getCookies().then(module => module.default());\n }\n})();\n\nfunction getCardGalleryCollectionBylObserver(observerConfig, element) {\n const cardGalleryCollectionByl = [...element.querySelectorAll('[data-component=\"CardGalleryCollectionByl\"]')].map(\n item => ({\n loader: getCardGalleryCollectionByl,\n element: item\n })\n );\n\n /**\n * Since we have multiple of the same component, in this\n * layout the CardGalleryCollectionByl component will have its own\n * observer part to handle its dynamic init\n */\n const cardGalleryCollectionBylObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = cardGalleryCollectionByl\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=\"CardGalleryCollectionByl\"][data-type=\"${type}\"]`);\n cardGalleryCollectionBylObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n cardGalleryCollectionByl.forEach(component => {\n cardGalleryCollectionBylObserver.observe(component.element);\n });\n}\n\nfunction getCarouselObserver(observerConfig, element) {\n const bannerProductCardCarousel = [\n ...element.querySelectorAll('[data-component=\"BannerProductCardCarousel\"][data-type^=\"component\"]')\n ].map(item => ({\n loader: getCarousel,\n element: item\n }));\n\n const bannerProductCardCarouselObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = bannerProductCardCarousel\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n loader().then(module => {\n const { type } = entry.target.dataset;\n module.default(`[data-component=\"BannerProductCardCarousel\"][data-type=\"${type}\"]`);\n bannerProductCardCarouselObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n bannerProductCardCarousel.forEach(component => {\n bannerProductCardCarouselObserver.observe(component.element);\n });\n}\n\nfunction getCampaignsObserver(observerConfig, element) {\n const tabsBannerProductCardCarousel = [\n ...element.querySelectorAll('[data-component=\"TabsBannerProductCardCarousel\"][data-type^=\"component\"]')\n ].map(item => ({\n loader: getCampaigns,\n element: item\n }));\n\n const tabsBannerProductCardCarouselObserver = new IntersectionObserver(entries => {\n entries.forEach(entry => {\n if (entry.intersectionRatio > 0) {\n const { loader } = tabsBannerProductCardCarousel\n .filter(component => component.element === entry.target)\n .reduce(acc => acc);\n\n loader().then(module => {\n const { type } = entry.target.dataset;\n module.default(`[data-component=\"TabsBannerProductCardCarousel\"][data-type=\"${type}\"]`);\n tabsBannerProductCardCarouselObserver.unobserve(entry.target);\n });\n }\n });\n }, observerConfig);\n\n tabsBannerProductCardCarousel.forEach(component => {\n tabsBannerProductCardCarouselObserver.observe(component.element);\n });\n}\n","/* ==========================================================================\n LayoutHomeByl > Client > Components\n ========================================================================== */\n/**\n * Searchers\n */\nconst getSearchers = require('@logitravel/alex-contrib-bylogi/components/multisearcher/client/js/searchers');\n\n/**\n * HeaderCarousel\n */\nconst getHeaderCarousel = () => {\n return import(\n /* webpackChunkName: \"header-carousel\" */\n '@bluekiri/alexandria-contrib-components/components/header-carousel/client/js'\n );\n};\n\n/**\n * HeaderBanner\n */\nconst getHeaderBanner = () => {\n return import(\n /* webpackChunkName: \"header-banner\" */\n '@bluekiri/alexandria-contrib-components/components/header-banner/client/js'\n );\n};\n\n/**\n * Header\n */\nconst getHeader = () => {\n return import(\n /* webpackChunkName: \"header-byl\" */\n '@logitravel/alex-contrib-bylogi/components/header-byl/client/js'\n );\n};\n\n/**\n * Footer\n */\nconst getFooter = () => {\n return import(\n /* webpackChunkName: \"footer-byl\" */\n '@logitravel/alex-contrib-bylogi/components/footer-byl/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 * Multisearch\n */\nconst getMultisearcher = () => {\n return import(\n /* webpackChunkName: \"multisearcher\" */\n '@logitravel/alex-contrib-bylogi/components/multisearcher/client/js'\n );\n};\n\n/**\n * Campaign\n */\nconst getCampaigns = () => {\n return import(\n /* webpackChunkName: \"campaigns\" */\n '@logitravel/alex-contrib-bylogi/components/tabs-banner-product-card-carousel/client/js'\n );\n};\n\n/**\n * BannerProductCardCarousel\n */\nconst getCarousel = () => {\n return import(\n /* webpackChunkName: \"banner-product-card-carousel\" */\n '@logitravel/alex-contrib-bylogi/components/banner-product-card-carousel/client/js'\n );\n};\n\n/**\n * CardGalleryCollectionByl\n */\nconst getCardGalleryCollectionByl = () => {\n return import(\n /* webpackChunkName: \"card-gallery-collection\" */\n '@logitravel/alex-contrib-bylogi/components/card-gallery-collection-byl/client/js'\n );\n};\n\n/**\n * CardEffectMaskCarousel\n */\nconst getCardEffectMaskCarousel = () => {\n return import(\n /* webpackChunkName: \"card-effect-mask-collection\" */\n '@logitravel/alex-contrib-bylogi/components/card-effect-mask-carousel/client/js'\n );\n};\n\n/**\n * VerticalTabs\n */\nconst getVerticalTabs = () => {\n return import(\n /* webpackChunkName: \"vertical-tabs\" */\n '@logitravel/alex-contrib-bylogi/components/vertical-tabs/client/js'\n );\n};\n\n/**\n * Features\n */\nconst getFeatures = () => {\n return import(\n /* webpackChunkName: \"features-byl\" */\n '@logitravel/alex-contrib-bylogi/components/features-byl/client/js'\n );\n};\n\n/**\n * Carousel Card Simple\n */\nconst getCarouselCardSimple = () => {\n return import(\n /* webpackChunkName: \"carousel-card-simple\" */\n '@logitravel/alex-contrib-bylogi/components/carousel-card-simple/client/js'\n );\n};\n\n/**\n * Carousel Offers Cta\n */\nconst getCarouselOffersCta = () => {\n return import(\n /* webpackChunkName: \"carousel-offers-cta\" */\n '@logitravel/alexandria-contrib-components-packages/components/carousel-offers-cta/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getHeader,\n name: 'HeaderByl'\n },\n {\n loader: getFooter,\n name: 'FooterByl'\n },\n {\n loader: getHeaderCarousel,\n name: 'HeaderCarousel'\n },\n {\n loader: getHeaderBanner,\n name: 'HeaderBanner'\n },\n {\n loader: getCardEffectMaskCarousel,\n name: 'CardEffectMaskCarousel'\n },\n {\n loader: getVerticalTabs,\n name: 'VerticalTabs'\n },\n {\n loader: getFeatures,\n name: 'FeaturesByl'\n },\n {\n loader: getCarouselCardSimple,\n name: 'CarouselCardSimple'\n },\n {\n loader: getCarouselOffersCta,\n name: 'CarouselOffersCta'\n }\n];\n\nconst searchers = getSearchers();\nif (!document.querySelector('[data-component=Multisearcher]')) {\n Object.keys(searchers).forEach(item => COMPONENTS.push({ loader: searchers[item], name: item }));\n} else {\n COMPONENTS.push({\n loader: getMultisearcher,\n name: 'Multisearcher'\n });\n}\n\n/**\n * Resolver components\n */\nfunction resolveComponents() {\n return COMPONENTS;\n}\n\n/* Exports */\nmodule.exports = {\n getCookies,\n getCardGalleryCollectionByl,\n getCarousel,\n getCampaigns,\n resolveComponents\n};\n"],"sourceRoot":""}