hubs-travel-js 0.0.46 → 0.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1 @@
1
- (()=>{var n=(t,o)=>()=>(t&&(o=t(t=0)),o);var i=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports);function p(){document.querySelectorAll("[data-map-pos-left]").forEach(t=>{let o=t.getAttribute("data-map-pos-left"),e=t.getAttribute("data-map-pos-top");o&&e&&(t.style.position="absolute",t.style.left=o+"%",t.style.top=e+"%")})}var a=n(()=>{});var r=i(()=>{a();document.addEventListener("DOMContentLoaded",function(){p()})});r();})();
2
- //# sourceMappingURL=bundle-about-us.min.js.map
1
+ (()=>{function p(){document.querySelectorAll("[data-map-pos-left]").forEach(t=>{let o=t.getAttribute("data-map-pos-left"),e=t.getAttribute("data-map-pos-top");o&&e&&(t.style.position="absolute",t.style.left=o+"%",t.style.top=e+"%")})}document.addEventListener("DOMContentLoaded",function(){p()});})();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../components/europe-map.js", "../pages/about-us/index.js"],
4
4
  "sourcesContent": ["export function initEuropeMap () {\n document.querySelectorAll(\"[data-map-pos-left]\").forEach(el => {\n const left = el.getAttribute(\"data-map-pos-left\");\n const top = el.getAttribute(\"data-map-pos-top\");\n \n if (left && top) {\n el.style.position = \"absolute\"; // Ensure absolute positioning\n el.style.left = left + \"%\";\n el.style.top = top + \"%\";\n }\n });\n}", "import { initEuropeMap } from '../../components/europe-map';\n\ndocument.addEventListener('DOMContentLoaded', function() {\n initEuropeMap();\n});\n"],
5
- "mappings": "uGAAO,SAASA,GAAiB,CAC/B,SAAS,iBAAiB,qBAAqB,EAAE,QAAQC,GAAM,CAC7D,IAAMC,EAAOD,EAAG,aAAa,mBAAmB,EAC1CE,EAAMF,EAAG,aAAa,kBAAkB,EAE1CC,GAAQC,IACVF,EAAG,MAAM,SAAW,WACpBA,EAAG,MAAM,KAAOC,EAAO,IACvBD,EAAG,MAAM,IAAME,EAAM,IAEzB,CAAC,CACH,CAXA,IAAAC,EAAAC,EAAA,QCAA,IAAAC,EAAAC,EAAA,KAAAC,IAEA,SAAS,iBAAiB,mBAAoB,UAAW,CACvDC,EAAc,CAChB,CAAC",
6
- "names": ["initEuropeMap", "el", "left", "top", "init_europe_map", "__esmMin", "require_about_us", "__commonJSMin", "init_europe_map", "initEuropeMap"]
5
+ "mappings": "MAAO,SAASA,GAAiB,CAC/B,SAAS,iBAAiB,qBAAqB,EAAE,QAAQC,GAAM,CAC7D,IAAMC,EAAOD,EAAG,aAAa,mBAAmB,EAC1CE,EAAMF,EAAG,aAAa,kBAAkB,EAE1CC,GAAQC,IACVF,EAAG,MAAM,SAAW,WACpBA,EAAG,MAAM,KAAOC,EAAO,IACvBD,EAAG,MAAM,IAAME,EAAM,IAEzB,CAAC,CACH,CCTA,SAAS,iBAAiB,mBAAoB,UAAW,CACvDC,EAAc,CAChB,CAAC",
6
+ "names": ["initEuropeMap", "el", "left", "top", "initEuropeMap"]
7
7
  }
@@ -1,2 +1 @@
1
- (()=>{var u=(e,n)=>()=>(e&&(n=e(e=0)),n);var C=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);function w(){document.querySelectorAll("[data-map-pos-left]").forEach(e=>{let n=e.getAttribute("data-map-pos-left"),i=e.getAttribute("data-map-pos-top");n&&i&&(e.style.position="absolute",e.style.left=n+"%",e.style.top=i+"%")})}var y=u(()=>{});var g,E=u(()=>{g=function(){let e={};function n(o,t,r){let s=document.querySelector(o),c=document.querySelector(`${o}.w-dropdown`),f=s.querySelector(`${o} .w-dropdown-toggle`),a=s.querySelector(`${o} .w-dropdown-list`),b=s.querySelector(`${o} .dropdown-selected-value`),p=s.querySelectorAll(`${o} .dropdown-item`);if(e[o]={container:s,dropdown:c,dropdownToggle:f,dropdownList:a,selectedItemValueContainer:b,collectionItems:p,onChange:t},p.forEach(d=>{d.addEventListener("click",function(h){h.preventDefault();let m=this;i(o,m),t&&t(m),a.classList.remove("w--open"),c.blur()})}),r){let d=l(o,r);d&&setTimeout(()=>{d.click()},200)}}function i(o,t){let r=e[o];if(!r)return;let s=r.selectedItemValueContainer;for(;s.firstChild;)s.removeChild(s.firstChild);let c=t;if(c){let f=c.cloneNode(!0);s.appendChild(f);let a=c.getAttribute("data-value");r.dropdown.setAttribute("data-current-value",a)}else console.error("SelectedItem Element not found.",t)}function l(o,t){let r=e[o];return Array.from(r.collectionItems).find(s=>s.getAttribute("data-value")===t)}return{init:function({selector:o,onChange:t,initialValue:r}){document.addEventListener("DOMContentLoaded",function(){n(o,t,r)})},setValue:function(o,t){let r=l(o,t);r?r.click():t!=null&&console.error(`No item with value '${t}' found in dropdown '${o}'`)},getValue:function(o){return e[o].dropdown.getAttribute("data-current-value")}}}()});function S(){document.querySelectorAll("#edition-cards-section .edition-card-item").forEach(n=>{let i=n.querySelectorAll("a"),l=n.getAttribute("data-editionslug"),o=n.getAttribute("data-bookingstate");i.forEach(t=>{if(o=="Available Soon"){t.setAttribute("href","#"),t.style.cursor="auto";let r=t.querySelector(".edition-card-image");r.style.opacity=.4}else if(l){let r=t.getAttribute("href").split("?")[0];t.setAttribute("href",`${r}?edition=${encodeURIComponent(l)}`)}})})}var v=u(()=>{});function A(){let e=document.querySelectorAll(".filter-button"),n=document.querySelectorAll(".filter-list-item");e.forEach(l=>{l.addEventListener("click",function(){e.forEach(t=>t.classList.remove("active")),this.classList.add("active");let o=this.getAttribute("data-season");o==="all"?n.forEach(t=>{t.classList.remove("filtered-out")}):n.forEach(t=>{t.getAttribute("data-season")===o?t.classList.remove("filtered-out"):t.classList.add("filtered-out")})})});let i=document.querySelector('[data-season="all"]');i&&i.click()}var L=u(()=>{});var I=C(()=>{y();E();v();L();document.addEventListener("DOMContentLoaded",function(){S(),A(),w()});function q(e){let n=document.querySelectorAll(".filter-list-item");e===""?n.forEach(i=>{i.style.display="block"}):n.forEach(i=>{i.getAttribute("data-location")===e?i.style.display="block":i.style.display="none"})}var B=new URLSearchParams(window.location.search),D=B.get("location");g.init({selector:"#destination-dropdown",initialValue:D,onChange:e=>{let n=e.getAttribute("data-value");q(n)}})});I();})();
2
- //# sourceMappingURL=bundle-all-destinations.min.js.map
1
+ (()=>{function m(){document.querySelectorAll("[data-map-pos-left]").forEach(o=>{let r=o.getAttribute("data-map-pos-left"),i=o.getAttribute("data-map-pos-top");r&&i&&(o.style.position="absolute",o.style.left=r+"%",o.style.top=i+"%")})}var w=function(){let o={};function r(e,t,n){let s=document.querySelector(e),c=document.querySelector(`${e}.w-dropdown`),u=s.querySelector(`${e} .w-dropdown-toggle`),a=s.querySelector(`${e} .w-dropdown-list`),E=s.querySelector(`${e} .dropdown-selected-value`),f=s.querySelectorAll(`${e} .dropdown-item`);if(o[e]={container:s,dropdown:c,dropdownToggle:u,dropdownList:a,selectedItemValueContainer:E,collectionItems:f,onChange:t},f.forEach(d=>{d.addEventListener("click",function(S){S.preventDefault();let p=this;i(e,p),t&&t(p),a.classList.remove("w--open"),c.blur()})}),n){let d=l(e,n);d&&setTimeout(()=>{d.click()},200)}}function i(e,t){let n=o[e];if(!n)return;let s=n.selectedItemValueContainer;for(;s.firstChild;)s.removeChild(s.firstChild);let c=t;if(c){let u=c.cloneNode(!0);s.appendChild(u);let a=c.getAttribute("data-value");n.dropdown.setAttribute("data-current-value",a)}else console.error("SelectedItem Element not found.",t)}function l(e,t){let n=o[e];return Array.from(n.collectionItems).find(s=>s.getAttribute("data-value")===t)}return{init:function({selector:e,onChange:t,initialValue:n}){document.addEventListener("DOMContentLoaded",function(){r(e,t,n)})},setValue:function(e,t){let n=l(e,t);n?n.click():t!=null&&console.error(`No item with value '${t}' found in dropdown '${e}'`)},getValue:function(e){return o[e].dropdown.getAttribute("data-current-value")}}}();function y(){document.querySelectorAll("#edition-cards-section .edition-card-item").forEach(r=>{let i=r.querySelectorAll("a"),l=r.getAttribute("data-editionslug"),e=r.getAttribute("data-bookingstate");i.forEach(t=>{if(e=="Available Soon"){t.setAttribute("href","#"),t.style.cursor="auto";let n=t.querySelector(".edition-card-image");n.style.opacity=.4}else if(l){let n=t.getAttribute("href").split("?")[0];t.setAttribute("href",`${n}?edition=${encodeURIComponent(l)}`)}})})}function g(){let o=document.querySelectorAll(".filter-button"),r=document.querySelectorAll(".filter-list-item");o.forEach(l=>{l.addEventListener("click",function(){o.forEach(t=>t.classList.remove("active")),this.classList.add("active");let e=this.getAttribute("data-season");e==="all"?r.forEach(t=>{t.classList.remove("filtered-out")}):r.forEach(t=>{t.getAttribute("data-season")===e?t.classList.remove("filtered-out"):t.classList.add("filtered-out")})})});let i=document.querySelector('[data-season="all"]');i&&i.click()}document.addEventListener("DOMContentLoaded",function(){y(),g(),m()});function v(o){let r=document.querySelectorAll(".filter-list-item");o===""?r.forEach(i=>{i.style.display="block"}):r.forEach(i=>{i.getAttribute("data-location")===o?i.style.display="block":i.style.display="none"})}var A=new URLSearchParams(window.location.search),L=A.get("location");w.init({selector:"#destination-dropdown",initialValue:L,onChange:o=>{let r=o.getAttribute("data-value");v(r)}});})();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../components/europe-map.js", "../controls/collectionListDropdown.js", "../components/upcoming-editions.js", "../components/upcoming-editions-filter.js", "../pages/all-destinations/index.js"],
4
4
  "sourcesContent": ["export function initEuropeMap () {\n document.querySelectorAll(\"[data-map-pos-left]\").forEach(el => {\n const left = el.getAttribute(\"data-map-pos-left\");\n const top = el.getAttribute(\"data-map-pos-top\");\n \n if (left && top) {\n el.style.position = \"absolute\"; // Ensure absolute positioning\n el.style.left = left + \"%\";\n el.style.top = top + \"%\";\n }\n });\n}", "export const CollectionListDropDown = (function () {\n // Store dropdown instances to access them later\n const dropdowns = {};\n \n function initDropDown(selector, onChange, initialValue) {\n const container = document.querySelector(selector);\n const dropdown = document.querySelector(`${selector}.w-dropdown`);\n const dropdownToggle = container.querySelector(`${selector} .w-dropdown-toggle`); \n const dropdownList = container.querySelector(`${selector} .w-dropdown-list`);\n const selectedItemValueContainer = container.querySelector(`${selector} .dropdown-selected-value`);\n const collectionItems = container.querySelectorAll(`${selector} .dropdown-item`);\n \n // Store this dropdown instance data for later access\n dropdowns[selector] = {\n container,\n dropdown,\n dropdownToggle,\n dropdownList,\n selectedItemValueContainer,\n collectionItems,\n onChange\n };\n \n collectionItems.forEach(item => {\n item.addEventListener('click', function(event) {\n event.preventDefault(); // Prevent default link behavior if using Link Blocks\n const selectedOption = this;\n selectDropDownElement(selector, selectedOption);\n \n onChange && onChange(selectedOption);\n // Close the dropdown\n dropdownList.classList.remove('w--open'); // Close the dropdown\n // Move focus away to reset dropdown behavior\n dropdown.blur();\n });\n });\n \n if (initialValue) {\n const item = getElementByItemValue(selector, initialValue);\n if (item) { \n setTimeout(() => {\n item.click(); // Simulate a click on the matching item to activate filter\n }, 200);\n }\n }\n }\n \n function selectDropDownElement(selector, selectedItem) {\n const dropdown = dropdowns[selector];\n if (!dropdown) return;\n \n const selectedItemValueContainer = dropdown.selectedItemValueContainer;\n \n while (selectedItemValueContainer.firstChild) {\n selectedItemValueContainer.removeChild(selectedItemValueContainer.firstChild);\n }\n \n const sourceElement = selectedItem;\n if (sourceElement) {\n const clonedElement = sourceElement.cloneNode(true);\n selectedItemValueContainer.appendChild(clonedElement);\n const currentValue = sourceElement.getAttribute('data-value');\n dropdown.dropdown.setAttribute('data-current-value', currentValue);\n } else {\n console.error(\"SelectedItem Element not found.\", selectedItem);\n }\n }\n \n function getElementByItemValue(selector, value) {\n const dropdown = dropdowns[selector];\n return Array.from(dropdown.collectionItems).find((x) => {\n return x.getAttribute('data-value') === value;\n });\n }\n \n // Public methods\n return {\n init: function({ selector, onChange, initialValue }) {\n document.addEventListener('DOMContentLoaded', function() {\n initDropDown(selector, onChange, initialValue);\n });\n },\n // Add a new public method to change dropdown value from outside\n setValue: function(selector, value) {\n const item = getElementByItemValue(selector, value);\n if (item) {\n item.click(); // Trigger the click event on the item\n } else if (value !== undefined && value !== null) {\n console.error(`No item with value '${value}' found in dropdown '${selector}'`);\n }\n },\n // Get currently selected dropdown value\n getValue: function(selector) {\n const dropdown = dropdowns[selector];\n return dropdown.dropdown.getAttribute('data-current-value');\n }\n };\n})();", "export const EditionCardsCarousel = (function () {\n let swiperInstance, prevButton, nextButton = null;\n let allSlides = []; // we need to store them for filtering \n let SELECTORS = null; \n\n function initSwiper() {\n const refContainer = document.querySelector(SELECTORS.refContainer); \n const swiperWrapper = document.querySelector(SELECTORS.swiperWrapper);\n prevButton = document.querySelector(SELECTORS.prevButton);\n nextButton = document.querySelector(SELECTORS.nextButton);\n allSlides = Array.from(document.querySelectorAll('#edition-cards-section .swiper .swiper-slide'));\n\n if (!refContainer || !swiperWrapper || !prevButton || !nextButton) {\n console.error('Required elements not found');\n return null;\n } \n \n\t\tconst refRect = refContainer.getBoundingClientRect();\n \tconst offsetBefore = refRect.left;\n\n // Initialize Swiper\n const swiper = new Swiper(SELECTORS.swiper, {\n slidesPerView: \"auto\",\n spaceBetween: 16,\n freeMode: false,\n slidesOffsetBefore: offsetBefore,\n slidesOffsetAfter: 16,\n navigation: {\n nextEl: SELECTORS.nextButton,\n \tprevEl: SELECTORS.prevButton,\n },\n watchOverflow: true,\n });\n\n\t swiperInstance = swiper;\n\n // Set initial state of buttons\n updateButtonsState();\n\n // Add event listeners to update button states when slides change\n swiper.on('slideChange', updateButtonsState);\n \n // Add resize event listener separately\n window.addEventListener('resize', () => {\n const newOffsetBefore = refContainer.getBoundingClientRect().left;\n\n // Check if Swiper instance exists and has a method to update params\n if (swiper && swiper.params) {\n swiper.params.slidesOffsetBefore = newOffsetBefore;\n swiper.update(); // Refresh Swiper\n }\n });\n\n return swiper;\n }\n\n // Function to update button states\n function updateButtonsState() {\n \tif (!prevButton || !nextButton) return;\n \n prevButton.style.opacity = swiperInstance.isBeginning ? '0.5' : '1';\n prevButton.style.pointerEvents = swiperInstance.isBeginning ? 'none' : 'auto'; \n\n //nextButton.style.opacity = swiperInstance.isEnd ? '0.5' : '1';\n //nextButton.style.pointerEvents = swiperInstance.isEnd ? 'none' : 'auto';\n // Get Swiper's max translate position\n const maxTranslate = swiperInstance.maxTranslate();\n const currentTranslate = swiperInstance.translate;\n\n if (currentTranslate <= maxTranslate + 5) { // buffer of 5 to prevent minor calculation errors.\n nextButton.style.opacity = '0.5';\n nextButton.style.pointerEvents = 'none';\n } else {\n nextButton.style.opacity = '1';\n nextButton.style.pointerEvents = 'auto';\n }\n }\n\n // Public methods\n return {\n init: function(selectors) {\n SELECTORS = selectors;\n document.addEventListener('DOMContentLoaded', function() {\n \tconst swiperWrapper = document.querySelector(SELECTORS.swiperWrapper);\n swiperWrapper.style.gap = '0';\n \t\n // Initialize swiper\n initSwiper();\n });\n },\n filterSeason(season) {\n \tif (!swiperInstance) return;\n \n \t// Collect slides to keep\n \tconst slidesToKeep = allSlides.filter(slideEl => \n \t\tseason === 'all' || \n \t\tseason === slideEl.getAttribute('data-season')\n \t);\n \n swiperInstance.removeAllSlides();\n\n // Add filtered slides\n swiperInstance.addSlide(0, slidesToKeep);\n\n // Reset to first slide\n swiperInstance.slideTo(0, 0, false);\n \n updateButtonsState();\n }\n };\n})();\n\n\n// loop through all edition cards and add the edition query param to all URLs\n// because we are linking to a destination page and want to pre-set the edition dropdown \nexport function updateEditionCardLinkUrls() {\n\tconst allEditionCards = document.querySelectorAll(\"#edition-cards-section .edition-card-item\");\n \n allEditionCards.forEach((editionCard) => {\n \tconst editionLinkElems = editionCard.querySelectorAll(\"a\"); // we defined the card multiple times in the collection item\n const editionSlug = editionCard.getAttribute(\"data-editionslug\");\n const bookingState = editionCard.getAttribute(\"data-bookingstate\");\n\n editionLinkElems.forEach((link) => {\n \t// remove link from card and give bg less opacity for booking state \"available soon\"\n \tif (bookingState == \"Available Soon\") {\n \t\tlink.setAttribute(\"href\", \"#\");\n link.style.cursor = \"auto\";\n \n const bgImage = link.querySelector(\".edition-card-image\");\n bgImage.style.opacity = 0.4;\n } else if (editionSlug) {\n const baseUrl = link.getAttribute(\"href\").split(\"?\")[0]; // Remove existing query params\n // Update the link's href with the new query parameter\n link.setAttribute(\"href\", `${baseUrl}?edition=${encodeURIComponent(editionSlug)}`);\n }\n });\n });\n}\n", "export function initUpcomingEditionsFilter() {\n // Set up filter buttons\n const filterButtons = document.querySelectorAll('.filter-button');\n const allItems = document.querySelectorAll('.filter-list-item');\n\n // Add click event to each filter button\n filterButtons.forEach(button => {\n button.addEventListener('click', function() {\n // Remove active class from all buttons\n filterButtons.forEach(btn => btn.classList.remove(\"active\"));\n \n // Add active class to current button\n this.classList.add(\"active\");\n \n // Get the season value from the button's data attribute\n const season = this.getAttribute('data-season');\n \n // If \"All\" is selected, show all items\n if (season === 'all') {\n allItems.forEach(item => {\n item.classList.remove(\"filtered-out\");\n \t});\n } else {\n \t// Filter items based on the selected season\n \tallItems.forEach(item => {\n const itemSeason = item.getAttribute('data-season');\n if (itemSeason === season) {\n item.classList.remove(\"filtered-out\");\n } else {\n item.classList.add(\"filtered-out\");\n }\n });\n }\n });\n });\n \n // Trigger \"All\" filter on page load\n const allButton = document.querySelector('[data-season=\"all\"]');\n if (allButton) {\n allButton.click();\n }\n}", "import { initEuropeMap } from '../../components/europe-map';\nimport { CollectionListDropDown } from \"../../controls/collectionListDropdown\"\nimport { updateEditionCardLinkUrls } from \"../../components/upcoming-editions\";\nimport { initUpcomingEditionsFilter } from \"../../components/upcoming-editions-filter\";\n\ndocument.addEventListener('DOMContentLoaded', function() {\n\tupdateEditionCardLinkUrls();\n initUpcomingEditionsFilter();\n initEuropeMap();\n});\n\n\nfunction filterItemsByLocation(location) {\n\t// Get all edition card items\n const allItems = document.querySelectorAll('.filter-list-item');\n \n // If none is selected, show all items\n if (location === '') {\n allItems.forEach(item => {\n item.style.display = 'block';\n });\n } else {\n // Filter items based on the selected season\n allItems.forEach(item => {\n const itemLocation = item.getAttribute('data-location');\n if (itemLocation === location) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n }\n}\n\nconst urlParams = new URLSearchParams(window.location.search);\nconst urlParamLocation = urlParams.get(\"location\");\n\n// Initialize the Dropdown\nCollectionListDropDown.init({ \n\tselector: \"#destination-dropdown\", \n initialValue: urlParamLocation, \n onChange: (selectedItem) => {\n // Get the location value from the dropdown\n const location = selectedItem.getAttribute('data-value');\n filterItemsByLocation(location);\n\t}\n});"],
5
- "mappings": "uGAAO,SAASA,GAAiB,CAC/B,SAAS,iBAAiB,qBAAqB,EAAE,QAAQC,GAAM,CAC7D,IAAMC,EAAOD,EAAG,aAAa,mBAAmB,EAC1CE,EAAMF,EAAG,aAAa,kBAAkB,EAE1CC,GAAQC,IACVF,EAAG,MAAM,SAAW,WACpBA,EAAG,MAAM,KAAOC,EAAO,IACvBD,EAAG,MAAM,IAAME,EAAM,IAEzB,CAAC,CACH,CAXA,IAAAC,EAAAC,EAAA,QCAA,IAAaC,EAAbC,EAAAC,EAAA,KAAaF,EAA0B,UAAY,CAEjD,IAAMG,EAAY,CAAC,EAEnB,SAASC,EAAaC,EAAUC,EAAUC,EAAc,CACtD,IAAMC,EAAY,SAAS,cAAcH,CAAQ,EAC3CI,EAAW,SAAS,cAAc,GAAGJ,CAAQ,aAAa,EAC1DK,EAAiBF,EAAU,cAAc,GAAGH,CAAQ,qBAAqB,EACzEM,EAAeH,EAAU,cAAc,GAAGH,CAAQ,mBAAmB,EACrEO,EAA6BJ,EAAU,cAAc,GAAGH,CAAQ,2BAA2B,EAC3FQ,EAAkBL,EAAU,iBAAiB,GAAGH,CAAQ,iBAAiB,EA2B/E,GAxBAF,EAAUE,CAAQ,EAAI,CACpB,UAAAG,EACA,SAAAC,EACA,eAAAC,EACA,aAAAC,EACA,2BAAAC,EACA,gBAAAC,EACA,SAAAP,CACF,EAEAO,EAAgB,QAAQC,GAAQ,CAC9BA,EAAK,iBAAiB,QAAS,SAASC,EAAO,CAC7CA,EAAM,eAAe,EACrB,IAAMC,EAAiB,KACvBC,EAAsBZ,EAAUW,CAAc,EAE9CV,GAAYA,EAASU,CA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AAC,EAAA,QCAA,IAAAC,EAAAC,EAAA,KAAAC,IACAC,IACAC,IACAC,IAEA,SAAS,iBAAiB,mBAAoB,UAAW,CACxDC,EAA0B,EACzBC,EAA2B,EAC3BC,EAAc,CAChB,CAAC,EAGD,SAASC,EAAsBC,EAAU,CAEvC,IAAMC,EAAW,SAAS,iBAAiB,mBAAmB,EAG1DD,IAAa,GACfC,EAAS,QAAQC,GAAQ,CACvBA,EAAK,MAAM,QAAU,OACvB,CAAC,EAGDD,EAAS,QAAQC,GAAQ,CACFA,EAAK,aAAa,eAAe,IACjCF,EACnBE,EAAK,MAAM,QAAU,QAErBA,EAAK,MAAM,QAAU,MAEzB,CAAC,CAEL,CAEA,IAAMC,EAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM,EACtDC,EAAmBD,EAAU,IAAI,UAAU,EAGjDE,EAAuB,KAAK,CAC3B,SAAU,wBACT,aAAcD,EACd,SAAWE,GAAiB,CAE1B,IAAMN,EAAWM,EAAa,aAAa,YAAY,EACvDP,EAAsBC,CAAQ,CACjC,CACD,CAAC",
6
- "names": ["initEuropeMap", "el", "left", "top", "init_europe_map", "__esmMin", "CollectionListDropDown", "init_collectionListDropdown", "__esmMin", "dropdowns", "initDropDown", "selector", "onChange", "initialValue", "container", "dropdown", "dropdownToggle", "dropdownList", "selectedItemValueContainer", "collectionItems", "item", "event", "selectedOption", "selectDropDownElement", "getElementByItemValue", "selectedItem", "sourceElement", "clonedElement", "currentValue", "value", "x", "updateEditionCardLinkUrls", "editionCard", "editionLinkElems", "editionSlug", "bookingState", "link", "bgImage", "baseUrl", "init_upcoming_editions", "__esmMin", "initUpcomingEditionsFilter", "filterButtons", "allItems", "button", "btn", "season", "item", "allButton", "init_upcoming_editions_filter", "__esmMin", "require_all_destinations", "__commonJSMin", "init_europe_map", "init_collectionListDropdown", "init_upcoming_editions", "init_upcoming_editions_filter", "updateEditionCardLinkUrls", "initUpcomingEditionsFilter", "initEuropeMap", "filterItemsByLocation", "location", "allItems",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,CACFA,EAAK,aAAa,eAAe,IACjCF,EACnBE,EAAK,MAAM,QAAU,QAErBA,EAAK,MAAM,QAAU,MAEzB,CAAC,CAEL,CAEA,IAAMC,EAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM,EACtDC,EAAmBD,EAAU,IAAI,UAAU,EAGjDE,EAAuB,KAAK,CAC3B,SAAU,wBACT,aAAcD,EACd,SAAWE,GAAiB,CAE1B,IAAMN,EAAWM,EAAa,aAAa,YAAY,EACvDP,EAAsBC,CAAQ,CACjC,CACD,CAAC",
6
+ "names": ["initEuropeMap", "el", "left", "top", "CollectionListDropDown", "dropdowns", "initDropDown", "selector", "onChange", "initialValue", "container", "dropdown", "dropdownToggle", "dropdownList", "selectedItemValueContainer", "collectionItems", "item", "event", "selectedOption", "selectDropDownElement", "getElementByItemValue", "selectedItem", "sourceElement", "clonedElement", "currentValue", "value", "x", "updateEditionCardLinkUrls", "editionCard", "editionLinkElems", "editionSlug", "bookingState", "link", "bgImage", "baseUrl", "initUpcomingEditionsFilter", "filterButtons", "allItems", "button", "btn", "season", "item", "allButton", "updateEditionCardLinkUrls", "initUpcomingEditionsFilter", "initEuropeMap", "filterItemsByLocation", "location", "allItems", "item", "urlParams", "urlParamLocation", "CollectionListDropDown", "selectedItem"]
7
7
  }
@@ -1,2 +1 @@
1
- (()=>{var oe=Object.create;var H=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ce=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of re(t))!ie.call(e,n)&&n!==o&&H(e,n,{get:()=>t[n],enumerable:!(s=ne(t,n))||s.enumerable});return e};var ae=(e,t,o)=>(o=e!=null?oe(se(e)):{},ce(t||!e||!e.__esModule?H(o,"default",{value:e,enumerable:!0}):o,e));function V(e){let t=document.querySelectorAll(".room-price-data"),o=Array.from(t).map(s=>JSON.parse(s.textContent));return e?o.filter(s=>s.editionSlug===e):o}function $(e,t){return!e||!t?0:Math.floor((t-e)/(1e3*60*60*24*30))}function h(e,t){return new Intl.NumberFormat("de-DE",{style:"currency",currency:t,currencyDisplay:"code"}).format(e)}function U(e,t=null){return isNaN(parseFloat(e))?t:parseFloat(e)}var W=I(()=>{});function z(){document.querySelectorAll("[data-trigger]").forEach(o=>{o.addEventListener("change",()=>t(o)),t(o)});function t(o){let s=o.getAttribute("data-trigger"),n=o.value;document.querySelectorAll(`[data-condition-trigger="${s}"]`).forEach(a=>{let d=a.getAttribute("data-condition-value")===n,i=a.matches("input, select, textarea")?a:a.querySelector("input, select, textarea");a.style.display=d?"block":"none",i&&(i.required=d,d||(i.value=""))})}}function O(){document.querySelectorAll("[data-custom-dropdown]").forEach(e=>{let t=document.createElement("input");t.type="hidden",t.name=e.dataset.name||"custom-dropdown",t.setAttribute("required",e.dataset.required==="true"||!1),t.value="",e.appendChild(t);let o=e.querySelector(".dropdown-selected-value");e.querySelectorAll(".dropdown-item").forEach(n=>{n.addEventListener("click",c=>{c.preventDefault();let a=n.dataset.value,d=n.cloneNode(!0);d.style.padding=0,o.innerHTML="",o.appendChild(d),t.value=a})})})}function _(e,t,o=30){let s=document.querySelector(e),n=document.querySelector(t),c=new DateRangePicker(s,{format:"dd. MM yyyy"}),a=o;return c.setMinimumDays=d=>{a=d},c.validateDateRange=()=>{let[d,i]=c.getDates();d&&i&&Math.floor((i-d)/864e5)<a?(n.setCustomValidity(`You need to choose a minimum of ${a} days.`),c.setDates(d,new Date(d.getTime()+a*24*60*60*1e3))):n.setCustomValidity(""),n.reportValidity()},s.addEventListener("changeDate",c.validateDateRange),{rangepicker:c,datesInput:s,startDateField:n}}function j(){let e=document.querySelectorAll(".form-step"),t=document.querySelectorAll(".form-wizard-step .form-wizard-step-progress"),o=0;function s(i){e.forEach((l,r)=>{l.style.display=r===i?"block":"none"}),t.forEach((l,r)=>{r<i||r===i?l.classList.add("active"):l.classList.remove("active")})}function n(){let i=e[o].querySelectorAll("input, select, textarea"),l=[];return i.forEach(r=>{let m=r.type==="hidden"||r.offsetParent===null;if(r.required&&(!r.value||r.value.trim()==="")){let y=r.dataset.name||r.name||r.placeholder||"Unnamed field";l.push(`${y} is required.`)}if(!m&&r.value&&!r.checkValidity()){let p=r.name||r.placeholder||"Unnamed field";l.push(`${p} is invalid.`)}}),l}function c(i,l){let r=document.querySelector(i);if(!r)return;r.innerHTML="";let m=document.createElement("ul");l.forEach(p=>{let y=document.createElement("li");y.textContent=p,m.appendChild(y)}),r.appendChild(m)}function a(i){let l=document.querySelector(i);l&&(l.innerHTML="")}document.querySelectorAll(".form-next-step-btn").forEach(i=>{i.addEventListener("click",()=>{if(i.getAttribute("disabled")==="true")return;let l=n(),r=`#error-list-step-${o}`;a(r),l.length==0?(o=Math.min(o+1,e.length-1),o===e.length-1&&d(),s(o)):c(r,l)})});function d(){document.querySelectorAll('[id^="review-"]').forEach(l=>{let r=l.dataset.fieldname;try{let m=document.querySelector(`[name="${r}"]`).value;l.innerText=m}catch{}})}document.querySelectorAll(".form-previous-step-btn").forEach(i=>{i.addEventListener("click",()=>{o=Math.max(o-1,0),s(o)})}),s(o)}var J=I(()=>{});function Q(){document.getElementById("close-button").addEventListener("click",function(){let e=document.referrer,t=window.location.hostname,o=null;try{o=e?new URL(e).hostname:null}catch{o=null}window.history.length>1&&o===t?window.history.back():window.location.href="/"})}var Y=I(()=>{});var X=N(()=>{W();J();Y();var g="EUR",R=null;document.addEventListener("DOMContentLoaded",function(){Q(),z(),j(),O(),R=_("#dates-start-end-group","#Start-Date"),de(),ue(),me(),le(),pe()});function le(){let e=new URLSearchParams(window.location.search),t=e.get("destination"),o=e.get("edition"),s=e.get("room"),n=e.get("guests");t&&C("#destination-dropdown",t,"data-destinationslug");let c=o&&C("#edition-dropdown",o,"data-editionslug");if(s&&C("#room-dropdown",s,"data-roomslug"),n){let a=document.getElementById("Guests");a&&(a.value=n)}if(c){let a=c.dataset.startdate,d=c.dataset.enddate,i=R.rangepicker;i.setOptions({minDate:a,maxDate:d}),i.setDates(a,d)}}function de(){let e=document.querySelector("#destination-dropdown"),t=document.querySelector("#edition-dropdown"),o=t.querySelector(".dropdown-selected-value"),s=o.innerHTML,n=document.querySelector("#room-dropdown"),c=n.querySelector(".dropdown-selected-value"),a=e.querySelectorAll(".dropdown-item"),d=t.querySelectorAll(".dropdown-item"),i=n.querySelectorAll(".dropdown-item");function l(r,m){o.setAttribute("disabled",r===""?"true":"false"),c.setAttribute("disabled",r===""?"true":"false"),o.innerHTML=s,c.innerHTML=s,g=m,[...d,...i].forEach(p=>{let y=p.dataset.destinationslug===r;p.style.display=y?"flex":"none"})}l("",g),a.forEach(r=>{r.addEventListener("click",function(){l(this.dataset.destinationslug,this.dataset.currency)})})}function C(e,t,o){let s=document.querySelectorAll(`${e} .dropdown-item`),n=s&&Array.from(s).find(c=>c.getAttribute(o)===t);return n&&n.click(),n}function ue(){let t=document.querySelector("#edition-dropdown").querySelectorAll(".dropdown-item"),o=document.querySelector("#dates-start-end-group");function s(n,c){let a=o.rangepicker;a.setOptions({minDate:n,maxDate:c}),a.setDates(n,c)}t.forEach(n=>{n.addEventListener("click",function(){s(this.dataset.startdate,this.dataset.enddate)})})}function me(){document.querySelector("#dates-start-end-group").addEventListener("changeDate",()=>{P(),K()}),document.querySelector("#room-dropdown").querySelectorAll(".dropdown-item").forEach(n=>{n.addEventListener("click",()=>{P();let c=n.getAttribute("data-allow-weekly-booking"),a=R.rangepicker;a.setMinimumDays(c==="Enabled"?7:30),a.validateDateRange()})}),document.querySelector("#Guests").addEventListener("change",()=>{P()})}function pe(){K(),P()}function K(){let t=document.querySelector("#dates-start-end-group").rangepicker,o=document.querySelector(".discount-info-blue"),s=document.querySelector(".discount-info-green"),[n,c]=t.getDates(),a=$(n,c);!n||!c||a<=2?(o.style.display="flex",s.style.display="none"):(o.style.display="none",s.style.display="flex")}function P(){let e=document.querySelectorAll(".price-info-card"),o=document.querySelector("#dates-start-end-group").rangepicker,s=document.querySelector("#destination-dropdown .dropdown-selected-value .dropdown-item"),n=document.querySelector("#edition-dropdown .dropdown-selected-value .dropdown-item"),c=document.querySelector("#room-dropdown .dropdown-selected-value .dropdown-item"),a=document.querySelector("#Guests"),d=s?s.dataset.destinationslug:"",i=n?n.dataset.editionslug:"",l=c?c.dataset.roomslug:"",r=c?c.getAttribute("data-allow-weekly-booking")==="Enabled":!1,[m,p]=o.getDates(),y=a?parseInt(a.value):0;if(d&&i&&l&&m&&p&&y>0){let D=V();e.forEach(f=>{f.style.display="flex",ye(f,D,i,l,m,p,y,r)});let k={day:"numeric",month:"short",year:"numeric"},b=m.toLocaleDateString("en-GB",{day:"numeric",month:"short"}).replace(",",""),q=p.toLocaleDateString("en-GB",k).replace(",","");document.querySelectorAll(".total-dates").forEach(f=>f.innerHTML=`${b} - ${q}`)}else e.forEach(D=>D.style.display="none")}function ye(e,t,o,s,n,c,a,d){let i=$(n,c),l=e.querySelector(".room-price"),r=e.querySelector(".room-price-discount"),m=e.querySelector(".room-price-month-desc"),p=e.querySelector(".total-guests"),y=e.querySelector(".total-totalprice"),D=y.firstElementChild,k=e.querySelector(".room-price-breakdown"),b=e.querySelector(".total-dates"),q=document.querySelector("#form-next-step-btn-step-1"),f=q.querySelector("a"),E=t.find(u=>u.editionSlug===o&&u.roomSlug===s),G=e.querySelectorAll(".price-info-card-title"),B=document.querySelector('[name="Total-Price"]');if(!E){k.innerText="No room price found for the selected season or room.",y.style.display="none",l.style.display="none",r.style.display="none",p.parentElement.style.display="none",b.style.display="none",m.style.display="none",f.style.pointerEvents="none",f.style.backgroundColor="var(--_colors---light-silver)",f.style.opacity=.3,q.setAttribute("disabled",!0),G.forEach(u=>u.style.display="none"),B.value=0;return}y.style.display="block",l.style.display="block",p.parentElement.style.display="flex",b.style.display="block",m.style.display="block",f.style.pointerEvents="auto",f.style.backgroundColor="var(--_colors---primary)",f.style.opacity=1,q.setAttribute("disabled",!1),G.forEach(u=>u.style.display="block");let L=U(E.basePriceWeek),M=E.basePriceMonth,Z=E.discountMonth2,ee=E.discountMonth3,S=0,x=[],F=0,te=u=>u===1?"st":u===2?"nd":u===3?"rd":"th";if(i<1&&d&&L){let u=L;r.style.display="none",l.innerText=`${h(u,g)}`,m.innerText="per week"}else i>=1&&(S+=M,x.push(`Month 1: ${h(S,g)}`),r.style.display="none",l.innerText=`${h(S,g)}`,m.innerText="1st month");for(let u=2;u<=i;u++){let w=0;u===2?w=Z:u>=3&&(w=ee);let A=M*(1-w/100);S+=A,x.push(`Month ${u}: ${h(A,g)}`);let v=u<=3?`${u}${te(u)} month`:"from 3rd month";w>0&&(r.innerText=`${w.toFixed(1)}% discount - ${v}`,r.style.display="flex"),l.innerHTML=`${h(A,g)}`,m.innerText=v,F=w}let T=(c-n)/(1e3*60*60*24)-i*30;if(T>0){let u=i>=1?M:L,w=i>=1?30:7,v=u*(1-F/100)/w*T;S+=v,x.push(`${i>=1?"+":""} ${Math.round(T)} days: ${h(v,g)}`)}k.innerHTML=x.join("<br>"),p.innerText=`${a} x Person`,D.innerText=`${h(S,g)}`,B.value=`${h(S,g)}`}});var fe=N(()=>{var be=ae(X())});fe();})();
2
- //# sourceMappingURL=bundle-book-workation.min.js.map
1
+ (()=>{function z(e){let n=document.querySelectorAll(".room-price-data"),t=Array.from(n).map(c=>JSON.parse(c.textContent));return e?t.filter(c=>c.editionSlug===e):t}function F(e,n){return!e||!n?0:Math.floor((n-e)/(1e3*60*60*24*30))}function S(e,n){return new Intl.NumberFormat("de-DE",{style:"currency",currency:n,currencyDisplay:"code"}).format(e)}function O(e,n=null){return isNaN(parseFloat(e))?n:parseFloat(e)}function _(){document.querySelectorAll("[data-trigger]").forEach(t=>{t.addEventListener("change",()=>n(t)),n(t)});function n(t){let c=t.getAttribute("data-trigger"),r=t.value;document.querySelectorAll(`[data-condition-trigger="${c}"]`).forEach(a=>{let u=a.getAttribute("data-condition-value")===r,l=a.matches("input, select, textarea")?a:a.querySelector("input, select, textarea");a.style.display=u?"block":"none",l&&(l.required=u,u||(l.value=""))})}}function j(){document.querySelectorAll("[data-custom-dropdown]").forEach(e=>{let n=document.createElement("input");n.type="hidden",n.name=e.dataset.name||"custom-dropdown",n.setAttribute("required",e.dataset.required==="true"||!1),n.value="",e.appendChild(n);let t=e.querySelector(".dropdown-selected-value");e.querySelectorAll(".dropdown-item").forEach(r=>{r.addEventListener("click",i=>{i.preventDefault();let a=r.dataset.value,u=r.cloneNode(!0);u.style.padding=0,t.innerHTML="",t.appendChild(u),n.value=a})})})}function J(e,n,t=30){let c=document.querySelector(e),r=document.querySelector(n),i=new DateRangePicker(c,{format:"dd. MM yyyy"}),a=t;return i.setMinimumDays=u=>{a=u},i.validateDateRange=()=>{let[u,l]=i.getDates();u&&l&&Math.floor((l-u)/864e5)<a?(r.setCustomValidity(`You need to choose a minimum of ${a} days.`),i.setDates(u,new Date(u.getTime()+a*24*60*60*1e3))):r.setCustomValidity(""),r.reportValidity()},c.addEventListener("changeDate",i.validateDateRange),{rangepicker:i,datesInput:c,startDateField:r}}function Q(){let e=document.querySelectorAll(".form-step"),n=document.querySelectorAll(".form-wizard-step .form-wizard-step-progress"),t=0;function c(l){e.forEach((o,s)=>{o.style.display=s===l?"block":"none"}),n.forEach((o,s)=>{s<l||s===l?o.classList.add("active"):o.classList.remove("active")})}function r(){let l=e[t].querySelectorAll("input, select, textarea"),o=[];return l.forEach(s=>{let p=s.type==="hidden"||s.offsetParent===null;if(s.required&&(!s.value||s.value.trim()==="")){let y=s.dataset.name||s.name||s.placeholder||"Unnamed field";o.push(`${y} is required.`)}if(!p&&s.value&&!s.checkValidity()){let f=s.name||s.placeholder||"Unnamed field";o.push(`${f} is invalid.`)}}),o}function i(l,o){let s=document.querySelector(l);if(!s)return;s.innerHTML="";let p=document.createElement("ul");o.forEach(f=>{let y=document.createElement("li");y.textContent=f,p.appendChild(y)}),s.appendChild(p)}function a(l){let o=document.querySelector(l);o&&(o.innerHTML="")}document.querySelectorAll(".form-next-step-btn").forEach(l=>{l.addEventListener("click",()=>{if(l.getAttribute("disabled")==="true")return;let o=r(),s=`#error-list-step-${t}`;a(s),o.length==0?(t=Math.min(t+1,e.length-1),t===e.length-1&&u(),c(t)):i(s,o)})});function u(){document.querySelectorAll('[id^="review-"]').forEach(o=>{let s=o.dataset.fieldname;try{let p=document.querySelector(`[name="${s}"]`).value;o.innerText=p}catch{}})}document.querySelectorAll(".form-previous-step-btn").forEach(l=>{l.addEventListener("click",()=>{t=Math.max(t-1,0),c(t)})}),c(t)}function Y(){document.getElementById("close-button").addEventListener("click",function(){let e=document.referrer,n=window.location.hostname,t=null;try{t=e?new URL(e).hostname:null}catch{t=null}window.history.length>1&&t===n?window.history.back():window.location.href="/"})}var h="EUR",N=null;document.addEventListener("DOMContentLoaded",function(){Y(),_(),Q(),j(),N=J("#dates-start-end-group","#Start-Date"),ne(),re(),se(),oe(),ie()});function oe(){let e=new URLSearchParams(window.location.search),n=e.get("destination"),t=e.get("edition"),c=e.get("room"),r=e.get("guests");n&&G("#destination-dropdown",n,"data-destinationslug");let i=t&&G("#edition-dropdown",t,"data-editionslug");if(c&&G("#room-dropdown",c,"data-roomslug"),r){let a=document.getElementById("Guests");a&&(a.value=r)}if(i){let a=i.dataset.startdate,u=i.dataset.enddate,l=N.rangepicker;l.setOptions({minDate:a,maxDate:u}),l.setDates(a,u)}}function ne(){let e=document.querySelector("#destination-dropdown"),n=document.querySelector("#edition-dropdown"),t=n.querySelector(".dropdown-selected-value"),c=t.innerHTML,r=document.querySelector("#room-dropdown"),i=r.querySelector(".dropdown-selected-value"),a=e.querySelectorAll(".dropdown-item"),u=n.querySelectorAll(".dropdown-item"),l=r.querySelectorAll(".dropdown-item");function o(s,p){t.setAttribute("disabled",s===""?"true":"false"),i.setAttribute("disabled",s===""?"true":"false"),t.innerHTML=c,i.innerHTML=c,h=p,[...u,...l].forEach(f=>{let y=f.dataset.destinationslug===s;f.style.display=y?"flex":"none"})}o("",h),a.forEach(s=>{s.addEventListener("click",function(){o(this.dataset.destinationslug,this.dataset.currency)})})}function G(e,n,t){let c=document.querySelectorAll(`${e} .dropdown-item`),r=c&&Array.from(c).find(i=>i.getAttribute(t)===n);return r&&r.click(),r}function re(){let n=document.querySelector("#edition-dropdown").querySelectorAll(".dropdown-item"),t=document.querySelector("#dates-start-end-group");function c(r,i){let a=t.rangepicker;a.setOptions({minDate:r,maxDate:i}),a.setDates(r,i)}n.forEach(r=>{r.addEventListener("click",function(){c(this.dataset.startdate,this.dataset.enddate)})})}function se(){document.querySelector("#dates-start-end-group").addEventListener("changeDate",()=>{I(),K()}),document.querySelector("#room-dropdown").querySelectorAll(".dropdown-item").forEach(r=>{r.addEventListener("click",()=>{I();let i=r.getAttribute("data-allow-weekly-booking"),a=N.rangepicker;a.setMinimumDays(i==="Enabled"?7:30),a.validateDateRange()})}),document.querySelector("#Guests").addEventListener("change",()=>{I()})}function ie(){K(),I()}function K(){let n=document.querySelector("#dates-start-end-group").rangepicker,t=document.querySelector(".discount-info-blue"),c=document.querySelector(".discount-info-green"),[r,i]=n.getDates(),a=F(r,i);!r||!i||a<=2?(t.style.display="flex",c.style.display="none"):(t.style.display="none",c.style.display="flex")}function I(){let e=document.querySelectorAll(".price-info-card"),t=document.querySelector("#dates-start-end-group").rangepicker,c=document.querySelector("#destination-dropdown .dropdown-selected-value .dropdown-item"),r=document.querySelector("#edition-dropdown .dropdown-selected-value .dropdown-item"),i=document.querySelector("#room-dropdown .dropdown-selected-value .dropdown-item"),a=document.querySelector("#Guests"),u=c?c.dataset.destinationslug:"",l=r?r.dataset.editionslug:"",o=i?i.dataset.roomslug:"",s=i?i.getAttribute("data-allow-weekly-booking")==="Enabled":!1,[p,f]=t.getDates(),y=a?parseInt(a.value):0;if(u&&l&&o&&p&&f&&y>0){let g=z();e.forEach(D=>{D.style.display="flex",ce(D,g,l,o,p,f,y,s)});let E={day:"numeric",month:"short",year:"numeric"},q=p.toLocaleDateString("en-GB",{day:"numeric",month:"short"}).replace(",",""),x=f.toLocaleDateString("en-GB",E).replace(",","");document.querySelectorAll(".total-dates").forEach(D=>D.innerHTML=`${q} - ${x}`)}else e.forEach(g=>g.style.display="none")}function ce(e,n,t,c,r,i,a,u){function l(d){return d===1?"st":d===2?"nd":d===3?"rd":"th"}function o(d,m){d&&(d.style.display=m)}function s(d,m,k){!d||!m||(m.style.pointerEvents=k?"auto":"none",m.style.backgroundColor=k?"var(--_colors---primary)":"var(--_colors---light-silver)",m.style.opacity=k?1:.3,d.setAttribute("disabled",!k))}function p(){V.innerText="No room price found for the selected season or room.",o(D,"none"),o(g,"none"),o(E,"none"),o(x?.parentElement,"none"),o(H,"none"),o(q,"none"),s(P,U,!1),W.forEach(d=>o(d,"none")),L&&(L.value=0)}function f(){o(D,"block"),o(g,"block"),o(x?.parentElement,"flex"),o(H,"block"),o(q,"block"),s(P,U,!0),W.forEach(d=>o(d,"block"))}let y=F(r,i),g=e.querySelector(".room-price"),E=e.querySelector(".room-price-discount"),q=e.querySelector(".room-price-month-desc"),x=e.querySelector(".total-guests"),D=e.querySelector(".total-totalprice"),X=D.firstElementChild,V=e.querySelector(".room-price-breakdown"),H=e.querySelector(".total-dates"),P=document.querySelector("#form-next-step-btn-step-1"),U=P?P.querySelector("a"):null,b=n.find(d=>d.editionSlug===t&&d.roomSlug===c),W=e.querySelectorAll(".price-info-card-title"),L=document.querySelector('[name="Total-Price"]');if(!b){p();return}f();let $=O(b.basePriceWeek),C=b.basePriceMonth,Z=b.discountMonth2,ee=b.discountMonth3,M=0,A=[],R=Math.round((i-r)/(1e3*60*60*24));if(y<1&&u&&$){o(E,"none"),g.innerText=`${S($,h)}`,q.innerText="per week";let m=$/7*R;A.push({text:`${R} days: ${S(m,h)}`}),M=m}else if(y>=1){let d=R,m=1,k=0,te=0;for(;d>0;){let w=0;m===1?w=0:m===2?w=Z:m>=3&&(w=ee),k=w;let T=d>=30?30:d;te=T;let B=C*(1-w/100)/30*T;M+=B,A.push({text:T===30?`Month ${m}: ${S(B,h)}`:`+ ${d} days: ${S(B,h)}`,discount:w,month:m}),d-=T,m++}let v=A[A.length-1];if(v&&v.discount>0){let w=v.month<=3?`${v.month}${l(v.month)} month`:"from 3rd month";E.innerText=`${v.discount.toFixed(1)}% discount - ${w}`,o(E,"flex"),g.innerText=`${S(C*(1-v.discount/100),h)}`,q.innerText=w}else o(E,"none"),g.innerText=`${S(C,h)}`,q.innerText="1st month"}V.innerHTML=A.map(d=>d.text).join("<br>"),x.innerText=`${a} x Person`,X.innerText=`${S(M,h)}`,L&&(L.value=`${S(M,h)}`)}})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../utils/commonUtils.js", "../utils/formUtils.js", "../utils/close-page.js", "../pages/book-workation/book-workation.js", "../pages/book-workation/index.js"],
4
- "sourcesContent": ["\n// Get all room price data - this is done by a collection list element creating:\n// < script type=\"application/json\" class=\"room-price-data\"> \n// {\n// \"roomSlug\": \"\",\n// \"editionSlug\": \"\",\n// \"basePriceWeek\": ,\n// \"basePriceMonth\": ,\n// \"discountMonth2\": ,\n// \"discountMonth3\":\n// }\n// </ script > \nexport function getAllRoomPrices(editionSlugFilter) {\n const priceElements = document.querySelectorAll('.room-price-data');\n const roomPrices = Array.from(priceElements).map(x => JSON.parse(x.textContent));\n if (!editionSlugFilter) {\n \treturn roomPrices;\n }\n return roomPrices.filter((x) => x.editionSlug === editionSlugFilter)\n}\n\n// calculate month difference while 1 month is always 30 days\nexport function getMonthDifference(startDate, endDate) {\n if (!startDate || !endDate) return 0;\n return Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24 * 30)); \n}\n\nexport function formatPrice(price, currency) {\n\t// That\u2019s the locale for German, which uses the formatting style we\u2019re after. \n // We could also use 'fr-FR', 'it-IT', etc. \u2014 most European locales format this way.\n return new Intl.NumberFormat('de-DE', {\n style: 'currency',\n \tcurrency,\n currencyDisplay: 'code'\n }).format(price);\n}\n\nexport function parseDecimalFromString(price, defaultValue = null) {\n return !isNaN(parseFloat(price))\n ? parseFloat(price)\n : defaultValue; \n}\n", "/**\n * Conditional Form Fields Script (Generic & Reusable)\n *\n * This script enables conditional visibility and required-state for form fields\n * based on trigger inputs (like dropdowns or radios).\n *\n * \u2705 How to use:\n * 1. Add `data-trigger=\"yourTriggerName\"` to the input controlling the logic (e.g. <select> or <input>).\n * 2. Add `data-condition-trigger=\"yourTriggerName\"` to any form field container that should be shown conditionally.\n * 3. Add `data-condition-value=\"triggerValue\"` to define when that field should be visible.\n * 4. Inside the conditional container, set form elements to `required` \u2014 the script toggles this automatically.\n *\n * This allows multiple trigger/condition pairs on the same page without extra JS.\n */\nexport function initConditionalFormFields() {\n const triggers = document.querySelectorAll('[data-trigger]');\n\n triggers.forEach((trigger) => {\n trigger.addEventListener('change', () => updateConditionalFields(trigger));\n updateConditionalFields(trigger); // Run on load\n });\n\n function updateConditionalFields(trigger) {\n const triggerName = trigger.getAttribute('data-trigger');\n const triggerValue = trigger.value;\n\n const conditionals = document.querySelectorAll(`[data-condition-trigger=\"${triggerName}\"]`);\n\n conditionals.forEach((field) => {\n const shouldShow = field.getAttribute('data-condition-value') === triggerValue;\n const input = field.matches('input, select, textarea') ? field : field.querySelector('input, select, textarea');\n\n field.style.display = shouldShow ? 'block' : 'none';\n if (input) {\n input.required = shouldShow;\n if (!shouldShow) input.value = '';\n }\n });\n }\n}\n\n/** This script\n * - loops through all custom dropdowns with \"data-custom-dropdown\" attribute\n * - sets the selected value as selected in the dropdown\n * - creates a hidden input for form data\n * - sets the selected value from \"data-value\" to the hidden input\n **/\nexport function initCustomDropdowns() {\n document.querySelectorAll('[data-custom-dropdown]').forEach((dropdown) => {\n // Create the hidden input\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = dropdown.dataset.name || 'custom-dropdown';\n input.setAttribute('required', dropdown.dataset.required === 'true' || false);\n input.value = ''; // Or set a default value if needed\n\n // Append it to the dropdown or its closest form\n dropdown.appendChild(input);\n\n const toggle = dropdown.querySelector('.dropdown-selected-value');\n const links = dropdown.querySelectorAll('.dropdown-item');\n\n links.forEach((link) => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n const value = link.dataset.value;\n const content = link.cloneNode(true);\n content.style.padding = 0; //reset paddings from dropdown-item\n\n // Update visual\n toggle.innerHTML = '';\n toggle.appendChild(content);\n\n // Set hidden field\n input.value = value;\n });\n });\n });\n}\n\n\n\n// Setting up daterange-pickers\n// Docs: https://mymth.github.io/vanillajs-datepicker/\nexport function initDateRangePickers(groupSelector, startDateSelector, minimumDays = 30) {\n const datesInput = document.querySelector(groupSelector);\n const startDateField = document.querySelector(startDateSelector);\n const rangepicker = new DateRangePicker(datesInput, {\n format: 'dd. MM yyyy',\n });\n\n // Add an event listener to validate the date range\n let currentMinimumDays = minimumDays;\n\n // Expose a method to update minimumDays dynamically\n rangepicker.setMinimumDays = (days) => {\n currentMinimumDays = days;\n };\n\n rangepicker.validateDateRange = () => {\n const [startDate, endDate] = rangepicker.getDates();\n\n if (startDate && endDate) {\n const differenceInDays = Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24));\n if (differenceInDays < currentMinimumDays) {\n startDateField.setCustomValidity(`You need to choose a minimum of ${currentMinimumDays} days.`);\n // Set end date to {{currentMinimumDays}} days after start date\n rangepicker.setDates(startDate, new Date(startDate.getTime() + currentMinimumDays * 24 * 60 * 60 * 1000)); \n } else {\n startDateField.setCustomValidity('');\n }\n } else {\n startDateField.setCustomValidity('');\n }\n // Trigger form validation\n startDateField.reportValidity();\n }\n\n datesInput.addEventListener('changeDate', rangepicker.validateDateRange);\n\n return { rangepicker, datesInput, startDateField };\n}\n\n\n/**\n * This script is responsible for\n * - the navigation of the multi step field\n * - update of the wizard step indicators\n * - form validation of all form elements of the current step\n **/\nexport function initFormWizardSteps() {\n const steps = document.querySelectorAll('.form-step');\n const stepIndicators = document.querySelectorAll(\n '.form-wizard-step .form-wizard-step-progress'\n );\n let currentStep = 0;\n\n function showStep(index) {\n steps.forEach((step, i) => {\n step.style.display = i === index ? 'block' : 'none';\n });\n\n stepIndicators.forEach((indicator, i) => {\n if (i < index || i === index) {\n indicator.classList.add('active');\n } else {\n indicator.classList.remove('active');\n }\n });\n }\n\n function validateCurrentStep() {\n const currentInputs = steps[currentStep].querySelectorAll('input, select, textarea');\n const errors = [];\n\n currentInputs.forEach((input) => {\n const isHidden = input.type === 'hidden' || input.offsetParent === null;\n\n if (input.required) {\n const isEmpty = !input.value || input.value.trim() === '';\n if (isEmpty) {\n const label = input.dataset.name || input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is required.`);\n }\n }\n\n // Custom type validation (e.g., email)\n if (!isHidden && input.value && !input.checkValidity()) {\n const label = input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is invalid.`);\n }\n });\n return errors;\n }\n\n function showErrors(containerId, errorMessages) {\n const container = document.querySelector(containerId);\n\n if (!container) return;\n\n // Clear any previous errors\n container.innerHTML = '';\n\n // Create <ul> element\n const ul = document.createElement('ul');\n\n // Add each error as <li>\n errorMessages.forEach((msg) => {\n const li = document.createElement('li');\n li.textContent = msg;\n ul.appendChild(li);\n });\n\n // Append the list to the container\n container.appendChild(ul);\n }\n\n function resetErrors(containerId) {\n const container = document.querySelector(containerId);\n if (container) {\n container.innerHTML = '';\n }\n }\n\n document.querySelectorAll('.form-next-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n if (btn.getAttribute('disabled') === 'true') {\n return;\n }\n\n const errors = validateCurrentStep();\n const errorListId = `#error-list-step-${currentStep}`;\n resetErrors(errorListId);\n if (errors.length == 0) {\n currentStep = Math.min(currentStep + 1, steps.length - 1);\n const isLastStep = currentStep === steps.length - 1;\n if (isLastStep) {\n prepareReviewFields(); // this loops through all fields with #review-* and sets the corresponding value\n }\n showStep(currentStep);\n } else {\n showErrors(errorListId, errors);\n }\n });\n });\n\n function prepareReviewFields() {\n const reviewElements = document.querySelectorAll('[id^=\"review-\"]');\n\n // Loop through the matched elements\n reviewElements.forEach((element) => {\n const fieldName = element.dataset.fieldname;\n try {\n const fieldValue = document.querySelector(`[name=\"${fieldName}\"]`).value;\n element.innerText = fieldValue;\n } catch {}\n });\n }\n\n document.querySelectorAll('.form-previous-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n currentStep = Math.max(currentStep - 1, 0);\n showStep(currentStep);\n });\n });\n\n showStep(currentStep); // Init\n}", "\n/**\n * Initializes a X button on the page with ID \"close-button\":\n * When clicked it tries to receive the previous page\n * - If there was a previous page and that page was on the same domain -> navigate there\n * - If there was no previous page or previous page was not on same domain -> navigate home \"/\"\n */\nexport function initCloseButtonClick() {\n document.getElementById(\"close-button\").addEventListener(\"click\", function () {\n const referrer = document.referrer;\n const currentDomain = window.location.hostname;\n\n // Extract the domain from the referrer URL\n let referrerDomain = null;\n try {\n referrerDomain = referrer ? new URL(referrer).hostname : null;\n } catch (e) {\n referrerDomain = null;\n }\n\n if (window.history.length > 1 && referrerDomain === currentDomain) {\n window.history.back();\n } else {\n window.location.href = \"/\";\n }\n });\n}", "\nimport { getAllRoomPrices, getMonthDifference, formatPrice, parseDecimalFromString } from \"../../utils/commonUtils\";\nimport { initConditionalFormFields, initFormWizardSteps, initCustomDropdowns, initDateRangePickers } from \"../../utils/formUtils\";\nimport { initCloseButtonClick } from \"../../utils/close-page\";\n\nlet selectedCurrency = \"EUR\"; // default currency\nlet rangePickerElements = null; // global variable to store the range picker instance\n\ndocument.addEventListener('DOMContentLoaded', function () {\n initCloseButtonClick();\n \n //form preparation\n initConditionalFormFields();\n initFormWizardSteps();\n initCustomDropdowns();\n \n //init controls\n rangePickerElements = initDateRangePickers('#dates-start-end-group', '#Start-Date');\n initDestinationDropdown();\n initSeasonDropDown();\n\n initPriceUpdateListeners();\n\n //set inital form values\n initQueryParamFormValues();\n\n //init info/card boxes on the right side of the form\n initCardInfoBoxes();\n});\n\n\n/**\n * This script handles initial setting of form values that come from query parameters\n **/\nfunction initQueryParamFormValues () {\n const urlParams = new URLSearchParams(window.location.search);\n const queryDestination = urlParams.get('destination');\n const queryEdition = urlParams.get('edition');\n const queryRoom = urlParams.get('room');\n const queryGuestsCount = urlParams.get('guests');\n\n queryDestination &&\n selectDropDownValue('#destination-dropdown', queryDestination, 'data-destinationslug');\n const selectedEdition = queryEdition && selectDropDownValue('#edition-dropdown', queryEdition, 'data-editionslug');\n queryRoom && selectDropDownValue('#room-dropdown', queryRoom, 'data-roomslug');\n\n // Guests dropdown is not a custom dropdown\n if (queryGuestsCount) {\n const guestDropdown = document.getElementById('Guests');\n if (guestDropdown) {\n guestDropdown.value = queryGuestsCount;\n }\n }\n\n if (selectedEdition) {\n const seasonStartDate = selectedEdition.dataset.startdate;\n const seasonEndDate = selectedEdition.dataset.enddate; // TODO: receive length of stay to determine end date\n \n const rangepicker = rangePickerElements.rangepicker;\n rangepicker.setOptions({\n minDate: seasonStartDate,\n maxDate: seasonEndDate,\n });\n rangepicker.setDates(seasonStartDate, seasonEndDate);\n }\n}\n\n\n/**\n * This script handles the dependencies of the destination/location dropdown\n * When destination dropdown value changed:\n * - Update Season/Edition dropdown and show only seasons/editions from the specific location\n * - Update Room dropdown and show only rooms from the specific location\n **/\nfunction initDestinationDropdown() {\n const locationDropdown = document.querySelector('#destination-dropdown');\n\n const editionDropdown = document.querySelector('#edition-dropdown');\n const editionToggle = editionDropdown.querySelector('.dropdown-selected-value');\n const editionPlaceholder = editionToggle.innerHTML;\n\n const roomDropdown = document.querySelector('#room-dropdown');\n const roomToggle = roomDropdown.querySelector('.dropdown-selected-value');\n\n const locationDropdownItems = locationDropdown.querySelectorAll('.dropdown-item');\n const editionDropdownItems = editionDropdown.querySelectorAll('.dropdown-item');\n const roomDropdownItems = roomDropdown.querySelectorAll('.dropdown-item');\n\n function onDestinationChange(selectedDestinationSlug, destinationCurrency) {\n editionToggle.setAttribute('disabled', selectedDestinationSlug === '' ? 'true' : 'false');\n roomToggle.setAttribute('disabled', selectedDestinationSlug === '' ? 'true' : 'false');\n\n // Clear selected edition option\n editionToggle.innerHTML = editionPlaceholder;\n roomToggle.innerHTML = editionPlaceholder;\n\n selectedCurrency = destinationCurrency;\n\n [...editionDropdownItems, ...roomDropdownItems].forEach((item) => {\n const visible = item.dataset.destinationslug === selectedDestinationSlug;\n item.style.display = visible ? 'flex' : 'none';\n });\n }\n\n // Initial population\n onDestinationChange('', selectedCurrency);\n\n // Update on change\n locationDropdownItems.forEach((locationItem) => {\n locationItem.addEventListener('click', function () {\n onDestinationChange(this.dataset.destinationslug, this.dataset.currency);\n });\n });\n}\n\n\nfunction selectDropDownValue(selector, value, dataAttribute) {\n const dropdownItems = document.querySelectorAll(`${selector} .dropdown-item`);\n const item =\n dropdownItems &&\n Array.from(dropdownItems).find((item) => item.getAttribute(dataAttribute) === value);\n item && item.click();\n return item;\n}\n\n\n/**\n * This script handles the dependencies of the season dropdown\n * When season dropdown value changed:\n * - Reset the start and end dates\n * - Set minimum start date to season start date\n * - Set maximum end date to season end date\n **/\nfunction initSeasonDropDown() {\n const editionDropdown = document.querySelector('#edition-dropdown');\n const editionDropdownItems = editionDropdown.querySelectorAll('.dropdown-item');\n\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n\n function onSeasonChange(seasonStartDate, seasonEndDate) {\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n\n rangepicker.setOptions({\n minDate: seasonStartDate,\n maxDate: seasonEndDate,\n });\n rangepicker.setDates(seasonStartDate, seasonEndDate);\n }\n\n // Update on change\n editionDropdownItems.forEach((edition) => {\n edition.addEventListener('click', function () {\n onSeasonChange(this.dataset.startdate, this.dataset.enddate);\n });\n });\n}\n\n/**\n * Initializes event listeners for dropdown and date picker changes on the booking page.\n *\n * - Listens for changes in the start/end date input group and updates price and discount info.\n * - Listens for room selection changes, updates price info, and adjusts the date range picker\n * based on the selected room's weekly booking allowance.\n * - Listens for changes in the guest count dropdown and updates price info accordingly.\n */\nfunction initPriceUpdateListeners() {\n // react on change of start / end date\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n datesInputGroup.addEventListener('changeDate', () => {\n updatePriceInfoCard();\n updateDiscountBoxes();\n });\n\n // react on change of room\n const roomDropdown = document.querySelector('#room-dropdown');\n const roomDropdownItems = roomDropdown.querySelectorAll('.dropdown-item');\n roomDropdownItems.forEach((roomItem) => {\n roomItem.addEventListener('click', () => {\n updatePriceInfoCard();\n\n const allowWeeklyBooking = roomItem.getAttribute('data-allow-weekly-booking');\n // change date range picker to the selected room\n const rangepicker = rangePickerElements.rangepicker;\n rangepicker.setMinimumDays(allowWeeklyBooking === 'Enabled' ? 7 : 30);\n rangepicker.validateDateRange();\n });\n });\n\n //react on guest count change\n const guestsDropdown = document.querySelector('#Guests');\n guestsDropdown.addEventListener('change', () => {\n updatePriceInfoCard();\n });\n}\n\n\n/**\n * This script handles visual and textual changes on the content on top of the image next to the form\n * depending on form values.\n **/\nfunction initCardInfoBoxes() {\n updateDiscountBoxes();\n updatePriceInfoCard();\n}\n\n\nfunction updateDiscountBoxes() {\n //reset discount infos\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n \n const discountInfoBlue = document.querySelector('.discount-info-blue');\n const discountInfoGreen = document.querySelector('.discount-info-green');\n\n const [startDate, endDate] = rangepicker.getDates();\n // calculate month difference while 1 month is always 30 days\n const monthDifference = getMonthDifference(startDate, endDate);\n \n if ((!startDate || !endDate) || monthDifference <= 2) {\n discountInfoBlue.style.display = 'flex';\n discountInfoGreen.style.display = 'none';\n } else {\n discountInfoBlue.style.display = 'none';\n discountInfoGreen.style.display = 'flex';\n }\n}\n\n\n//determine if we display the price info card or not\n// only show, if \n// - destination is set\n// - edition is set\n// - room is set\n// - dates are set\n// - (guests are always set)\nfunction updatePriceInfoCard() {\n const priceInfoCards = document.querySelectorAll('.price-info-card');\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n const selectedDestinationItem = document.querySelector('#destination-dropdown .dropdown-selected-value .dropdown-item');\n const selectedEditionItem = document.querySelector('#edition-dropdown .dropdown-selected-value .dropdown-item');\n const selectedRoomItem = document.querySelector('#room-dropdown .dropdown-selected-value .dropdown-item');\n const selectedGuestsItem = document.querySelector('#Guests');\n\n const destinationSlug = selectedDestinationItem ? selectedDestinationItem.dataset.destinationslug : '';\n const editionSlug = selectedEditionItem ? selectedEditionItem.dataset.editionslug : '';\n const roomSlug = selectedRoomItem ? selectedRoomItem.dataset.roomslug : '';\n const allowWeeklyBooking = selectedRoomItem ? selectedRoomItem.getAttribute('data-allow-weekly-booking') === 'Enabled' : false;\n const [startDate, endDate] = rangepicker.getDates(); \n const selectedGuestsCount = selectedGuestsItem ? parseInt(selectedGuestsItem.value) : 0;\n\n if (destinationSlug && editionSlug && roomSlug && startDate && endDate && selectedGuestsCount > 0) {\n const editionRoomPrices = getAllRoomPrices();\n priceInfoCards.forEach(priceInfoCard => { \n priceInfoCard.style.display = 'flex';\n updateRoomPriceAndBreakdown(priceInfoCard, editionRoomPrices, editionSlug, roomSlug, startDate, endDate, selectedGuestsCount, allowWeeklyBooking);\n });\n\n // update dates\n const options = { day: 'numeric', month: 'short', year: 'numeric' };\n const formattedStartDate = startDate.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }).replace(',', '');\n const formattedEndDate = endDate.toLocaleDateString('en-GB', options).replace(',', '');\n document.querySelectorAll('.total-dates').forEach(x => x.innerHTML = `${formattedStartDate} - ${formattedEndDate}`);\n } else {\n priceInfoCards.forEach(x => x.style.display = 'none');\n }\n}\n\n\n// update room price & breakdown\nfunction updateRoomPriceAndBreakdown(priceInfoCard, editionRoomPrices, editionSlug, roomSlug, startDate, endDate, guestsCount, allowWeeklyBooking) {\n const monthDifference = getMonthDifference(startDate, endDate);\n\n const roomPriceElement = priceInfoCard.querySelector('.room-price');\n const discountBox = priceInfoCard.querySelector('.room-price-discount');\n const roomPriceDescription = priceInfoCard.querySelector('.room-price-month-desc');\n const totalGuestsElement = priceInfoCard.querySelector('.total-guests');\n \n const totalPriceElement = priceInfoCard.querySelector('.total-totalprice');\n const totalPriceText = totalPriceElement.firstElementChild;\n const priceBreakdownElement = priceInfoCard.querySelector('.room-price-breakdown');\n const datesElement = priceInfoCard.querySelector('.total-dates');\n\n const nextButton = document.querySelector('#form-next-step-btn-step-1'); // we have this only one time on the page\n const nextButtonAnchor = nextButton.querySelector('a');\n\n const roomPriceInfo = editionRoomPrices.find((x) => x.editionSlug === editionSlug && x.roomSlug === roomSlug);\n const priceInfoCardTitles = priceInfoCard.querySelectorAll('.price-info-card-title');\n\n const hiddenTotalPriceField = document.querySelector(`[name=\"Total-Price\"]`);\n\n if (!roomPriceInfo) {\n priceBreakdownElement.innerText = 'No room price found for the selected season or room.';\n totalPriceElement.style.display = 'none';\n roomPriceElement.style.display = 'none';\n discountBox.style.display = 'none';\n totalGuestsElement.parentElement.style.display = 'none';\n datesElement.style.display = 'none';\n roomPriceDescription.style.display = 'none';\n nextButtonAnchor.style.pointerEvents = 'none';\n nextButtonAnchor.style.backgroundColor = 'var(--_colors---light-silver)';\n nextButtonAnchor.style.opacity = 0.3;\n nextButton.setAttribute('disabled', true);\n priceInfoCardTitles.forEach(x => x.style.display = 'none');\n hiddenTotalPriceField.value = 0;\n return;\n }\n \n //reset visual elements\n totalPriceElement.style.display = 'block';\n roomPriceElement.style.display = 'block';\n totalGuestsElement.parentElement.style.display = 'flex';\n datesElement.style.display = 'block';\n roomPriceDescription.style.display = 'block';\n nextButtonAnchor.style.pointerEvents = 'auto';\n nextButtonAnchor.style.backgroundColor = 'var(--_colors---primary)';\n nextButtonAnchor.style.opacity = 1;\n nextButton.setAttribute('disabled', false);\n priceInfoCardTitles.forEach(x => x.style.display = 'block');\n\n const basePriceWeek = parseDecimalFromString(roomPriceInfo.basePriceWeek); // weekly price is string and can be empty\n const basePriceMonth = roomPriceInfo.basePriceMonth;\n const discountMonth2 = roomPriceInfo.discountMonth2;\n const discountMonth3 = roomPriceInfo.discountMonth3;\n\n let totalPrice = 0;\n let breakdown = [];\n let remainingDaysDiscount = 0;\n\n const getMonthNumberEnding = (month) => month === 1 ? 'st' : (month === 2 ? 'nd' : (month === 3 ? 'rd' : 'th'));\n\n if (monthDifference < 1 && allowWeeklyBooking && basePriceWeek) {\n const weeklyPrice = basePriceWeek;\n discountBox.style.display = 'none';\n roomPriceElement.innerText = `${formatPrice(weeklyPrice, selectedCurrency)}`;\n roomPriceDescription.innerText = `per week`;\n } else if (monthDifference >= 1) {\n totalPrice += basePriceMonth;\n breakdown.push(`Month 1: ${formatPrice(totalPrice, selectedCurrency)}`);\n discountBox.style.display = 'none';\n roomPriceElement.innerText = `${formatPrice(totalPrice, selectedCurrency)}`;\n roomPriceDescription.innerText = `1st month`;\n }\n\n for (let month = 2; month <= monthDifference; month++) {\n let discount = 0;\n if (month === 2) {\n discount = discountMonth2;\n } else if (month >= 3) {\n discount = discountMonth3;\n }\n\n const monthlyPrice = basePriceMonth * (1 - discount / 100);\n totalPrice += monthlyPrice;\n breakdown.push(`Month ${month}: ${formatPrice(monthlyPrice, selectedCurrency)}`);\n\n let monthText = month <= 3 \n ? `${month}${getMonthNumberEnding(month)} month`\n : `from 3rd month`;\n\n if (discount > 0) {\n discountBox.innerText = `${discount.toFixed(1)}% discount - ${monthText}`;\n discountBox.style.display = 'flex';\n }\n\n roomPriceElement.innerHTML = `${formatPrice(monthlyPrice, selectedCurrency)}`;\n roomPriceDescription.innerText = monthText;\n remainingDaysDiscount = discount;\n }\n\n const remainingDays = (endDate - startDate) / (1000 * 60 * 60 * 24) - monthDifference * 30;\n if (remainingDays > 0) {\n const basePrice = (monthDifference >= 1) ? basePriceMonth : basePriceWeek;\n const daysDivider = (monthDifference >= 1) ? 30 : 7;\n const dailyRate = basePrice * (1 - remainingDaysDiscount / 100) / daysDivider;\n const remainingPrice = dailyRate * remainingDays;\n totalPrice += remainingPrice;\n breakdown.push(`${monthDifference >= 1 ? '+' : ''} ${Math.round(remainingDays)} days: ${formatPrice(remainingPrice, selectedCurrency)}`);\n }\n\n priceBreakdownElement.innerHTML = breakdown.join('<br>');\n totalGuestsElement.innerText = `${guestsCount} x Person`;\n totalPriceText.innerText = `${formatPrice(totalPrice, selectedCurrency)}`;\n hiddenTotalPriceField.value = `${formatPrice(totalPrice, selectedCurrency)}`; //setting the value in the hidden field for review and sending in form\n}\n", "import \"./book-workation\";"],
5
- "mappings": "+jBAYO,SAASA,EAAiBC,EAAmB,CAClD,IAAMC,EAAgB,SAAS,iBAAiB,kBAAkB,EAC5DC,EAAa,MAAM,KAAKD,CAAa,EAAE,IAAIE,GAAK,KAAK,MAAMA,EAAE,WAAW,CAAC,EAC/E,OAAKH,EAGEE,EAAW,OAAQC,GAAMA,EAAE,cAAgBH,CAAiB,EAF3DE,CAGV,CAGO,SAASE,EAAmBC,EAAWC,EAAS,CACrD,MAAI,CAACD,GAAa,CAACC,EAAgB,EAC5B,KAAK,OAAOA,EAAUD,IAAc,IAAO,GAAK,GAAK,GAAK,GAAG,CACtE,CAEO,SAASE,EAAYC,EAAOC,EAAU,CAG3C,OAAO,IAAI,KAAK,aAAa,QAAS,CACpC,MAAO,WACR,SAAAA,EACC,gBAAiB,MACnB,CAAC,EAAE,OAAOD,CAAK,CACjB,CAEO,SAASE,EAAuBF,EAAOG,EAAe,KAAM,CACjE,OAAQ,MAAM,WAAWH,CAAK,CAAC,EAE3BG,EADA,WAAWH,CAAK,CAEtB,CAzCA,IAAAI,EAAAC,EAAA,QCcO,SAASC,GAA4B,CACzB,SAAS,iBAAiB,gBAAgB,EAElD,QAASC,GAAY,CAC5BA,EAAQ,iBAAiB,SAAU,IAAMC,EAAwBD,CAAO,CAAC,EACzEC,EAAwBD,CAAO,CACjC,CAAC,EAED,SAASC,EAAwBD,EAAS,CACxC,IAAME,EAAcF,EAAQ,aAAa,cAAc,EACjDG,EAAeH,EAAQ,MAER,SAAS,iBAAiB,4BAA4BE,CAAW,IAAI,EAE7E,QAASE,GAAU,CAC9B,IAAMC,E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gBAAgBE,CAAS,GACvE1B,EAAY,MAAM,QAAU,QAG9BD,EAAiB,UAAY,GAAGwB,EAAYE,EAAcnG,CAAgB,CAAC,GAC3E2E,EAAqB,UAAYyB,EACjCP,EAAwBK,CAC1B,CAEA,IAAMG,GAAiBjD,EAAUD,IAAc,IAAO,GAAK,GAAK,IAAME,EAAkB,GACxF,GAAIgD,EAAgB,EAAG,CACrB,IAAMC,EAAajD,GAAmB,EAAKmC,EAAiBF,EACtDiB,EAAelD,GAAmB,EAAK,GAAK,EAE5CmD,EADYF,GAAa,EAAIT,EAAwB,KAAOU,EAC/BF,EACnCV,GAAca,EACdZ,EAAU,KAAK,GAAGvC,GAAmB,EAAI,IAAM,EAAE,IAAI,KAAK,MAAMgD,CAAa,CAAC,UAAUJ,EAAYO,EAAgBxG,CAAgB,CAAC,EAAE,CACzI,CAEA+E,EAAsB,UAAYa,EAAU,KAAK,MAAM,EACvDhB,EAAmB,UAAY,GAAGJ,CAAW,YAC7CM,EAAe,UAAY,GAAGmB,EAAYN,EAAY3F,CAAgB,CAAC,GACvEqF,EAAsB,MAAQ,GAAGY,EAAYN,EAAY3F,CAAgB,CAAC,EAC5E,IChYA,IAAAyG,GAAAC,EAAA,SAAAC,GAAO",
6
- "names": ["getAllRoomPrices", "editionSlugFilter", "priceElements", "roomPrices", "x", "getMonthDifference", "startDate", "endDate", "formatPrice", "price", "currency", "parseDecimalFromString", "defaultValue", "init_commonUtils", "__esmMin", "initConditionalFormFields", "trigger", "updateConditionalFields", "triggerName", "triggerValue", "field", "shouldShow", "input", "initCustomDropdowns", "dropdown", "toggle", "link", "e", "value", "content", "initDateRangePickers", "groupSelector", "startDateSelector", "minimumDays", "datesInput", "startDateField", "rangepicker", "currentMinimumDays", "days", "startDate", "endDate", "initFormWizardSteps", "steps", "stepIndicators", "currentStep", "showStep", "index", "step", "i", "indicator", "validateCurrentStep", "currentInputs", "errors", "isHidden", "label", "showErrors", "containerId", "errorMessages", "container", "ul", "msg", "li", "resetErrors", "btn", "errorListId", "prepareReviewFields", "element", "fieldName", "fieldValue", "init_formUtils", "__esmMin", "initCloseButtonClick", "referrer", "currentDomain", "referrerDomain", "init_close_page", "__esmMin", "require_book_workation", "__commonJSMin", "init_commonUtils", "init_formUtils", "init_close_page", "selectedCurrency", "rangePickerElements", "initCloseButtonClick", "initConditionalFormFields", "initFormWizardSteps", "initCustomDropdowns", "initDateRangePickers", "initDestinationDropdown", "initSeasonDropDown", "initPriceUpdateListeners", "initQueryParamFormValues", "initCardInfoBoxes", "urlParams", "queryDestination", "queryEdition", "queryRoom", "queryGuestsCount", "selectDropDownValue", "selectedEdition", "guestDropdown", "seasonStartDate", "seasonEndDate", "rangepicker", "locationDropdown", "editionDropdown", "editionToggle", "editionPlaceholder", "roomDropdown", "roomToggle", "locationDropdownItems", "editionDropdownItems", "roomDropdownItems", "onDestinationChange", "selectedDestinationSlug", "destinationCurrency", "item", "visible", "locationItem", "selector", "value", "dataAttribute", "dropdownItems", "datesInputGroup", "onSeasonChange", "edition", "updatePriceInfoCard", "updateDiscountBoxes", "roomItem", "allowWeeklyBooking", "discountInfoBlue", "discountInfoGreen", "startDate", "endDate", "monthDifference", "getMonthDifference", "priceInfoCards", "selectedDestinationItem", "selectedEditionItem", "selectedRoomItem", "selectedGuestsItem", "destinationSlug", "editionSlug", "roomSlug", "selectedGuestsCount", "editionRoomPrices", "getAllRoomPrices", "priceInfoCard", "updateRoomPriceAndBreakdown", "options", "formattedStartDate", "formattedEndDate", "x", "guestsCount", "roomPriceElement", "discountBox", "roomPriceDescription", "totalGuestsElement", "totalPriceElement", "totalPriceText", "priceBreakdownElement", "datesElement", "nextButton", "nextButtonAnchor", "roomPriceInfo", "priceInfoCardTitles", "hiddenTotalPriceField", "basePriceWeek", "parseDecimalFromString", "basePriceMonth", "discountMonth2", "discountMonth3", "totalPrice", "breakdown", "remainingDaysDiscount", "getMonthNumberEnding", "month", "weeklyPrice", "formatPrice", "discount", "monthlyPrice", "monthText", "remainingDays", "basePrice", "daysDivider", "remainingPrice", "require_book_workation", "__commonJSMin", "import_book_workation"]
3
+ "sources": ["../utils/commonUtils.js", "../utils/formUtils.js", "../utils/close-page.js", "../pages/book-workation/book-workation.js"],
4
+ "sourcesContent": ["\n// Get all room price data - this is done by a collection list element creating:\n// < script type=\"application/json\" class=\"room-price-data\"> \n// {\n// \"roomSlug\": \"\",\n// \"editionSlug\": \"\",\n// \"basePriceWeek\": ,\n// \"basePriceMonth\": ,\n// \"discountMonth2\": ,\n// \"discountMonth3\":\n// }\n// </ script > \nexport function getAllRoomPrices(editionSlugFilter) {\n const priceElements = document.querySelectorAll('.room-price-data');\n const roomPrices = Array.from(priceElements).map(x => JSON.parse(x.textContent));\n if (!editionSlugFilter) {\n \treturn roomPrices;\n }\n return roomPrices.filter((x) => x.editionSlug === editionSlugFilter)\n}\n\n// calculate month difference while 1 month is always 30 days\nexport function getMonthDifference(startDate, endDate) {\n if (!startDate || !endDate) return 0;\n return Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24 * 30)); \n}\n\nexport function formatPrice(price, currency) {\n\t// That\u2019s the locale for German, which uses the formatting style we\u2019re after. \n // We could also use 'fr-FR', 'it-IT', etc. \u2014 most European locales format this way.\n return new Intl.NumberFormat('de-DE', {\n style: 'currency',\n \tcurrency,\n currencyDisplay: 'code'\n }).format(price);\n}\n\nexport function parseDecimalFromString(price, defaultValue = null) {\n return !isNaN(parseFloat(price))\n ? parseFloat(price)\n : defaultValue; \n}\n", "/**\n * Conditional Form Fields Script (Generic & Reusable)\n *\n * This script enables conditional visibility and required-state for form fields\n * based on trigger inputs (like dropdowns or radios).\n *\n * \u2705 How to use:\n * 1. Add `data-trigger=\"yourTriggerName\"` to the input controlling the logic (e.g. <select> or <input>).\n * 2. Add `data-condition-trigger=\"yourTriggerName\"` to any form field container that should be shown conditionally.\n * 3. Add `data-condition-value=\"triggerValue\"` to define when that field should be visible.\n * 4. Inside the conditional container, set form elements to `required` \u2014 the script toggles this automatically.\n *\n * This allows multiple trigger/condition pairs on the same page without extra JS.\n */\nexport function initConditionalFormFields() {\n const triggers = document.querySelectorAll('[data-trigger]');\n\n triggers.forEach((trigger) => {\n trigger.addEventListener('change', () => updateConditionalFields(trigger));\n updateConditionalFields(trigger); // Run on load\n });\n\n function updateConditionalFields(trigger) {\n const triggerName = trigger.getAttribute('data-trigger');\n const triggerValue = trigger.value;\n\n const conditionals = document.querySelectorAll(`[data-condition-trigger=\"${triggerName}\"]`);\n\n conditionals.forEach((field) => {\n const shouldShow = field.getAttribute('data-condition-value') === triggerValue;\n const input = field.matches('input, select, textarea') ? field : field.querySelector('input, select, textarea');\n\n field.style.display = shouldShow ? 'block' : 'none';\n if (input) {\n input.required = shouldShow;\n if (!shouldShow) input.value = '';\n }\n });\n }\n}\n\n/** This script\n * - loops through all custom dropdowns with \"data-custom-dropdown\" attribute\n * - sets the selected value as selected in the dropdown\n * - creates a hidden input for form data\n * - sets the selected value from \"data-value\" to the hidden input\n **/\nexport function initCustomDropdowns() {\n document.querySelectorAll('[data-custom-dropdown]').forEach((dropdown) => {\n // Create the hidden input\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = dropdown.dataset.name || 'custom-dropdown';\n input.setAttribute('required', dropdown.dataset.required === 'true' || false);\n input.value = ''; // Or set a default value if needed\n\n // Append it to the dropdown or its closest form\n dropdown.appendChild(input);\n\n const toggle = dropdown.querySelector('.dropdown-selected-value');\n const links = dropdown.querySelectorAll('.dropdown-item');\n\n links.forEach((link) => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n const value = link.dataset.value;\n const content = link.cloneNode(true);\n content.style.padding = 0; //reset paddings from dropdown-item\n\n // Update visual\n toggle.innerHTML = '';\n toggle.appendChild(content);\n\n // Set hidden field\n input.value = value;\n });\n });\n });\n}\n\n\n\n// Setting up daterange-pickers\n// Docs: https://mymth.github.io/vanillajs-datepicker/\nexport function initDateRangePickers(groupSelector, startDateSelector, minimumDays = 30) {\n const datesInput = document.querySelector(groupSelector);\n const startDateField = document.querySelector(startDateSelector);\n const rangepicker = new DateRangePicker(datesInput, {\n format: 'dd. MM yyyy',\n });\n\n // Add an event listener to validate the date range\n let currentMinimumDays = minimumDays;\n\n // Expose a method to update minimumDays dynamically\n rangepicker.setMinimumDays = (days) => {\n currentMinimumDays = days;\n };\n\n rangepicker.validateDateRange = () => {\n const [startDate, endDate] = rangepicker.getDates();\n\n if (startDate && endDate) {\n const differenceInDays = Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24));\n if (differenceInDays < currentMinimumDays) {\n startDateField.setCustomValidity(`You need to choose a minimum of ${currentMinimumDays} days.`);\n // Set end date to {{currentMinimumDays}} days after start date\n rangepicker.setDates(startDate, new Date(startDate.getTime() + currentMinimumDays * 24 * 60 * 60 * 1000)); \n } else {\n startDateField.setCustomValidity('');\n }\n } else {\n startDateField.setCustomValidity('');\n }\n // Trigger form validation\n startDateField.reportValidity();\n }\n\n datesInput.addEventListener('changeDate', rangepicker.validateDateRange);\n\n return { rangepicker, datesInput, startDateField };\n}\n\n\n/**\n * This script is responsible for\n * - the navigation of the multi step field\n * - update of the wizard step indicators\n * - form validation of all form elements of the current step\n **/\nexport function initFormWizardSteps() {\n const steps = document.querySelectorAll('.form-step');\n const stepIndicators = document.querySelectorAll(\n '.form-wizard-step .form-wizard-step-progress'\n );\n let currentStep = 0;\n\n function showStep(index) {\n steps.forEach((step, i) => {\n step.style.display = i === index ? 'block' : 'none';\n });\n\n stepIndicators.forEach((indicator, i) => {\n if (i < index || i === index) {\n indicator.classList.add('active');\n } else {\n indicator.classList.remove('active');\n }\n });\n }\n\n function validateCurrentStep() {\n const currentInputs = steps[currentStep].querySelectorAll('input, select, textarea');\n const errors = [];\n\n currentInputs.forEach((input) => {\n const isHidden = input.type === 'hidden' || input.offsetParent === null;\n\n if (input.required) {\n const isEmpty = !input.value || input.value.trim() === '';\n if (isEmpty) {\n const label = input.dataset.name || input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is required.`);\n }\n }\n\n // Custom type validation (e.g., email)\n if (!isHidden && input.value && !input.checkValidity()) {\n const label = input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is invalid.`);\n }\n });\n return errors;\n }\n\n function showErrors(containerId, errorMessages) {\n const container = document.querySelector(containerId);\n\n if (!container) return;\n\n // Clear any previous errors\n container.innerHTML = '';\n\n // Create <ul> element\n const ul = document.createElement('ul');\n\n // Add each error as <li>\n errorMessages.forEach((msg) => {\n const li = document.createElement('li');\n li.textContent = msg;\n ul.appendChild(li);\n });\n\n // Append the list to the container\n container.appendChild(ul);\n }\n\n function resetErrors(containerId) {\n const container = document.querySelector(containerId);\n if (container) {\n container.innerHTML = '';\n }\n }\n\n document.querySelectorAll('.form-next-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n if (btn.getAttribute('disabled') === 'true') {\n return;\n }\n\n const errors = validateCurrentStep();\n const errorListId = `#error-list-step-${currentStep}`;\n resetErrors(errorListId);\n if (errors.length == 0) {\n currentStep = Math.min(currentStep + 1, steps.length - 1);\n const isLastStep = currentStep === steps.length - 1;\n if (isLastStep) {\n prepareReviewFields(); // this loops through all fields with #review-* and sets the corresponding value\n }\n showStep(currentStep);\n } else {\n showErrors(errorListId, errors);\n }\n });\n });\n\n function prepareReviewFields() {\n const reviewElements = document.querySelectorAll('[id^=\"review-\"]');\n\n // Loop through the matched elements\n reviewElements.forEach((element) => {\n const fieldName = element.dataset.fieldname;\n try {\n const fieldValue = document.querySelector(`[name=\"${fieldName}\"]`).value;\n element.innerText = fieldValue;\n } catch {}\n });\n }\n\n document.querySelectorAll('.form-previous-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n currentStep = Math.max(currentStep - 1, 0);\n showStep(currentStep);\n });\n });\n\n showStep(currentStep); // Init\n}", "\n/**\n * Initializes a X button on the page with ID \"close-button\":\n * When clicked it tries to receive the previous page\n * - If there was a previous page and that page was on the same domain -> navigate there\n * - If there was no previous page or previous page was not on same domain -> navigate home \"/\"\n */\nexport function initCloseButtonClick() {\n document.getElementById(\"close-button\").addEventListener(\"click\", function () {\n const referrer = document.referrer;\n const currentDomain = window.location.hostname;\n\n // Extract the domain from the referrer URL\n let referrerDomain = null;\n try {\n referrerDomain = referrer ? new URL(referrer).hostname : null;\n } catch (e) {\n referrerDomain = null;\n }\n\n if (window.history.length > 1 && referrerDomain === currentDomain) {\n window.history.back();\n } else {\n window.location.href = \"/\";\n }\n });\n}", "import { getAllRoomPrices, getMonthDifference, formatPrice, parseDecimalFromString } from \"../../utils/commonUtils\";\nimport { initConditionalFormFields, initFormWizardSteps, initCustomDropdowns, initDateRangePickers } from \"../../utils/formUtils\";\nimport { initCloseButtonClick } from \"../../utils/close-page\";\n\nlet selectedCurrency = \"EUR\"; // default currency\nlet rangePickerElements = null; // global variable to store the range picker instance\n\ndocument.addEventListener('DOMContentLoaded', function () {\n initCloseButtonClick();\n \n //form preparation\n initConditionalFormFields();\n initFormWizardSteps();\n initCustomDropdowns();\n \n //init controls\n rangePickerElements = initDateRangePickers('#dates-start-end-group', '#Start-Date');\n initDestinationDropdown();\n initSeasonDropDown();\n\n initPriceUpdateListeners();\n\n //set inital form values\n initQueryParamFormValues();\n\n //init info/card boxes on the right side of the form\n initCardInfoBoxes();\n});\n\n\n/**\n * This script handles initial setting of form values that come from query parameters\n **/\nfunction initQueryParamFormValues () {\n const urlParams = new URLSearchParams(window.location.search);\n const queryDestination = urlParams.get('destination');\n const queryEdition = urlParams.get('edition');\n const queryRoom = urlParams.get('room');\n const queryGuestsCount = urlParams.get('guests');\n\n queryDestination &&\n selectDropDownValue('#destination-dropdown', queryDestination, 'data-destinationslug');\n const selectedEdition = queryEdition && selectDropDownValue('#edition-dropdown', queryEdition, 'data-editionslug');\n queryRoom && selectDropDownValue('#room-dropdown', queryRoom, 'data-roomslug');\n\n // Guests dropdown is not a custom dropdown\n if (queryGuestsCount) {\n const guestDropdown = document.getElementById('Guests');\n if (guestDropdown) {\n guestDropdown.value = queryGuestsCount;\n }\n }\n\n if (selectedEdition) {\n const seasonStartDate = selectedEdition.dataset.startdate;\n const seasonEndDate = selectedEdition.dataset.enddate; // TODO: receive length of stay to determine end date\n \n const rangepicker = rangePickerElements.rangepicker;\n rangepicker.setOptions({\n minDate: seasonStartDate,\n maxDate: seasonEndDate,\n });\n rangepicker.setDates(seasonStartDate, seasonEndDate);\n }\n}\n\n\n/**\n * This script handles the dependencies of the destination/location dropdown\n * When destination dropdown value changed:\n * - Update Season/Edition dropdown and show only seasons/editions from the specific location\n * - Update Room dropdown and show only rooms from the specific location\n **/\nfunction initDestinationDropdown() {\n const locationDropdown = document.querySelector('#destination-dropdown');\n\n const editionDropdown = document.querySelector('#edition-dropdown');\n const editionToggle = editionDropdown.querySelector('.dropdown-selected-value');\n const editionPlaceholder = editionToggle.innerHTML;\n\n const roomDropdown = document.querySelector('#room-dropdown');\n const roomToggle = roomDropdown.querySelector('.dropdown-selected-value');\n\n const locationDropdownItems = locationDropdown.querySelectorAll('.dropdown-item');\n const editionDropdownItems = editionDropdown.querySelectorAll('.dropdown-item');\n const roomDropdownItems = roomDropdown.querySelectorAll('.dropdown-item');\n\n function onDestinationChange(selectedDestinationSlug, destinationCurrency) {\n editionToggle.setAttribute('disabled', selectedDestinationSlug === '' ? 'true' : 'false');\n roomToggle.setAttribute('disabled', selectedDestinationSlug === '' ? 'true' : 'false');\n\n // Clear selected edition option\n editionToggle.innerHTML = editionPlaceholder;\n roomToggle.innerHTML = editionPlaceholder;\n\n selectedCurrency = destinationCurrency;\n\n [...editionDropdownItems, ...roomDropdownItems].forEach((item) => {\n const visible = item.dataset.destinationslug === selectedDestinationSlug;\n item.style.display = visible ? 'flex' : 'none';\n });\n }\n\n // Initial population\n onDestinationChange('', selectedCurrency);\n\n // Update on change\n locationDropdownItems.forEach((locationItem) => {\n locationItem.addEventListener('click', function () {\n onDestinationChange(this.dataset.destinationslug, this.dataset.currency);\n });\n });\n}\n\n\nfunction selectDropDownValue(selector, value, dataAttribute) {\n const dropdownItems = document.querySelectorAll(`${selector} .dropdown-item`);\n const item =\n dropdownItems &&\n Array.from(dropdownItems).find((item) => item.getAttribute(dataAttribute) === value);\n item && item.click();\n return item;\n}\n\n\n/**\n * This script handles the dependencies of the season dropdown\n * When season dropdown value changed:\n * - Reset the start and end dates\n * - Set minimum start date to season start date\n * - Set maximum end date to season end date\n **/\nfunction initSeasonDropDown() {\n const editionDropdown = document.querySelector('#edition-dropdown');\n const editionDropdownItems = editionDropdown.querySelectorAll('.dropdown-item');\n\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n\n function onSeasonChange(seasonStartDate, seasonEndDate) {\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n\n rangepicker.setOptions({\n minDate: seasonStartDate,\n maxDate: seasonEndDate,\n });\n rangepicker.setDates(seasonStartDate, seasonEndDate);\n }\n\n // Update on change\n editionDropdownItems.forEach((edition) => {\n edition.addEventListener('click', function () {\n onSeasonChange(this.dataset.startdate, this.dataset.enddate);\n });\n });\n}\n\n/**\n * Initializes event listeners for dropdown and date picker changes on the booking page.\n *\n * - Listens for changes in the start/end date input group and updates price and discount info.\n * - Listens for room selection changes, updates price info, and adjusts the date range picker\n * based on the selected room's weekly booking allowance.\n * - Listens for changes in the guest count dropdown and updates price info accordingly.\n */\nfunction initPriceUpdateListeners() {\n // react on change of start / end date\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n datesInputGroup.addEventListener('changeDate', () => {\n updatePriceInfoCard();\n updateDiscountBoxes();\n });\n\n // react on change of room\n const roomDropdown = document.querySelector('#room-dropdown');\n const roomDropdownItems = roomDropdown.querySelectorAll('.dropdown-item');\n roomDropdownItems.forEach((roomItem) => {\n roomItem.addEventListener('click', () => {\n updatePriceInfoCard();\n\n const allowWeeklyBooking = roomItem.getAttribute('data-allow-weekly-booking');\n // change date range picker to the selected room\n const rangepicker = rangePickerElements.rangepicker;\n rangepicker.setMinimumDays(allowWeeklyBooking === 'Enabled' ? 7 : 30);\n rangepicker.validateDateRange();\n });\n });\n\n //react on guest count change\n const guestsDropdown = document.querySelector('#Guests');\n guestsDropdown.addEventListener('change', () => {\n updatePriceInfoCard();\n });\n}\n\n\n/**\n * This script handles visual and textual changes on the content on top of the image next to the form\n * depending on form values.\n **/\nfunction initCardInfoBoxes() {\n updateDiscountBoxes();\n updatePriceInfoCard();\n}\n\n\nfunction updateDiscountBoxes() {\n //reset discount infos\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n \n const discountInfoBlue = document.querySelector('.discount-info-blue');\n const discountInfoGreen = document.querySelector('.discount-info-green');\n\n const [startDate, endDate] = rangepicker.getDates();\n // calculate month difference while 1 month is always 30 days\n const monthDifference = getMonthDifference(startDate, endDate);\n \n if ((!startDate || !endDate) || monthDifference <= 2) {\n discountInfoBlue.style.display = 'flex';\n discountInfoGreen.style.display = 'none';\n } else {\n discountInfoBlue.style.display = 'none';\n discountInfoGreen.style.display = 'flex';\n }\n}\n\n\n//determine if we display the price info card or not\n// only show, if \n// - destination is set\n// - edition is set\n// - room is set\n// - dates are set\n// - (guests are always set)\nfunction updatePriceInfoCard() {\n const priceInfoCards = document.querySelectorAll('.price-info-card');\n const datesInputGroup = document.querySelector('#dates-start-end-group');\n const rangepicker = datesInputGroup.rangepicker; // get the instance of the datepicker\n const selectedDestinationItem = document.querySelector('#destination-dropdown .dropdown-selected-value .dropdown-item');\n const selectedEditionItem = document.querySelector('#edition-dropdown .dropdown-selected-value .dropdown-item');\n const selectedRoomItem = document.querySelector('#room-dropdown .dropdown-selected-value .dropdown-item');\n const selectedGuestsItem = document.querySelector('#Guests');\n\n const destinationSlug = selectedDestinationItem ? selectedDestinationItem.dataset.destinationslug : '';\n const editionSlug = selectedEditionItem ? selectedEditionItem.dataset.editionslug : '';\n const roomSlug = selectedRoomItem ? selectedRoomItem.dataset.roomslug : '';\n const allowWeeklyBooking = selectedRoomItem ? selectedRoomItem.getAttribute('data-allow-weekly-booking') === 'Enabled' : false;\n const [startDate, endDate] = rangepicker.getDates(); \n const selectedGuestsCount = selectedGuestsItem ? parseInt(selectedGuestsItem.value) : 0;\n\n if (destinationSlug && editionSlug && roomSlug && startDate && endDate && selectedGuestsCount > 0) {\n const editionRoomPrices = getAllRoomPrices();\n priceInfoCards.forEach(priceInfoCard => { \n priceInfoCard.style.display = 'flex';\n updateRoomPriceAndBreakdown(priceInfoCard, editionRoomPrices, editionSlug, roomSlug, startDate, endDate, selectedGuestsCount, allowWeeklyBooking);\n });\n\n // update dates\n const options = { day: 'numeric', month: 'short', year: 'numeric' };\n const formattedStartDate = startDate.toLocaleDateString('en-GB', { day: 'numeric', month: 'short' }).replace(',', '');\n const formattedEndDate = endDate.toLocaleDateString('en-GB', options).replace(',', '');\n document.querySelectorAll('.total-dates').forEach(x => x.innerHTML = `${formattedStartDate} - ${formattedEndDate}`);\n } else {\n priceInfoCards.forEach(x => x.style.display = 'none');\n }\n}\n\n\n// update room price & breakdown\nfunction updateRoomPriceAndBreakdown(priceInfoCard, editionRoomPrices, editionSlug, roomSlug, startDate, endDate, guestsCount, allowWeeklyBooking) {\n // --- Helper functions ---\n function getMonthNumberEnding(month) {\n return month === 1 ? 'st' : (month === 2 ? 'nd' : (month === 3 ? 'rd' : 'th'));\n }\n\n function setElementDisplay(element, display) {\n if (element) element.style.display = display;\n }\n\n function setButtonState(button, anchor, enabled) {\n if (!button || !anchor) return;\n anchor.style.pointerEvents = enabled ? 'auto' : 'none';\n anchor.style.backgroundColor = enabled ? 'var(--_colors---primary)' : 'var(--_colors---light-silver)';\n anchor.style.opacity = enabled ? 1 : 0.3;\n button.setAttribute('disabled', !enabled);\n }\n\n function handleNoRoomPriceInfo() {\n priceBreakdownElement.innerText = 'No room price found for the selected season or room.';\n setElementDisplay(totalPriceElement, 'none');\n setElementDisplay(roomPriceElement, 'none');\n setElementDisplay(discountBox, 'none');\n setElementDisplay(totalGuestsElement?.parentElement, 'none');\n setElementDisplay(datesElement, 'none');\n setElementDisplay(roomPriceDescription, 'none');\n setButtonState(nextButton, nextButtonAnchor, false);\n priceInfoCardTitles.forEach(x => setElementDisplay(x, 'none'));\n if (hiddenTotalPriceField) hiddenTotalPriceField.value = 0;\n }\n\n function resetVisualElements() {\n setElementDisplay(totalPriceElement, 'block');\n setElementDisplay(roomPriceElement, 'block');\n setElementDisplay(totalGuestsElement?.parentElement, 'flex');\n setElementDisplay(datesElement, 'block');\n setElementDisplay(roomPriceDescription, 'block');\n setButtonState(nextButton, nextButtonAnchor, true);\n priceInfoCardTitles.forEach(x => setElementDisplay(x, 'block'));\n }\n\n // --- DOM element references ---\n const monthDifference = getMonthDifference(startDate, endDate);\n const roomPriceElement = priceInfoCard.querySelector('.room-price');\n const discountBox = priceInfoCard.querySelector('.room-price-discount');\n const roomPriceDescription = priceInfoCard.querySelector('.room-price-month-desc');\n const totalGuestsElement = priceInfoCard.querySelector('.total-guests');\n const totalPriceElement = priceInfoCard.querySelector('.total-totalprice');\n const totalPriceText = totalPriceElement.firstElementChild;\n const priceBreakdownElement = priceInfoCard.querySelector('.room-price-breakdown');\n const datesElement = priceInfoCard.querySelector('.total-dates');\n const nextButton = document.querySelector('#form-next-step-btn-step-1');\n const nextButtonAnchor = nextButton ? nextButton.querySelector('a') : null;\n const roomPriceInfo = editionRoomPrices.find((x) => x.editionSlug === editionSlug && x.roomSlug === roomSlug);\n const priceInfoCardTitles = priceInfoCard.querySelectorAll('.price-info-card-title');\n const hiddenTotalPriceField = document.querySelector(`[name=\"Total-Price\"]`);\n\n if (!roomPriceInfo) {\n handleNoRoomPriceInfo();\n return;\n }\n\n resetVisualElements();\n\n const basePriceWeek = parseDecimalFromString(roomPriceInfo.basePriceWeek);\n const basePriceMonth = roomPriceInfo.basePriceMonth;\n const discountMonth2 = roomPriceInfo.discountMonth2;\n const discountMonth3 = roomPriceInfo.discountMonth3;\n let totalPrice = 0;\n let breakdown = [];\n\n // Calculate total days\n const totalDays = Math.round((endDate - startDate) / (1000 * 60 * 60 * 24));\n\n if (monthDifference < 1 && allowWeeklyBooking && basePriceWeek) {\n setElementDisplay(discountBox, 'none');\n roomPriceElement.innerText = `${formatPrice(basePriceWeek, selectedCurrency)}`;\n roomPriceDescription.innerText = `per week`;\n // For weekly, calculate daily rate and multiply by days\n const dailyRate = basePriceWeek / 7;\n const weekPrice = dailyRate * totalDays;\n breakdown.push({ text: `${totalDays} days: ${formatPrice(weekPrice, selectedCurrency)}` });\n totalPrice = weekPrice;\n } else if (monthDifference >= 1) {\n // Monthly pricing with discounts per month\n let daysLeft = totalDays;\n let month = 1;\n let lastDiscount = 0;\n let lastMonthDays = 0;\n while (daysLeft > 0) {\n let discount = 0;\n if (month === 1) {\n discount = 0;\n } else if (month === 2) {\n discount = discountMonth2;\n } else if (month >= 3) {\n discount = discountMonth3;\n }\n lastDiscount = discount;\n // For each month, use 30 days or remaining days if less\n const daysThisMonth = daysLeft >= 30 ? 30 : daysLeft;\n lastMonthDays = daysThisMonth;\n const discountedBase = basePriceMonth * (1 - discount / 100);\n const dailyRate = discountedBase / 30;\n const priceForThisMonth = dailyRate * daysThisMonth;\n totalPrice += priceForThisMonth;\n breakdown.push({\n text: daysThisMonth === 30 ? `Month ${month}: ${formatPrice(priceForThisMonth, selectedCurrency)}` : `+ ${daysLeft} days: ${formatPrice(priceForThisMonth, selectedCurrency)}`,\n discount,\n month\n });\n daysLeft -= daysThisMonth;\n month++;\n }\n // Show discount for last month if applicable\n const last = breakdown[breakdown.length - 1];\n if (last && last.discount > 0) {\n const monthText = last.month <= 3 ? `${last.month}${getMonthNumberEnding(last.month)} month` : `from 3rd month`;\n discountBox.innerText = `${last.discount.toFixed(1)}% discount - ${monthText}`;\n setElementDisplay(discountBox, 'flex');\n roomPriceElement.innerText = `${formatPrice(basePriceMonth * (1 - last.discount / 100), selectedCurrency)}`;\n roomPriceDescription.innerText = monthText;\n } else {\n setElementDisplay(discountBox, 'none');\n roomPriceElement.innerText = `${formatPrice(basePriceMonth, selectedCurrency)}`;\n roomPriceDescription.innerText = `1st month`;\n }\n }\n\n // Update DOM with results\n priceBreakdownElement.innerHTML = breakdown.map(b => b.text).join('<br>');\n totalGuestsElement.innerText = `${guestsCount} x Person`;\n totalPriceText.innerText = `${formatPrice(totalPrice, selectedCurrency)}`;\n if (hiddenTotalPriceField) hiddenTotalPriceField.value = `${formatPrice(totalPrice, selectedCurrency)}`;\n}\n\n// Export for testing\nexport { updateRoomPriceAndBreakdown };\n"],
5
+ "mappings": "MAYO,SAASA,EAAiBC,EAAmB,CAClD,IAAMC,EAAgB,SAAS,iBAAiB,kBAAkB,EAC5DC,EAAa,MAAM,KAAKD,CAAa,EAAE,IAAIE,GAAK,KAAK,MAAMA,EAAE,WAAW,CAAC,EAC/E,OAAKH,EAGEE,EAAW,OAAQC,GAAMA,EAAE,cAAgBH,CAAiB,EAF3DE,CAGV,CAGO,SAASE,EAAmBC,EAAWC,EAAS,CACrD,MAAI,CAACD,GAAa,CAACC,EAAgB,EAC5B,KAAK,OAAOA,EAAUD,IAAc,IAAO,GAAK,GAAK,GAAK,GAAG,CACtE,CAEO,SAASE,EAAYC,EAAOC,EAAU,CAG3C,OAAO,IAAI,KAAK,aAAa,QAAS,CACpC,MAAO,WACR,SAAAA,EACC,gBAAiB,MACnB,CAAC,EAAE,OAAOD,CAAK,CACjB,CAEO,SAASE,EAAuBF,EAAOG,EAAe,KAAM,CACjE,OAAQ,MAAM,WAAWH,CAAK,CAAC,EAE3BG,EADA,WAAWH,CAAK,CAEtB,CC3BO,SAASI,GAA4B,CACzB,SAAS,iBAAiB,gBAAgB,EAElD,QAASC,GAAY,CAC5BA,EAAQ,iBAAiB,SAAU,IAAMC,EAAwBD,CAAO,CAAC,EACzEC,EAAwBD,CAAO,CACjC,CAAC,EAED,SAASC,EAAwBD,EAAS,CACxC,IAAME,EAAcF,EAAQ,aAAa,cAAc,EACjDG,EAAeH,EAAQ,MAER,SAAS,iBAAiB,4BAA4BE,CAAW,IAAI,EAE7E,QAASE,GAAU,CAC9B,IAAMC,EAAaD,EAAM,aAAa,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,EAAeE,EAEf,IAAMC,EAAgBJ,GAAY,GAAK,GAAKA,EAC5CE,GAAgBE,EAGhB,IAAMC,EAFiBb,GAAkB,EAAIW,EAAW,KACrB,GACGC,EACtCT,GAAcU,EACdT,EAAU,KAAK,CACb,KAAMQ,IAAkB,GAAK,SAASrC,CAAK,KAAK+B,EAAYO,EAAmBhH,CAAgB,CAAC,GAAM,KAAK2G,CAAQ,UAAUF,EAAYO,EAAmBhH,CAAgB,CAAC,GAC7K,SAAA8G,EACA,MAAApC,CACF,CAAC,EACDiC,GAAYI,EACZrC,GACF,CAEA,IAAMuC,EAAOV,EAAUA,EAAU,OAAS,CAAC,EAC3C,GAAIU,GAAQA,EAAK,SAAW,EAAG,CAC7B,IAAMC,EAAYD,EAAK,OAAS,EAAI,GAAGA,EAAK,KAAK,GAAGxC,EAAqBwC,EAAK,KAAK,CAAC,SAAW,iBAC/F3B,EAAY,UAAY,GAAG2B,EAAK,SAAS,QAAQ,CAAC,CAAC,gBAAgBC,CAAS,GAC5EvC,EAAkBW,EAAa,MAAM,EACrCD,EAAiB,UAAY,GAAGoB,EAAYN,GAAkB,EAAIc,EAAK,SAAW,KAAMjH,CAAgB,CAAC,GACzGyF,EAAqB,UAAYyB,CACnC,MACEvC,EAAkBW,EAAa,MAAM,EACrCD,EAAiB,UAAY,GAAGoB,EAAYN,EAAgBnG,CAAgB,CAAC,GAC7EyF,EAAqB,UAAY,WAErC,CAGAN,EAAsB,UAAYoB,EAAU,IAAIY,GAAKA,EAAE,IAAI,EAAE,KAAK,MAAM,EACxE5B,EAAmB,UAAY,GAAGf,CAAW,YAC7CuB,EAAe,UAAY,GAAGU,EAAYH,EAAYtG,CAAgB,CAAC,GACnE6F,IAAuBA,EAAsB,MAAQ,GAAGY,EAAYH,EAAYtG,CAAgB,CAAC,GACvG",
6
+ "names": ["getAllRoomPrices", "editionSlugFilter", "priceElements", "roomPrices", "x", "getMonthDifference", "startDate", "endDate", "formatPrice", "price", "currency", "parseDecimalFromString", "defaultValue", "initConditionalFormFields", "trigger", "updateConditionalFields", "triggerName", "triggerValue", "field", "shouldShow", "input", "initCustomDropdowns", "dropdown", "toggle", "link", "e", "value", "content", "initDateRangePickers", "groupSelector", "startDateSelector", "minimumDays", "datesInput", "startDateField", "rangepicker", "currentMinimumDays", "days", "startDate", "endDate", "initFormWizardSteps", "steps", "stepIndicators", "currentStep", "showStep", "index", "step", "i", "indicator", "validateCurrentStep", "currentInputs", "errors", "isHidden", "label", "showErrors", "containerId", "errorMessages", "container", "ul", "msg", "li", "resetErrors", "btn", "errorListId", "prepareReviewFields", "element", "fieldName", "fieldValue", "initCloseButtonClick", "referrer", "currentDomain", "referrerDomain", "selectedCurrency", "rangePickerElements", "initCloseButtonClick", "initConditionalFormFields", "initFormWizardSteps", "initCustomDropdowns", "initDateRangePickers", "initDestinationDropdown", "initSeasonDropDown", "initPriceUpdateListeners", "initQueryParamFormValues", "initCardInfoBoxes", "urlParams", "queryDestination", "queryEdition", "queryRoom", "queryGuestsCount", "selectDropDownValue", "selectedEdition", "guestDropdown", "seasonStartDate", "seasonEndDate", "rangepicker", "locationDropdown", "editionDropdown", "editionToggle", "editionPlaceholder", "roomDropdown", "roomToggle", "locationDropdownItems", "editionDropdownItems", "roomDropdownItems", "onDestinationChange", "selectedDestinationSlug", "destinationCurrency", "item", "visible", "locationItem", "selector", "value", "dataAttribute", "dropdownItems", "datesInputGroup", "onSeasonChange", "edition", "updatePriceInfoCard", "updateDiscountBoxes", "roomItem", "allowWeeklyBooking", "discountInfoBlue", "discountInfoGreen", "startDate", "endDate", "monthDifference", "getMonthDifference", "priceInfoCards", "selectedDestinationItem", "selectedEditionItem", "selectedRoomItem", "selectedGuestsItem", "destinationSlug", "editionSlug", "roomSlug", "selectedGuestsCount", "editionRoomPrices", "getAllRoomPrices", "priceInfoCard", "updateRoomPriceAndBreakdown", "options", "formattedStartDate", "formattedEndDate", "x", "guestsCount", "getMonthNumberEnding", "month", "setElementDisplay", "element", "display", "setButtonState", "button", "anchor", "enabled", "handleNoRoomPriceInfo", "priceBreakdownElement", "totalPriceElement", "roomPriceElement", "discountBox", "totalGuestsElement", "datesElement", "roomPriceDescription", "nextButton", "nextButtonAnchor", "priceInfoCardTitles", "hiddenTotalPriceField", "resetVisualElements", "totalPriceText", "roomPriceInfo", "basePriceWeek", "parseDecimalFromString", "basePriceMonth", "discountMonth2", "discountMonth3", "totalPrice", "breakdown", "totalDays", "formatPrice", "weekPrice", "daysLeft", "lastDiscount", "lastMonthDays", "discount", "daysThisMonth", "priceForThisMonth", "last", "monthText", "b"]
7
7
  }
@@ -1,2 +1 @@
1
- (()=>{var p=(e,t)=>()=>(e&&(t=e(e=0)),t);var f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var c,l=p(()=>{c=function(){let e,t,i=null,s=null;function a(){let r=document.querySelector(s.swiperWrapper);if(t=document.querySelector(s.prevButton),i=document.querySelector(s.nextButton),!r||!t||!i)return console.error("Required elements not found"),null;let u=new Swiper(s.swiper,{slidesPerView:1,spaceBetween:0,freeMode:!1,slidesOffsetAfter:0,navigation:{nextEl:s.nextButton,prevEl:s.prevButton},watchOverflow:!0});return e=u,n(),u.on("slideChange",function(){n()}),u}function n(){!t||!i||(t.style.opacity=e.isBeginning?"0.5":"1",t.style.pointerEvents=e.isBeginning?"none":"auto",i.style.opacity=e.isEnd?"0.5":"1",i.style.pointerEvents=e.isEnd?"none":"auto")}return{init:function(r){s=r,document.addEventListener("DOMContentLoaded",function(){a()})}}}()});var o,d=p(()=>{o=class{constructor(t){this.SELECTORS=t,this.swiperInstance=null,this.prevButton=null,this.nextButton=null}init(){document.addEventListener("DOMContentLoaded",()=>{let t=document.querySelector(this.SELECTORS.swiperWrapper);t.style.gap="0",this.initSwiper()})}initSwiper(){let t=document.querySelector(this.SELECTORS.refContainer),i=document.querySelector(this.SELECTORS.swiperWrapper);if(this.prevButton=document.querySelector(this.SELECTORS.prevButton),this.nextButton=document.querySelector(this.SELECTORS.nextButton),!t||!i||!this.prevButton||!this.nextButton)return console.error("Required elements not found"),null;let a=t.getBoundingClientRect().left,n=new Swiper(this.SELECTORS.swiper,{slidesPerView:"auto",spaceBetween:16,freeMode:!1,slidesOffsetBefore:a,slidesOffsetAfter:16,navigation:{nextEl:this.SELECTORS.nextButton,prevEl:this.SELECTORS.prevButton},watchOverflow:!0});return this.swiperInstance=n,this.updateButtonsState(),n.on("slideChange",this.updateButtonsState.bind(this)),window.addEventListener("resize",()=>{let r=t.getBoundingClientRect().left;n&&n.params&&(n.params.slidesOffsetBefore=r,n.update())}),n}updateButtonsState(){if(!this.prevButton||!this.nextButton)return;this.prevButton.style.opacity=this.swiperInstance.isBeginning?"0.5":"1",this.prevButton.style.pointerEvents=this.swiperInstance.isBeginning?"none":"auto";let t=this.swiperInstance.maxTranslate();this.swiperInstance.translate<=t+5?(this.nextButton.style.opacity="0.5",this.nextButton.style.pointerEvents="none"):(this.nextButton.style.opacity="1",this.nextButton.style.pointerEvents="auto")}}});var B=f(()=>{l();d();var w=new o({refContainer:"#activity-cards-swiper-ref-container",swiper:"#activity-cards-section .swiper",swiperWrapper:"#activity-cards-section .swiper-wrapper",prevButton:"#activity-cards-swiper-prev-btn",nextButton:"#activity-cards-swiper-next-btn"});w.init();c.init({swiper:"#testimonial-side-section .swiper",swiperWrapper:"#testimonial-side-section .swiper-wrapper",prevButton:"#testimonial-side-btn-left",nextButton:"#testimonial-side-btn-right"})});B();})();
2
- //# sourceMappingURL=bundle-business-destination.min.js.map
1
+ (()=>{var p=function(){let s,t,n=null,i=null;function a(){let r=document.querySelector(i.swiperWrapper);if(t=document.querySelector(i.prevButton),n=document.querySelector(i.nextButton),!r||!t||!n)return console.error("Required elements not found"),null;let u=new Swiper(i.swiper,{slidesPerView:1,spaceBetween:0,freeMode:!1,slidesOffsetAfter:0,navigation:{nextEl:i.nextButton,prevEl:i.prevButton},watchOverflow:!0});return s=u,e(),u.on("slideChange",function(){e()}),u}function e(){!t||!n||(t.style.opacity=s.isBeginning?"0.5":"1",t.style.pointerEvents=s.isBeginning?"none":"auto",n.style.opacity=s.isEnd?"0.5":"1",n.style.pointerEvents=s.isEnd?"none":"auto")}return{init:function(r){i=r,document.addEventListener("DOMContentLoaded",function(){a()})}}}();var o=class{constructor(t){this.SELECTORS=t,this.swiperInstance=null,this.prevButton=null,this.nextButton=null}init(){document.addEventListener("DOMContentLoaded",()=>{let t=document.querySelector(this.SELECTORS.swiperWrapper);t&&(t.style.gap="0"),this.initSwiper()})}initSwiper(){let t=document.querySelector(this.SELECTORS.refContainer),n=document.querySelector(this.SELECTORS.swiperWrapper);if(this.prevButton=document.querySelector(this.SELECTORS.prevButton),this.nextButton=document.querySelector(this.SELECTORS.nextButton),!t||!n||!this.prevButton||!this.nextButton)return console.error("Required elements not found"),null;let a=t.getBoundingClientRect().left,e=new Swiper(this.SELECTORS.swiper,{slidesPerView:"auto",spaceBetween:16,freeMode:!1,slidesOffsetBefore:a,slidesOffsetAfter:16,navigation:{nextEl:this.SELECTORS.nextButton,prevEl:this.SELECTORS.prevButton},watchOverflow:!0});return this.swiperInstance=e,this.updateButtonsState(),e.on("slideChange",this.updateButtonsState.bind(this)),window.addEventListener("resize",()=>{let r=t.getBoundingClientRect().left;e&&e.params&&(e.params.slidesOffsetBefore=r,e.update())}),e}updateButtonsState(){if(!this.prevButton||!this.nextButton)return;this.prevButton.style.opacity=this.swiperInstance.isBeginning?"0.5":"1",this.prevButton.style.pointerEvents=this.swiperInstance.isBeginning?"none":"auto";let t=this.swiperInstance.maxTranslate();this.swiperInstance.translate<=t+5?(this.nextButton.style.opacity="0.5",this.nextButton.style.pointerEvents="none"):(this.nextButton.style.opacity="1",this.nextButton.style.pointerEvents="auto")}};var c=new o({refContainer:"#activity-cards-swiper-ref-container",swiper:"#activity-cards-section .swiper",swiperWrapper:"#activity-cards-section .swiper-wrapper",prevButton:"#activity-cards-swiper-prev-btn",nextButton:"#activity-cards-swiper-next-btn"});c.init();p.init({swiper:"#testimonial-side-section .swiper",swiperWrapper:"#testimonial-side-section .swiper-wrapper",prevButton:"#testimonial-side-btn-left",nextButton:"#testimonial-side-btn-right"});})();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../components/testimonial-side-carousel.js", "../components/simple-cards.js", "../pages/business-destination/index.js"],
4
4
  "sourcesContent": ["export const TestimonialSideCarousel = (function () {\n let swiperInstance, prevButton, nextButton = null;\n let SELECTORS = null; // Declare SELECTORS as null initially\n\n function initSwiper() {\n const swiperWrapper = document.querySelector(SELECTORS.swiperWrapper);\n prevButton = document.querySelector(SELECTORS.prevButton);\n nextButton = document.querySelector(SELECTORS.nextButton);\n\n if (!swiperWrapper || !prevButton || !nextButton) {\n console.error('Required elements not found');\n return null;\n } \n\n // Initialize Swiper\n const swiper = new Swiper(SELECTORS.swiper, {\n slidesPerView: 1,\n spaceBetween: 0,\n freeMode: false,\n slidesOffsetAfter: 0,\n navigation: {\n nextEl: SELECTORS.nextButton,\n prevEl: SELECTORS.prevButton,\n },\n watchOverflow: true,\n });\n\n\t\tswiperInstance = swiper;\n\n // Set initial state of buttons\n updateButtonsState();\n\n // Add event listeners to update button states when slides change\n swiper.on('slideChange', function () {\n updateButtonsState();\n });\n\n return swiper;\n }\n\n // Function to update button states\n function updateButtonsState() {\n \tif (!prevButton || !nextButton) return;\n \n prevButton.style.opacity = swiperInstance.isBeginning ? '0.5' : '1';\n prevButton.style.pointerEvents = swiperInstance.isBeginning ? 'none' : 'auto'; \n\n\t\tnextButton.style.opacity = swiperInstance.isEnd ? '0.5' : '1';\n nextButton.style.pointerEvents = swiperInstance.isEnd ? 'none' : 'auto';\n }\n\n // Public methods\n return {\n init: function(selectors) {\n SELECTORS = selectors; // Assign selectors to the SELECTORS variable\n \tdocument.addEventListener('DOMContentLoaded', function() {\n // Initialize swiper\n initSwiper();\n\t\t\t});\n }\n };\n})();\n", "export class SimpleCardsCarousel {\n constructor(selectors) {\n this.SELECTORS = selectors;\n this.swiperInstance = null;\n this.prevButton = null;\n this.nextButton = null;\n }\n\n init() {\n document.addEventListener('DOMContentLoaded', () => {\n const swiperWrapper = document.querySelector(this.SELECTORS.swiperWrapper);\n swiperWrapper.style.gap = '0';\n this.initSwiper();\n });\n }\n\n initSwiper() {\n const refContainer = document.querySelector(this.SELECTORS.refContainer);\n const swiperWrapper = document.querySelector(this.SELECTORS.swiperWrapper);\n this.prevButton = document.querySelector(this.SELECTORS.prevButton);\n this.nextButton = document.querySelector(this.SELECTORS.nextButton);\n\n if (!refContainer || !swiperWrapper || !this.prevButton || !this.nextButton) {\n console.error('Required elements not found');\n return null;\n }\n\n const refRect = refContainer.getBoundingClientRect();\n const offsetBefore = refRect.left;\n\n // Initialize Swiper\n const swiper = new Swiper(this.SELECTORS.swiper, {\n slidesPerView: 'auto',\n spaceBetween: 16,\n freeMode: false,\n slidesOffsetBefore: offsetBefore,\n slidesOffsetAfter: 16,\n navigation: {\n nextEl: this.SELECTORS.nextButton,\n prevEl: this.SELECTORS.prevButton,\n },\n watchOverflow: true,\n });\n\n this.swiperInstance = swiper;\n\n // Set initial state of buttons\n this.updateButtonsState();\n\n // Add event listeners to update button states when slides change\n swiper.on('slideChange', this.updateButtonsState.bind(this));\n\n // Add resize event listener separately\n window.addEventListener('resize', () => {\n const newOffsetBefore = refContainer.getBoundingClientRect().left;\n if (swiper && swiper.params) {\n swiper.params.slidesOffsetBefore = newOffsetBefore;\n swiper.update();\n }\n });\n\n return swiper;\n }\n\n updateButtonsState() {\n if (!this.prevButton || !this.nextButton) return;\n\n this.prevButton.style.opacity = this.swiperInstance.isBeginning ? '0.5' : '1';\n this.prevButton.style.pointerEvents = this.swiperInstance.isBeginning ? 'none' : 'auto';\n\n // Get Swiper's max translate position\n const maxTranslate = this.swiperInstance.maxTranslate();\n const currentTranslate = this.swiperInstance.translate;\n\n if (currentTranslate <= maxTranslate + 5) {\n this.nextButton.style.opacity = '0.5';\n this.nextButton.style.pointerEvents = 'none';\n } else {\n this.nextButton.style.opacity = '1';\n this.nextButton.style.pointerEvents = 'auto';\n }\n }\n}", "import { TestimonialSideCarousel } from \"../../components/testimonial-side-carousel\"\nimport { SimpleCardsCarousel } from \"../../components/simple-cards\";\n\n// Initialize the carousel\nconst commonFacilitiesCardsCarousel = new SimpleCardsCarousel({\n refContainer: \"#activity-cards-swiper-ref-container\", // this is needed for calculating the left offset\n swiper: '#activity-cards-section .swiper',\n swiperWrapper: '#activity-cards-section .swiper-wrapper', \n prevButton: '#activity-cards-swiper-prev-btn',\n nextButton: '#activity-cards-swiper-next-btn'\n});\ncommonFacilitiesCardsCarousel.init();\n\n// Initialize the carousel\nTestimonialSideCarousel.init({\n swiper: '#testimonial-side-section .swiper',\n swiperWrapper: '#testimonial-side-section .swiper-wrapper', \n prevButton: '#testimonial-side-btn-left',\n nextButton: '#testimonial-side-btn-right'\n});"],
5
- "mappings": "uGAAA,IAAaA,EAAbC,EAAAC,EAAA,KAAaF,EAA2B,UAAY,CAClD,IAAIG,EAAgBC,EAAYC,EAAa,KACzCC,EAAY,KAEhB,SAASC,GAAa,CACpB,IAAMC,EAAgB,SAAS,cAAcF,EAAU,aAAa,EAIpE,GAHAF,EAAa,SAAS,cAAcE,EAAU,UAAU,EACxDD,EAAa,SAAS,cAAcC,EAAU,UAAU,EAEpD,CAACE,GAAiB,CAACJ,GAAc,CAACC,EACpC,eAAQ,MAAM,6BAA6B,EACpC,KAIT,IAAMI,EAAS,IAAI,OAAOH,EAAU,OAAQ,CAC1C,cAAe,EACf,aAAc,EACd,SAAU,GACV,kBAAmB,EACnB,WAAY,CACV,OAAQA,EAAU,WAClB,OAAQA,EAAU,UACpB,EACA,cAAe,EACjB,CAAC,EAEH,OAAAH,EAAiBM,EAGfC,EAAmB,EAGnBD,EAAO,GAAG,cAAe,UAAY,CACnCC,EAAmB,CACrB,CAAC,EAEMD,CACT,CAGA,SAASC,GAAqB,CACzB,CAACN,GAAc,CAACC,IAEnBD,EAAW,MAAM,QAAUD,EAAe,YAAc,MAAQ,IAChEC,EAAW,MAAM,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iBAAiB,SAAU,IAAM,CACtC,IAAMC,EAAkBH,EAAa,sBAAsB,EAAE,KACzDE,GAAUA,EAAO,SACnBA,EAAO,OAAO,mBAAqBC,EACnCD,EAAO,OAAO,EAElB,CAAC,EAEMA,CACT,CAEA,oBAAqB,CACnB,GAAI,CAAC,KAAK,YAAc,CAAC,KAAK,WAAY,OAE1C,KAAK,WAAW,MAAM,QAAU,KAAK,eAAe,YAAc,MAAQ,IAC1E,KAAK,WAAW,MAAM,cAAgB,KAAK,eAAe,YAAc,OAAS,OAGjF,IAAME,EAAe,KAAK,eAAe,aAAa,EAC7B,KAAK,eAAe,WAErBA,EAAe,GACrC,KAAK,WAAW,MAAM,QAAU,MAChC,KAAK,WAAW,MAAM,cAAgB,SAEtC,KAAK,WAAW,MAAM,QAAU,IAChC,KAAK,WAAW,MAAM,cAAgB,OAE1C,CACF,IClFA,IAAAC,EAAAC,EAAA,KAAAC,IACAC,IAGA,IAAMC,EAAgC,IAAIC,EAAoB,CAC5D,aAAc,uCACd,OAAQ,kCACR,cAAe,0CACf,WAAY,kCACZ,WAAY,iCACd,CAAC,EACDD,EAA8B,KAAK,EAGnCE,EAAwB,KAAK,CAC3B,OAAQ,oCACR,cAAe,4CACf,WAAY,6BACZ,WAAY,6BACd,CAAC",
6
- "names": ["TestimonialSideCarousel", "init_testimonial_side_carousel", "__esmMin", "swiperInstance", "prevButton", "nextButton", "SELECTORS", "initSwiper", "swiperWrapper", "swiper", "updateButtonsState", "selectors", "SimpleCardsCarousel", "init_simple_cards", "__esmMin", "selectors", "swiperWrapper", "refContainer", "offsetBefore", "swiper", "newOffsetBefore", "maxTranslate", "require_business_destination", "__commonJSMin", "init_testimonial_side_carousel", "init_simple_cards", "commonFacilitiesCardsCarousel", "SimpleCardsCarousel", "TestimonialSideCarousel"]
5
+ "mappings": "MAAO,IAAMA,EAA2B,UAAY,CAClD,IAAIC,EAAgBC,EAAYC,EAAa,KACzCC,EAAY,KAEhB,SAASC,GAAa,CACpB,IAA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AAwB,KAAK,CAC3B,OAAQ,oCACR,cAAe,4CACf,WAAY,6BACZ,WAAY,6BACd,CAAC",
6
+ "names": ["TestimonialSideCarousel", "swiperInstance", "prevButton", "nextButton", "SELECTORS", "initSwiper", "swiperWrapper", "swiper", "updateButtonsState", "selectors", "SimpleCardsCarousel", "selectors", "swiperWrapper", "refContainer", "offsetBefore", "swiper", "newOffsetBefore", "maxTranslate", "commonFacilitiesCardsCarousel", "SimpleCardsCarousel", "TestimonialSideCarousel"]
7
7
  }
@@ -1,2 +1 @@
1
- (()=>{var f=Object.create;var c=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var g=(t,e)=>()=>(t&&(e=t(t=0)),e);var l=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var E=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!v.call(t,r)&&r!==n&&c(t,r,{get:()=>e[r],enumerable:!(a=p(e,r))||a.enumerable});return t};var S=(t,e,n)=>(n=t!=null?f(h(t)):{},E(e||!t||!t.__esModule?c(n,"default",{value:t,enumerable:!0}):n,t));function d(){document.querySelectorAll("[data-trigger]").forEach(n=>{n.addEventListener("change",()=>e(n)),e(n)});function e(n){let a=n.getAttribute("data-trigger"),r=n.value;document.querySelectorAll(`[data-condition-trigger="${a}"]`).forEach(o=>{let s=o.getAttribute("data-condition-value")===r,i=o.matches("input, select, textarea")?o:o.querySelector("input, select, textarea");o.style.display=s?"block":"none",i&&(i.required=s,s||(i.value=""))})}}var u=g(()=>{});var m=l(()=>{u();document.addEventListener("DOMContentLoaded",function(){d()})});var q=l(()=>{var b=S(m())});q();})();
2
- //# sourceMappingURL=bundle-contact.min.js.map
1
+ (()=>{function a(){document.querySelectorAll("[data-trigger]").forEach(e=>{e.addEventListener("change",()=>o(e)),o(e)});function o(e){let s=e.getAttribute("data-trigger"),i=e.value;document.querySelectorAll(`[data-condition-trigger="${s}"]`).forEach(t=>{let n=t.getAttribute("data-condition-value")===i,r=t.matches("input, select, textarea")?t:t.querySelector("input, select, textarea");t.style.display=n?"block":"none",r&&(r.required=n,n||(r.value=""))})}}document.addEventListener("DOMContentLoaded",function(){a()});})();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../utils/formUtils.js", "../pages/contact/contact-form.js", "../pages/contact/index.js"],
4
- "sourcesContent": ["/**\n * Conditional Form Fields Script (Generic & Reusable)\n *\n * This script enables conditional visibility and required-state for form fields\n * based on trigger inputs (like dropdowns or radios).\n *\n * \u2705 How to use:\n * 1. Add `data-trigger=\"yourTriggerName\"` to the input controlling the logic (e.g. <select> or <input>).\n * 2. Add `data-condition-trigger=\"yourTriggerName\"` to any form field container that should be shown conditionally.\n * 3. Add `data-condition-value=\"triggerValue\"` to define when that field should be visible.\n * 4. Inside the conditional container, set form elements to `required` \u2014 the script toggles this automatically.\n *\n * This allows multiple trigger/condition pairs on the same page without extra JS.\n */\nexport function initConditionalFormFields() {\n const triggers = document.querySelectorAll('[data-trigger]');\n\n triggers.forEach((trigger) => {\n trigger.addEventListener('change', () => updateConditionalFields(trigger));\n updateConditionalFields(trigger); // Run on load\n });\n\n function updateConditionalFields(trigger) {\n const triggerName = trigger.getAttribute('data-trigger');\n const triggerValue = trigger.value;\n\n const conditionals = document.querySelectorAll(`[data-condition-trigger=\"${triggerName}\"]`);\n\n conditionals.forEach((field) => {\n const shouldShow = field.getAttribute('data-condition-value') === triggerValue;\n const input = field.matches('input, select, textarea') ? field : field.querySelector('input, select, textarea');\n\n field.style.display = shouldShow ? 'block' : 'none';\n if (input) {\n input.required = shouldShow;\n if (!shouldShow) input.value = '';\n }\n });\n }\n}\n\n/** This script\n * - loops through all custom dropdowns with \"data-custom-dropdown\" attribute\n * - sets the selected value as selected in the dropdown\n * - creates a hidden input for form data\n * - sets the selected value from \"data-value\" to the hidden input\n **/\nexport function initCustomDropdowns() {\n document.querySelectorAll('[data-custom-dropdown]').forEach((dropdown) => {\n // Create the hidden input\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = dropdown.dataset.name || 'custom-dropdown';\n input.setAttribute('required', dropdown.dataset.required === 'true' || false);\n input.value = ''; // Or set a default value if needed\n\n // Append it to the dropdown or its closest form\n dropdown.appendChild(input);\n\n const toggle = dropdown.querySelector('.dropdown-selected-value');\n const links = dropdown.querySelectorAll('.dropdown-item');\n\n links.forEach((link) => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n const value = link.dataset.value;\n const content = link.cloneNode(true);\n content.style.padding = 0; //reset paddings from dropdown-item\n\n // Update visual\n toggle.innerHTML = '';\n toggle.appendChild(content);\n\n // Set hidden field\n input.value = value;\n });\n });\n });\n}\n\n\n\n// Setting up daterange-pickers\n// Docs: https://mymth.github.io/vanillajs-datepicker/\nexport function initDateRangePickers(groupSelector, startDateSelector, minimumDays = 30) {\n const datesInput = document.querySelector(groupSelector);\n const startDateField = document.querySelector(startDateSelector);\n const rangepicker = new DateRangePicker(datesInput, {\n format: 'dd. MM yyyy',\n });\n\n // Add an event listener to validate the date range\n let currentMinimumDays = minimumDays;\n\n // Expose a method to update minimumDays dynamically\n rangepicker.setMinimumDays = (days) => {\n currentMinimumDays = days;\n };\n\n rangepicker.validateDateRange = () => {\n const [startDate, endDate] = rangepicker.getDates();\n\n if (startDate && endDate) {\n const differenceInDays = Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24));\n if (differenceInDays < currentMinimumDays) {\n startDateField.setCustomValidity(`You need to choose a minimum of ${currentMinimumDays} days.`);\n // Set end date to {{currentMinimumDays}} days after start date\n rangepicker.setDates(startDate, new Date(startDate.getTime() + currentMinimumDays * 24 * 60 * 60 * 1000)); \n } else {\n startDateField.setCustomValidity('');\n }\n } else {\n startDateField.setCustomValidity('');\n }\n // Trigger form validation\n startDateField.reportValidity();\n }\n\n datesInput.addEventListener('changeDate', rangepicker.validateDateRange);\n\n return { rangepicker, datesInput, startDateField };\n}\n\n\n/**\n * This script is responsible for\n * - the navigation of the multi step field\n * - update of the wizard step indicators\n * - form validation of all form elements of the current step\n **/\nexport function initFormWizardSteps() {\n const steps = document.querySelectorAll('.form-step');\n const stepIndicators = document.querySelectorAll(\n '.form-wizard-step .form-wizard-step-progress'\n );\n let currentStep = 0;\n\n function showStep(index) {\n steps.forEach((step, i) => {\n step.style.display = i === index ? 'block' : 'none';\n });\n\n stepIndicators.forEach((indicator, i) => {\n if (i < index || i === index) {\n indicator.classList.add('active');\n } else {\n indicator.classList.remove('active');\n }\n });\n }\n\n function validateCurrentStep() {\n const currentInputs = steps[currentStep].querySelectorAll('input, select, textarea');\n const errors = [];\n\n currentInputs.forEach((input) => {\n const isHidden = input.type === 'hidden' || input.offsetParent === null;\n\n if (input.required) {\n const isEmpty = !input.value || input.value.trim() === '';\n if (isEmpty) {\n const label = input.dataset.name || input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is required.`);\n }\n }\n\n // Custom type validation (e.g., email)\n if (!isHidden && input.value && !input.checkValidity()) {\n const label = input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is invalid.`);\n }\n });\n return errors;\n }\n\n function showErrors(containerId, errorMessages) {\n const container = document.querySelector(containerId);\n\n if (!container) return;\n\n // Clear any previous errors\n container.innerHTML = '';\n\n // Create <ul> element\n const ul = document.createElement('ul');\n\n // Add each error as <li>\n errorMessages.forEach((msg) => {\n const li = document.createElement('li');\n li.textContent = msg;\n ul.appendChild(li);\n });\n\n // Append the list to the container\n container.appendChild(ul);\n }\n\n function resetErrors(containerId) {\n const container = document.querySelector(containerId);\n if (container) {\n container.innerHTML = '';\n }\n }\n\n document.querySelectorAll('.form-next-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n if (btn.getAttribute('disabled') === 'true') {\n return;\n }\n\n const errors = validateCurrentStep();\n const errorListId = `#error-list-step-${currentStep}`;\n resetErrors(errorListId);\n if (errors.length == 0) {\n currentStep = Math.min(currentStep + 1, steps.length - 1);\n const isLastStep = currentStep === steps.length - 1;\n if (isLastStep) {\n prepareReviewFields(); // this loops through all fields with #review-* and sets the corresponding value\n }\n showStep(currentStep);\n } else {\n showErrors(errorListId, errors);\n }\n });\n });\n\n function prepareReviewFields() {\n const reviewElements = document.querySelectorAll('[id^=\"review-\"]');\n\n // Loop through the matched elements\n reviewElements.forEach((element) => {\n const fieldName = element.dataset.fieldname;\n try {\n const fieldValue = document.querySelector(`[name=\"${fieldName}\"]`).value;\n element.innerText = fieldValue;\n } catch {}\n });\n }\n\n document.querySelectorAll('.form-previous-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n currentStep = Math.max(currentStep - 1, 0);\n showStep(currentStep);\n });\n });\n\n showStep(currentStep); // Init\n}", "import { initConditionalFormFields } from \"../../utils/formUtils\" \n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n initConditionalFormFields();\n});", "import \"./contact-form\""],
5
- "mappings": "kjBAcO,SAASA,GAA4B,CACzB,SAAS,iBAAiB,gBAAgB,EAElD,QAASC,GAAY,CAC5BA,EAAQ,iBAAiB,SAAU,IAAMC,EAAwBD,CAAO,CAAC,EACzEC,EAAwBD,CAAO,CACjC,CAAC,EAED,SAASC,EAAwBD,EAAS,CACxC,IAAME,EAAcF,EAAQ,aAAa,cAAc,EACjDG,EAAeH,EAAQ,MAER,SAAS,iBAAiB,4BAA4BE,CAAW,IAAI,EAE7E,QAASE,GAAU,CAC9B,IAAMC,EAAaD,EAAM,aAAa,sBAAsB,IAAMD,EAC5DG,EAAQF,EAAM,QAAQ,yBAAyB,EAAIA,EAAQA,EAAM,cAAc,yBAAyB,EAE9GA,EAAM,MAAM,QAAUC,EAAa,QAAU,OACzCC,IACFA,EAAM,SAAWD,EACZA,IAAYC,EAAM,MAAQ,IAEnC,CAAC,CACH,CACF,CAvCA,IAAAC,EAAAC,EAAA,QCAA,IAAAC,EAAAC,EAAA,KAAAC,IAEA,SAAS,iBAAiB,mBAAoB,UAAY,CACxDC,EAA0B,CAC5B,CAAC,ICJD,IAAAC,EAAAC,EAAA,SAAAC,EAAO",
6
- "names": ["initConditionalFormFields", "trigger", "updateConditionalFields", "triggerName", "triggerValue", "field", "shouldShow", "input", "init_formUtils", "__esmMin", "require_contact_form", "__commonJSMin", "init_formUtils", "initConditionalFormFields", "require_contact", "__commonJSMin", "import_contact_form"]
3
+ "sources": ["../utils/formUtils.js", "../pages/contact/contact-form.js"],
4
+ "sourcesContent": ["/**\n * Conditional Form Fields Script (Generic & Reusable)\n *\n * This script enables conditional visibility and required-state for form fields\n * based on trigger inputs (like dropdowns or radios).\n *\n * \u2705 How to use:\n * 1. Add `data-trigger=\"yourTriggerName\"` to the input controlling the logic (e.g. <select> or <input>).\n * 2. Add `data-condition-trigger=\"yourTriggerName\"` to any form field container that should be shown conditionally.\n * 3. Add `data-condition-value=\"triggerValue\"` to define when that field should be visible.\n * 4. Inside the conditional container, set form elements to `required` \u2014 the script toggles this automatically.\n *\n * This allows multiple trigger/condition pairs on the same page without extra JS.\n */\nexport function initConditionalFormFields() {\n const triggers = document.querySelectorAll('[data-trigger]');\n\n triggers.forEach((trigger) => {\n trigger.addEventListener('change', () => updateConditionalFields(trigger));\n updateConditionalFields(trigger); // Run on load\n });\n\n function updateConditionalFields(trigger) {\n const triggerName = trigger.getAttribute('data-trigger');\n const triggerValue = trigger.value;\n\n const conditionals = document.querySelectorAll(`[data-condition-trigger=\"${triggerName}\"]`);\n\n conditionals.forEach((field) => {\n const shouldShow = field.getAttribute('data-condition-value') === triggerValue;\n const input = field.matches('input, select, textarea') ? field : field.querySelector('input, select, textarea');\n\n field.style.display = shouldShow ? 'block' : 'none';\n if (input) {\n input.required = shouldShow;\n if (!shouldShow) input.value = '';\n }\n });\n }\n}\n\n/** This script\n * - loops through all custom dropdowns with \"data-custom-dropdown\" attribute\n * - sets the selected value as selected in the dropdown\n * - creates a hidden input for form data\n * - sets the selected value from \"data-value\" to the hidden input\n **/\nexport function initCustomDropdowns() {\n document.querySelectorAll('[data-custom-dropdown]').forEach((dropdown) => {\n // Create the hidden input\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = dropdown.dataset.name || 'custom-dropdown';\n input.setAttribute('required', dropdown.dataset.required === 'true' || false);\n input.value = ''; // Or set a default value if needed\n\n // Append it to the dropdown or its closest form\n dropdown.appendChild(input);\n\n const toggle = dropdown.querySelector('.dropdown-selected-value');\n const links = dropdown.querySelectorAll('.dropdown-item');\n\n links.forEach((link) => {\n link.addEventListener('click', (e) => {\n e.preventDefault();\n const value = link.dataset.value;\n const content = link.cloneNode(true);\n content.style.padding = 0; //reset paddings from dropdown-item\n\n // Update visual\n toggle.innerHTML = '';\n toggle.appendChild(content);\n\n // Set hidden field\n input.value = value;\n });\n });\n });\n}\n\n\n\n// Setting up daterange-pickers\n// Docs: https://mymth.github.io/vanillajs-datepicker/\nexport function initDateRangePickers(groupSelector, startDateSelector, minimumDays = 30) {\n const datesInput = document.querySelector(groupSelector);\n const startDateField = document.querySelector(startDateSelector);\n const rangepicker = new DateRangePicker(datesInput, {\n format: 'dd. MM yyyy',\n });\n\n // Add an event listener to validate the date range\n let currentMinimumDays = minimumDays;\n\n // Expose a method to update minimumDays dynamically\n rangepicker.setMinimumDays = (days) => {\n currentMinimumDays = days;\n };\n\n rangepicker.validateDateRange = () => {\n const [startDate, endDate] = rangepicker.getDates();\n\n if (startDate && endDate) {\n const differenceInDays = Math.floor((endDate - startDate) / (1000 * 60 * 60 * 24));\n if (differenceInDays < currentMinimumDays) {\n startDateField.setCustomValidity(`You need to choose a minimum of ${currentMinimumDays} days.`);\n // Set end date to {{currentMinimumDays}} days after start date\n rangepicker.setDates(startDate, new Date(startDate.getTime() + currentMinimumDays * 24 * 60 * 60 * 1000)); \n } else {\n startDateField.setCustomValidity('');\n }\n } else {\n startDateField.setCustomValidity('');\n }\n // Trigger form validation\n startDateField.reportValidity();\n }\n\n datesInput.addEventListener('changeDate', rangepicker.validateDateRange);\n\n return { rangepicker, datesInput, startDateField };\n}\n\n\n/**\n * This script is responsible for\n * - the navigation of the multi step field\n * - update of the wizard step indicators\n * - form validation of all form elements of the current step\n **/\nexport function initFormWizardSteps() {\n const steps = document.querySelectorAll('.form-step');\n const stepIndicators = document.querySelectorAll(\n '.form-wizard-step .form-wizard-step-progress'\n );\n let currentStep = 0;\n\n function showStep(index) {\n steps.forEach((step, i) => {\n step.style.display = i === index ? 'block' : 'none';\n });\n\n stepIndicators.forEach((indicator, i) => {\n if (i < index || i === index) {\n indicator.classList.add('active');\n } else {\n indicator.classList.remove('active');\n }\n });\n }\n\n function validateCurrentStep() {\n const currentInputs = steps[currentStep].querySelectorAll('input, select, textarea');\n const errors = [];\n\n currentInputs.forEach((input) => {\n const isHidden = input.type === 'hidden' || input.offsetParent === null;\n\n if (input.required) {\n const isEmpty = !input.value || input.value.trim() === '';\n if (isEmpty) {\n const label = input.dataset.name || input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is required.`);\n }\n }\n\n // Custom type validation (e.g., email)\n if (!isHidden && input.value && !input.checkValidity()) {\n const label = input.name || input.placeholder || 'Unnamed field';\n errors.push(`${label} is invalid.`);\n }\n });\n return errors;\n }\n\n function showErrors(containerId, errorMessages) {\n const container = document.querySelector(containerId);\n\n if (!container) return;\n\n // Clear any previous errors\n container.innerHTML = '';\n\n // Create <ul> element\n const ul = document.createElement('ul');\n\n // Add each error as <li>\n errorMessages.forEach((msg) => {\n const li = document.createElement('li');\n li.textContent = msg;\n ul.appendChild(li);\n });\n\n // Append the list to the container\n container.appendChild(ul);\n }\n\n function resetErrors(containerId) {\n const container = document.querySelector(containerId);\n if (container) {\n container.innerHTML = '';\n }\n }\n\n document.querySelectorAll('.form-next-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n if (btn.getAttribute('disabled') === 'true') {\n return;\n }\n\n const errors = validateCurrentStep();\n const errorListId = `#error-list-step-${currentStep}`;\n resetErrors(errorListId);\n if (errors.length == 0) {\n currentStep = Math.min(currentStep + 1, steps.length - 1);\n const isLastStep = currentStep === steps.length - 1;\n if (isLastStep) {\n prepareReviewFields(); // this loops through all fields with #review-* and sets the corresponding value\n }\n showStep(currentStep);\n } else {\n showErrors(errorListId, errors);\n }\n });\n });\n\n function prepareReviewFields() {\n const reviewElements = document.querySelectorAll('[id^=\"review-\"]');\n\n // Loop through the matched elements\n reviewElements.forEach((element) => {\n const fieldName = element.dataset.fieldname;\n try {\n const fieldValue = document.querySelector(`[name=\"${fieldName}\"]`).value;\n element.innerText = fieldValue;\n } catch {}\n });\n }\n\n document.querySelectorAll('.form-previous-step-btn').forEach((btn) => {\n btn.addEventListener('click', () => {\n currentStep = Math.max(currentStep - 1, 0);\n showStep(currentStep);\n });\n });\n\n showStep(currentStep); // Init\n}", "import { initConditionalFormFields } from \"../../utils/formUtils\" \n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n initConditionalFormFields();\n});"],
5
+ "mappings": "MAcO,SAASA,GAA4B,CACzB,SAAS,iBAAiB,gBAAgB,EAElD,QAASC,GAAY,CAC5BA,EAAQ,iBAAiB,SAAU,IAAMC,EAAwBD,CAAO,CAAC,EACzEC,EAAwBD,CAAO,CACjC,CAAC,EAED,SAASC,EAAwBD,EAAS,CACxC,IAAME,EAAcF,EAAQ,aAAa,cAAc,EACjDG,EAAeH,EAAQ,MAER,SAAS,iBAAiB,4BAA4BE,CAAW,IAAI,EAE7E,QAASE,GAAU,CAC9B,IAAMC,EAAaD,EAAM,aAAa,sBAAsB,IAAMD,EAC5DG,EAAQF,EAAM,QAAQ,yBAAyB,EAAIA,EAAQA,EAAM,cAAc,yBAAyB,EAE9GA,EAAM,MAAM,QAAUC,EAAa,QAAU,OACzCC,IACFA,EAAM,SAAWD,EACZA,IAAYC,EAAM,MAAQ,IAEnC,CAAC,CACH,CACF,CCrCA,SAAS,iBAAiB,mBAAoB,UAAY,CACxDC,EAA0B,CAC5B,CAAC",
6
+ "names": ["initConditionalFormFields", "trigger", "updateConditionalFields", "triggerName", "triggerValue", "field", "shouldShow", "input", "initConditionalFormFields"]
7
7
  }