{"version":3,"sources":["webpack:///./node_modules/@bluekiri/alexandria/helpers/domHelpers.js","webpack:///./components/layout-logitravel-contact/client/js/index.js","webpack:///./components/layout-logitravel-contact/client/js/components.js"],"names":["module","exports","elementExist","element","document","querySelector","toNode","html","DOMParser","parseFromString","body","childNodes","require","_require2","resolveComponents","getCookies","getTopButton","getHeader","selector","arguments","length","undefined","config","_objectSpread","dataset","result","JSON","parse","__webpack_public_path__","publicPath","components","filter","component","name","map","loader","concat","observerConfig","root","rootMargin","threshold","observer","IntersectionObserver","entries","forEach","entry","intersectionRatio","target","reduce","acc","then","default","unobserve","observe","COMPONENTS"],"mappings":";2EAQAA,EAAOC,QAAU,CACbC,aALiB,SAAAC,GAAO,QAAMC,SAASC,cAAcF,IAMrDG,OAJW,SAAAC,GAAI,OAAI,IAAIC,WAAYC,gBAAgBF,EAAM,aAAaG,KAAKC,c,qwBCD/EC,EAAQ,KAER,IAAQV,EAAiBU,EAAQ,KAAzBV,aAERW,EAAmED,EAAQ,KAAnEE,EAAiBD,EAAjBC,kBAAmBC,EAAUF,EAAVE,WAAYC,EAAYH,EAAZG,aAAcC,EAASJ,EAATI,WAErD,WAA2F,IAAzDC,EAAQC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,6CACzC,GAAIjB,EAAagB,GAAW,CACxB,IAAMf,EAAUC,SAASC,cAAca,GAEjCI,EAAMC,EAAA,GACJ,WACA,IAAKpB,EAAQqB,QAAQF,OAAQ,MAAO,GAEpC,IAAMG,EAASC,KAAKC,MAAMxB,EAAQqB,QAAQF,QAE1C,OADAnB,EAAQqB,QAAQF,OAAS,GAClBG,EALP,IAaRG,IAA0BN,EAAOO,WAGjC,IAAMC,EAAahB,IACdiB,QAAO,SAAAC,GAAS,MAAuB,WAAnBA,EAAUC,QAC9BC,KAAI,SAAAF,GAAS,MAAK,CACfG,OAAQH,EAAUG,OAClBhC,QAASC,SAASC,cAAc,oBAAD+B,OAAqBJ,EAAUC,KAAI,WAErEF,QAAO,SAAAC,GAAS,OAAIA,EAAU7B,WAE7BkC,EAAiB,CACnBC,KAAM,KACNC,WAAY,MACZC,UAAW,KAOTC,EAAW,IAAIC,sBAAqB,SAAAC,GACtCA,EAAQC,SAAQ,SAAAC,GACRA,EAAMC,kBAAoB,IAW1BX,EAVmBL,EACdC,QAAO,SAAAC,GAAS,OAAIA,EAAU7B,UAAY0C,EAAME,UAChDC,QAAO,SAAAC,GAAG,OAAIA,KAFXd,UAUCe,MAAK,SAAAlD,GACNA,EAAOmD,SAASnD,EAAOmD,UAC3BV,EAASW,UAAUP,EAAME,gBAItCV,GAKHP,EAAWc,SAAQ,SAAAZ,GACfS,EAASY,QAAQrB,EAAU7B,YAI/BY,IAAamC,MAAK,SAAAlD,GAAM,OAAIA,EAAOmD,aAGnCnC,IAAekC,MAAK,SAAAlD,GAAM,OAAIA,EAAOmD,aAGrClC,IAAYiC,MAAK,SAAAlD,GAAM,OAAIA,EAAOmD,YA1E1C,I,sDCJA,IAgFMG,EAAa,CACf,CACInB,OAxEU,WACd,OAAO,yDAwEHF,KAAM,UAEV,CACIE,OA9Cc,WAClB,OAAO,yDA8CHF,KAAM,iBAEV,CACIE,OAxCY,WAChB,OAAO,yDAwCHF,KAAM,eAEV,CACIE,OAlCmB,WACvB,OAAO,gEAkCHF,KAAM,sBAEV,CACIE,OA5BkB,WACtB,OAAO,yDA4BHF,KAAM,sBAYdjC,EAAOC,QAAU,CACbc,WA5Fe,WACf,OAAO,yDA4FPE,UAjHc,WACd,OAAO,iEAiHPD,aApFiB,WACjB,OAAO,oCAoFPF,kBATJ,WACI,OAAOwC,M","file":"index.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 LayoutLogitravelContact > Client\n ========================================================================== */\n\n/* Import modules */\nrequire('intersection-observer');\n\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst { resolveComponents, getCookies, getTopButton, getHeader } = require('./components');\n\n(function LayoutLogitravelContact(selector = '[data-component=\"LayoutLogitravelContact\"]') {\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(component => component.name !== 'Header')\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 /* 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","/* ==========================================================================\n LayoutLogitravelContact > 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 * contactHeader\n */\nconst contactHeader = () => {\n return import(\n /* webpackChunkName: \"contact-header\" */\n '@logitravel/alex-comp-mar/components/contact-header/client/js'\n );\n};\n\n/**\n * contactChat\n */\nconst contactChat = () => {\n return import(\n /* webpackChunkName: \"contact-chat\" */\n '@logitravel/alex-comp-mar/components/contact-chat/client/js'\n );\n};\n\n/**\n * contactFaqCarousel\n */\nconst contactFaqCarousel = () => {\n return import(\n /* webpackChunkName: \"contact-faq-carousel\" */\n '@logitravel/alex-comp-mar/components/contact-faq-carousel/client/js'\n );\n};\n\n/**\n * contactCardsLinks\n */\nconst contactCardsLinks = () => {\n return import(\n /* webpackChunkName: \"contact-cards-links\" */\n '@logitravel/alex-comp-mar/components/contact-cards-links/client/js'\n );\n};\n\n/**\n * Components\n */\nconst COMPONENTS = [\n {\n loader: getFooter,\n name: 'Footer'\n },\n {\n loader: contactHeader,\n name: 'ContactHeader'\n },\n {\n loader: contactChat,\n name: 'ContactChat'\n },\n {\n loader: contactFaqCarousel,\n name: 'ContactFaqCarousel'\n },\n {\n loader: contactCardsLinks,\n name: 'ContactCardsLinks'\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 resolveComponents\n};\n"],"sourceRoot":""}