{"version":3,"sources":["webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/prototype.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/store/actions.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/index.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/images/index.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/constants/index.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/select/index.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/store/reducer.js","webpack:///./node_modules/@logitravel/comp-dsk-melia/components/footer-mel/client/js/config.js"],"names":["Store","actions","types","reducer","initSelect","initImages","destroyImages","prototype","this","store","data","destroy","dispatch","reactions","subscribe","state","action","type","DESTROY","unsubscribe","Object","keys","forEach","key","element","parentNode","removeChild","subscriptions","config","init","setupStore","setupActions","setupReactions","module","exports","elementExist","selector","configuration","instance","create","document","querySelector","hooks","dataset","result","JSON","parse","ImageClient","inst","images","querySelectorAll","map","image","length","SVG","LOGO","OPERATEDBY","OPERATEDBY_NEG","ORIGINAJAX","endpoint","parameterName","verb","LANGAJAX","IMAGES","alternative","resize","operation","suboperation","width","height","quality","ajax","fromEvent","getService","value","baseUrl","url","method","toUpperCase","body","context","languages","originAjax","langAjax","language","laguages","departures","departure","changeLanguage","changeLanguageSevice","status","window","location","reload","link","find","item","href","changeDepartures","changeOriginService","initialState","component","start","css","self","about","reservations","business","contactUs","rrss","newsletter"],"mappings":";gFAKA,MAAM,MAAEA,GAAU,EAAQ,SAEpB,QAAEC,EAAO,MAAEC,GAAU,EAAQ,SAC7B,QAAEC,GAAY,EAAQ,SAEtB,WAAEC,GAAe,EAAQ,SACzB,WAAEC,EAAU,cAAEC,GAAkB,EAAQ,QAGxCC,EAAY,CAEd,aACI,OAAIC,KAAKC,QAETD,KAAKC,MAAQ,IAAIT,EAAM,CACnBU,KAAMP,KA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E,EAAOC,QAAU,CACb/B,QAVJ,SAAiBY,EAAQqF,EAAcpF,GACnC,OAAQA,EAAOC,MACX,KAAKf,EAAMgB,QACX,QACI,OAAOH,M,mBCRnB,MAAMa,EAAS,CACXyE,UAAW,YACXxE,MAAM,EACNyE,OAAO,EACPC,IAAK,CACDC,KAAM,aACNC,MAAO,oBACPC,aAAc,2BACdC,SAAU,uBACVC,UAAW,wBACXC,KAAM,mBACNC,WAAY,0BAEhB7F,KAAM,CACFoE,SAAU,uBACVE,UAAW,wBACXnC,MAAO,oBAEXA,MAAO,CACHa,OAAQ,CACJG,MAAO,IACPC,OAAQ,KAKpBpC,EAAOC,QAAU,IAAMN","file":"footer-mel.1254a3c49451ffad0fb6.bundle.js","sourcesContent":["/* ==========================================================================\n FooterMel > Client > Prototype\n ========================================================================== */\n\n/* Import modules */\nconst { Store } = require('@bluekiri/alexandria/helpers/state');\n\nconst { actions, types } = require('./store/actions');\nconst { reducer } = require('./store/reducer');\n\nconst { initSelect } = require('./select');\nconst { initImages, destroyImages } = require('./images');\n\n/* Prototype */\nconst prototype = {\n /* Setup store */\n setupStore() {\n if (this.store) return this;\n\n this.store = new Store({\n data: reducer\n });\n\n return this;\n },\n /* Setup actions */\n setupActions() {\n if (this.actions) return this;\n\n this.actions = {\n destroy: () => this.store.dispatch(actions.destroy())\n };\n\n return this;\n },\n /* Setup reactions */\n setupReactions() {\n if (this.reactions) return this;\n this.reactions = {\n destroy: this.store.subscribe((state, action) => {\n if (action.type !== types.DESTROY) return;\n\n /* Destroy components */\n destroyImages(this);\n\n /* Unsubscribe */\n this.unsubscribe();\n [...Object.keys(this.reactions)].forEach(key => this.reactions[key].unsubscribe());\n\n /* Clean DOM */\n this.element.parentNode.removeChild(this.element);\n\n /* Clean reference */\n [...Object.keys(this)].forEach(key => delete this[key]);\n })\n };\n\n return this;\n },\n /* Subscribe */\n subscribe() {\n if (this.subscriptions) this.unsubscribe();\n\n this.subscriptions = {};\n\n return this;\n },\n /* Unsubscribe */\n unsubscribe() {\n if (!this.subscriptions) return this;\n\n [...Object.keys(this.subscriptions)].forEach(key => this.subscriptions[key].unsubscribe());\n\n return this;\n },\n\n /* Init */\n init() {\n if (!this.config.init) return this;\n\n /* Setup store */\n this.setupStore();\n\n /* Setup actions */\n this.setupActions();\n\n /* Setup reactions */\n this.setupReactions();\n\n /* Subscribe */\n this.subscribe();\n\n /* Init components */\n initImages(this);\n initSelect(this);\n\n return this;\n }\n};\n\n/* Exports */\nmodule.exports = prototype;\n","/* ==========================================================================\n FooterMel > Client > Store > Actions\n ========================================================================== */\n\n/* Types */\nconst DESTROY = 'FOOTER_MEL::DESTROY';\n\n/* Actions */\nconst destroy = () => ({ type: DESTROY });\n\n/* Exports */\nmodule.exports = {\n types: {\n DESTROY\n },\n actions: {\n destroy\n }\n};\n","/* ==========================================================================\n FooterMel > Client\n ========================================================================== */\n\n/* Import modules */\nconst { elementExist } = require('@bluekiri/alexandria/helpers/domHelpers');\n\nconst prototype = require('./prototype');\nconst config = require('./config');\n\n/**\n * FooterMel component\n * @param {selector} String selector for the component in the client side.\n */\nmodule.exports = function FooterMel(selector = '[data-component=FooterMel]', configuration = {}) {\n if (elementExist(selector)) {\n /* Instance */\n const instance = Object.create(prototype);\n\n /* Selector */\n instance.selector = selector;\n\n /* Element */\n instance.element = document.querySelector(selector);\n\n /* Hooks */\n instance.hooks = {};\n\n /* Config */\n instance.config = {\n ...config(),\n ...configuration,\n ...(function getConfig() {\n if (!instance.element.dataset.config) return '';\n\n const result = JSON.parse(instance.element.dataset.config);\n instance.element.dataset.config = '';\n return result;\n })()\n };\n\n /* Init */\n instance.init();\n\n /* Return */\n return instance;\n }\n};\n","/* ==========================================================================\n FooterMel > Client > images\n ========================================================================== */\n/* Modules */\nconst ImageClient = require('@bluekiri/alexandria-contrib-components/components/image-rxjs/client/js');\n\nfunction initImages(instance) {\n const inst = instance;\n\n inst.images = [...inst.element.querySelectorAll('[data-component=\"ImageRxjs\"]')].map(image => {\n const { type } = image.dataset;\n\n return ImageClient(`${inst.selector} [data-component=\"ImageRxjs\"][data-type=\"${type}\"]`);\n });\n}\n\nfunction destroyImages(instance) {\n if (!instance.image && !instance.images.length) return;\n\n instance.images.forEach(image => {\n image.actions.destroy();\n });\n}\n\nmodule.exports = {\n initImages,\n destroyImages\n};\n","/* ==========================================================================\n FooterMel > Constants\n ========================================================================== */\n\n/* Exports */\nmodule.exports = {\n SVG: {\n LOGO: 'https://cdn.logitravel.com/melia/images/logo_escapes.svg',\n OPERATEDBY: 'https://cdn.logitravel.com/melia/images/logo_operatedby.svg',\n OPERATEDBY_NEG: 'https://cdn.logitravel.com/melia/images/logo_operatedby-neg.svg'\n },\n ORIGINAJAX: {\n endpoint: '/partnershipshowcase/origin',\n parameterName: 'PortCode',\n verb: 'post'\n },\n LANGAJAX: {\n endpoint: '/partnershipshowcase/language',\n parameterName: 'Language',\n verb: 'post'\n },\n IMAGES: {\n alternative: '/comun/images/not-available.png',\n resize: {\n operation: 'resize',\n suboperation: '',\n width: 120,\n height: 50,\n quality: 90\n }\n }\n};\n","/* ==========================================================================\n FooterMel > Client\n ========================================================================== */\n\n/* Modules */\nconst { ajax } = require('rxjs/ajax');\nconst { fromEvent } = require('rxjs');\nconst configuration = require('../config');\nconst { ORIGINAJAX } = require('../../../constants');\n\nfunction getService(data) {\n const { endpoint, parameterName, verb, value, baseUrl } = data;\n\n return ajax({\n url: `${baseUrl}${endpoint}`,\n method: verb.toUpperCase(),\n\n body: {\n [`${parameterName}`]: value\n }\n });\n}\n\nfunction initSelect(instance) {\n const inst = instance;\n const { config = {} } = instance;\n const { context = {}, endpoint = {}, languages = [] } = config;\n const { baseUrl } = context;\n const { originAjax = ORIGINAJAX, langAjax = false } = endpoint;\n\n /* Extends hooks */\n inst.hooks = {\n ...inst.hooks,\n language: inst.element.querySelector(`select[data-type=\"${configuration().type.laguages}\"]`),\n departures: inst.element.querySelector(`select[data-type=\"${configuration().type.departure}\"]`)\n };\n /* Extends Subscriptions */\n inst.subscriptions = {\n ...inst.subscriptions,\n changeLanguage: fromEvent(inst.hooks.language, 'change').subscribe(() => {\n if (inst.subscriptions.changeLanguageSevice) inst.subscriptions.changeLanguageSevice.unsubscribe();\n\n if (langAjax) {\n /* extendSubscription */\n inst.subscriptions = {\n ...inst.subscriptions,\n changeLanguageSevice: getService({\n ...langAjax,\n baseUrl,\n value: inst.hooks.language.value\n }).subscribe(data => {\n if (data.status === 200) window.location.reload();\n })\n };\n } else {\n const { link = '#' } = languages.find(item => item.value === inst.hooks.language.value);\n\n window.location.href = link;\n }\n }),\n changeDepartures: fromEvent(inst.hooks.departures, 'change').subscribe(() => {\n if (inst.subscriptions.changeOriginService) inst.subscriptions.changeOriginService.unsubscribe();\n\n /* extendSubscription */\n inst.subscriptions = {\n ...inst.subscriptions,\n changeOriginService: getService({\n ...originAjax,\n baseUrl,\n value: inst.hooks.departures.value\n }).subscribe(data => {\n if (data.status === 200) window.location.reload();\n })\n };\n })\n };\n}\n\nmodule.exports = {\n initSelect\n};\n","/* ==========================================================================\n FooterMel > Client > Store > Reducer\n ========================================================================== */\n\n/* Modules */\nconst { types } = require('./actions');\n\n/* Initial state */\nconst initialState = {};\n\n/* Reducer */\nfunction reducer(state = initialState, action) {\n switch (action.type) {\n case types.DESTROY:\n default:\n return state;\n }\n}\n\n/* Exports */\nmodule.exports = {\n reducer\n};\n","/* ==========================================================================\n FooterMel > Client > Config\n ========================================================================== */\n\n/* Import modules */\n\n/* Config */\nconst config = {\n component: 'FooterMel',\n init: true,\n start: true,\n css: {\n self: 'footer-mel',\n about: 'footer-mel__about',\n reservations: 'footer-mel__reservations',\n business: 'footer-mel__business',\n contactUs: 'footer-mel__contactUs',\n rrss: 'footer-mel__rrss',\n newsletter: 'footer-mel__newsletter'\n },\n type: {\n laguages: 'footer-mel-languages',\n departure: 'footer-mel-departures',\n image: 'footer-mel-image'\n },\n image: {\n resize: {\n width: 102,\n height: 0\n }\n }\n};\n\nmodule.exports = () => config;\n"],"sourceRoot":""}