hubs-travel-js 0.0.45 → 0.0.47
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.
- package/bundle-about-us.min.js +1 -1
- package/bundle-about-us.min.js.map +2 -2
- package/bundle-all-destinations.min.js +1 -1
- package/bundle-all-destinations.min.js.map +2 -2
- package/bundle-book-workation.min.js +1 -1
- package/bundle-book-workation.min.js.map +4 -4
- package/bundle-business-destination.min.js +1 -1
- package/bundle-business-destination.min.js.map +2 -2
- package/bundle-contact.min.js +1 -1
- package/bundle-contact.min.js.map +4 -4
- package/bundle-destination.min.js +5 -5
- package/bundle-destination.min.js.map +3 -3
- package/bundle-faqs.min.js +1 -1
- package/bundle-faqs.min.js.map +2 -2
- package/bundle-homepage.min.js +1 -1
- package/bundle-homepage.min.js.map +2 -2
- package/bundle-hubs-business.min.js +1 -1
- package/bundle-hubs-business.min.js.map +2 -2
- package/bundle-request-quote.min.js +1 -1
- package/bundle-request-quote.min.js.map +2 -2
- package/package.json +1 -1
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../components/special-room-offers-cards.js", "../controls/collectionListDropdown.js", "../components/upcoming-editions.js", "../components/upcoming-editions-filter.js", "../components/simple-cards.js", "../components/testimonial-cards.js", "../pages/homepage/index.js"],
|
|
4
4
|
"sourcesContent": ["export const SpecialRoomOffersCardsCarousel = (function () {\n\tlet swiperInstance, pagination = null;\n let SELECTORS = null;\n\n function initSwiper() {\n const swiperWrapper = document.querySelector(SELECTORS.swiperWrapper);\n pagination = document.querySelector(SELECTORS.pagination);\n\n if (!swiperWrapper || !pagination) { \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 grid: {\n rows: 5,\n },\n spaceBetween: 0,\n pagination: {\n el: SELECTORS.pagination,\n clickable: true,\n },\n });\n\n\t\tswiperInstance = swiper;\n\n // Add event listeners to update button states when slides change\n swiper.on('slideChange', function () {\n });\n\n return swiper;\n }\n\n // Public methods\n return {\n init: function(selectors) {\n SELECTORS = selectors;\n document.addEventListener('DOMContentLoaded', function() {\n\n // Initialize swiper\n initSwiper();\n });\n }\n };\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}", "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}", "export const TestimonialCardsCarousel = (function () {\n function initSwiper(selector) {\n // Initialize Swiper\n const swiper = new Swiper(selector, {\n effect: \"cards\",\n grabCursor: true,\n slidesPerView: 1,\n spaceBetween: 0,\n freeMode: false,\n slidesOffsetAfter: 0,\n watchOverflow: true,\n navigation: {\n nextEl: '#testimonial-cards-swiper-next-btn',\n prevEl: '#testimonial-cards-swiper-prev-btn',\n },\n });\n\n // Set initial state of buttons\n updateButtonsState(swiper);\n\n // Add event listeners to update button states when slides change\n swiper.on('slideChange', function() {\n updateButtonsState(swiper);\n });\n\n return swiper;\n }\n\n // Function to update button states\n function updateButtonsState(swiper) {\n const prevButton = document.querySelector('#testimonial-cards-swiper-prev-btn');\n const nextButton = document.querySelector('#testimonial-cards-swiper-next-btn');\n\n prevButton.style.opacity = swiper.isBeginning ? '0.5' : '1';\n prevButton.style.pointerEvents = swiper.isBeginning ? 'none': 'auto'; \n\n nextButton.style.opacity = swiper.isEnd ? '0.5' : '1';\n nextButton.style.pointerEvents = swiper.isEnd ? 'none' : 'auto';\n }\n \n // Public API\n return {\n initSwiper\n };\n})();\n\nexport function initTestimonialCards() {\n //fix webflow designer display\n const slides = document.querySelectorAll('#testimonial-cards-section .testimonial-card-slide');\n slides.forEach(slide => {\n slide.style.position = \"static\";\n });\n \n //fix error of shadows\n const shadows = document.querySelectorAll('#testimonial-cards-section .swiper-slide-shadow');\n shadows.forEach(shadow => {\n shadow.style.borderRadius = \"16px\";\n });\n}", "import { SpecialRoomOffersCardsCarousel } from \"../../components/special-room-offers-cards\"; \nimport { CollectionListDropDown } from \"../../controls/collectionListDropdown\"\nimport { EditionCardsCarousel, updateEditionCardLinkUrls } from \"../../components/upcoming-editions\";\nimport { initUpcomingEditionsFilter } from \"../../components/upcoming-editions-filter\";\nimport { SimpleCardsCarousel } from \"../../components/simple-cards\";\nimport { TestimonialCardsCarousel, initTestimonialCards } from \"../../components/testimonial-cards\";\n\ndocument.addEventListener('DOMContentLoaded', function() {\n // Update edition card links\n updateEditionCardLinkUrls();\n\n // Initialize the upcoming editions filter\n initUpcomingEditionsFilter();\n\n // Initialize the testimonial cards\n initTestimonialCards();\n});\n\n// Initialize the Location Filter Dropdown in the Hero Section\nCollectionListDropDown.init({ selector: \"#destination-dropdown\", onChange: (selectedItem) => {\n\tconst selectedValue = selectedItem.getAttribute(\"data-value\") || selectedItem.textContent.trim(); \n const linkElement = document.querySelector(\"#find-workation-button\");\n const baseUrl = linkElement.getAttribute(\"href\").split(\"?\")[0]; // Remove existing query params\n\n // Update the link's href with the new query parameter\n linkElement.setAttribute(\"href\", `${baseUrl}?location=${encodeURIComponent(selectedValue)}`);\n}});\n\n// Initialize the carousel\nSpecialRoomOffersCardsCarousel.init({\n swiper: '#special-room-offers-section .swiper',\n swiperWrapper: '#special-room-offers-section .swiper-wrapper', \n pagination: '#special-room-offers-section .swiper-pagination',\n});\n\n// Initialize the carousel\nEditionCardsCarousel.init({\n refContainer: \"#edition-cards-swiper-ref-container\", // this is needed for calculating the left offset\n swiper: '#edition-cards-section .swiper',\n swiperWrapper: '#edition-cards-section .swiper-wrapper', \n prevButton: '#edition-cards-swiper-prev-btn',\n nextButton: '#edition-cards-swiper-next-btn'\n});\n\n// Initialize the carousel\nconst activityCardsCarousel = 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});\nactivityCardsCarousel.init();\n\nTestimonialCardsCarousel.initSwiper(\"#testimonial-cards-section .swiper\");\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["SpecialRoomOffersCardsCarousel", "
|
|
5
|
+
"mappings": "MAAO,IAAMA,EAAkC,UAAY,CAC1D,IAAIC,EAAgBC,EAAa,KAC5BC,EAAY,KAEhB,SAASC,GAAa,CACpB,IAAMC,EAAgB,SAAS,cAAcF,EAAU,aAAa,EAGpE,GAFAD,EAAa,SAAS,c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,iBAAiB,oDAAoD,EACtF,QAAQC,GAAS,CACtBA,EAAM,MAAM,SAAW,QACzB,CAAC,EAGe,SAAS,iBAAiB,iDAAiD,EACnF,QAAQC,GAAU,CACxBA,EAAO,MAAM,aAAe,MAC9B,CAAC,CACH,CCnDA,SAAS,iBAAiB,mBAAoB,UAAW,CAEvDC,EAA0B,EAG1BC,EAA2B,EAG3BC,EAAqB,CACvB,CAAC,EAGDC,EAAuB,KAAK,CAAE,SAAU,wBAAyB,SAAWC,GAAiB,CAC5F,IAAMC,EAAgBD,EAAa,aAAa,YAAY,GAAKA,EAAa,YAAY,KAAK,EACxFE,EAAc,SAAS,cAAc,wBAAwB,EAC7DC,EAAUD,EAAY,aAAa,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,EAG7DA,EAAY,aAAa,OAAQ,GAAGC,CAAO,aAAa,mBAAmBF,CAAa,CAAC,EAAE,CAC7F,CAAC,CAAC,EAGFG,EAA+B,KAAK,CAClC,OAAQ,uCACR,cAAe,+CACf,WAAY,iDACd,CAAC,EAGDC,EAAqB,KAAK,CACxB,aAAc,sCACd,OAAQ,iCACR,cAAe,yCACf,WAAY,iCACZ,WAAY,gCACd,CAAC,EAGD,IAAMC,EAAwB,IAAIC,EAAoB,CACpD,aAAc,uCACd,OAAQ,kCACR,cAAe,0CACf,WAAY,kCACZ,WAAY,iCACd,CAAC,EACDD,EAAsB,KAAK,EAE3BE,EAAyB,WAAW,oCAAoC",
|
|
6
|
+
"names": ["SpecialRoomOffersCardsCarousel", "swiperInstance", "pagination", "SELECTORS", "initSwiper", "swiperWrapper", "swiper", "selectors", "CollectionListDropDown", "dropdowns", "initDropDown", "selector", "onChange", "initialValue", "container", "dropdown", "dropdownToggle", "dropdownList", "selectedItemValueContainer", "collectionItems", "item", "event", "selectedOption", "selectDropDownElement", "getElementByItemValue", "selectedItem", "sourceElement", "clonedElement", "currentValue", "value", "x", "EditionCardsCarousel", "swiperInstance", "prevButton", "nextButton", "allSlides", "SELECTORS", "initSwiper", "refContainer", "swiperWrapper", "offsetBefore", "swiper", "updateButtonsState", "newOffsetBefore", "maxTranslate", "selectors", "season", "slidesToKeep", "slideEl", "updateEditionCardLinkUrls", "editionCard", "editionLinkElems", "editionSlug", "bookingState", "link", "bgImage", "baseUrl", "initUpcomingEditionsFilter", "filterButtons", "allItems", "button", "btn", "season", "item", "allButton", "SimpleCardsCarousel", "selectors", "swiperWrapper", "refContainer", "offsetBefore", "swiper", "newOffsetBefore", "maxTranslate", "TestimonialCardsCarousel", "initSwiper", "selector", "swiper", "updateButtonsState", "prevButton", "nextButton", "initTestimonialCards", "slide", "shadow", "updateEditionCardLinkUrls", "initUpcomingEditionsFilter", "initTestimonialCards", "CollectionListDropDown", "selectedItem", "selectedValue", "linkElement", "baseUrl", "SpecialRoomOffersCardsCarousel", "EditionCardsCarousel", "activityCardsCarousel", "SimpleCardsCarousel", "TestimonialCardsCarousel"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{var
|
|
1
|
+
(()=>{var d=function(){let r,i,o=null,e=null;function c(){let t=document.querySelector(e.swiperWrapper);if(i=document.querySelector(e.prevButton),o=document.querySelector(e.nextButton),!t||!i||!o)return console.error("Required elements not found"),null;let s=new Swiper(e.swiper,{slidesPerView:"auto",spaceBetween:16,freeMode:!1,slidesOffsetAfter:16,navigation:{nextEl:e.nextButton,prevEl:e.prevButton},watchOverflow:!0});r=s,p(),s.on("slideChange",function(){p()});function a(){let n=t.getBoundingClientRect().left,u=document.querySelector("#features-cards-section .features-cards-carousel-container");u.style.width=`${window.innerWidth-n}px`,u.style.minWidth=`${window.innerWidth-n}px`,u.style.maxWidth=`${window.innerWidth-n}px`,t.style.width=`${window.innerWidth-n}px`,t.style.minWidth=`${window.innerWidth-n}px`,t.style.maxWidth=`${window.innerWidth-n}px`}return window.addEventListener("resize",a),a(),s}function p(){!i||!o||(i.style.opacity=r.isBeginning?"0.5":"1",i.style.pointerEvents=r.isBeginning?"none":"auto",o.style.opacity=r.isEnd?"0.5":"1",o.style.pointerEvents=r.isEnd?"none":"auto")}return{init:function(t){e=t,document.addEventListener("DOMContentLoaded",function(){let s=document.querySelector(e.swiperWrapper);s.style.gap="0",c()})}}}();d.init({swiper:"#features-cards-section .swiper",swiperWrapper:"#features-cards-section .swiper-wrapper",prevButton:"#features-cards-btn-left",nextButton:"#features-cards-btn-right"});})();
|
|
2
2
|
//# sourceMappingURL=bundle-hubs-business.min.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../components/feature-slider.js", "../pages/hubs-business/index.js"],
|
|
4
4
|
"sourcesContent": ["export const FeaturesCardsCarousel = (function () {\n let swiperInstance, prevButton, nextButton = null;\n let SELECTORS = null;\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: \"auto\",\n spaceBetween: 16,\n freeMode: false,\n slidesOffsetAfter: 16,\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 \n function setWrapperWidth() {\n const wrapperRect = swiperWrapper.getBoundingClientRect();\n \tconst wrapperBefore = wrapperRect.left;\n const carouselContainer = document.querySelector('#features-cards-section .features-cards-carousel-container')\n \n carouselContainer.style.width = `${window.innerWidth - wrapperBefore}px`;\n carouselContainer.style.minWidth = `${window.innerWidth - wrapperBefore}px`;\n carouselContainer.style.maxWidth = `${window.innerWidth - wrapperBefore}px`;\n\n swiperWrapper.style.width = `${window.innerWidth - wrapperBefore}px`;\n swiperWrapper.style.minWidth = `${window.innerWidth - wrapperBefore}px`;\n swiperWrapper.style.maxWidth = `${window.innerWidth - wrapperBefore}px`;\n }\n\n window.addEventListener('resize', setWrapperWidth);\n setWrapperWidth(); \n \n // Add resize event listener separately\n //window.addEventListener('resize', () => {\n // const newOffsetBefore = refContainer.getBoundingClientRect().left;\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\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;\n \tdocument.addEventListener('DOMContentLoaded', function() {\n\t\t\t\tconst swiperWrapper = document.querySelector(SELECTORS.swiperWrapper);\n swiperWrapper.style.gap = '0';\n \n // Initialize swiper\n initSwiper();\n\t\t\t});\n }\n };\n})();\n", "import { FeaturesCardsCarousel } from \"../../components/feature-slider\";\n\n// Initialize the feature cards carousel\nFeaturesCardsCarousel.init({\n swiper: '#features-cards-section .swiper',\n swiperWrapper: '#features-cards-section .swiper-wrapper', \n prevButton: '#features-cards-btn-left',\n nextButton: '#features-cards-btn-right'\n});"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["FeaturesCardsCarousel", "
|
|
5
|
+
"mappings": "MAAO,IAAMA,EAAyB,UAAY,CAChD,IAAIC,EAAgBC,EAAYC,EAAa,KACzCC,EAAY,KAEhB,SAASC,GAAa,CACpB,IAAMC,EAAgB,SAAS,cAAcF,EAAU,aAAa,EAIpE,GAHAF,EAAa,SAAS,c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,aAAa,EAChEE,EAAc,MAAM,IAAM,IAG1BD,EAAW,CAChB,CAAC,CACA,CACF,CACF,EAAG,ECzFHQ,EAAsB,KAAK,CACzB,OAAQ,kCACR,cAAe,0CACf,WAAY,2BACZ,WAAY,2BACd,CAAC",
|
|
6
|
+
"names": ["FeaturesCardsCarousel", "swiperInstance", "prevButton", "nextButton", "SELECTORS", "initSwiper", "swiperWrapper", "swiper", "updateButtonsState", "setWrapperWidth", "wrapperBefore", "carouselContainer", "selectors", "FeaturesCardsCarousel"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{
|
|
1
|
+
(()=>{function p(){document.querySelectorAll("[data-trigger]").forEach(e=>{e.addEventListener("change",()=>i(e)),i(e)});function i(e){let l=e.getAttribute("data-trigger"),c=e.value;document.querySelectorAll(`[data-condition-trigger="${l}"]`).forEach(s=>{let a=s.getAttribute("data-condition-value")===c,n=s.matches("input, select, textarea")?s:s.querySelector("input, select, textarea");s.style.display=a?"block":"none",n&&(n.required=a,a||(n.value=""))})}}function y(){document.querySelectorAll("[data-custom-dropdown]").forEach(r=>{let i=document.createElement("input");i.type="hidden",i.name=r.dataset.name||"custom-dropdown",i.setAttribute("required",r.dataset.required==="true"||!1),i.value="",r.appendChild(i);let e=r.querySelector(".dropdown-selected-value");r.querySelectorAll(".dropdown-item").forEach(c=>{c.addEventListener("click",d=>{d.preventDefault();let s=c.dataset.value,a=c.cloneNode(!0);a.style.padding=0,e.innerHTML="",e.appendChild(a),i.value=s})})})}function h(r,i,e=30){let l=document.querySelector(r),c=document.querySelector(i),d=new DateRangePicker(l,{format:"dd. MM yyyy"}),s=e;return d.setMinimumDays=a=>{s=a},d.validateDateRange=()=>{let[a,n]=d.getDates();a&&n&&Math.floor((n-a)/864e5)<s?(c.setCustomValidity(`You need to choose a minimum of ${s} days.`),d.setDates(a,new Date(a.getTime()+s*24*60*60*1e3))):c.setCustomValidity(""),c.reportValidity()},l.addEventListener("changeDate",d.validateDateRange),{rangepicker:d,datesInput:l,startDateField:c}}function v(){let r=document.querySelectorAll(".form-step"),i=document.querySelectorAll(".form-wizard-step .form-wizard-step-progress"),e=0;function l(n){r.forEach((o,t)=>{o.style.display=t===n?"block":"none"}),i.forEach((o,t)=>{t<n||t===n?o.classList.add("active"):o.classList.remove("active")})}function c(){let n=r[e].querySelectorAll("input, select, textarea"),o=[];return n.forEach(t=>{let u=t.type==="hidden"||t.offsetParent===null;if(t.required&&(!t.value||t.value.trim()==="")){let f=t.dataset.name||t.name||t.placeholder||"Unnamed field";o.push(`${f} is required.`)}if(!u&&t.value&&!t.checkValidity()){let m=t.name||t.placeholder||"Unnamed field";o.push(`${m} is invalid.`)}}),o}function d(n,o){let t=document.querySelector(n);if(!t)return;t.innerHTML="";let u=document.createElement("ul");o.forEach(m=>{let f=document.createElement("li");f.textContent=m,u.appendChild(f)}),t.appendChild(u)}function s(n){let o=document.querySelector(n);o&&(o.innerHTML="")}document.querySelectorAll(".form-next-step-btn").forEach(n=>{n.addEventListener("click",()=>{if(n.getAttribute("disabled")==="true")return;let o=c(),t=`#error-list-step-${e}`;s(t),o.length==0?(e=Math.min(e+1,r.length-1),e===r.length-1&&a(),l(e)):d(t,o)})});function a(){document.querySelectorAll('[id^="review-"]').forEach(o=>{let t=o.dataset.fieldname;try{let u=document.querySelector(`[name="${t}"]`).value;o.innerText=u}catch{}})}document.querySelectorAll(".form-previous-step-btn").forEach(n=>{n.addEventListener("click",()=>{e=Math.max(e-1,0),l(e)})}),l(e)}function g(){document.getElementById("close-button").addEventListener("click",function(){let r=document.referrer,i=window.location.hostname,e=null;try{e=r?new URL(r).hostname:null}catch{e=null}window.history.length>1&&e===i?window.history.back():window.location.href="/"})}document.addEventListener("DOMContentLoaded",function(){g(),p(),v(),y(),h("#dates-start-end-group","#Estimated-Start-Date")});})();
|
|
2
2
|
//# sourceMappingURL=bundle-request-quote.min.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../utils/formUtils.js", "../utils/close-page.js", "../pages/request-quote/index.js"],
|
|
4
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}", "\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 { initConditionalFormFields, initFormWizardSteps, initCustomDropdowns, initDateRangePickers } from \"../../utils/formUtils\" \nimport { initCloseButtonClick } from \"../../utils/close-page\";\n\ndocument.addEventListener('DOMContentLoaded', function () {\n initCloseButtonClick();\n initConditionalFormFields();\n initFormWizardSteps();\n initCustomDropdowns();\n initDateRangePickers('#dates-start-end-group', '#Estimated-Start-Date');\n});"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["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", "
|
|
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,CAQO,SAASC,GAAsB,CACpC,SAAS,iBAAiB,wBAAwB,EAAE,QAASC,GAAa,CAExE,IAAMF,EAAQ,SAAS,cAAc,OAAO,EAC5CA,EAAM,KAAO,SACbA,EAAM,KAAOE,EAAS,QAAQ,MAAQ,kBACtCF,EAAM,aAAa,WAAYE,EAAS,QAAQ,WAAa,QAAU,EAAK,EAC5EF,EAAM,MAAQ,GAGdE,EAAS,YAAYF,CAAK,EAE1B,IAAMG,EAASD,EAAS,cAAc,0BAA0B,EAClDA,EAAS,iBAAiB,gBAAgB,EAElD,QAASE,GAAS,CACtBA,EAAK,iBAAiB,QAAUC,GAAM,CACpCA,EAAE,eAAe,EACjB,IAAMC,EAAQF,EAAK,QAAQ,MACrBG,EAAUH,EAAK,UAAU,EAAI,EACnCG,EAAQ,MAAM,QAAU,EAGxBJ,EAAO,UAAY,GACnBA,EAAO,YAAYI,CAAO,EAG1BP,EAAM,MAAQM,CAChB,CAAC,CACH,CA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H,CAAC,EAED,SAASa,GAAsB,CACN,SAAS,iBAAiB,iBAAiB,EAGnD,QAASC,GAAY,CAClC,IAAMC,EAAYD,EAAQ,QAAQ,UAClC,GAAI,CACF,IAAME,EAAa,SAAS,cAAc,UAAUD,CAAS,IAAI,EAAE,MACnED,EAAQ,UAAYE,CACtB,MAAQ,CAAC,CACX,CAAC,CACH,CAEA,SAAS,iBAAiB,yBAAyB,EAAE,QAASL,GAAQ,CACpEA,EAAI,iBAAiB,QAAS,IAAM,CAClCnB,EAAc,KAAK,IAAIA,EAAc,EAAG,CAAC,EACzCC,EAASD,CAAW,CACtB,CAAC,CACH,CAAC,EAEDC,EAASD,CAAW,CACtB,CChPO,SAASyB,GAAuB,CACrC,SAAS,eAAe,cAAc,EAAE,iBAAiB,QAAS,UAAY,CAC5E,IAAMC,EAAW,SAAS,SACpBC,EAAgB,OAAO,SAAS,SAGlCC,EAAiB,KACrB,GAAI,CACFA,EAAiBF,EAAW,IAAI,IAAIA,CAAQ,EAAE,SAAW,IAC3D,MAAY,CACVE,EAAiB,IACnB,CAEI,OAAO,QAAQ,OAAS,GAAKA,IAAmBD,EAClD,OAAO,QAAQ,KAAK,EAEpB,OAAO,SAAS,KAAO,GAE3B,CAAC,CACH,CCvBA,SAAS,iBAAiB,mBAAoB,UAAY,CACxDE,EAAqB,EACrBC,EAA0B,EAC1BC,EAAoB,EACpBC,EAAoB,EACpBC,EAAqB,yBAA0B,uBAAuB,CACxE,CAAC",
|
|
6
|
+
"names": ["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", "initCloseButtonClick", "initConditionalFormFields", "initFormWizardSteps", "initCustomDropdowns", "initDateRangePickers"]
|
|
7
7
|
}
|