{"version":3,"file":"denso-part-finder-0384bbce0c.min.js","sources":["denso-part-finder.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n(function ($) {\n var navBreak = 768;\n var VINLENGTH = 17;\n $(document).ready(function () {\n dpfPutSearchInHeader();\n dpfMobileSearch(); // move part search div to bottom of header\n dpfHeaderSearchOffset();\n $(\".dpf-tablink\").on(\"click\", function () {\n // tab functionality\n var tabName = $(this).data(\"tabcontent\");\n $(\".dpf-tabcontent\").hide();\n $(\".dpf-tablink\").not($(this)).removeClass(\"active\");\n $(this).addClass(\"active\");\n $(\"#\" + tabName).show();\n });\n vinInput().on(\"input\", function (e) {\n turnOffPredefinedEvents();\n toggleVinSubmit();\n });\n partNumberInput().on(\"input\", function (e) {\n turnOffPredefinedEvents();\n togglePartNumberSubmit();\n });\n crossRefInput().on(\"input\", function (e) {\n turnOffPredefinedEvents();\n toggleCrossRefSubmit();\n });\n\n // Maybe we should get more strict and also check for a base vehicle or part number.\n if (window.location.href.includes(\"part-finder-search-results\")) {\n updatePartsList();\n }\n initDropdowns();\n if (window.location.href.includes(\"part-finder-search-results\")) {\n loadEngineDetails();\n }\n takeOverFindMyPart();\n if (window.location.href.includes(\"part-finder-part-details\")) {\n loadChannelAdvisor();\n }\n if (window.location.href.includes(\"installation-guides\")) {\n updateGuidesList();\n }\n form().submit(handleFormSubmit);\n });\n $(window).on(\"resize orientationchange\", function () {\n dpfMobileSearch();\n dpfHeaderSearchOffset();\n });\n $(window).on(\"keypress\", function (e) {\n var dropdownContainers = [$(\"#dpfVehicleYearDropdownItems\").parent(), $(\"#dpfVehicleMakeDropdownItems\").parent(), $(\"#dpfVehicleModelDropdownItems\").parent(), $(\"#dpfVehicleEngineDropdownItems\").parent(), $(\"#dpfVehicleTrimDropdownItems\").parent()];\n var openContainer = dropdownContainers.find(function (container) {\n return container.hasClass(\"open\");\n });\n if (openContainer) {\n e.preventDefault();\n var activeValue = openContainer.siblings(\".dpf-form__active-value\").children(\"span\");\n var containerChoices = openContainer.children(\"ul\").children(\"li\");\n var key = String.fromCharCode(e.charCode);\n if (key) {\n var newText = $(\"#\" + activeValue.attr(\"id\").slice(0, -4)).val() === activeValue.text().trim() ? key : activeValue.text() + key;\n activeValue.text(newText);\n containerChoices.each(function () {\n // use includes instead of startsWith for fuzzy search\n if ($(this).text().toLowerCase().startsWith(newText.toLowerCase())) {\n $(this).removeClass(\"hidden\");\n } else {\n $(this).addClass(\"hidden\");\n }\n });\n\n // todo function?\n $(\"li.dpf-form__dropdown-item\").removeClass(\"dpf-dropdown-selected\");\n processRemainingOptions(containerChoices, newText);\n }\n }\n });\n var ENTER = 13;\n var TAB = 9;\n var BACKSPACE = 8;\n var UP = 38;\n var DOWN = 40;\n var CONTROLLED_CHARACTERS = [ENTER, TAB, BACKSPACE, UP, DOWN];\n\n // Now detect backspaces and enters.\n $(window).on(\"keydown\", function (e) {\n // We only handle the controlled characters in keydown.\n if (!CONTROLLED_CHARACTERS.includes(e.keyCode)) {\n return;\n }\n\n // todo move this out into a function\n var dropdownContainers = [$(\"#dpfVehicleYearDropdownItems\").parent(), $(\"#dpfVehicleMakeDropdownItems\").parent(), $(\"#dpfVehicleModelDropdownItems\").parent(), $(\"#dpfVehicleEngineDropdownItems\").parent(), $(\"#dpfVehicleTrimDropdownItems\").parent(), $(\"#dpfVehiclePartTypeDropdownItems\").parent()];\n var openContainer = dropdownContainers.find(function (container) {\n return container.hasClass(\"open\");\n });\n if (openContainer) {\n e.preventDefault();\n var activeValue = openContainer.siblings(\".dpf-form__active-value\").children(\"span\");\n var containerChoices = openContainer.children(\"ul\").children(\"li\");\n\n // We condition upon activeValue attr id because it will be undefined for any multiple dropdown.\n // We cannot do text search on our multiple dropdowns.\n // It does not make sense with the design of them as it stands.\n if (e.keyCode === BACKSPACE && activeValue.attr(\"id\")) {\n var newText = $(\"#\" + activeValue.attr(\"id\").slice(0, -4)).val() === activeValue.text().trim() ? \"\" : activeValue.text().trim().slice(0, -1);\n activeValue.text(newText);\n containerChoices.each(function () {\n // use includes instead of startsWith for fuzzy search\n if ($(this).text().toLowerCase().startsWith(newText.toLowerCase())) {\n $(this).removeClass(\"hidden\");\n } else {\n $(this).addClass(\"hidden\");\n }\n });\n $(\"li.dpf-form__dropdown-item\").removeClass(\"dpf-dropdown-selected\");\n processRemainingOptions(containerChoices, newText);\n } else if (e.keyCode === ENTER || e.keyCode === TAB) {\n dpfDropdownClicked($(\".dpf-dropdown-selected\"));\n } else if (e.keyCode === UP) {\n var currentSelected = $(\"li.dpf-form__dropdown-item.dpf-dropdown-selected\");\n var newSelected = currentSelected.prev();\n if (newSelected.length) {\n currentSelected.removeClass(\"dpf-dropdown-selected\");\n newSelected.addClass(\"dpf-dropdown-selected\");\n }\n } else if (e.keyCode === DOWN) {\n var _currentSelected = $(\"li.dpf-form__dropdown-item.dpf-dropdown-selected\");\n var _newSelected = _currentSelected.next();\n if (_newSelected.length) {\n _currentSelected.removeClass(\"dpf-dropdown-selected\");\n _newSelected.addClass(\"dpf-dropdown-selected\");\n }\n }\n }\n });\n\n // thank you to https://stackoverflow.com/a/3410557\n // use this if we later bring fuzzy search back\n // it is unused for now\n function getIndicesOf(searchStr, str, caseSensitive) {\n var searchStrLen = searchStr.length;\n if (searchStrLen == 0) {\n return [];\n }\n var startIndex = 0,\n index,\n indices = [];\n if (!caseSensitive) {\n str = str.toLowerCase();\n searchStr = searchStr.toLowerCase();\n }\n while ((index = str.indexOf(searchStr, startIndex)) > -1) {\n indices.push(index);\n startIndex = index + searchStrLen;\n }\n return indices;\n }\n function processRemainingOptions(containerChoices, newText) {\n var remainingOptions = $.grep(containerChoices, function (item) {\n return !$(item).hasClass(\"hidden\");\n });\n\n // Initial select the first option.\n $(remainingOptions[0]).addClass(\"dpf-dropdown-selected\");\n\n // Add underline to matching portion.\n remainingOptions.forEach(function (element) {\n // use getIndices for fuzzy search\n // due to no fuzzy search, we can simplify this to only using [0]\n var indices = [0];\n var finalHtml = $(element).text().substring(0, indices[0]);\n for (var i = 0; i < indices.length; i++) {\n var end = indices[i] + newText.length;\n finalHtml += \"\" + $(element).text().substring(indices[i], end) + \"\";\n if (i < indices.length - 1) {\n finalHtml += $(element).text().substring(end, indices[i + 1]).replace(\" \", \" \");\n } else {\n finalHtml += $(element).text().substring(end).replace(\" \", \" \");\n }\n }\n $(element).html(finalHtml);\n });\n }\n $(document).on('click', '#dpfMenuLink, .dpfMenuLink', function (e) {\n e.preventDefault();\n if ($(\"#dpfHeaderSearch\").length > 0) {\n // Commonly happens away from home page.\n window.scrollTo({\n top: 0\n });\n\n // In order to bypass the scroll action hiding the form,\n // we need to let the scroll action finish first.\n setTimeout(function () {\n $(\"#dpfHeaderSearch\").addClass('search-visible');\n dpfHeaderSearchOffset();\n }, 20);\n } else {\n // Commonly happens on home page.\n document.getElementById(\"dpfSearchFormWrapper\").scrollIntoView();\n }\n if ($(window).innerWidth() < navBreak) {\n disableScroll();\n }\n });\n function dpfHeaderSearchOffset() {\n var headHeight = $('header').height();\n var initialTop = '-1000px';\n if ($(window).innerWidth() >= navBreak) {\n initialTop = '-500px';\n }\n $('#dpfHeaderSearch.search-visible').css('top', headHeight);\n $('#dpfHeaderSearch:not(.search-visible').css('top', initialTop);\n }\n function dpfMobileSearch() {\n if ($(window).innerWidth() < navBreak) {\n var activeTab = $(\".dpf-tablink.active\").text();\n $(\".dpf-search-header-nav-active\").text(activeTab);\n $(\".dpf-search-header-nav-active.tab-nav-open\").on(\"click\", function () {\n $(this).siblings(\".dpf-tab-nav\").removeClass(\"open\").slideUp();\n $(this).removeClass(\"tab-nav-open\");\n });\n $(\".dpf-search-header-nav-active:not(tab-nav-open)\").on(\"click\", function () {\n $(this).siblings(\".dpf-tab-nav\").addClass(\"open\").slideDown();\n $(this).addClass(\"tab-nav-open\");\n });\n $(\".dpf-tablink\").on(\"click\", function () {\n var selectedTab = $(this).text();\n $(\".dpf-search-header-nav-active\").text(selectedTab);\n $(this).parents(\".dpf-tab-nav\").removeClass(\"open\").slideUp();\n });\n } else {\n $(\".dpf-tab-nav\").removeClass(\"open\").slideUp();\n }\n }\n function initDropdowns() {\n var pageLoad = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n return new Promise(function (resolve) {\n // loadMakes and other functions will abort if the arguments passed are not valid,\n // so we do not need to check in this function\n var setYear = $(\"#dpfVehicleYear\").val();\n var setMake = $(\"#dpfVehicleMake\").val();\n var setModel = $(\"#dpfVehicleBaseVehicle\").val();\n var setEngine = $(\"#dpfVehicleEngine\").val();\n var setTrim = $(\"#dpfVehicleTrim\").val();\n Promise.all([loadYears(), loadMakes(setYear, false), loadModels(setYear, setMake, false), loadEngines(setModel, false), loadTrims(setEngine, setModel, false), loadPartTypes(setTrim, setModel, setEngine, pageLoad, false)]).then(function (_) {\n return resolve();\n });\n });\n }\n function loadChannelAdvisor() {\n var setPartNumber = $(\"#dpfVehicleChannelAdvisorList\").data(\"part-number\");\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_channel_advisor_retailers\",\n partNumber: setPartNumber\n },\n success: function success(res) {\n // Very repetitive - find a way to pattern?\n if (res.data && res.data.available) {\n $(\"#dpfVehicleChannelAdvisorList\").html(res.data.available);\n $(\"#dpfVehicleChannelAdvisorList\").removeClass(\"hidden\");\n } else {\n $(\"#dpfVehicleChannelAdvisorAvailableNone\").removeClass(\"hidden\");\n }\n if (res.data && res.data.unavailable) {\n $(\"#dpfVehicleChannelAdvisorUnavailableList\").html(res.data.unavailable);\n $(\"#dpfUnavailable\").removeClass(\"hidden\");\n }\n $(\"#dpfChannelAdvisorSpinner\").addClass(\"hidden\");\n },\n error: function error(err) {\n console.error(err);\n }\n });\n }\n function loadEngineDetails() {\n var setEngine = $(\"#dpfVehicleEngine\").val();\n if (setEngine) {\n $('#dpfSearchResultsSpinner').removeClass('hidden');\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_vcdb_cc_cid\",\n engineBaseId: setEngine\n },\n success: function success(res) {\n if (res.data) {\n if (res.data['CC']) {\n $('#dpfVehicleInfo').append(\"
  • CC: \" + res.data['CC'] + \"
  • \");\n }\n if (res.data['CID']) {\n $('#dpfVehicleInfo').append(\"
  • CID: \" + res.data['CID'] + \"
  • \");\n }\n }\n $('#dpfSearchResultsSpinner').addClass('hidden');\n },\n error: function error(err) {\n console.error(err);\n }\n });\n } else {\n $('#dpfSearchResultsSpinner').addClass('hidden');\n }\n }\n\n // Use mousedown so that this fires *before* other click events.\n $(document).on(\"mousedown\", function (e) {\n var $trigger1 = $(\"#dpfSearchFormWrapper\");\n var $trigger2 = $(\"#dpfVehicleFilterPanel\");\n if (e.target.id !== \"dpfMenuLink\" && !e.target.classList.contains(\"dpfMenuLink\") && $trigger1 !== e.target && !$trigger1.has(e.target).length) {\n if ($(\"#dpfHeaderSearch\").hasClass(\"search-visible\")) {\n enableScroll();\n }\n $(\"#dpfHeaderSearch\").removeClass(\"search-visible\");\n dpfHeaderSearchOffset();\n\n // Query by dropdown-open to make sure that we do not slideToggle on unopened dropdowns.\n // That messes them up.\n $(\".dpf-form__fieldtype-select.dropdown-open\").each(function () {\n $(this).removeClass(\"dropdown-open\");\n $(this).children(\".dpf-form__dropdown-wrapper\").removeClass(\"open\");\n if ($(this).data(\"timeout-id\")) {\n clearInterval($(this).data(\"timeout-id\"));\n $(this).find(\".dpf-form__active-value span\").removeClass(\"dpf-keyboard-indicator\");\n }\n if ($(this).children(\".dpf-form__active-value\").children(\"span\").text() === \"\") {\n $(this).children(\"label\").removeClass(\"in-focus\");\n }\n });\n } else {\n // If we did click inside the search form, we need to close\n // any open dropdown.\n $('.dpf-form__dropdown-wrapper').each(function () {\n if ($(this).hasClass('open') && !e.target.classList.contains('dpf-form__active-value') &&\n // opening dropdown\n !e.target.parentNode.classList.contains('dpf-form__active-value') &&\n // opening dropdown with span\n !e.target.parentNode.classList.contains('dpf-form__dropdown-item') &&\n // clicking on text\n !e.target.parentNode.classList.contains('dpf-form__dropdown') &&\n // clicking outside text\n !e.target.classList.contains('dpf-form__dropdown-wrapper') // clicking on scroll bar\n ) {\n $(this).parent().removeClass(\"dropdown-open\");\n $(this).toggleClass('open');\n if ($(this).parent().data(\"timeout-id\")) {\n clearInterval($(this).parent().data(\"timeout-id\"));\n $(this).parent().find(\".dpf-form__active-value span\").removeClass(\"dpf-keyboard-indicator\");\n }\n if ($(this).parent().find(\".dpf-form__active-value span\").text().trim() === \"\") {\n $(this).siblings(\"label\").removeClass(\"in-focus\");\n }\n }\n });\n }\n if (e.target.id !== \"dpfFilterOpen\" && $trigger2.hasClass(\"translate-x-full\") && $trigger2 !== e.target && !$trigger2.has(e.target).length) {\n if ($trigger2.hasClass(\"translate-x-full\")) {\n enableScroll();\n }\n $trigger2.removeClass(\"translate-x-full\");\n $('.dpf-mobile-filter-overlay').addClass('hidden');\n }\n });\n $(document).on(\"mousemove\", \"li.dpf-form__dropdown-item\", function () {\n $(\"li.dpf-form__dropdown-item\").removeClass(\"dpf-dropdown-selected\");\n $(this).addClass(\"dpf-dropdown-selected\");\n });\n $(document).on(\"mouseout\", \"li.dpf-form__dropdown-item\", function () {\n $(this).removeClass(\"dpf-dropdown-selected\");\n });\n function takeOverFindMyPart() {\n var links = $('a[href=\"/find-my-part\"]');\n if (window.location.href.includes(\"installation-guides\")) {\n links.attr(\"href\", \"/#find-my-part\");\n } else {\n links.attr('href', '#');\n links.addClass('dpfMenuLink');\n }\n }\n\n // not getting called currently\n function handleScroll() {\n $(\"#dpfHeaderSearch\").removeClass(\"search-visible\");\n dpfHeaderSearchOffset();\n $(\".dpf-form__fieldtype-select\").removeClass(\"dropdown-open\");\n $(\".dpf-form__fieldtype-select\").children(\".dpf-form__dropdown-wrapper\").removeClass(\"open\").removeAttr(\"style\");\n if ($(\".dpf-form__fieldtype-select\").data(\"timeout-id\")) {\n clearInterval($(\".dpf-form__fieldtype-select\").data(\"timeout-id\"));\n $(\".dpf-form__fieldtype-select\").find(\".dpf-form__active-value span\").removeClass(\"dpf-keyboard-indicator\");\n }\n }\n function dpfPutSearchInHeader() {\n $(\"#dpfHeaderSearch\").insertAfter(\"header\");\n if ($(\"#dpfHeaderSearch\").is(\":visible\")) {\n $(window).scroll(handleScroll);\n $(\".dpf-tablink\").on(\"click\", function () {\n var selectedTab = $(this).text();\n $(\".dpf-search-header-nav-active\").text(selectedTab);\n $(this).parents(\".dpf-tab-nav\").removeClass(\"open\").slideUp();\n });\n } else {\n $(\".dpf-tab-nav\").removeClass(\"open\");\n }\n }\n\n // Opening, closing dropdown by clicking on it\n $(document).on('click', 'fieldset:not(.disabled) .dpf-form__active-value', function () {\n dpfOpenDropdown($(this));\n });\n function dpfOpenDropdown(clicked) {\n $('.dpf-form__active-value').each(function () {\n if ($(this).siblings('.dpf-form__dropdown-wrapper').hasClass('open') && !$(this).is(clicked)) {\n $(this).siblings('.dpf-form__dropdown-wrapper').toggleClass('open');\n $(this).parent().removeClass(\"dropdown-open\");\n }\n });\n var label = clicked.parents('.dpf-form__fieldtype-select').toggleClass('dropdown-open').find('.dpf-form__label');\n label.toggleClass('black');\n if (!clicked.parent().hasClass(\"dpf-form__field-multiple\")) {\n label.addClass('in-focus');\n }\n clicked.siblings('.dpf-form__dropdown-wrapper').toggleClass('open');\n $(\".dpf-form__fieldtype-select\").each(function () {\n if ($(this).data(\"timeout-id\")) {\n clearInterval($(this).data(\"timeout-id\"));\n $(this).find(\".dpf-form__active-value span\").removeClass(\"dpf-keyboard-indicator\");\n }\n });\n if (clicked.parent().hasClass(\"dropdown-open\")) {\n if (!clicked.parent().hasClass(\"dpf-form__field-multiple\") && clicked.children(\"span\").text().trim() === $(this).siblings(\"input\").val()) {\n clicked.siblings(\".dpf-form__dropdown-wrapper\").find(\"li.dpf-form__dropdown-item.hidden\").removeClass(\"hidden\");\n }\n $(clicked.siblings(\".dpf-form__dropdown-wrapper\").find(\"li.dpf-form__dropdown-item\")[0]).addClass(\"dpf-dropdown-selected\");\n }\n if (!clicked.parent().hasClass(\"dropdown-open\") && clicked.children(\"span\").text().trim() === \"\") {\n clicked.siblings(\"label\").removeClass(\"in-focus\");\n }\n if (!clicked.parent().hasClass(\"dpf-form__field-multiple\") && clicked.parent().hasClass(\"dropdown-open\")) {\n var textNode = clicked.children(\"span\");\n if ($(window).innerWidth() >= navBreak) {\n clicked.parent().data(\"timeout-id\", setInterval(function () {\n textNode.toggleClass(\"dpf-keyboard-indicator\");\n }, 500));\n }\n }\n }\n function dpfVehicleSearchReset(fieldWrap) {\n fieldWrap.find('.dpf-form__active-value').children('span').text('');\n fieldWrap.find('.dpf-form__input-selected').val('');\n fieldWrap.find('label').removeClass('in-focus');\n fieldWrap.removeClass('disabled');\n fieldWrap.nextAll().find('.dpf-form__active-value').children('span').text('');\n fieldWrap.nextAll().find('.dpf-form__input-selected').val('');\n fieldWrap.nextAll().find('label').removeClass('in-focus');\n fieldWrap.nextAll().addClass('disabled');\n if ($('#dpfVehicleEngine').val().length <= 0) {\n $('.dpf-form__field-wrapper:nth-of-type(5)').addClass('disabled');\n $('.dpf-form__field-wrapper:nth-of-type(6)').addClass('hidden disabled');\n } else {\n if ($('#dpfVehicleTrim').val().length <= 0) {\n $('.dpf-form__field-wrapper:nth-of-type(6)').addClass('hidden disabled');\n }\n }\n }\n function loadYears() {\n return new Promise(function (resolve) {\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_opticat_years\"\n },\n success: function success(res) {\n $(\"#dpfVehicleYearDropdownItems\").html(res);\n $(\"#dpfVehicleYearFieldset\").removeClass(\"disabled\");\n handlePreviousValue($(res), $(\"#dpfVehicleYearSpan\"), $(\"#dpfVehicleYear\"));\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n\n // will not try if year is not passed\n function loadMakes(year) {\n var openDropdown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return new Promise(function (resolve) {\n if (!year) return resolve();\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_opticat_makes\",\n year: year\n },\n success: function success(res) {\n $(\"#dpfVehicleMakeDropdownItems\").html(res);\n $(\"#dpfVehicleMakeFieldset\").removeClass(\"disabled\");\n handlePreviousValue($(res), $(\"#dpfVehicleMakeSpan\"), $(\"#dpfVehicleMake\"));\n if (openDropdown) {\n dpfOpenDropdown($(\"#dpfVehicleMakeFieldset\").find(\"div.dpf-form__input\"));\n }\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n\n // will not try unless both year and makeId are passed\n function loadModels(year, makeId) {\n var openDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n return new Promise(function (resolve) {\n if (!year || !makeId) return resolve();\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_opticat_models\",\n year: year,\n makeId: makeId\n },\n success: function success(res) {\n $(\"#dpfVehicleModelDropdownItems\").html(res);\n $(\"#dpfVehicleModelFieldset\").removeClass(\"disabled\");\n handlePreviousValue($(res), $(\"#dpfVehicleModelNameSpan\"), $(\"#dpfVehicleBaseVehicle\"));\n if (openDropdown) {\n dpfOpenDropdown($(\"#dpfVehicleModelFieldset\").find(\"div.dpf-form__input\"));\n }\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n function loadEngines(baseVehicleId) {\n var openDropdown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n return new Promise(function (resolve) {\n if (!baseVehicleId) return resolve();\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: {\n action: \"dpf_opticat_engines\",\n baseVehicleId: baseVehicleId\n },\n success: function success(res) {\n // res.length === 0 does not happen in the new system, but just in case\n if (res.length === 0) {\n loadTrims(null, baseVehicleId);\n } else {\n $(\"#dpfVehicleEngineDropdownItems\").html(res);\n $(\"#dpfVehicleEngineFieldset\").removeClass(\"hidden disabled\");\n handlePreviousValue($(res), $(\"#dpfVehicleEngineNameSpan\"), $(\"#dpfVehicleEngine\"));\n if (openDropdown) {\n dpfOpenDropdown($(\"#dpfVehicleEngineFieldset\").find(\"div.dpf-form__input\"));\n }\n }\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n function loadTrims(baseEngineId, baseVehicleId) {\n var openDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n return new Promise(function (resolve) {\n if (!baseVehicleId) return resolve();\n var extraData = {\n baseVehicleId: baseVehicleId\n };\n if (baseEngineId) {\n extraData.baseEngineId = baseEngineId;\n }\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: Object.assign(extraData, {\n action: \"dpf_opticat_trims\"\n }),\n success: function success(res) {\n // res.length === 0 does not happen in the new system, but just in case\n if (res.length === 0) {\n loadPartTypes(null, baseVehicleId, baseEngineId);\n } else {\n $(\"#dpfVehicleTrimDropdownItems\").html(res);\n $(\"#dpfVehicleTrimFieldset\").removeClass(\"hidden disabled\");\n handlePreviousValue($(res), $(\"#dpfVehicleTrimSpan\"), $(\"#dpfVehicleTrim\"));\n if (openDropdown) {\n dpfOpenDropdown($(\"#dpfVehicleTrimFieldset\").find(\"div.dpf-form__input\"));\n }\n }\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n function loadPartTypes(trimId, baseVehicleId, baseEngineId) {\n var pageLoad = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var openDropdown = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n return new Promise(function (resolve) {\n if (!baseVehicleId) return resolve();\n var params = new URLSearchParams(window.location.search);\n var grouped = groupParamsByKey(params);\n var partTypesArray = grouped['dpfVehiclePartTypes[]'] ? typeof grouped['dpfVehiclePartTypes[]'] === 'string' ? [grouped['dpfVehiclePartTypes[]']] : grouped['dpfVehiclePartTypes[]'] : [];\n var extraData = {\n baseVehicleId: baseVehicleId\n };\n if (trimId) {\n extraData.trimId = trimId;\n }\n if (baseEngineId) {\n extraData.baseEngineId = baseEngineId;\n }\n if (pageLoad) {\n extraData.partTypes = partTypesArray;\n } else {\n dpfVehicleSearchReset($(\"#dpfVehiclePartTypesFieldset\"));\n }\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n data: Object.assign(extraData, {\n action: \"dpf_opticat_part_types\"\n }),\n success: function success(res) {\n $(\"#dpfVehiclePartTypeDropdownItems\").html(\"
  • \\n\\t\\t\\t\\t\\t\\t\\t\\n\\t\\t\\t\\t\\t\\t\\tSelect all\\n\\t\\t\\t\\t\\t\\t
  • \" + res);\n $(\"#dpfVehiclePartTypesFieldset\").removeClass('hidden disabled');\n submitAvailable($(\"#dpfVehicleSearchForm\"));\n if (openDropdown) {\n dpfOpenDropdown($(\"#dpfVehiclePartTypesFieldset\").find(\"div.dpf-form__input\"));\n }\n resolve();\n },\n error: function error(err) {\n console.error(err);\n\n // bad - this needs better error handling.\n // but this has never thrown an error in extensive testing\n resolve();\n }\n });\n });\n }\n function dpfVehicleChangeValue(input, val, name) {\n input.val(val);\n $('#dpfVehiclePartTypeDropdownItems').children('li').children('input.cursor-pointer').attr('checked', false);\n if (input.attr(\"id\") === \"dpfVehicleYear\") {\n // GET request to OptiCat to get available makes,\n // then fill in the values for make\n loadMakes(val);\n partNumberInput().val(\"\");\n vinInput().val(\"\");\n } else if (input.attr(\"id\") === \"dpfVehicleMake\") {\n $(\"#dpfVehicleMakeName\").val(name);\n loadModels($(\"#dpfVehicleYear\").val(), val);\n } else if (input.attr(\"id\") === \"dpfVehicleBaseVehicle\") {\n $(\"#dpfVehicleModelName\").val(name);\n loadEngines(val);\n } else if (input.attr(\"id\") === \"dpfVehicleEngine\") {\n $(\"#dpfVehicleEngineName\").val(name);\n loadTrims(val, $(\"#dpfVehicleBaseVehicle\").val());\n } else if (input.attr(\"id\") === \"dpfVehicleTrim\") {\n $(\"#dpfVehicleTrimName\").val(name);\n loadPartTypes(val, $(\"#dpfVehicleBaseVehicle\").val(), $(\"#dpfVehicleEngine\").val());\n }\n }\n function dpfDropdownClicked(clicked) {\n var $form = clicked.parents('.dpf-form');\n var $fieldWrap = clicked.parents('.dpf-form__field-wrapper');\n var $field = clicked.parents('.dpf-form__fieldtype-select');\n var selectedValue = clicked.attr('data-value');\n var selectedDisplay = clicked.text();\n if (!$field.hasClass(\"dpf-form__field-multiple\")) {\n $field.find(\"li.dpf-form__dropdown-item\").removeClass(\"dpf-dropdown-selected\");\n\n // Remove the underlines because we have chosen.\n $field.find(\"li.dpf-form__dropdown-item\").each(function () {\n $(this).html($(this).text().replace(\" \", \" \"));\n });\n }\n\n // not used, but helpful to know how to find it\n // var currentValue = $field.find('.dpf-form__input-selected').val()\n\n // selectedValue being undefined can be our \"Select All\"\n\n $fieldWrap.find('.dpf-form__label').addClass('in-focus').removeClass('black');\n if ($field.hasClass('dpf-form__field-multiple')) {\n var input = clicked.children('input:visible').first();\n var newValue = !input.is(':checked');\n\n // Process our current input.\n input.prop('checked', newValue);\n\n // Post-process select all.\n if (clicked.attr('data-value') === undefined) {\n $field.children('.dpf-form__dropdown-wrapper').children('.dpf-form__dropdown').children('.dpf-form__dropdown-item').children('input:visible').prop('checked', newValue);\n } else {\n // Make sure select all is not checked.\n $field.children('.dpf-form__dropdown-wrapper').children('.dpf-form__dropdown').children('.dpf-form__dropdown-item').children('input:visible').first().prop('checked', false);\n }\n\n // Set our name appropriately.\n var checkedboxes = $field.children('.dpf-form__dropdown-wrapper').children('.dpf-form__dropdown').children('.dpf-form__dropdown-item').children('input:checked:visible');\n if (checkedboxes.length === 1) {\n $field.find('.dpf-form__active-value').children('span').text(checkedboxes.closest('.dpf-form__dropdown-item').first().text());\n } else if (checkedboxes.length > 1) {\n $field.find('.dpf-form__active-value').children('span').text('Multiple selected');\n } else {\n $field.find('.dpf-form__label').addClass('black').removeClass('in-focus');\n $field.find('.dpf-form__active-value').children('span').text('');\n }\n } else {\n $field.removeClass('dropdown-open');\n $field.find('.dpf-form__dropdown-wrapper').removeClass('open').slideUp();\n if ($field.data(\"timeout-id\")) {\n clearInterval($field.data(\"timeout-id\"));\n $field.find(\".dpf-form__active-value span\").removeClass(\"dpf-keyboard-indicator\");\n }\n $field.find('.dpf-form__active-value').children('span').text(selectedDisplay);\n dpfVehicleChangeValue($field.find('.dpf-form__input-selected'), selectedValue, selectedDisplay);\n }\n if (clicked.data('field') == 'year') {\n $('.dpf-form__separator, .dpf-form__separator + fieldset').hide();\n $('.dpf-form__clear-filters').removeClass('hidden');\n if ($(window).innerWidth() >= navBreak) {\n $form.addClass('tablet-all-drops');\n } else {\n $form.removeClass('tablet-all-drops');\n }\n }\n // this shows how to control the submit button via a non-multi select field\n // if ( $('#dpfVehicleTrim').val() !== '' ) {\n // \t$form.find('button[type=submit]').attr('disabled', false);\n // }\n submitAvailable($form);\n if ($('#dpfVehiclePartOrVin').val() !== '') {\n $('#dpfVehiclePartOrVin').val('');\n $('label[for=\"dpfVehiclePartOrVin\"]').removeClass('in-focus');\n }\n\n // Per Saundra 09/12/2022 - powersports and small engine lookups will be removed from part finder search for now\n // if( clicked.parents('.dpf-form').is('#dpfSmallEngineSearchForm') ) {\n // \t$form.find('button[type=submit]').attr('disabled', false)\n // }\n\n // Per Saundra 09/12/2022 - powersports and small engine lookups will be removed from part finder search for now\n // if( clicked.parents('.dpf-form').is('#dpfPowersportsSearchForm') ) {\n // \tif( clicked.data('field') == 'type' ) {\n // \t\tif( $('#dpfPowersportsMake').val().length ) {\n // \t\t\tdpfVehicleSearchReset($fieldWrap)\n // \t\t}\n // \t}\n // \tif( $('#dpfPowersportsModel').val() !== '' ) {\n // \t\t$form.find('button[type=submit]').attr('disabled', false)\n // \t}\n // \telse {\n // \t\t$form.find('button[type=submit]').attr('disabled', true)\n\n // \t}\n // }\n }\n\n function handlePreviousValue(res, nameSpan, input) {\n // Handle the input existing.\n if (input.val()) {\n var chosenSibling = res.filter(\"li[data-value='\" + input.val() + \"']\");\n if (chosenSibling.length > 0) {\n // Make sure our fieldset is available if all else is selected.\n input.closest(\".dpf-form__field-wrapper\").removeClass(\"disabled\");\n } else {\n dpfVehicleSearchReset(input.closest(\".dpf-form__field-wrapper\"));\n }\n }\n\n // Handle only the name existing.\n if (nameSpan.text().length > 0 && !input.val()) {\n var _chosenSibling = res.filter(\"li:contains('\" + $(\"#dpfVehicleModelNameSpan\").text() + \"')\");\n if (_chosenSibling.length > 0) {\n dpfVehicleChangeValue(input, _chosenSibling.data(\"value\"), _chosenSibling.text(), true);\n } else {\n dpfVehicleSearchReset(input.closest(\".dpf-form__field-wrapper\"));\n }\n }\n }\n function submitAvailable(form) {\n form.find('button[type=submit]').attr('disabled', $('#dpfVehiclePartTypesFieldset').hasClass('hidden') || !$('#dpfVehicleYearFieldset').hasClass('hidden') && !$('#dpfVehicleYear').val() || !$('#dpfVehicleMakeFieldset').hasClass('hidden') && !$('#dpfVehicleMake').val() || !$('#dpfVehicleModelFieldset').hasClass('hidden') && !$('#dpfVehicleBaseVehicle').val() || !$('#dpfVehicleEngineFieldset').hasClass('hidden') && !$('#dpfVehicleEngine').val() || !$('#dpfVehicleTrimFieldset').hasClass('hidden') && !$('#dpfVehicleTrim').val() || $('.dpf-form__dropdown-item').children('input[type=checkbox][name=\"dpfVehiclePartTypes[]\"]:checked').length === 0 && !$('#dpfPartTypeSelectAll').is(':checked'));\n }\n $(document).on('click', '.dpf-form__dropdown-item', function () {\n dpfDropdownClicked($(this));\n });\n $(document).on('click', '.dpf-form__dropdown-item > input', function () {\n dpfDropdownClicked($(this).parent());\n });\n $(document).on(\"click\", \"#dpfClearFilters\", function () {\n $(this).parents(\".dpf-form__clear-filters\").addClass(\"hidden\");\n $(\".dpf-form__separator, .dpf-form__separator + fieldset\").show();\n $(\".dpf-form__field-wrapper:nth-of-type(4), .dpf-form__field-wrapper:nth-of-type(5), .dpf-form__field-wrapper:nth-of-type(6)\").addClass(\"hidden disabled\");\n $(\".dpf-form__field-wrapper:nth-of-type(2), .dpf-form__field-wrapper:nth-of-type(3)\").addClass(\"disabled\");\n $(\".dpf-form__separator + .dpf-form__field-wrapper\").removeClass(\"disabled\");\n $(\".dpf-form__input\").val(\"\");\n $(\".dpf-form__input-selected\").val(\"\");\n $(\".dpf-form__input-selected\").siblings(\"input\").val(\"\");\n $(\".dpf-form__active-value\").children('span').text(\"\");\n $(\".dpf-form__label\").removeClass(\"in-focus\");\n $(\".dpf-form__fieldtype-select label\").removeClass(\"in-focus\");\n $(\"#dpfVehicleSearchSubmit\").attr(\"disabled\", true);\n if (window.innerWidth >= navBreak) {\n $(\".dpf-form\").removeClass(\"tablet-all-drops\");\n }\n $(\".dpf-form__dropdown-item\").removeClass(\"hidden\");\n });\n $(document).on('click', '#dpfVehicleSetPartNum', function () {\n $(\"#dpfVehicleSetVin\").prop(\"checked\", false);\n $(\"#dpfVehicleVin\").parent().addClass(\"hidden\");\n $(\"#dpfVehiclePartNum\").parent().removeClass(\"hidden\");\n togglePartNumberSubmit();\n });\n $(document).on('click', '#dpfVehicleSetVin', function () {\n $(\"#dpfVehicleSetPartNum\").prop(\"checked\", false);\n $(\"#dpfVehicleVin\").parent().removeClass(\"hidden\");\n $(\"#dpfVehiclePartNum\").parent().addClass(\"hidden\");\n toggleVinSubmit();\n });\n $(document).on('click', '.dpf-form__toggle-pill', function () {\n $(\"#dpfVehicleSetVin, #dpfVehicleSetPartNum\").each(function () {\n this.checked = !this.checked;\n });\n $(\"#dpfVehicleVin\").parent().toggleClass(\"hidden\");\n $(\"#dpfVehiclePartNum\").parent().toggleClass(\"hidden\");\n togglePartNumberSubmit();\n toggleVinSubmit();\n });\n\n // normal form things floating labels\n var inputs = '.dpf-form input:not(.dpf-form__select-input):not([type=\"radio\"]):not([type=\"checkbox\"]):not([type=\"submit\"]):not([type=\"button\"]):not([type=\"image\"]):not([type=\"file\"]):visible, .dpf-form textarea:visible';\n $(document).on(\"focus\", inputs, function () {\n $(this).parents(\".dpf-form__field\").find(\".dpf-form__input\").addClass(\"in-focus\");\n $(this).parents(\".dpf-form__field\").find(\"label:first\").addClass(\"in-focus font-weight-bold\");\n });\n $(document).on('blur', inputs, function () {\n $(this).parents('.dpf-form__field').find('.dpf-form__input').removeClass('in-focus');\n $(this).parents('.dpf-form__field').find('label:first').removeClass('in-focus font-weight-bold');\n if ($(this).val().length > 0) {\n $(this).parents('.dpf-form__field').find('label:first').addClass('in-focus');\n } else {\n $(this).parents('.dpf-form__field').find('label:first').removeClass('in-focus');\n }\n });\n\n // todo whenever this is called, should also update the current page query string\n // this is on hold due to upcoming interface changes\n function updatePartsList() {\n var params = groupParamsByKey(new URLSearchParams(window.location.search));\n var filters = [];\n\n // move this and the same code in `setViewAllFilter` into shared function?\n var parents = $(window).innerWidth() < navBreak ? $('.dpfFilterMainSelect').children('input') : filterSelection().children('div').children('input');\n var allChildren = $(window).innerWidth() < navBreak ? $('.dpfFilterPage').children('div').children('input') : filterSelection().children('div').children('div').children('input');\n parents.each(function () {\n if ($(this).is(\":checked\")) {\n filters.push($(this).data(\"category-name\"));\n }\n });\n allChildren.each(function () {\n if ($(this).is(\":checked\")) {\n filters.push($(this).data(\"part-type-id\"));\n }\n });\n $(\"#dpfVehicleSearchList\").html(\"\");\n $(\"#dpfProductAvailable\").text(\"?? Products Available\");\n $(\"#dpfSearching\").removeClass(\"hidden\");\n $(\"#dpfMaxShown\").addClass(\"hidden\");\n $.ajax({\n type: \"POST\",\n url: dpf.ajax_url,\n // need to include all of the names etc. because otherwise the query-string navigation\n // will break\n // (yes, cleaning up query strings is on the wish list)\n data: {\n action: \"dpf_opticat_parts\",\n dpfSearch: params.dpfSearch,\n dpfVehicleBaseVehicle: params.dpfVehicleBaseVehicle,\n dpfVehiclePartNum: params.dpfVehiclePartNum,\n dpfVehicleCrossRef: params.dpfVehicleCrossRef,\n dpfVehicleEngine: params.dpfVehicleEngine,\n dpfVehicleEngineName: params.dpfVehicleEngineName,\n dpfVehicleTrim: params.dpfVehicleTrim,\n dpfVehicleTrimName: params.dpfVehicleTrimName,\n dpfVehicleYear: params.dpfVehicleYear,\n dpfVehicleMake: params.dpfVehicleMake,\n dpfVehicleMakeName: params.dpfVehicleMakeName,\n dpfVehicleModelName: params.dpfVehicleModelName,\n dpfVehicleAvailablePartTypes: params['dpfVehicleAvailablePartTypes[]'],\n dpfVehiclePartTypes: filters\n },\n success: function success(res) {\n $(\"#dpfVehicleSearchList\").html(res.data.html);\n if (res.data.count === 0) {\n $(\"#dpfNoParts\").removeClass(\"hidden\");\n } else {\n $(\"#dpfNoParts\").addClass(\"hidden\");\n $('.dpf-product-count').removeClass('hidden');\n }\n $(\"#dpfProductAvailable\").text(res.data.count + \" Product\" + (res.data.count === 1 ? '' : 's') + \" Available\");\n $(\"#dpfSearching\").addClass(\"hidden\");\n if (res.data.maxShown) {\n $(\"#dpfMaxShown\").removeClass(\"hidden\");\n }\n },\n error: function error(err) {\n // When we get an error, we will still receive a part count.\n // So we can fill that in still.\n // unfortunate duplication of string\n $(\"#dpfProductAvailable\").text('0 Products Available');\n $(\"#dpfNoParts\").removeClass(\"hidden\");\n $(\"#dpfSearching\").addClass(\"hidden\");\n }\n });\n }\n $(document).on('click', '.dpfPartTypeFilterParent', function () {\n $(this).parent().siblings('div:not(.dpfFilterViewAllCategory)').toggleClass('hidden');\n $(this).toggleClass('rotate');\n if ($(this).parent().siblings('div:not(.dpfFilterViewAllCategory)').hasClass('hidden')) {\n $(this).parent().siblings('div.dpfFilterViewAllCategory').addClass('hidden');\n } else {\n var categoryChildren = $(this).parent().siblings('div').children('input');\n if (categoryChildren.length !== categoryChildren.parent().children('input:checked').length) {\n $(this).parent().siblings('div.dpfFilterViewAllCategory').removeClass('hidden');\n } else {\n $(this).parent().siblings('div.dpfFilterViewAllCategory').addClass('hidden');\n }\n }\n });\n $(document).on('click', '.dpfPartTypeFilterType', function () {\n // Carry over checkbox from desktop to mobile and vice versa.\n var totalInputs = $(\"input[data-part-type-id=\\\"\" + $(this).data('part-type-id') + \"\\\"]\");\n totalInputs.prop(\"checked\", $(this).is(\":checked\"));\n var category = totalInputs.parent().parent().children('input.dpfPartTypeInputParent');\n var page = totalInputs.parent().parent();\n var mobileCategory = totalInputs.parent().parent().parent().children('div').children(\"input[data-category-name=\\\"\" + page.attr('data-category-name') + \"\\\"]\");\n\n // If we are now checked, we do not want our parent to be.\n // Otherwise, being checked means nothing.\n if (this.checked) {\n category.prop(\"checked\", false);\n mobileCategory.prop(\"checked\", false);\n }\n var categoryChildren = $(this).parent().parent().children('div').children('input');\n if (categoryChildren.length !== categoryChildren.parent().children('input:checked').length) {\n $(this).parent().siblings('div.dpfFilterViewAllCategory').removeClass('hidden');\n } else {\n $(this).parent().siblings('div.dpfFilterViewAllCategory').addClass('hidden');\n }\n $(\"#dpfFilterReset\").removeClass(\"hidden\");\n updatePartsList();\n });\n $(document).on('click', '.dpfFilterViewAllCategory', function () {\n $(this).siblings('div').children('input').prop('checked', true);\n $(this).addClass('hidden');\n updatePartsList();\n });\n\n // helper function from https://stackoverflow.com/a/52539264,\n // then customized to allow going one level deep with named params\n // to go further, we will need to move to recursion\n var groupParamsByKey = function groupParamsByKey(params) {\n return [].concat(_toConsumableArray(params.entries())).reduce(function (acc, tuple) {\n // adjust key name upon retrieving it\n // for each key:\n // the named portion of the key will be extracted and handled on its own\n // note that the above can only go one layer deep\n // any array indexes will be removed. just send data in the right order\n var namedPortion = /\\[[^\\]]+\\]/;\n var capturedNamedPortion = /(\\[)[^\\]]+(\\])/;\n\n // removes the named portion and then removes any indexes\n var key = tuple[0].replace(namedPortion, '').replace(capturedNamedPortion, '$1$2');\n var val = tuple[1];\n var matches = tuple[0].match(namedPortion)?.map(function (m) {\n return m.replace('[', '').replace(']', '');\n });\n if (acc.hasOwnProperty(key)) {\n // matches: we are doing a named key\n // not matches: we are doing a standard situation of where the key\n // may possibly be an array or not\n if (matches) {\n if (acc[key][matches[0]]) {\n if (Array.isArray(acc[key][matches[0]])) {\n acc[key][matches[0]] = [].concat(_toConsumableArray(acc[key][matches[0]]), [val]);\n } else {\n acc[key][matches[0]] = [acc[key][matches[0]], val];\n }\n } else {\n // This should just be = val!\n // But the PHP code requires each entry to be an array,\n // so this makes life easier.\n acc[key][matches[0]] = [val];\n }\n } else {\n // if the current key is already an array, we'll add the value to it\n if (Array.isArray(acc[key])) {\n acc[key] = [].concat(_toConsumableArray(acc[key]), [val]);\n } else {\n // if it's not an array, but contains a value, we'll convert it into an array\n // and add the current value to it\n acc[key] = [acc[key], val];\n }\n }\n } else if (matches) {\n // This should just be = val!\n // But the PHP code requires each entry to be an array,\n // so this makes life easier.\n acc[key] = {};\n acc[key][matches[0]] = [val];\n } else if (key.includes(\"[]\")) {\n // If we are an array value, we need to make sure that we always store an array.\n acc[key] = [val];\n } else {\n // plain assignment if no special case is present\n acc[key] = val;\n }\n return acc;\n }, {});\n };\n $(document).on('click', '#dpfFilterReset', function () {\n // move this and the same code in `setViewAllFilter` into shared function?\n var parents = filterSelection().children('div').children('input');\n var allChildren = filterSelection().children('div').children('div').children('input');\n var viewAll = filterSelection().children('div').children('div.dpfFilterViewAllCategory');\n var params = new URLSearchParams(window.location.search);\n var grouped = groupParamsByKey(params);\n var hasPartTypes = grouped['dpfVehiclePartTypes[]'] !== undefined;\n parents.each(function () {\n if (hasPartTypes && grouped['dpfVehiclePartTypes[]'].includes($(this).attr('data-category-name'))) {\n $(this).prop(\"checked\", true);\n } else {\n $(this).prop(\"checked\", false);\n }\n });\n allChildren.each(function () {\n $(this).prop(\"checked\", false);\n });\n viewAll.each(function () {\n $(this).addClass(\"hidden\");\n });\n updatePartsList();\n });\n $(document).on('click', '.dpfFilterMainSelect', function () {\n var categoryName = $(this).children('input').data('category-name');\n $(\".dpfFilterPage[data-category-name=\\\"\" + categoryName + \"\\\"]\").removeClass('hidden');\n $('.dpfFilterMainSelect').addClass('hidden');\n });\n\n // When filtering is open, we will disable scrolling outside of the filtering panel.\n $(document).on('click', '#dpfVehicleCloseFilters', function () {\n $('#dpfVehicleFilterPanel').removeClass('translate-x-full');\n $('.dpf-mobile-filter-overlay').addClass('hidden');\n enableScroll();\n });\n $(document).on('click', '#dpfFilterOpen', function () {\n $('#dpfVehicleFilterPanel').addClass('translate-x-full');\n $('#dpfVehicleFilterPanel').css('height', $(window).innerHeight() - $('header').height());\n $('.dpf-mobile-filter-overlay').removeClass('hidden');\n $('.dpf-mobile-filter-overlay').css('height', $(window).innerHeight() - $('header').height());\n disableScroll();\n });\n $(document).on('click', '.dpfFilterBack', function () {\n $('.dpfFilterPage').addClass('hidden');\n $('.dpfFilterMainSelect').removeClass('hidden');\n });\n\n // Accepts an img element within the gallery list and uses it to switch the gallery image.\n function switchGalleryImage(element) {\n if (element.attr(\"data-url\")) {\n // CSS could certainly be used to maintain the width, but since we are already using JS\n // to switch the element, it is so easy to set width and height too ...\n galleryImage().html(\"\");\n } else if (element.attr(\"data-big-src\")) {\n galleryImage().html(\"\\\"\"\");\n }\n }\n $(document).on('click', '.dpfGalleryImage', function () {\n switchGalleryImage($(this));\n });\n function updateGuidesList() {\n var params = groupParamsByKey(new URLSearchParams(window.location.search));\n if (!params.dpfVehicleBaseVehicle && !params.dpfVehiclePartNum) {\n return;\n }\n $(\"#dpfInstallationGuideResults\").html(\"\");\n $(\"#dpfSearching\").removeClass(\"hidden\");\n $(\"#dpfGuideNone\").addClass(\"hidden\");\n $(\"#dpfGuideMaxShown\").addClass(\"hidden\");\n $(\"#dpfGuideFormContainer\").removeClass(\"pb-20\");\n $.ajax({\n url: dpf.ajax_url,\n type: \"POST\",\n data: {\n action: \"dpf_opticat_guides\",\n dpfVehicleBaseVehicle: params.dpfVehicleBaseVehicle,\n dpfVehiclePartNum: params.dpfVehiclePartNum,\n dpfVehicleEngine: params.dpfVehicleEngine,\n dpfVehicleTrim: params.dpfVehicleTrim,\n dpfVehiclePartTypes: params['dpfVehiclePartTypes[]']\n },\n success: function success(response) {\n $('#dpfInstallationGuideResults').html(response.data.html);\n $(\"#dpfSearching\").addClass(\"hidden\");\n if (!response.data.html) {\n $(\"#dpfGuideNone\").removeClass(\"hidden\");\n }\n if (response.data.html && response.data.maxShown) {\n $(\"#dpfGuideMaxShown\").removeClass(\"hidden\");\n }\n },\n error: function error(e) {\n console.error(e);\n }\n });\n }\n function getHiddenStop(choices) {\n return new Promise(function (resolve) {\n choices.each(function () {\n if (!$(this).hasClass('hidden')) {\n resolve($(this).index() - 1);\n }\n });\n });\n }\n function getGalleryPageSize(clicked) {\n var mobile = clicked.parent().hasClass('mobile-thumbs');\n return mobile ? 2 : 6;\n }\n $(document).on('click', '.dpfPartImageUp', function () {\n var pageSize = getGalleryPageSize($(this));\n var choices = ($(this).parent().hasClass('mobile-thumbs') ? galleryImage() : galleryImage().parent()).siblings('ul').children('li.dpf-img-wrap');\n getHiddenStop(choices).then(function (hiddenStop) {\n if (hiddenStop === 0) {\n for (var i = 0; i < pageSize; i++) {\n $(choices[i]).addClass('hidden');\n }\n var remainder = choices.length % pageSize == 0 ? pageSize : choices.length % pageSize;\n for (var _i = choices.length - 1; _i > choices.length - 1 - remainder; _i--) {\n if (_i >= 0) {\n $(choices[_i]).removeClass('hidden');\n }\n }\n } else {\n for (var _i2 = hiddenStop; _i2 < hiddenStop + pageSize; _i2++) {\n $(choices[_i2]).addClass('hidden');\n }\n for (var _i3 = hiddenStop - 1; _i3 > hiddenStop - 1 - pageSize; _i3--) {\n if (_i3 >= 0) {\n $(choices[_i3]).removeClass('hidden');\n }\n }\n }\n });\n });\n $(document).on('click', '.dpfPartImageDown', function () {\n var pageSize = getGalleryPageSize($(this));\n var choices = ($(this).parent().hasClass('mobile-thumbs') ? galleryImage() : galleryImage().parent()).siblings('ul').children('li.dpf-img-wrap');\n getHiddenStop(choices).then(function (hiddenStop) {\n if (hiddenStop > 0 && hiddenStop >= choices.length - pageSize) {\n for (var i = 0; i < pageSize; i++) {\n $(choices[i]).removeClass('hidden');\n }\n for (var _i4 = hiddenStop; _i4 < hiddenStop + pageSize; _i4++) {\n if (_i4 < choices.length) {\n $(choices[_i4]).addClass('hidden');\n }\n }\n } else {\n for (var _i5 = hiddenStop; _i5 < hiddenStop + pageSize; _i5++) {\n $(choices[_i5]).addClass('hidden');\n }\n for (var _i6 = hiddenStop + pageSize; _i6 < hiddenStop + pageSize + pageSize; _i6++) {\n if (_i6 < choices.length) {\n $(choices[_i6]).removeClass('hidden');\n }\n }\n }\n });\n });\n function meetsCharacterRequirements() {\n return vinInput().val().length === 17;\n }\n function turnOffPredefinedEvents() {\n submitButton().off();\n }\n function toggleVinSubmit() {\n submitButton().prop(\"disabled\", !meetsCharacterRequirements());\n }\n function togglePartNumberSubmit() {\n submitButton().prop(\"disabled\", partNumberInput().val().length < 3);\n }\n function toggleCrossRefSubmit() {\n crossRefSubmitButton().prop(\"disabled\", crossRefInput().val().length < 3);\n }\n function fillFormWithVinData(data) {\n $(\"#dpfVehicleVin\").val(\"\");\n toggleVinSubmit();\n $(\".dpf-form__clear-filters\").removeClass(\"hidden\");\n var paramMap = {\n \"year\": \"dpfVehicleYear\",\n \"makeName\": \"dpfVehicleMakeName\",\n \"makeId\": \"dpfVehicleMake\",\n \"modelName\": \"dpfVehicleModelName\",\n \"baseVehicleId\": \"dpfVehicleBaseVehicle\",\n \"subModelId\": \"dpfVehicleTrim\",\n \"subModelName\": \"dpfVehicleTrimName\",\n \"EngineBaseId\": \"dpfVehicleEngine\",\n \"EngineName\": \"dpfVehicleEngineName\"\n };\n var filterable = [];\n for (var entry in data) {\n if (data[entry].length === 1) {\n $(\"#\" + paramMap[entry]).val(data[entry][0]);\n if (paramMap[entry].endsWith(\"Name\") || paramMap[entry].endsWith(\"Year\")) {\n $(\"#\" + paramMap[entry] + \"Span\").text(data[entry][0]);\n $(\"#\" + paramMap[entry]).siblings(\"label\").addClass(\"in-focus\");\n }\n $(\"#\" + paramMap[entry] + \"Fieldset\").removeClass(\"hidden\");\n } else {\n filterable.push(entry);\n }\n }\n initDropdowns(false).then(function (_) {\n filterable.forEach(function (f) {\n if (!paramMap[f].endsWith(\"Name\")) {\n $(\"#\" + paramMap[f] + \"DropdownItems\").children(\"li\").each(function () {\n if (!data[f].includes($(this).data(\"value\"))) {\n $(this).addClass(\"hidden\");\n }\n });\n }\n });\n });\n $(\".dpf-form__separator\").addClass(\"hidden\");\n $(\"#dpfPartNumberVinFieldset\").addClass(\"hidden\");\n }\n function handleFormSubmit(event) {\n event.preventDefault();\n\n // If we checked all available part types, we will check none of them.\n var serializedArray = $(this).serializeArray();\n if ($(\"#dpfVehiclePartTypeDropdownItems\").children('li').first().children('input').is(':checked')) {\n serializedArray = serializedArray.filter(function (el) {\n return el.name !== 'dpfVehiclePartTypes[]';\n });\n }\n var usingVin = vinInput().val().length > 0 && !vinInput().parent().hasClass('hidden');\n\n // If we are in installation guide mode, we will paste search results onto the page.\n if ($('#dpfVehicleAboveInfo').hasClass('hidden')) {\n if (usingVin) {\n if (meetsCharacterRequirements()) {\n $.ajax({\n url: dpf.ajax_url,\n type: \"POST\",\n data: {\n action: \"dpf_vin_search\",\n vin: vinInput().val()\n },\n dataType: \"JSON\",\n success: function success(response) {\n var data = response.data;\n removeExistingError();\n fillFormWithVinData(data);\n },\n error: function error(_) {\n removeExistingError();\n // not sure if we have a way to propogate user errors\n container().prepend(\"

    Could not find any installation guides for this vehicle

    \");\n }\n });\n } else {\n removeExistingError();\n // not sure if we have a way to propogate user errors\n container().prepend(\"

    Length must be 17 characters

    \");\n }\n } else {\n var newUrl = window.location.protocol + \"//\" + window.location.host + window.location.pathname + \"?\" + $.param(serializedArray);\n window.history.pushState({\n path: newUrl\n }, \"\", newUrl);\n updateGuidesList();\n }\n return;\n }\n if (!usingVin) {\n var newSearch = $.param(serializedArray);\n window.location.href = '/part-finder-search-results?' + newSearch;\n return;\n }\n if (meetsCharacterRequirements()) {\n $.ajax({\n url: dpf.ajax_url,\n type: \"POST\",\n data: {\n action: \"dpf_vin_search\",\n vin: vinInput().val()\n },\n dataType: \"JSON\",\n success: function success(response) {\n var data = response.data;\n removeExistingError();\n fillFormWithVinData(data);\n },\n error: function error(_) {\n removeExistingError();\n // not sure if we have a way to propogate user errors\n container().prepend(\"

    Unable to locate that vehicle

    \");\n }\n });\n } else {\n removeExistingError();\n // not sure if we have a way to propogate user errors\n container().prepend(\"

    Length must be 17 characters

    \");\n }\n }\n function partNumberInput() {\n return $(\"#dpfVehiclePartNum\");\n }\n function vinInput() {\n return $(\"#dpfVehicleVin\");\n }\n function submitButton() {\n return $(\"#dpfVehicleSearchSubmit\");\n }\n function crossRefSubmitButton() {\n return $(\"#dpfCrossReferenceSearchSubmit\");\n }\n function crossRefInput() {\n return $(\"#dpfVehicleCrossRef\");\n }\n function form() {\n return $(\"#dpfVehicleSearchForm\");\n }\n function container() {\n return $(\".dpf-vehicle-search-form\");\n }\n function filterSelection() {\n return $(\"#dpfFilterSelection\");\n }\n function galleryImage() {\n return $(\"#dpfGalleryImage\");\n }\n function removeExistingError() {\n $(\"#error\").remove();\n }\n function disableScroll() {\n $('html').addClass('disable-scroll');\n $('body').addClass('disable-scroll');\n }\n function enableScroll() {\n $('html').removeClass('disable-scroll');\n $('body').removeClass('disable-scroll');\n }\n})(jQuery);\n\n},{}]},{},[1]);\n"],"names":["r","e","n","t","o","i","f","c","require","u","a","Error","code","p","exports","call","length","1","module","../../../public/partials/base/dpf-base","2","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","iter","Symbol","iterator","from","minLen","Object","prototype","toString","slice","constructor","name","test","TypeError","len","arr2","processRemainingOptions","containerChoices","newText","remainingOptions","$","grep","item","hasClass","addClass","forEach","element","indices","finalHtml","text","substring","end","replace","html","dpfHeaderSearchOffset","headHeight","height","initialTop","window","innerWidth","navBreak","css","dpfMobileSearch","activeTab","on","this","siblings","removeClass","slideUp","slideDown","selectedTab","parents","initDropdowns","pageLoad","arguments","undefined","Promise","resolve","setYear","val","setMake","setModel","setEngine","setTrim","all","ajax","type","url","dpf","ajax_url","data","action","success","res","handlePreviousValue","error","err","console","loadMakes","loadModels","loadEngines","loadTrims","loadPartTypes","then","_","handleScroll","children","removeAttr","clearInterval","find","dpfOpenDropdown","clicked","each","is","toggleClass","parent","textNode","label","trim","setInterval","dpfVehicleSearchReset","fieldWrap","nextAll","year","openDropdown","makeId","baseVehicleId","baseEngineId","extraData","assign","trimId","params","URLSearchParams","location","search","grouped","groupParamsByKey","partTypesArray","partTypes","submitAvailable","dpfVehicleChangeValue","input","attr","partNumberInput","vinInput","dpfDropdownClicked","newValue","$form","$fieldWrap","$field","selectedValue","selectedDisplay","first","prop","checkedboxes","closest","hide","nameSpan","filter","_chosenSibling","form","updatePartsList","filters","filterSelection","allChildren","push","dpfSearch","dpfVehicleBaseVehicle","dpfVehiclePartNum","dpfVehicleCrossRef","dpfVehicleEngine","dpfVehicleEngineName","dpfVehicleTrim","dpfVehicleTrimName","dpfVehicleYear","dpfVehicleMake","dpfVehicleMakeName","dpfVehicleModelName","dpfVehicleAvailablePartTypes","dpfVehiclePartTypes","count","maxShown","updateGuidesList","response","getHiddenStop","choices","index","getGalleryPageSize","meetsCharacterRequirements","turnOffPredefinedEvents","submitButton","off","toggleVinSubmit","togglePartNumberSubmit","fillFormWithVinData","entry","paramMap","makeName","modelName","subModelId","subModelName","EngineBaseId","EngineName","filterable","endsWith","includes","handleFormSubmit","event","preventDefault","newSearch","serializedArray","serializeArray","usingVin","el","vin","dataType","removeExistingError","container","prepend","newUrl","protocol","host","pathname","param","history","pushState","path","href","crossRefInput","galleryImage","remove","disableScroll","enableScroll","CONTROLLED_CHARACTERS","inputs","jQuery","document","ready","links","setPartNumber","insertAfter","scroll","tabName","not","show","engineBaseId","append","partNumber","available","unavailable","submit","activeValue","openContainer","key","String","fromCharCode","charCode","toLowerCase","startsWith","_currentSelected","_newSelected","keyCode","newSelected","currentSelected","prev","next","scrollTo","top","setTimeout","getElementById","scrollIntoView","$trigger1","$trigger2","target","id","classList","contains","has","parentNode","checked","categoryChildren","totalInputs","category","page","mobileCategory","concat","entries","reduce","acc","tuple","namedPortion","matches","match","map","m","hasOwnProperty","viewAll","hasPartTypes","categoryName","innerHeight","width","pageSize","hiddenStop","remainder","_i","_i2","_i3","_i4","_i5","_i6"],"mappings":"AAAA,CAAY,SAASA,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,GAAG,CAACJ,EAAEG,GAAG,CAAC,GAAG,CAACJ,EAAEI,GAAG,CAAC,IAAIE,EAAE,YAAY,OAAOC,SAASA,QAAQ,GAAG,CAACF,GAAGC,EAAE,OAAOA,EAAEF,EAAE,CAAA,CAAE,EAAE,GAAGI,EAAE,OAAOA,EAAEJ,EAAE,CAAA,CAAE,EAAgD,MAA1CK,EAAE,IAAIC,MAAM,uBAAuBN,EAAE,GAAG,GAAUO,KAAK,mBAAmBF,CAAC,CAAKG,EAAEX,EAAEG,GAAG,CAACS,QAAQ,EAAE,EAAEb,EAAEI,GAAG,GAAGU,KAAKF,EAAEC,QAAQ,SAASd,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,CAAC,CAAC,EAAEa,EAAEA,EAAEC,QAAQd,EAAEC,EAAEC,EAAEC,CAAC,CAAC,CAAC,OAAOD,EAAEG,GAAGS,OAAO,CAAC,IAAI,IAAIL,EAAE,YAAY,OAAOD,SAASA,QAAQH,EAAE,EAAEA,EAAEF,EAAEa,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