{"version":3,"sources":["../../../source/assets/js/app/icons.js","../../../source/assets/js/app/popup.js","../../../source/assets/js/app/layers.js","../../../source/assets/js/app/hotels.js","../../../source/assets/js/app/places.js","../../../source/assets/js/app.js"],"names":["iconBase","L","Icon","extend","options","shadowUrl","iconSize","shadowSize","iconAnchor","shadowAnchor","popupAnchor","icon","servicios","iconUrl","restaurantes","habitaciones","recreativo","customPopup","place","lang","concat","img","currentHotel","id","name","info","w","h","customOptions","className","MobDet","maxWidth","minWidth","minZoom","layers","granada","tileLayer","attribution","maxZoom","continuousWorld","noWrap","crs","CRS","simple","detectRetina","castilla","moro","marina","club","fillHotels","where","list","fillList","document","createElement","innerHTML","appendChild","forEach","item","listPlaces","querySelector","listPlacesLg","listHotelsSm","listHotelsLgContainer","listPlacesEsp","listPlacesEng","hotelesEsp","hotelesEng","groupEsp","layerGroup","groupEng","titleEsp","titleEng","map","center","zoom","maxBounds","LatLngBounds","LatLng","maxBoundsViscosity","hotel","attributionControl","setPrefix","dataHoteles","nameEsp","nameEng","currentLang","innerText","dataMenu","esp","eng","hotelEsp","url","hotelEng","onClickMenuItem","data","marker","getLayer","flyTo","getLatLng","openPopup","classList","remove","navBtnsSmContainer","add","currentActiveBox","navSmContainer","querySelectorAll","e","href","includes","markerEsp","bindPopup","markerEng","addLayer","markerEsp_id","getLayerId","markerEng_id","addTo","itemEsp","itemEng","addEventListener","bind","push","langBtns","navbarNavLangLg","navbarNavLangSm","changeLanguage","btnLang","newLang","dataset","selectedIndex","value","firstChild","removeChild","createCookie","removeLayer","preventDefault","navAnchor","anchor","this","contains","menu","current","itemsPswp","pswpElement","index","shareEl","fullscreenEl","target","src","placeid","imgw","imgh","PhotoSwipe","PhotoSwipeUI_Default","init"],"mappings":"yBAAA,IAAMA,EAAWC,EAAEC,KAAKC,OAAO,CAC9BC,QAAS,CACRC,UAAW,wCACXC,SAAc,CAAC,GAAI,IACnBC,WAAc,CAAC,GAAI,GACnBC,WAAc,CAAC,GAAI,IACnBC,aAA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AUrC,EAAe9C,cAAc,SAE9B,OAAZmF,GAAkBA,EAAQ1C,UAAUC,OAAO,QAG1BI,EAAe9C,cAAf,IAAAxC,OAAiCwH,KAAKV,QAAQY,OACtDzC,UAAUG,IAAI,aAO7B,IACIwC,EADEC,EAAc5F,SAASsD,iBAAiB,SAAS,GAEjDvG,EAAU,CACf8I,MAAO,EACPC,SAAS,EACTC,cAAc,GAIf/F,SAASO,cAAc,uBAAuB6D,iBAAiB,QAAS,SAASb,GAC7EA,EAAEyC,OAAOhD,UAAUwC,SAAS,gBAC9BG,EAAY,CAAC,CACZM,IAAG,wBAAAlI,OAA0BE,aAA1B,KAAAF,OAA0CwF,EAAEyC,OAAOnB,QAAQqB,QAA3D,UACH7H,EAAGkF,EAAEyC,OAAOnB,QAAQsB,KACpB7H,EAAGiF,EAAEyC,OAAOnB,QAAQuB,OAGX,IAAIC,WAAYT,EAAaU,qBAAsBX,EAAW5I,GAEhEwJ","sourcesContent":["const iconBase = L.Icon.extend({\n\toptions: {\n\t\tshadowUrl: 'assets/images/mapicons/pin-shadow.png',\n\t\ticonSize: [26, 26],\n\t\tshadowSize: [30, 8],\n\t\ticonAnchor: [13, 17],\n\t\tshadowAnchor: [14, -2],\n\t\tpopupAnchor: [0, -26]\n\t}\n});\n\nconst icon = {\n\tservicios: new iconBase({iconUrl: 'assets/images/mapicons/pin-servicios.svg'}),\n\trestaurantes: new iconBase({iconUrl: 'assets/images/mapicons/pin-restaurantes.svg'}),\n\thabitaciones: new iconBase({iconUrl: 'assets/images/mapicons/pin-habitaciones.svg'}),\n\trecreativo: new iconBase({iconUrl: 'assets/images/mapicons/pin-recreativo.svg'})\n};\n\nexport {iconBase, icon};","function customPopup(place, lang) {\n\treturn `\n\t\t${place.img !== false ? `\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t` : ``}\n\t\t
\n\t\t\t

${place.lang[lang].name}

\n\t\t\t${place.lang[lang].info ? `

${place.lang[lang].info}

` : ``}\n\t\t\t${place.img !== false ? `` : \"\"}\n\t\t
\n\t`\n};\n\nlet customOptions = {\n\tclassName: \"popup\"\n};\n\nif (MobDet) {\n\tcustomOptions.maxWidth = 250\n\tcustomOptions.minWidth = 250\n} else {\n\tcustomOptions.maxWidth = 380\n\tcustomOptions.minWidth = 380\n}\n\nexport {customPopup, customOptions}","const minZoomSm = 1\nconst minZoomLg = 2\nlet minZoom = MobDet ? minZoomSm : minZoomLg\n\nconst layers = {\n\tgranada: L.tileLayer('assets/images/maptiles/granada/{z}/{x}/{y}.jpg', {\n\t\t\tattribution: '',\n\t\t\tmaxZoom: 4,\n\t\t\tminZoom,\n\t\t\tcontinuousWorld: false,\n\t\t\tnoWrap: true,\n\t\t\tcrs: L.CRS.simple,\n\t\t\tdetectRetina: true\n\t}),\n\tcastilla: L.tileLayer('assets/images/maptiles/castilla/{z}/{x}/{y}.jpg', {\n\t\t\tattribution: '',\n\t\t\tmaxZoom: 4,\n\t\t\tminZoom,\n\t\t\tcontinuousWorld: false,\n\t\t\tnoWrap: true,\n\t\t\tcrs: L.CRS.simple,\n\t\t\tdetectRetina: true\n\t}),\n\tmoro: L.tileLayer('assets/images/maptiles/moro/{z}/{x}/{y}.jpg', {\n\t\t\tattribution: '',\n\t\t\tmaxZoom: 4,\n\t\t\tminZoom,\n\t\t\tcontinuousWorld: false,\n\t\t\tnoWrap: true,\n\t\t\tcrs: L.CRS.simple,\n\t\t\tdetectRetina: true\n\t}),\n\tmarina: L.tileLayer('assets/images/maptiles/marina/{z}/{x}/{y}.jpg', {\n\t\t\tattribution: '',\n\t\t\tmaxZoom: 4,\n\t\t\tminZoom,\n\t\t\tcontinuousWorld: false,\n\t\t\tnoWrap: true,\n\t\t\tcrs: L.CRS.simple,\n\t\t\tdetectRetina: true\n\t}),\n\tclub: L.tileLayer('assets/images/maptiles/club/{z}/{x}/{y}.jpg', {\n\t\t\tattribution: '',\n\t\t\tmaxZoom: 4,\n\t\t\tminZoom,\n\t\t\tcontinuousWorld: false,\n\t\t\tnoWrap: true,\n\t\t\tcrs: L.CRS.simple,\n\t\t\tdetectRetina: true\n\t})\n};\n\nexport {layers};","function fillHotels(where, list) {\n\tlet fillList;\n\t\n\tfillList = document.createElement('div')\n\t\n\tfillList.innerHTML = list\n\twhere.appendChild(fillList)\n}\n\nexport {fillHotels}","function fillList(where, list) {\n\tlist.forEach(item => {\n\t\twhere.appendChild(item)\n\t})\n}\n\nexport {fillList}","import {icon} from 'app/icons';\nimport {customPopup, customOptions} from 'app/popup';\nimport {layers} from 'app/layers';\nimport {fillHotels} from 'app/hotels';\nimport {fillList} from 'app/places';\n\n// TODO: close mobile menu function\n// TODO: better modules\n// TODO: Detección de idioma inicial?\n\n// Containers\nlet listPlaces = document.querySelector('#navbarNavUbicacionesSm'),\n\t\tlistPlacesLg = document.querySelector('#navbarNavUbicacionesLg'),\n\t\tlistHotelsSm = document.querySelector('#navbarNavHotelesSm'),\n\t\tlistHotelsLgContainer = document.querySelector('#navbarNavHotelesLg'),\n\t\tmenuContainerSm = document.querySelector('.navbar__bottom--container');\n\t\t\n// Hotels & Places lists\nlet listPlacesEsp = [],\n\t\tlistPlacesEng = [],\n\t\thotelesEsp = [],\n\t\thotelesEng = [];\n\n// others\nlet groupEsp = L.layerGroup(),\n\t\tgroupEng = L.layerGroup(),\n\t\ttitleEsp = \"\",\n\t\ttitleEng = \"\",\n\t\tmenuEsp = [],\n\t\tmenuEng = [];\n\n\n// Create the map\nlet map = new L.map('map', {\n\tlayers: [layers[currentHotel]],\n\tcenter: [0, 0],\n\tzoom: 0,\n\tmaxBounds: new L.LatLngBounds(new L.LatLng(80, -250), new L.LatLng(-80, 250)),\n\tmaxBoundsViscosity: 1.0\n});\nmap.attributionControl.setPrefix(\"\")\n\n\n// Fill data\n///\ntitleEsp = dataHoteles[currentHotel].nameEsp\ntitleEng = dataHoteles[currentHotel].nameEng\nif (currentLang === \"esp\") {\n\tdocument.querySelector(\".navbar--title\").innerText = titleEsp\n} else {\n\tdocument.querySelector(\".navbar--title\").innerText = titleEng\n}\n\n// menu\ndataMenu.forEach(item => {\n\tlet itemEsp = item.esp\n\tlet itemEng = item.eng\n\t\n\tmenuEsp.push(itemEsp)\n\tmenuEng.push(itemEng)\n})\n\n// hoteles\nfor (const hotel in dataHoteles) {\n\tlet hotelEsp = `${dataHoteles[hotel].nameEsp}`\n\tlet hotelEng = `${dataHoteles[hotel].nameEng}`\n\t\n\thotelesEsp += hotelEsp\n\thotelesEng += hotelEng\n}\n\nif (currentLang === \"esp\") {\n\tfillHotels(listHotelsSm,hotelesEsp)\n\tfillHotels(listHotelsLgContainer,hotelesEsp)\n} else {\n\tfillHotels(listHotelsSm,hotelesEsp)\n\tfillHotels(listHotelsLgContainer,hotelesEng)\n}\n\nlistHotelsSm.querySelectorAll(\".navbar__item\").forEach(function(e) {\n\tif (e.href.includes(currentHotel)) {\n\t\te.classList.add(\"active\")\n\t} else {\n\t\te.classList.remove(\"active\")\n\t}\n})\nlistHotelsLgContainer.querySelectorAll(\".navbar__item\").forEach(function(e) {\n\tif (e.href.includes(currentHotel)) {\n\t\te.classList.add(\"active\")\n\t} else {\n\t\te.classList.remove(\"active\")\n\t}\n})\n\n// lugares\ndataHoteles[currentHotel][\"locations\"].forEach(place => {\n\tlet markerEsp = L.marker( [place[\"lat\"], place[\"lng\"]], {\n\t\ticon: icon[place[\"cat\"]]\n\t})\n\t.bindPopup(customPopup(place, \"esp\"),customOptions);\n\t\n\tlet markerEng = L.marker( [place[\"lat\"], place[\"lng\"]], {\n\t\ticon: icon[place[\"cat\"]]\n\t})\n\t.bindPopup(customPopup(place, \"eng\"),customOptions);\n\t\n\t// Add each marker to the group\n\tgroupEsp.addLayer( markerEsp );\n\tgroupEng.addLayer( markerEng );\n\t\n\t// Save the ID of the marker with it's data\n\tplace.markerEsp_id = groupEsp.getLayerId(markerEsp);\n\tplace.markerEng_id = groupEsp.getLayerId(markerEng);\n})\n\nif (currentLang === \"esp\") {\n\tgroupEsp.addTo(map)\n} else {\n\tgroupEng.addTo(map)\n}\n\n\n// Click handler for handling\nfunction onClickMenuItem(data) {\n\tlet marker;\n\t\n\tif (currentLang === \"esp\") {\n\t\tmarker = groupEsp.getLayer(data)\n\t} else {\n\t\tmarker = groupEng.getLayer(data)\n\t}\n\t\n\tmap.flyTo(marker.getLatLng(), 3)\n\tmarker.openPopup()\n\t\n\tif(MobDet){\n\t\t// Close mobile menu, activate map\n\t\tlet currentActiveMenu = document.querySelector(\".active\")\n\t\tcurrentActiveMenu.classList.remove(\"active\")\n\t\tconst activateMap = navBtnsSmContainer.querySelector(\".navbar__bottom--item\")\n\t\tactivateMap.classList.add(\"active\")\n\t\tconst currentActiveBox = navSmContainer.querySelector(\".show\")\n\t\tif(currentActiveBox !== null) currentActiveBox.classList.remove(\"show\")\n\t}\n}\n\n\n// Append list lugares\ndataHoteles[currentHotel][\"locations\"].forEach(place => {\n\tlet itemEsp = document.createElement('div')\n\tlet itemEng = document.createElement('div')\n\titemEsp.classList.add(\"navbar__item\")\n\titemEng.classList.add(\"navbar__item\")\n\t\n\titemEsp.innerHTML= ``\n\titemEng.innerHTML= ``\n\t\n\titemEsp.addEventListener(\"click\", onClickMenuItem.bind(null, place.markerEsp_id))\n\titemEng.addEventListener(\"click\", onClickMenuItem.bind(null, place.markerEng_id))\n\t\n\tlistPlacesEsp.push(itemEsp)\n\tlistPlacesEng.push(itemEng)\n\t\n})\nif (currentLang === \"esp\") {\n\tif(MobDet){\n\t\tfillList(listPlaces,listPlacesEsp)\n\t} else {\n\t\tfillList(listPlacesLg,listPlacesEsp)\n\t}\n} else {\n\tif(MobDet){\n\t\tfillList(listPlaces,listPlacesEng)\n\t} else {\n\t\tfillList(listPlacesLg,listPlacesEng)\n\t}\n}\n\n\nfunction changeMenuLang(menu) {\n\tmenuContainerSm.querySelectorAll(\".navbar__bottom--item\").forEach((item, index) => {\n\t\titem.querySelector(\"span\").textContent = menu[index]\n\t})\n}\n\n// Lang\n///\nconst langContainer = document.querySelector(\".navbar__idioma\")\nconst langBtns = langContainer.querySelectorAll(\".btn__lang\")\nconst navbarNavLangLg = document.querySelector(\"#navbarNavLangLg\")\nconst navbarNavLangSm = document.querySelector(\"#navbarNavLang\")\n\nif(!MobDet){ // set selected lang for desktop\n\tif (currentLang === \"esp\") {\n\t\tnavbarNavLangLg.options.selectedIndex = 0\n\t} else {\n\t\tnavbarNavLangLg.options.selectedIndex = 1\n\t}\n} else {\n\tif (currentLang === \"esp\") {\n\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[0].classList.add(\"active\")\n\t} else {\n\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[1].classList.add(\"active\")\n\t}\n}\n\nfunction changeLanguage(btnLang) {\n\tlet newLang;\n\tif(MobDet){\n\t\tnewLang = btnLang.dataset.lang\n\t} else {\n\t\tnewLang = navbarNavLangLg.options[navbarNavLangLg.selectedIndex].value\t\t\n\t}\n\t\n\tif(currentLang === newLang) return\n\t\n\t// remove list of places\n\twhile (listPlaces.firstChild) listPlaces.removeChild(listPlaces.firstChild)\n\twhile (listPlacesLg.firstChild) listPlacesLg.removeChild(listPlacesLg.firstChild)\n\t\n\t// remove list of hotels\n\twhile (listHotelsSm.firstChild) listHotelsSm.removeChild(listHotelsSm.firstChild)\n\twhile (listHotelsLgContainer.firstChild) listHotelsLgContainer.removeChild(listHotelsLgContainer.firstChild)\n\t\n\t// add new list of places\n\tif (newLang === \"esp\") {\n\t\tcreateCookie(\"lang\", \"esp\", 365)\n\t\tmap.removeLayer(groupEng)\n\t\tgroupEsp.addTo(map)\n\t\t\n\t\tif(MobDet){\n\t\t\tfillList(listPlaces,listPlacesEsp)\n\t\t\tdocument.querySelector(\".navbar--title\").innerText = titleEsp\n\t\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[0].classList.add(\"active\")\n\t\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[1].classList.remove(\"active\")\n\t\t} else {\n\t\t\tfillList(listPlacesLg,listPlacesEsp)\n\t\t}\n\t\t\n\t\tfillHotels(listHotelsSm,hotelesEsp) //mobile hotels\n\t\tfillHotels(listHotelsLgContainer,hotelesEsp) // desktop hotels\n\t}\n\telse if (newLang === \"eng\") {\n\t\tcreateCookie(\"lang\", \"eng\", 365)\n\t\tmap.removeLayer(groupEsp)\n\t\tgroupEng.addTo(map)\n\t\t\n\t\tif(MobDet){\n\t\t\tfillList(listPlaces,listPlacesEng)\n\t\t\tdocument.querySelector(\".navbar--title\").innerText = titleEng\n\t\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[0].classList.remove(\"active\")\n\t\t\tnavbarNavLangSm.querySelectorAll(\".navbar__item\")[1].classList.add(\"active\")\n\t\t} else {\n\t\t\tfillList(listPlacesLg,listPlacesEng)\n\t\t}\n\t\t\n\t\tfillHotels(listHotelsSm,hotelesEng) //mobile hotels\n\t\tfillHotels(listHotelsLgContainer,hotelesEng) // desktop hotels\n\t}\n\t\n\t// active hotel\n\tlistHotelsSm.querySelectorAll(\".navbar__item\").forEach(function(e) {\n\t\tif (e.href.includes(currentHotel)) {\n\t\t\te.classList.add(\"active\")\n\t\t} else {\n\t\t\te.classList.remove(\"active\")\n\t\t}\n\t})\n\tlistHotelsLgContainer.querySelectorAll(\".navbar__item\").forEach(function(e) {\n\t\tif (e.href.includes(currentHotel)) {\n\t\t\te.classList.add(\"active\")\n\t\t} else {\n\t\t\te.classList.remove(\"active\")\n\t\t}\n\t})\n\t\n\tcurrentLang = newLang\n\t\n\t// Close mobile menu, activate map\n\tlet currentActiveMenu = document.querySelector(\".active\")\n\tcurrentActiveMenu.classList.remove(\"active\")\n\tconst activateMap = navBtnsSmContainer.querySelector(\".navbar__bottom--item\")\n\tactivateMap.classList.add(\"active\")\n\tconst currentActiveBox = navSmContainer.querySelector(\".show\")\n\tif(currentActiveBox !== null) currentActiveBox.classList.remove(\"show\")\n}\n\nnavbarNavLangLg.addEventListener(\"change\", () => changeLanguage() );\n\nlangBtns.forEach(btnLang => {\n\tbtnLang.addEventListener(\"click\", function(e) {\n\t\te.preventDefault();\n\t\tchangeLanguage(btnLang)\n\t})\n})\n\n// Menú SM\n///////////\nconst navBtnsSmContainer = document.querySelector(\".navbar__bottom--container\")\nconst navAnchor = navBtnsSmContainer.querySelectorAll(\".navbar__bottom--item\")\n\nconst navSmContainer = document.querySelector(\".navbar__nav\")\nconst nav = navBtnsSmContainer.querySelectorAll(\".navbar__box\")\n\nnavAnchor.forEach(anchor => {\n\tanchor.addEventListener(\"click\", function(e) {\n\t\te.preventDefault()\n\t\t\n\t\t// si ya está activo, no hagas nada\n\t\tif(this.classList.contains(\"active\")) return\n\t\t\n\t\t// agregar activo\n\t\tconst current = document.querySelector(\".active\")\n\t\tcurrent.classList.remove(\"active\")\n\t\t\n\t\tthis.classList.add(\"active\")\n\t\t\n\t\t\n\t\t// cajon de menu\n\t\tif(this.dataset.menu === \"mapa\") {\n\t\t\tconst current = navSmContainer.querySelector(\".show\")\n\t\t\tcurrent.classList.remove(\"show\")\n\t\t}\n\t\telse if(this.dataset.menu) {\n\t\t\tconst current = navSmContainer.querySelector(\".show\")\n\t\t\t\n\t\t\tif(current !== null) current.classList.remove(\"show\")\n\t\t\t// current.style.display = \"none\";\n\t\t\t\n\t\t\tconst currentMenu = navSmContainer.querySelector(`#${this.dataset.menu}`)\n\t\t\tcurrentMenu.classList.add(\"show\")\n\t\n\t\t}\n\t})\n})\n\n// Galeria\nconst pswpElement = document.querySelectorAll('.pswp')[0];\nvar itemsPswp;\nconst options = {\n\tindex: 0,\n\tshareEl: false,\n\tfullscreenEl: false\n};\nvar gallery;\n\ndocument.querySelector(\".leaflet-popup-pane\").addEventListener(\"click\", function(e) {\n\tif(e.target.classList.contains(\"popup__btn\")) {\n\t\titemsPswp = [{\n\t\t\tsrc: `assets/images/thumbs/${currentHotel}/${e.target.dataset.placeid}_f.jpg`,\n\t\t\tw: e.target.dataset.imgw,\n\t\t\th: e.target.dataset.imgh\n\t\t}]\n\t\t\n\t\tgallery = new PhotoSwipe( pswpElement, PhotoSwipeUI_Default, itemsPswp, options);\n\t\t\n\t\tgallery.init()\n\t}\n});"]}