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U,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdR,EAAoBU,EAAI,CAACN,EAASQ,KACjC,IAAI,IAAIC,KAAOD,EACXZ,EAAoBc,EAAEF,EAAYC,KAASb,EAAoBc,EAAEV,EAASS,IAC5EE,OAAOC,eAAeZ,EAASS,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDb,EAAoBc,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,G","sources":["webpack://rwest/./src/js/theme.js","webpack://rwest/webpack/bootstrap","webpack://rwest/webpack/runtime/compat get default export","webpack://rwest/webpack/runtime/define property getters","webpack://rwest/webpack/runtime/hasOwnProperty shorthand"],"sourcesContent":["// Block - Product Carousel Customization\n\nfunction fadeActiveSlideContentOnSlideChange(control) {\n let slider = control.parentNode.parentNode;\n let activeSlide = slider.querySelector(\".splide__slide.is-visible\");\n let activeSlideId = activeSlide.id;\n\n // Must do it by adding and removing a class rather than updating style object or it will not come back in when active again\n document.getElementById(activeSlideId).classList.add(\"content-hidden\");\n setTimeout(() => {\n document.getElementById(activeSlideId).classList.remove(\"content-hidden\");\n }, 500);\n}\n\n// Custom - Accordion\nfunction activateCustomAccordions() {\n const accordions = document.querySelectorAll('.accordion-custom .accordion-item');\n\n accordions.forEach(function(accordion) {\n const header = accordion.querySelector('.accordion-header');\n const content = accordion.querySelector('.accordion-content');\n\n if (accordion.classList.contains('active')) {\n content.style.maxHeight = content.scrollHeight + 30 + 'px';\n } else { \n content.style.maxHeight = '0';\n }\n\n header.addEventListener('click', function() {\n accordion.classList.toggle('active');\n\n if (accordion.classList.contains('active')) {\n content.style.maxHeight = content.scrollHeight + 30 + 'px';\n } else {\n content.style.maxHeight = '0';\n }\n });\n });\n\n}\n\n// Custom - Inventory Availablity Modal\nfunction activateInventoryModal() {\n let modalLinks = document.querySelectorAll('.inventory-modal-trigger');\n const body = document.querySelector('body');\n\n modalLinks.forEach(function(link) {\n link.onclick = function(event) {\n event.preventDefault(); \n\n const modalId = link.getAttribute('data-modal-id'); \n const modal = document.getElementById(modalId);\n const year = link.getAttribute('data-year');\n const make = link.getAttribute('data-make');\n const model = link.getAttribute('data-model');\n const series = link.getAttribute('data-series');\n let seriesText = '';\n if (series !== '') { seriesText = series; } else { seriesText = ''; }\n const inventoryTitle = year + ' ' + make + ' ' + model + ' ' + seriesText;\n\n const vin = link.getAttribute('data-vin');\n const stock = link.getAttribute('data-stock');\n\n if (modal) {\n let titleElement = modal.querySelector('#inventory');\n let yearInput = modal.querySelector('#input_3_7');\n let makeInput = modal.querySelector('#input_3_12');\n let modelInput = modal.querySelector('#input_3_13');\n let seriesInput = modal.querySelector('#input_3_14');\n let vinElement = modal.querySelector('#vin');\n let vinInput = modal.querySelector('#input_3_8')\n let stockElement = modal.querySelector('#stock');\n let stockInput = modal.querySelector('#input_3_9');\n titleElement.innerHTML = inventoryTitle;\n yearInput.value = year;\n makeInput.value = make;\n modelInput.value = model;\n seriesInput.value = series;\n vinElement.innerHTML = vin;\n vinInput.value = vin;\n stockElement.innerHTML = stock;\n stockInput.value = stock;\n modal.style.display = 'flex';\n body.style.overflow = 'hidden';\n }\n };\n });\n\n const closeButtons = document.querySelectorAll('.custom-modal-close');\n\n closeButtons.forEach(function(button) {\n button.onclick = function() {\n const modal = button.closest('.custom-modal-overlay'); \n let formReloadLink = document.querySelector('#gform_confirmation_message_3 .gws-reload-form');\n if (modal) {\n modal.style.display = 'none'; \n body.style.overflow = 'auto';\n }\n if(formReloadLink) {\n formReloadLink.click();\n }\n };\n });\n\n window.onclick = function(event) {\n if (event.target.classList.contains('custom-modal-overlay')) {\n let formReloadLink = document.querySelector('#gform_confirmation_message_3 .gws-reload-form');\n event.target.style.display = 'none';\n body.style.overflow = 'auto';\n if(formReloadLink) {\n formReloadLink.click();\n }\n }\n };\n}\n\n//////////////////////////////////////\n// Mobile Filters \n/////////////////////////////////////////\n\nlet tabletMax = 998.98;\n\nfunction positionMobileFilters() {\n const filters = document.getElementById('filter-accordions');\n \n if(filters) { \n const header = document.getElementById('header');\n const adminBar = document.getElementById('wpadminbar');\n const body = document.querySelector('body');\n const filtersSection = document.querySelector('.inventory-filters');\n const filtersContainer = document.getElementById('filters-wrapper');\n const filtersHeader = document.getElementById('filters-header');\n const applyFiltersBtn = document.getElementById('applyFilters');\n let filtersHeaderHeight = filtersHeader.getBoundingClientRect().height;\n let headerHeight = header.getBoundingClientRect().height + (adminBar ? adminBar.getBoundingClientRect().height : 0);\n\n filtersHeader.removeEventListener('click', openCloseMobileFilters);\n filtersSection.style.paddingTop = filtersHeaderHeight + 'px';\n filtersContainer.style.top = headerHeight + 'px';\n filters.style.height = (window.innerHeight - headerHeight - filtersHeaderHeight) + 'px';\n if (!filters.classList.contains('filters-open')) {\n filters.style.top = '-'+ (window.innerHeight - headerHeight - filtersHeaderHeight) + 'px';\n body.style.overflow = 'auto';\n } else {\n body.style.overflow = 'hidden';\n }\n // open and close filters\n filtersHeader.addEventListener('click', openCloseMobileFilters);\n applyFiltersBtn.addEventListener('click', openCloseMobileFilters);\n }\n\n}\n\nfunction openCloseMobileFilters() {\n const header = document.getElementById('header');\n const adminBar = document.getElementById('wpadminbar');\n const filters = document.getElementById('filter-accordions');\n const body = document.querySelector('body');\n const filtersHeader = document.getElementById('filters-header');\n let filtersHeaderHeight = filtersHeader.getBoundingClientRect().height;\n let headerHeight = header.getBoundingClientRect().height + (adminBar ? adminBar.getBoundingClientRect().height : 0);\n\n if (filters.classList.contains('filters-open')) {\n filters.style.top = '-'+ (window.innerHeight - headerHeight - filtersHeaderHeight) + 'px';\n filters.classList.remove('filters-open');\n filtersHeader.classList.remove('filters-open');\n body.style.overflow = 'auto';\n } else {\n filters.style.top = filtersHeaderHeight + 'px';\n filters.classList.add('filters-open');\n filtersHeader.classList.add('filters-open');\n body.style.overflow = 'hidden';\n }\n}\n\nfunction resetFiltersSizing() {\n const filters = document.getElementById('filter-accordions');\n const filtersSection = document.querySelector('.inventory-filters');\n const body = document.querySelector('body');\n \n if(filters) {\n filtersSection.style.paddingTop = '0px';\n filters.style.height = 'auto';\n body.style.overflow = 'auto';\n }\n}\n\nfunction disableCarouselWhenOneSlide() {\n let carousels = document.querySelectorAll('.kt-blocks-carousel');\n carousels.forEach(function(carousel) {\n let slideCount = carousel.querySelector('.splide__list').children.length;\n if(slideCount === 1) {\n carousel.classList.add('one-slide');\n }\n });\n}\n\nfunction hideEmptyFacetGroups() {\n\n let facetGroups = document.querySelectorAll('.facet-group');\n \n facetGroups.forEach(function(group) {\n let allEmpty = true;\n let groupFacets = group.querySelectorAll('.facetwp-facet');\n \n groupFacets.forEach(function(facet) {\n if (facet.children.length) {\n allEmpty = false;\n return;\n }\n });\n \n if (allEmpty) {\n // console.log('hiding facet group: ', group);\n group.style.display = \"none\";\n }\n });\n}\n\n// ON LOAD EVENTS\n\nwindow.addEventListener(\n \"load\",\n function () {\n // activate custom inventory modal\n activateInventoryModal();\n // disable carousels when only 1 image present\n disableCarouselWhenOneSlide();\n \n // hide emptry facet groups\n if (typeof FWP !== 'undefined') {\n hideEmptyFacetGroups();\n }\n\n // position mobile filters\n if (window.innerWidth <= tabletMax) {\n positionMobileFilters();\n }\n // Activate custom accordions - delayed for FWP loading on filter page\n setTimeout(() => {\n activateCustomAccordions();\n }, 100);\n \n \n // Add event listener to product carousel arrows once they are loaded\n document.body.addEventListener(\"click\", function (e) {\n if (\n e.target.classList.contains(\"splide__arrow\") &&\n e.target.closest(\".custom-product-carousel\")\n ) {\n fadeActiveSlideContentOnSlideChange(e.target);\n }\n });\n },\n false\n);\n\n// RESIZE EVENTS\n\nlet resizeTimer;\n\nwindow.addEventListener('resize', function(event) {\n\tif(resizeTimer) {\n\t\twindow.clearTimeout(resizeTimer);\n\t}\n\n\tresizeTimer = window.setTimeout(function() {\n\n if (window.innerWidth <= tabletMax) {\n positionMobileFilters();\n } else {\n resetFiltersSizing();\n }\n\n\t}, 100);\n});\n\n\ndocument.addEventListener('facetwp-loaded', function() {\n if (FWP.loaded) {\n activateInventoryModal();\n ;\n }\n\n});\n\n\n\n// ON SCROLL EVENTS\n\n// let scrollTimer;\n\n// window.addEventListener('scroll', function(event) {\n// \tif(scrollTimer) {\n// \t\twindow.clearTimeout(scrollTimer);\n// \t}\n\n// \tscrollTimer = window.setTimeout(function() {\n// \t\t// callback function\n// \t}, 100);\n// });\n\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))"],"names":["activateInventoryModal","modalLinks","document","querySelectorAll","body","querySelector","forEach","link","onclick","event","preventDefault","modalId","getAttribute","modal","getElementById","year","make","model","series","inventoryTitle","vin","stock","titleElement","yearInput","makeInput","modelInput","seriesInput","vinElement","vinInput","stockElement","stockInput","innerHTML","value","style","display","overflow","button","closest","formReloadLink","click","window","target","classList","contains","resizeTimer","tabletMax","positionMobileFilters","filters","header","adminBar","filtersSection","filtersContainer","filtersHeader","applyFiltersBtn","filtersHeaderHeight","getBoundingClientRect","height","headerHeight","removeEventListener","openCloseMobileFilters","paddingTop","top","innerHeight","addEventListener","remove","add","carousel","children","length","FWP","group","allEmpty","facet","innerWidth","setTimeout","accordion","content","maxHeight","scrollHeight","toggle","e","control","activeSlideId","parentNode","id","clearTimeout","loaded","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call"],"sourceRoot":""}