{"version":3,"file":"map-CcaGEkhe.js","sources":["../../../scripts/module/header.js","../../../scripts/module/tabs.js","../../../scripts/module/table.js","../../../scripts/module/externalLinks.js","../../../scripts/module/holidays.js","../../../scripts/module/childGrid.js","../../../scripts/module/faq.js","../../../scripts/module/hotel.js","../../../../node_modules/@elfalem/leaflet-curve/dist/leaflet.curve.js","../../../../node_modules/leaflet-geometryutil/src/leaflet.geometryutil.js","../../../../node_modules/leaflet-arrowheads/src/leaflet-arrowheads.js","../../../../node_modules/leaflet-gesture-handling/dist/leaflet-gesture-handling.min.js","../../../scripts/module/map.js"],"sourcesContent":["/* eslint-disable no-restricted-syntax */\nconst headerEl = document.querySelector('header');\n\nif (headerEl && headerEl.classList.contains('show-booking-search')) {\n\tconst targetNode = headerEl.querySelector('#booking-header-search');\n\tconst mutationConfig = { childList: true, attributes: true, subtree: true };\n\n\tconst observer = new MutationObserver((mutationsList) => {\n\t\tif (headerEl.classList.contains('query-view') || headerEl.classList.contains('search-view')) {\n\t\t\tobserver.disconnect();\n\t\t}\n\t\tfor (const mutation of mutationsList) {\n\t\t\tif (mutation.type === 'attributes') {\n\t\t\t\tconst bookingWidgetEl = targetNode.childNodes[0];\n\t\t\t\tif (bookingWidgetEl) {\n\t\t\t\t\tconst searchView = bookingWidgetEl.getAttribute('data-search-view');\n\t\t\t\t\tif (searchView) {\n\t\t\t\t\t\theaderEl.classList.add(searchView === 'query' ? 'query-view' : 'search-view');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tobserver.observe(targetNode, mutationConfig);\n}\n","import Flickity from 'flickity';\nimport { Accordion } from './accordion';\nimport { createGTCarousel } from './carousel';\n\n/* eslint-disable no-restricted-syntax */\nconst keyCode = Object.freeze({\n\tPAGEUP: 33,\n\tPAGEDOWN: 34,\n\tEND: 35,\n\tHOME: 36,\n\tLEFT: 37,\n\tUP: 38,\n\tRIGHT: 39,\n\tDOWN: 40,\n\tDELETE: 46,\n\tENTER: 13,\n\tSPACE: 32,\n\tRETURN: 13,\n});\n\nconst direction = Object.freeze({\n\t37: -1,\n\t38: -1,\n\t39: 1,\n\t40: 1,\n});\n\nclass TabList {\n\tconstructor(domNode) {\n\t\tthis.domNode = domNode;\n\t\tthis.tabs = [];\n\t\tthis.panels = [];\n\t}\n\n\tinit() {\n\t\tthis.tabs = this.domNode.querySelectorAll('[role=\"tab\"]');\n\t\tthis.panels = this.domNode.querySelectorAll('[role=\"tabpanel\"]');\n\n\t\tfor (let i = 0; i < this.tabs.length; ++i) {\n\t\t\tconst tab = this.tabs[i];\n\t\t\ttab.addEventListener('click', this.handleClick.bind(this));\n\t\t\ttab.addEventListener('keydown', this.handleKeydown.bind(this));\n\t\t\ttab.addEventListener('keyup', this.handleKeyup.bind(this));\n\t\t\ttab.index = i;\n\t\t}\n\t}\n\n\thandleClick(event) {\n\t\tconst tab = event.currentTarget;\n\t\tthis.activateTab(tab, false);\n\t}\n\n\thandleKeydown(event) {\n\t\tlet flag = false;\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase keyCode.HOME:\n\t\t\tcase keyCode.PAGEUP:\n\t\t\t\tthis.focusFirstTab();\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\n\t\t\tcase keyCode.END:\n\t\t\tcase keyCode.PAGEDOWN:\n\t\t\t\tthis.focusLastTab();\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (flag) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\thandleKeyup(event) {\n\t\tlet flag = false;\n\n\t\tswitch (event.keyCode) {\n\t\t\tcase keyCode.LEFT:\n\t\t\tcase keyCode.RIGHT:\n\t\t\t\tthis.determineOrientation(event);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\n\t\t\tcase keyCode.ENTER:\n\t\t\tcase keyCode.RETURN:\n\t\t\tcase keyCode.SPACE:\n\t\t\t\tthis.activateTab(event.currentTarget);\n\t\t\t\tflag = true;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif (flag) {\n\t\t\tevent.stopPropagation();\n\t\t\tevent.preventDefault();\n\t\t}\n\t}\n\n\tactivateTab(tab, setFocus = false) {\n\t\tthis.deactivateTabs();\n\n\t\ttab.removeAttribute('tabindex');\n\t\ttab.setAttribute('aria-selected', 'true');\n\t\ttab.classList.add('active');\n\n\t\tconst controls = tab.getAttribute('aria-controls');\n\t\tconst controledEl = document.querySelector(`#${controls}`);\n\t\tcontroledEl.removeAttribute('hidden');\n\t\tcontroledEl.removeAttribute('aria-hidden');\n\n\t\tif (controledEl.querySelector('.gallery-carousel')) {\n\t\t\tconst gCarouselEls = controledEl.querySelector('.gallery-carousel');\n\t\t\tconst gCarouselFlickity = Flickity.data(gCarouselEls);\n\t\t\tgCarouselFlickity.resize();\n\t\t}\n\n\t\tif (controledEl.querySelector('.image-text-carousel')) {\n\t\t\tconst itCarouselEl = controledEl.querySelector('.image-text-carousel');\n\t\t\tconst itCarouselFlickity = Flickity.data(itCarouselEl);\n\t\t\titCarouselFlickity.resize();\n\t\t}\n\n\t\tif (setFocus) {\n\t\t\ttab.focus();\n\t\t}\n\t}\n\n\tactivateTabs() {\n\t\tfor (const tab of this.tabs) {\n\t\t\ttab.removeAttribute('tabindex');\n\t\t\ttab.setAttribute('aria-selected', 'true');\n\t\t}\n\n\t\tfor (const panel of this.panels) {\n\t\t\tpanel.removeAttribute('hidden');\n\t\t\tpanel.removeAttribute('aria-hidden');\n\t\t}\n\t}\n\n\tdeactivateTabs() {\n\t\tfor (const tab of this.tabs) {\n\t\t\ttab.setAttribute('tabindex', '-1');\n\t\t\ttab.setAttribute('aria-selected', 'false');\n\t\t\ttab.classList.remove('active');\n\t\t}\n\n\t\tfor (const panel of this.panels) {\n\t\t\tpanel.setAttribute('hidden', 'hidden');\n\t\t\tpanel.setAttribute('aria-hidden', true);\n\t\t}\n\t}\n\n\tdetermineOrientation(event) {\n\t\tconst keyPressed = event.keyCode;\n\t\tlet proceed = false;\n\n\t\tif (keyPressed === keyCode.LEFT || keyPressed === keyCode.RIGHT) {\n\t\t\tproceed = true;\n\t\t}\n\n\t\tif (proceed) {\n\t\t\tthis.switchTabOnArrowPress(event);\n\t\t}\n\t}\n\n\tswitchTabOnArrowPress(event) {\n\t\tconst keyPressed = event.keyCode;\n\n\t\tif (direction[keyPressed]) {\n\t\t\tconst target = event.currentTarget;\n\n\t\t\tif (target.index !== undefined) {\n\t\t\t\tif (this.tabs[target.index + direction[keyPressed]]) {\n\t\t\t\t\tthis.tabs[target.index + direction[keyPressed]].focus();\n\t\t\t\t} else if (keyPressed === keyCode.LEFT) {\n\t\t\t\t\tthis.focusLastTab();\n\t\t\t\t} else if (keyPressed === keyCode.RIGHT) {\n\t\t\t\t\tthis.focusFirstTab();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfocusFirstTab() {\n\t\tthis.tabs[0].focus();\n\t}\n\n\tfocusLastTab() {\n\t\tthis.tabs[this.tabs.length - 1].focus();\n\t}\n}\n\nconst mediaBreakPoint = '(max-width: 767px)';\nconst mq = window.matchMedia(mediaBreakPoint);\n\nconst tabsBlockEls = document.querySelectorAll('.tabs-block');\n\ntabsBlockEls.forEach((tabsBlockEl) => {\n\tconst isGallery = tabsBlockEl.classList.contains('gallery');\n\n\tconst createTabTriggerEl = (tabs, parentEl) => {\n\t\ttabs.forEach((tab, idx) => {\n\t\t\tconst liEl = document.createElement('li');\n\t\t\tconst buttonEl = document.createElement('button');\n\n\t\t\tliEl.setAttribute('role', 'presentation');\n\t\t\tbuttonEl.classList.add('tab-button');\n\t\t\tbuttonEl.setAttribute('role', 'tab');\n\t\t\tbuttonEl.setAttribute('aria-selected', idx === 0 ? 'true' : 'false');\n\t\t\tbuttonEl.setAttribute('aria-controls', tab.panelid);\n\t\t\tbuttonEl.setAttribute('id', `${tab.panelid}TabTrigger`);\n\t\t\tif (idx === 0) {\n\t\t\t\tbuttonEl.classList.add('active');\n\t\t\t} else {\n\t\t\t\tbuttonEl.setAttribute('tabindex', '-1');\n\t\t\t}\n\t\t\tbuttonEl.appendChild(document.createTextNode(tab.tabName));\n\n\t\t\tliEl.appendChild(buttonEl);\n\t\t\tparentEl.appendChild(liEl);\n\t\t});\n\t};\n\n\tconst createGalleryTabTriggerEl = (tabs, parentEl) => {\n\t\tconst tplGalleryTabItem = document.getElementById('GalleryTabItemTpl') ? document.getElementById('GalleryTabItemTpl').content : null;\n\n\t\ttabs.forEach((tab, idx) => {\n\t\t\tconst galleryTabItemNode = tplGalleryTabItem.cloneNode(true);\n\t\t\tconst galleryTabButtonEl = galleryTabItemNode.querySelector('.gallery-tab-button');\n\n\t\t\tgalleryTabButtonEl.setAttribute('aria-selected', idx === 0 ? 'true' : 'false');\n\t\t\tgalleryTabButtonEl.setAttribute('aria-controls', tab.panelid);\n\t\t\tgalleryTabButtonEl.setAttribute('id', `${tab.panelid}TabTrigger`);\n\n\t\t\tgalleryTabButtonEl.querySelector('.tab-button-image').setAttribute('data-bg', tab.tabImage);\n\t\t\tgalleryTabButtonEl.querySelector('.sr-only').innerText = tab.tabimagealttext;\n\t\t\tgalleryTabButtonEl.querySelector('.tab-button-text').innerText = tab.tabName;\n\n\t\t\tif (idx === 0) {\n\t\t\t\tgalleryTabButtonEl.classList.add('active');\n\t\t\t} else {\n\t\t\t\tgalleryTabButtonEl.setAttribute('tabindex', '-1');\n\t\t\t}\n\n\t\t\tparentEl.appendChild(galleryTabItemNode);\n\t\t});\n\t};\n\n\tconst tabPanelEls = tabsBlockEl.querySelectorAll('.tab-panel');\n\tconst tabsData = Array.from(tabPanelEls).map((el) => ({\n\t\tpanelid: el.getAttribute('id'),\n\t\ttabName: el.getAttribute('data-tabname'),\n\t\ttabimagealttext: el.getAttribute('data-tabimagealttext'),\n\t\ttabImage: isGallery ? el.getAttribute('data-tabimage') : null,\n\t}));\n\n\tif (isGallery) {\n\t\tcreateGalleryTabTriggerEl(tabsData, tabsBlockEl.querySelector('.tabs-carousel'));\n\t\tconst tabsCarousel = tabsBlockEl.querySelector('.tabs-carousel-container');\n\t\tcreateGTCarousel(tabsCarousel);\n\t} else {\n\t\tcreateTabTriggerEl(tabsData, tabsBlockEl.querySelector('.tabs'));\n\t}\n\n\tconst prevWidth = window.innerWidth;\n\tlet initTabs = false;\n\tlet initAccordion = false;\n\tlet setActiveTab = false;\n\tlet setActoveAccordion = false;\n\tlet tabBlockTabList = null;\n\tlet tabAccordion = null;\n\n\tconst resizeHandler = () => {\n\t\tif (!mq.matches && !initTabs) {\n\t\t\tinitTabs = true;\n\t\t\ttabBlockTabList = new TabList(tabsBlockEl);\n\t\t\ttabBlockTabList.init();\n\t\t}\n\n\t\tif (mq.matches && !initAccordion) {\n\t\t\tinitAccordion = true;\n\t\t\tconst tabAccordionEl = tabsBlockEl.querySelector('.mobile-tabs-accordion');\n\t\t\ttabAccordion = new Accordion(tabAccordionEl);\n\t\t\ttabAccordion.init();\n\t\t}\n\n\t\tif (!mq.matches && !setActiveTab) {\n\t\t\tsetActiveTab = true;\n\t\t\tsetActoveAccordion = false;\n\t\t\tconst allPanelEls = tabsBlockEl.querySelectorAll('.accordion-panel');\n\t\t\tlet activeTab = isGallery ? tabsBlockEl.querySelector('.tabs-carousel .gallery-tab-button:first-of-type') : tabsBlockEl.querySelector('.tabs li:first-child .tab-button');\n\t\t\tfor (const el of allPanelEls) {\n\t\t\t\tif (!el.hasAttribute('hidden')) {\n\t\t\t\t\tactiveTab = document.querySelector(`#${el.getAttribute('id')}TabTrigger`);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttabBlockTabList.activateTab(activeTab, false);\n\t\t}\n\n\t\tif (mq.matches && !setActoveAccordion) {\n\t\t\tsetActoveAccordion = true;\n\t\t\tsetActiveTab = false;\n\t\t\tconst allPanelEls = tabsBlockEl.querySelectorAll('.accordion-panel');\n\t\t\tlet activeTab = tabsBlockEl.querySelector('.tab-panels-container .accordion-item:first-child .accordion-trigger');\n\t\t\tfor (const el of allPanelEls) {\n\t\t\t\tif (!el.hasAttribute('hidden')) {\n\t\t\t\t\tactiveTab = document.querySelector(`#${el.getAttribute('aria-labelledby')}`);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttabAccordion.activateAccordionItem(activeTab);\n\t\t}\n\t};\n\n\tresizeHandler();\n\twindow.addEventListener('resize', function () {\n\t\tif (window.innerWidth === prevWidth) {\n\t\t\treturn;\n\t\t}\n\t\tresizeHandler();\n\t});\n});\n","/* eslint-disable no-restricted-syntax */\nconst mediaBreakPoint = '(min-width: 768px)';\nconst mq = window.matchMedia(mediaBreakPoint);\nconst servicesTables = document.querySelectorAll('.js-services-table');\nlet showMobileOnlyElems = false;\nlet showDesktopOnlyElems = true;\n\nfunction toggleServicesMobileOnly(show) {\n\tlet mobileOnlyElems = [];\n\tfor (const tt of servicesTables) {\n\t\tmobileOnlyElems = [...mobileOnlyElems, ...tt.querySelectorAll('.mobile-only')];\n\t}\n\tshowMobileOnlyElems = show;\n\n\tfor (const elem of mobileOnlyElems) {\n\t\tif (show) {\n\t\t\telem.setAttribute('aria-hidden', false);\n\t\t\telem.removeAttribute('hidden');\n\t\t} else {\n\t\t\telem.setAttribute('aria-hidden', true);\n\t\t\telem.setAttribute('hidden', '');\n\t\t}\n\t}\n}\n\nfunction toggleServicesDesktopOnly(show) {\n\tlet desktopOnlyElems = [];\n\tfor (const tt of servicesTables) {\n\t\tdesktopOnlyElems = [...desktopOnlyElems, ...tt.querySelectorAll('.desktop-only')];\n\t}\n\tshowDesktopOnlyElems = show;\n\n\tfor (const elem of desktopOnlyElems) {\n\t\tif (show) {\n\t\t\telem.setAttribute('aria-hidden', false);\n\t\t\telem.removeAttribute('hidden');\n\t\t} else {\n\t\t\telem.setAttribute('aria-hidden', true);\n\t\t\telem.setAttribute('hidden', '');\n\t\t}\n\t}\n}\n\nif (servicesTables.length) {\n\ttoggleServicesMobileOnly(!mq.matches);\n\ttoggleServicesDesktopOnly(mq.matches);\n}\n\nwindow.addEventListener('resize', function () {\n\tif (servicesTables.length) {\n\t\tif (mq.matches && showMobileOnlyElems) {\n\t\t\ttoggleServicesMobileOnly(false);\n\t\t} else if (!mq.matches && !showMobileOnlyElems) {\n\t\t\ttoggleServicesMobileOnly(true);\n\t\t}\n\n\t\tif (mq.matches && !showDesktopOnlyElems) {\n\t\t\ttoggleServicesDesktopOnly(true);\n\t\t} else if (!mq.matches && showDesktopOnlyElems) {\n\t\t\ttoggleServicesDesktopOnly(false);\n\t\t}\n\t}\n});\n\nconst tableEls = document.querySelectorAll('.text-rte table');\nif (tableEls.length) {\n\ttableEls.forEach((tableEl) => {\n\t\tconst tableWrapEl = document.createElement('div');\n\t\ttableWrapEl.classList.add('table-wrapper');\n\t\ttableEl.parentNode.insertBefore(tableWrapEl, tableEl);\n\t\ttableWrapEl.appendChild(tableEl);\n\t\t// tableWrapEl.parentNode.removeChild(tableEl);\n\t});\n}\n","const anchors = document.querySelectorAll('a[href^=\"http\"]');\n\nanchors.forEach((anchor) => {\n\tconst currentDomainHostname = window.location.hostname;\n\tconst href = anchor.getAttribute('href');\n\n\tif (href && !href.includes(currentDomainHostname)) {\n\t\tif (anchor.hasAttribute('rel')) {\n\t\t\tconst relValue = anchor.getAttribute('rel');\n\t\t\tif (!relValue.includes('noopener')) {\n\t\t\t\tanchor.setAttribute('rel', `${relValue} noopener`);\n\t\t\t}\n\t\t} else {\n\t\t\tanchor.setAttribute('rel', 'noopener');\n\t\t}\n\t}\n});\n","import { createHCarousel } from './carousel';\n\nconst holidaysContainerEls = document.querySelectorAll('.handpicked-holidays-container');\n\nif (holidaysContainerEls.length) {\n\tholidaysContainerEls.forEach((holidaysContainerEl) => {\n\t\tconst holidayCarouselContainerEl = holidaysContainerEl.querySelector('.holidays-carousel-container');\n\t\tconst holidayCarouselEl = holidayCarouselContainerEl.querySelector('.holidays-carousel');\n\t\tconst holidayCarouselItemEls = holidayCarouselEl.querySelectorAll('.carousel-item.holiday');\n\t\tconst holidayCarouselFlickity = createHCarousel(holidayCarouselContainerEl);\n\n\t\tconst holidayTagContainerEl = holidaysContainerEl.querySelector('.holiday-tags');\n\t\tif (holidayTagContainerEl) {\n\t\t\tconst holidayTagEls = holidayTagContainerEl.querySelectorAll('.holiday-tag');\n\t\t\tholidayTagEls.forEach((tag) => {\n\t\t\t\ttag.addEventListener('click', (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopImmediatePropagation();\n\t\t\t\t\tconst target = event.currentTarget;\n\t\t\t\t\tconst sortedEls = holidayCarouselItemEls;\n\n\t\t\t\t\t// add active class to current clicked button\n\t\t\t\t\tholidayTagEls.forEach((el) => {\n\t\t\t\t\t\tel.classList.remove('active');\n\t\t\t\t\t});\n\t\t\t\t\ttarget.classList.add('active');\n\n\t\t\t\t\t// sort out carousels\n\t\t\t\t\tconst cellElements = holidayCarouselFlickity.cells.map((cell) => cell.element);\n\t\t\t\t\tholidayCarouselFlickity.remove(cellElements);\n\t\t\t\t\tsortedEls.forEach((el) => {\n\t\t\t\t\t\tif (target.getAttribute('data-term') || el.getAttribute('data-tags').includes(target.getAttribute('data-tag'))) {\n\t\t\t\t\t\t\tholidayCarouselFlickity.insert(el);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tholidayCarouselFlickity.resize();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tconst moreTagTriggerEl = holidayTagContainerEl.querySelector('.js-more-tags');\n\t\t\tif (moreTagTriggerEl) {\n\t\t\t\tconst holidayMoreTagEl = holidayTagContainerEl.querySelector('.more-tags');\n\t\t\t\tmoreTagTriggerEl.addEventListener('click', (event) => {\n\t\t\t\t\tconst target = event.currentTarget;\n\t\t\t\t\tholidayMoreTagEl.classList.remove('!hidden');\n\t\t\t\t\tholidayMoreTagEl.replaceWith(...holidayMoreTagEl.childNodes);\n\t\t\t\t\ttarget.remove();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t});\n}\n","const childGridContainerEls = document.querySelectorAll('.child-grid-container');\nif (childGridContainerEls) {\n\tchildGridContainerEls.forEach((container) => {\n\t\tconst extraChildGridItemEls = container.querySelectorAll('.extra-child-grid-item');\n\t\tconst seeAllTriggerEl = container.querySelector('.js-see-all-child-grid');\n\n\t\tif (seeAllTriggerEl) {\n\t\t\tseeAllTriggerEl.addEventListener('click', (event) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tconst target = event.currentTarget;\n\t\t\t\textraChildGridItemEls.forEach((item) => {\n\t\t\t\t\titem.classList.remove('hidden');\n\t\t\t\t});\n\t\t\t\ttarget.remove();\n\t\t\t});\n\t\t}\n\t});\n}\n","const faqFilterForm = document.querySelector('#faqFilter');\n\nif (faqFilterForm) {\n\tconst filterCountEl = faqFilterForm.querySelector('#filterCount');\n\tconst faqResultsContainerEl = document.querySelector('#faqResultsContainer');\n\tconst resetFaqFilterBtn = faqFilterForm.querySelector('#resetFaqilter');\n\n\tconst filterTagsEls = faqFilterForm.querySelectorAll('.fliter-tags-checkbox');\n\tconst faqCategoryEls = faqResultsContainerEl.querySelectorAll('.faq-category');\n\n\tlet filterCounter = 0;\n\n\tconst doSearch = () => {\n\t\tconst tags = Array.from(faqFilterForm.querySelectorAll('.fliter-tags-checkbox:checked')).map((el) => el.value);\n\n\t\tif (tags.length) {\n\t\t\tfaqCategoryEls.forEach((item) => {\n\t\t\t\tconst id = item.getAttribute('id').split('-')[1];\n\t\t\t\tif (tags.includes(id)) {\n\t\t\t\t\titem.classList.remove('hidden');\n\t\t\t\t} else {\n\t\t\t\t\titem.classList.add('hidden');\n\t\t\t\t}\n\t\t\t});\n\t\t\tresetFaqFilterBtn.classList.remove('md:hidden');\n\t\t} else {\n\t\t\tfaqCategoryEls.forEach((item) => {\n\t\t\t\titem.classList.remove('hidden');\n\t\t\t});\n\t\t\tresetFaqFilterBtn.classList.add('md:hidden');\n\t\t}\n\t};\n\n\tfilterTagsEls.forEach((item) => {\n\t\titem.addEventListener('change', (event) => {\n\t\t\tdoSearch();\n\n\t\t\tif (!event.currentTarget.checked && filterCounter > 0) {\n\t\t\t\tfilterCounter -= 1;\n\t\t\t} else {\n\t\t\t\tfilterCounter += 1;\n\t\t\t}\n\t\t\tfilterCountEl.innerHTML = `${filterCounter} filters`;\n\t\t});\n\t});\n\n\tresetFaqFilterBtn.addEventListener('click', (event) => {\n\t\tevent.preventDefault();\n\n\t\tfilterTagsEls.forEach((item) => {\n\t\t\tif (item.checked) {\n\t\t\t\t// eslint-disable-next-line no-param-reassign\n\t\t\t\titem.checked = false;\n\n\t\t\t\tif ('createEvent' in document) {\n\t\t\t\t\tconst evt = document.createEvent('HTMLEvents');\n\t\t\t\t\tevt.initEvent('change', false, true);\n\t\t\t\t\titem.dispatchEvent(evt);\n\t\t\t\t} else {\n\t\t\t\t\titem.fireEvent('onchange');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tevent.target.classList.add('md:hidden');\n\t});\n}\n","import axios from 'axios';\n\nconst hotelContainerEls = document.querySelectorAll('.js-hotel-prices a');\nconst hotelIndividualPriceEl = document.querySelector('.js-hotel-price');\n\nconst fetchHotelResults = (atcomRef, start, end) => {\n\treturn new Promise((resolve) => {\n\n\t\tconst baseUrl = document.body.dataset?.bookingApiUrl;\n\t\tif (!baseUrl) {\n\t\t\tconsole.error('\"data-booking-api-url\" data attribute must be defined on the body tag.');\n\t\t\tresolve({ data: {} });\n\t\t\treturn;\n\t\t}\n\n\t\tconst url = new URL(`${baseUrl}/api/v1/hotel/prices?startDate=${start}&endDate=${end}&code=${atcomRef}&includeMonths=1`);\n\n\t\taxios\n\t\t\t.get(url)\n\t\t\t.then((response) => {\n\t\t\t\tresolve(response.data);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t});\n\t});\n};\n\nconst getNext12Months = () => {\n\tconst currentDate = new Date();\n\tconst startOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 0, 1);\n\tconst endOfMonth = new Date(currentDate.getFullYear(), currentDate.getMonth() + 12 + 1, 0);\n\tconst returnAr = [startOfMonth.toISOString().split('T')[0], endOfMonth.toISOString().split('T')[0]];\n\treturn returnAr;\n};\n\nconst findLowestCost = (data) => {\n\treturn Object.values(data).reduce((minCost, cost) => {\n\t\tif (cost !== '' && (minCost === null || cost < minCost)) {\n\t\t\treturn cost;\n\t\t}\n\t\treturn minCost;\n\t}, null);\n};\n\nif (hotelContainerEls.length) {\n\thotelContainerEls.forEach((hotelContainerEl) => {\n\t\tconst hotelAtcomRef = hotelContainerEl.getAttribute('data-atcom');\n\t\tconst hotelPriceEl = hotelContainerEl.querySelector('#hotel-price');\n\t\tconst hotelPricePartentEl = hotelContainerEl.querySelector('div p.price-from');\n\t\tconst dates = getNext12Months();\n\n\t\tfetchHotelResults(hotelAtcomRef, dates[0], dates[1]).then((response) => {\n\t\t\tconst { data } = response;\n\t\t\tif (data) {\n\t\t\t\tconst lowestPrice = findLowestCost(data) / 2;\n\t\t\t\tif (lowestPrice > 0) {\n\t\t\t\t\thotelPriceEl.innerHTML = `£${parseFloat(parseFloat(lowestPrice).toFixed(0)).toLocaleString()} per person`;\n\t\t\t\t} else {\n\t\t\t\t\thotelPricePartentEl.setAttribute('hidden', 'hidden');\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n\nif (hotelIndividualPriceEl) {\n\tconst hotelAtcomRef = hotelIndividualPriceEl.getAttribute('data-atcom');\n\tconst dates = getNext12Months();\n\n\tfetchHotelResults(hotelAtcomRef, dates[0], dates[1]).then((response) => {\n\t\tconst { data } = response;\n\t\tif (data) {\n\t\t\tconst lowestPrice = findLowestCost(data) / 2;\n\t\t\tif (lowestPrice > 0) {\n\t\t\t\thotelIndividualPriceEl.innerHTML = `From £${parseFloat(parseFloat(lowestPrice).toFixed(0)).toLocaleString()} pp per night`;\n\t\t\t} else {\n\t\t\t\thotelIndividualPriceEl.setAttribute('hidden', 'hidden');\n\t\t\t}\n\t\t}\n\t});\n}\n","L.Curve=L.Path.extend({options:{},initialize:function(t,n){L.setOptions(this,n),this._setPath(t)},setLatLngs:function(t){return this.setPath(t)},getLatLngs:function(){return this.getPath()},_updateBounds:function(){var t=this._clickTolerance(),n=new L.Point(t,t);this._pxBounds=new L.Bounds([this._rawPxBounds.min.subtract(n),this._rawPxBounds.max.add(n)])},getPath:function(){return this._coords},setPath:function(t){return this._setPath(t),this.redraw()},getBounds:function(){return this._bounds},_setPath:function(t){this._coords=t,this._bounds=this._computeBounds()},_computeBounds:function(){for(var t,n,i,e=new L.LatLngBounds,a=0;a=0&&t<=1}));for(var h=[],c=0;c{var e=this._singleLinearTrace(t,n.x,i.x),a=this._singleLinearTrace(t,n.y,i.y);return this._map.layerPointToLatLng([e,a])}))},_quadraticTrace:function(t,n,i,e){return t.map((t=>{var a=this._singleQuadraticTrace(t,n.x,i.x,e.x),s=this._singleQuadraticTrace(t,n.y,i.y,e.y);return this._map.layerPointToLatLng([a,s])}))},_cubicTrace:function(t,n,i,e,a){return t.map((t=>{var s=this._singleCubicTrace(t,n.x,i.x,e.x,a.x),o=this._singleCubicTrace(t,n.y,i.y,e.y,a.y);return this._map.layerPointToLatLng([s,o])}))},_singleLinearTrace:function(t,n,i){return n+t*(i-n)},_singleQuadraticTrace:function(t,n,i,e){var a=1-t;return Math.pow(a,2)*n+2*a*t*i+Math.pow(t,2)*e},_singleCubicTrace:function(t,n,i,e,a){var s=1-t;return Math.pow(s,3)*n+3*Math.pow(s,2)*t*i+3*s*Math.pow(t,2)*e+Math.pow(t,3)*a},_reflectPoint:function(t,n){return x=n.x+(n.x-t.x),y=n.y+(n.y-t.y),L.point(x,y)}}),L.curve=function(t,n){return new L.Curve(t,n)};","// Packaging/modules magic dance.\n(function (factory) {\n var L;\n if (typeof define === 'function' && define.amd) {\n // AMD\n define(['leaflet'], factory);\n } else if (typeof module !== 'undefined') {\n // Node/CommonJS\n L = require('leaflet');\n module.exports = factory(L);\n } else {\n // Browser globals\n if (typeof window.L === 'undefined')\n throw 'Leaflet must be loaded first';\n factory(window.L);\n }\n}(function (L) {\n\"use strict\";\n\nL.Polyline._flat = L.LineUtil.isFlat || L.Polyline._flat || function (latlngs) {\n // true if it's a flat array of latlngs; false if nested\n return !L.Util.isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\n};\n\n/**\n * @fileOverview Leaflet Geometry utilities for distances and linear referencing.\n * @name L.GeometryUtil\n */\n\nL.GeometryUtil = L.extend(L.GeometryUtil || {}, {\n\n /**\n Shortcut function for planar distance between two {L.LatLng} at current zoom.\n\n @tutorial distance-length\n\n @param {L.Map} map Leaflet map to be used for this method\n @param {L.LatLng} latlngA geographical point A\n @param {L.LatLng} latlngB geographical point B\n @returns {Number} planar distance\n */\n distance: function (map, latlngA, latlngB) {\n return map.latLngToLayerPoint(latlngA).distanceTo(map.latLngToLayerPoint(latlngB));\n },\n\n /**\n Shortcut function for planar distance between a {L.LatLng} and a segment (A-B).\n @param {L.Map} map Leaflet map to be used for this method\n @param {L.LatLng} latlng - The position to search\n @param {L.LatLng} latlngA geographical point A of the segment\n @param {L.LatLng} latlngB geographical point B of the segment\n @returns {Number} planar distance\n */\n distanceSegment: function (map, latlng, latlngA, latlngB) {\n var p = map.latLngToLayerPoint(latlng),\n p1 = map.latLngToLayerPoint(latlngA),\n p2 = map.latLngToLayerPoint(latlngB);\n return L.LineUtil.pointToSegmentDistance(p, p1, p2);\n },\n\n /**\n Shortcut function for converting distance to readable distance.\n @param {Number} distance distance to be converted\n @param {String} unit 'metric' or 'imperial'\n @returns {String} in yard or miles\n */\n readableDistance: function (distance, unit) {\n var isMetric = (unit !== 'imperial'),\n distanceStr;\n if (isMetric) {\n // show metres when distance is < 1km, then show km\n if (distance > 1000) {\n distanceStr = (distance / 1000).toFixed(2) + ' km';\n }\n else {\n distanceStr = distance.toFixed(1) + ' m';\n }\n }\n else {\n distance *= 1.09361;\n if (distance > 1760) {\n distanceStr = (distance / 1760).toFixed(2) + ' miles';\n }\n else {\n distanceStr = distance.toFixed(1) + ' yd';\n }\n }\n return distanceStr;\n },\n\n /**\n Returns true if the latlng belongs to segment A-B\n @param {L.LatLng} latlng - The position to search\n @param {L.LatLng} latlngA geographical point A of the segment\n @param {L.LatLng} latlngB geographical point B of the segment\n @param {?Number} [tolerance=0.2] tolerance to accept if latlng belongs really\n @returns {boolean}\n */\n belongsSegment: function(latlng, latlngA, latlngB, tolerance) {\n tolerance = tolerance === undefined ? 0.2 : tolerance;\n var hypotenuse = latlngA.distanceTo(latlngB),\n delta = latlngA.distanceTo(latlng) + latlng.distanceTo(latlngB) - hypotenuse;\n return delta/hypotenuse < tolerance;\n },\n\n /**\n * Returns total length of line\n * @tutorial distance-length\n *\n * @param {L.Polyline|Array|Array} coords Set of coordinates\n * @returns {Number} Total length (pixels for Point, meters for LatLng)\n */\n length: function (coords) {\n var accumulated = L.GeometryUtil.accumulatedLengths(coords);\n return accumulated.length > 0 ? accumulated[accumulated.length-1] : 0;\n },\n\n /**\n * Returns a list of accumulated length along a line.\n * @param {L.Polyline|Array|Array} coords Set of coordinates\n * @returns {Array} Array of accumulated lengths (pixels for Point, meters for LatLng)\n */\n accumulatedLengths: function (coords) {\n if (typeof coords.getLatLngs == 'function') {\n coords = coords.getLatLngs();\n }\n if (coords.length === 0)\n return [];\n var total = 0,\n lengths = [0];\n for (var i = 0, n = coords.length - 1; i< n; i++) {\n total += coords[i].distanceTo(coords[i+1]);\n lengths.push(total);\n }\n return lengths;\n },\n\n /**\n Returns the closest point of a {L.LatLng} on the segment (A-B)\n\n @tutorial closest\n\n @param {L.Map} map Leaflet map to be used for this method\n @param {L.LatLng} latlng - The position to search\n @param {L.LatLng} latlngA geographical point A of the segment\n @param {L.LatLng} latlngB geographical point B of the segment\n @returns {L.LatLng} Closest geographical point\n */\n closestOnSegment: function (map, latlng, latlngA, latlngB) {\n var maxzoom = map.getMaxZoom();\n if (maxzoom === Infinity)\n maxzoom = map.getZoom();\n var p = map.project(latlng, maxzoom),\n p1 = map.project(latlngA, maxzoom),\n p2 = map.project(latlngB, maxzoom),\n closest = L.LineUtil.closestPointOnSegment(p, p1, p2);\n return map.unproject(closest, maxzoom);\n },\n\n /**\n Returns the closest point of a {L.LatLng} on a {L.Circle}\n\n @tutorial closest\n\n @param {L.LatLng} latlng - The position to search\n @param {L.Circle} circle - A Circle defined by a center and a radius\n @returns {L.LatLng} Closest geographical point on the circle circumference\n */\n closestOnCircle: function (circle, latLng) {\n const center = circle.getLatLng();\n const circleRadius = circle.getRadius();\n const radius = typeof circleRadius === 'number' ? circleRadius : circleRadius.radius;\n const x = latLng.lng;\n const y = latLng.lat;\n const cx = center.lng;\n const cy = center.lat;\n // dx and dy is the vector from the circle's center to latLng\n const dx = x - cx;\n const dy = y - cy;\n\n // distance between the point and the circle's center\n const distance = Math.sqrt(dx * dx + dy * dy)\n\n // Calculate the closest point on the circle by adding the normalized vector to the center\n const tx = cx + (dx / distance) * radius;\n const ty = cy + (dy / distance) * radius;\n\n return new L.LatLng(ty, tx);\n },\n \n\n /**\n Returns the closest latlng on layer.\n\n Accept nested arrays\n\n @tutorial closest\n\n @param {L.Map} map Leaflet map to be used for this method\n @param {Array|Array>|L.PolyLine|L.Polygon} layer - Layer that contains the result\n @param {L.LatLng} latlng - The position to search\n @param {?boolean} [vertices=false] - Whether to restrict to path vertices.\n @returns {L.LatLng} Closest geographical point or null if layer param is incorrect\n */\n closest: function (map, layer, latlng, vertices) {\n\n var latlngs,\n mindist = Infinity,\n result = null,\n i, n, distance, subResult;\n\n if (layer instanceof Array) {\n // if layer is Array>\n if (layer[0] instanceof Array && typeof layer[0][0] !== 'number') {\n // if we have nested arrays, we calc the closest for each array\n // recursive\n for (i = 0; i < layer.length; i++) {\n subResult = L.GeometryUtil.closest(map, layer[i], latlng, vertices);\n if (subResult && subResult.distance < mindist) {\n mindist = subResult.distance;\n result = subResult;\n }\n }\n return result;\n } else if (layer[0] instanceof L.LatLng\n || typeof layer[0][0] === 'number'\n || typeof layer[0].lat === 'number') { // we could have a latlng as [x,y] with x & y numbers or {lat, lng}\n layer = L.polyline(layer);\n } else {\n return result;\n }\n }\n\n // if we don't have here a Polyline, that means layer is incorrect\n // see https://github.com/makinacorpus/Leaflet.GeometryUtil/issues/23\n if (! ( layer instanceof L.Polyline ) )\n return result;\n\n // deep copy of latlngs\n latlngs = JSON.parse(JSON.stringify(layer.getLatLngs().slice(0)));\n\n // add the last segment for L.Polygon\n if (layer instanceof L.Polygon) {\n // add the last segment for each child that is a nested array\n var addLastSegment = function(latlngs) {\n if (L.Polyline._flat(latlngs)) {\n latlngs.push(latlngs[0]);\n } else {\n for (var i = 0; i < latlngs.length; i++) {\n addLastSegment(latlngs[i]);\n }\n }\n };\n addLastSegment(latlngs);\n }\n\n // we have a multi polygon / multi polyline / polygon with holes\n // use recursive to explore and return the good result\n if ( ! L.Polyline._flat(latlngs) ) {\n for (i = 0; i < latlngs.length; i++) {\n // if we are at the lower level, and if we have a L.Polygon, we add the last segment\n subResult = L.GeometryUtil.closest(map, latlngs[i], latlng, vertices);\n if (subResult.distance < mindist) {\n mindist = subResult.distance;\n result = subResult;\n }\n }\n return result;\n\n } else {\n\n // Lookup vertices\n if (vertices) {\n for(i = 0, n = latlngs.length; i < n; i++) {\n var ll = latlngs[i];\n distance = L.GeometryUtil.distance(map, latlng, ll);\n if (distance < mindist) {\n mindist = distance;\n result = ll;\n result.distance = distance;\n }\n }\n return result;\n }\n\n // Keep the closest point of all segments\n for (i = 0, n = latlngs.length; i < n-1; i++) {\n var latlngA = latlngs[i],\n latlngB = latlngs[i+1];\n distance = L.GeometryUtil.distanceSegment(map, latlng, latlngA, latlngB);\n if (distance <= mindist) {\n mindist = distance;\n result = L.GeometryUtil.closestOnSegment(map, latlng, latlngA, latlngB);\n result.distance = distance;\n }\n }\n return result;\n }\n\n },\n\n /**\n Returns the closest layer to latlng among a list of layers.\n\n @tutorial closest\n\n @param {L.Map} map Leaflet map to be used for this method\n @param {Array} layers Set of layers\n @param {L.LatLng} latlng - The position to search\n @returns {object} ``{layer, latlng, distance}`` or ``null`` if list is empty;\n */\n closestLayer: function (map, layers, latlng) {\n var mindist = Infinity,\n result = null,\n ll = null,\n distance = Infinity;\n\n for (var i = 0, n = layers.length; i < n; i++) {\n var layer = layers[i];\n if (layer instanceof L.LayerGroup) {\n // recursive\n var subResult = L.GeometryUtil.closestLayer(map, layer.getLayers(), latlng);\n if (subResult.distance < mindist) {\n mindist = subResult.distance;\n result = subResult;\n }\n } else {\n if (layer instanceof L.Circle){\n ll = this.closestOnCircle(layer, latlng);\n distance = L.GeometryUtil.distance(map, latlng, ll);\n } else\n // Single dimension, snap on points, else snap on closest\n if (typeof layer.getLatLng == 'function') {\n ll = layer.getLatLng();\n distance = L.GeometryUtil.distance(map, latlng, ll);\n }\n else {\n ll = L.GeometryUtil.closest(map, layer, latlng);\n if (ll) distance = ll.distance; // Can return null if layer has no points.\n }\n if (distance < mindist) {\n mindist = distance;\n result = {layer: layer, latlng: ll, distance: distance};\n }\n }\n }\n return result;\n },\n\n /**\n Returns the n closest layers to latlng among a list of input layers.\n\n @param {L.Map} map - Leaflet map to be used for this method\n @param {Array} layers - Set of layers\n @param {L.LatLng} latlng - The position to search\n @param {?Number} [n=layers.length] - the expected number of output layers.\n @returns {Array