{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_sylvania/cartridge/client/default/js/product/compare.js","webpack:///./cartridges/app_sylvania/cartridge/client/default/js/search.js","webpack:///./cartridges/app_sylvania/cartridge/client/default/js/search/search.js","webpack:///./sfra/cartridges/app_storefront_base/cartridge/client/default/js/search/search.js","webpack:///./sfra/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./vendor/app_storefront_core/cartridge/client/default/js/search/search.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,+CAA+C,mBAAmB;AAClE,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qDAAqD,WAAW;AAChE,aAAa;AACb;AACA,uDAAuD,WAAW;AAClE;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,WAAW;AAC9D,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qDAAqD,WAAW;AAChE,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB,EAAE;AAClG,gCAAgC;AAChC;;AAEA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACpTa;;AAEb,qBAAqB,mBAAO,CAAC,4FAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,+FAAiB;AAC5C,mBAAmB,mBAAO,CAAC,mGAAmB;AAC9C,CAAC;;;;;;;;;;;;ACPD,mBAAmB,mBAAO,CAAC,qGAAoB;;AAE/C;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,0B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;;;AAIA,4B;;;;;;;;;;;;ACpMa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;AC9Na;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACZA,KAAK,6CAA6C;;AAElD,eAAe,mBAAO,CAAC,8GAAoB;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uBAAuB;AAClE,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA,wB","file":"default/js/search.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_sylvania/cartridge/client/default/js/search.js\");\n","'use strict';\n\nvar $compareBar = $('.compare-bar-wrapper');\nvar maxSlots = parseInt($('.compare-bar').data('max-slots'), 10);\nvar productsForComparison = [];\nvar compareButtonText = ' Compare';\n\nvar lastKnownUrl = location.href;\n\n\n/**\n * @typedef ProductComparisonList\n * @type Object\n * @property {string} pid - ID for product to compare\n * @property {string} imgSrc - Image URL for selected product\n */\n\n/**\n * Compiles the HTML for a single slot\n *\n * @param {ProductComparisonList} product - Selected product to compare\n * @param {number} idx - Slot number (zero-based)\n * @return {string} - HTML for a single slot\n */\nfunction compileSlot(product, idx) {\n var pid = product.pid;\n var name = 'pid' + idx;\n\n return '' +\n '
' +\n '
' +\n '\"'' +\n '' +\n '
' +\n '' +\n '
\\n';\n}\n\n/**\n * Draw and render the Compare Bar product slots\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n */\nfunction redrawCompareSlots(productsToCompare) {\n var html = productsToCompare.map(function (product, idx) {\n return compileSlot(product, idx);\n }).join('');\n\n // Render empty slots\n if (productsToCompare.length < maxSlots) {\n var numAvailableSlots = maxSlots - productsToCompare.length;\n\n for (var i = 0; i < numAvailableSlots; i++) {\n if (i === 0 && productsToCompare.length < 2) {\n html += '
' +\n '
' + $('.compare-bar').data('min-products-msg') +\n '
';\n } else {\n html += '
';\n }\n }\n }\n\n $('.compare-bar .product-slots').empty().append(html);\n}\n\n/**\n * Enables/disables the Compare button, depending on whether at least two products have been\n * selected for comparison\n *\n * @param {number} numProducts - Number of products selected for comparison\n */\nfunction setCompareButton(numProducts) {\n if (numProducts > 0) {\n $('button.compare').html(compareButtonText + '' + numProducts + '');\n } else {\n $('button.compare').html(compareButtonText);\n }\n if (numProducts < 2) {\n $('button.compare').attr('disabled', true);\n } else {\n $('button.compare').removeAttr('disabled');\n }\n}\n\n/**\n * Returns a copy of a list of products to compare\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction copyProducts(productsToCompare) {\n return productsToCompare.map(function (product) {\n var proxy = {};\n\n Object.keys(product).forEach(function (key) {\n proxy[key] = product[key];\n });\n\n return proxy;\n });\n}\n\n/**\n * Handles the selection of a product for comparison\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @param {string} imgSrc - Image URL for selected product\n * @param {string} altText - Alt text for selected product image\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction selectProduct(products, pid, imgSrc, altText) {\n var productsToCompare = copyProducts(products) || [];\n console.log(maxSlots);\n console.log(productsToCompare.length);\n if (productsToCompare.length < maxSlots) {\n productsToCompare.push({\n pid: pid,\n imgSrc: imgSrc,\n altText: altText\n });\n\n if (productsToCompare.length === maxSlots) {\n $('input[type=checkbox]:not(:checked)').attr('disabled', true);\n }\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n $compareBar.show();\n }\n\n return productsToCompare;\n}\n\n/**\n * Handles the deselection of a product\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction deselectProduct(products, pid) {\n var productsToCompare = copyProducts(products) || [];\n\n productsToCompare = productsToCompare.filter(function (product) {\n return product.pid !== pid;\n });\n\n if (productsToCompare.length === 0) {\n $compareBar.hide();\n }\n\n $('input#' + pid).prop('checked', false);\n $('input[type=checkbox]:not(:checked)').removeAttr('disabled');\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n return productsToCompare;\n}\n\n/**\n * Clears the Compare Bar and hides it\n * @return {undefined}\n */\nfunction clearCompareBar() {\n productsForComparison.forEach(function (product) {\n $(this).trigger('compare:deselected', { pid: product.pid });\n });\n\n productsForComparison = [];\n $('.compare input').prop('checked', false);\n $('.compare input[type=checkbox]:not(:checked)').removeAttr('disabled');\n $compareBar.hide();\n}\n\n/**\n * Update form action url to not have query string\n * @returns {undefined}\n */\nfunction updateSubmitUrl() {\n var form = $('.compare-products-form');\n var targetUrl = form.attr('action');\n var urlParts = targetUrl.split('?');\n if (urlParts[1]) {\n urlParts[1].split('&').forEach(function (keyValue) {\n var splittedValues = keyValue.split('=');\n var key = decodeURIComponent(splittedValues[0]);\n var value = decodeURIComponent(splittedValues[1]);\n if (key && value) {\n if (form.find('[name=\"' + key + '\"]').length === 0) {\n form.append('');\n }\n }\n });\n form.attr('action', urlParts[0]);\n }\n}\n\nmodule.exports = {\n /**\n * Handles Compare checkbox click\n */\n handleCompareClick: function () {\n $('body').on('click', '.compare input[type=checkbox]', function () {\n var pid = $(this).attr('id');\n var checked = $(this).is(':checked');\n var imgSrc = $(this).closest('.product-tile')\n .find('.tile-image')\n .prop('src');\n var altText = $(this).closest('.product-tile')\n .find('.tile-image')\n .attr('alt');\n\n if (checked) {\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc, altText);\n $(this).trigger('compare:selected', { pid: pid });\n } else {\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n }\n });\n },\n\n /**\n * Handles the Clear All link\n */\n handleClearAll: function () {\n $('.compare-bar a.clear-all').on('click', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n\n /**\n * Handles deselection of a product on the Compare Bar\n */\n deselectProductOnCompareBar: function () {\n $('.compare-bar').on('click', '.close', function () {\n var pid = $(this).closest('.slot').data('pid').toString();\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n });\n },\n\n /**\n * Selects products for comparison based on the checked status of the Compare checkboxes in\n * each product tile. Used when user goes back from the Compare Products page.\n */\n selectCheckedProducts: function () {\n $('.product-grid').ready(function () {\n if (location.hash) {\n location.hash.replace('#', '').split(',').forEach(function (id) {\n $('input#' + id).prop('checked', 'checked');\n });\n }\n $('.compare input:checked').each(function () {\n var pid = $(this).prop('id');\n var imgSrc = $(this).closest('.product-tile')\n .find('img.tile-image')\n .prop('src');\n var altText = $(this).closest('.product-tile')\n .find('.tile-image')\n .attr('alt');\n\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc, altText);\n $(this).trigger('compare:selected', { pid: pid });\n });\n });\n },\n\n /**\n * Sets the \"backUrl\" property to the last attribute selected URL to ensure that when the user\n * goes back from the Compare Products page, the previously selected attributes are still\n * selected and applied to the previous search.\n */\n setBackUrl: function () {\n $('.search-results').on('click', '.refinements a', function () {\n $('input[name=\"backUrl\"]').val($(this).prop('href'));\n });\n },\n\n /**\n * Sets the history.pushState for history.back() to work from the Compare Products page.\n */\n setPushState: function () {\n $('.compare-products-form').on('submit', function () {\n updateSubmitUrl();\n var selectedProducts = $('.compare input:checked').map(function () { return this.id; }).get().join(',');\n history.pushState({}, document.title, lastKnownUrl + '#' + selectedProducts);\n location.hash = selectedProducts;\n\n $(this).find('input[name=\"cgid\"]').attr('value', $('input.category-id').val());\n });\n },\n catchFilterChange: function () {\n $('.container').on('click', '.refinements li a, .refinement-bar a.reset', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n listenToFilterChange: function () {\n $('body').on('search:filter', function (e, data) {\n lastKnownUrl = data.currentTarget.href;\n });\n }\n};\n","'use strict';\n\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./search/search'));\n processInclude(require('./product/compare'));\n});\n","const SearchCore = require('core/search/search');\n\nSearchCore.initRefinements = function () {\n $('.container').on('click', 'button.filter-results', function () {\n $('.refinement-bar').addClass('show');\n });\n\n $('.container').on('click', '.refinement-bar button.close, .modal-background', function () {\n $('.refinement-bar').removeClass('show');\n });\n\n $('.save-vehicle-btn').on('click', (e) => {\n var $this = $(e.currentTarget);\n\n $('.installation-guide-btn').removeClass('active');\n $('.guide-button-container').removeClass('active');\n $('.how-to-btn').removeClass('active');\n $('.toggle-guide-btn').removeClass('active-icon');\n $('.bulb-finder-mainheader').removeClass('active');\n $('.installation-guide-main-container').removeClass('active');\n $('.save-vehicle-main-container').toggleClass('active');\n $this.toggleClass('active');\n\n if ($this.hasClass('active')) {\n $('.guide-button-container .car-icon').attr('src' , 'https://i.ibb.co/GJF1NK2/car-active.png');\n $('.guide-button-container .bulb-icon').attr('src' , 'https://i.ibb.co/PwF0hLC/bulb.png');\n $('.guide-button-container .tools-icon').attr('src' , 'https://i.ibb.co/PFSHK5X/tools.png');\n $('.installation-guide-btn .option-icon').removeClass('fa-minus').addClass('fa-plus');\n $this.addClass('active-icon');\n } else {\n $('.guide-button-container .car-icon').attr('src' , 'https://i.ibb.co/jDWNRyf/car.png');\n $this.removeClass('active-icon');\n }\n });\n \n $('.installation-guide-btn').on('click', (e) => {\n var $this = $(e.currentTarget);\n \n $('.save-vehicle-btn').removeClass('active');\n $('.save-vehicle-btn').removeClass('active-icon');\n $('.how-to-btn').removeClass('active');\n $('.how-to-btn').removeClass('active-icon');\n $('.bulb-finder-mainheader').removeClass('active');\n $('.save-vehicle-main-container').removeClass('active');\n $this.toggleClass('active');\n $('.installation-guide-main-container').toggleClass('active');\n\n if ($this.hasClass('active')) {\n $('.guide-button-container .bulb-icon').attr('src' , 'https://i.ibb.co/h1jDypW/Bulb-active.png');\n $('.guide-button-container .car-icon').attr('src' , 'https://i.ibb.co/jDWNRyf/car.png');\n $('.guide-button-container .tools-icon').attr('src' , 'https://i.ibb.co/PFSHK5X/tools.png');\n $('.installation-guide-btn .option-icon').removeClass('fa-plus').addClass('fa-minus');\n $this.addClass('active-icon');\n $this.parent().addClass('active');\n } else {\n $('.guide-button-container .bulb-icon').attr('src' , 'https://i.ibb.co/PwF0hLC/bulb.png');\n $('.installation-guide-btn .option-icon').removeClass('fa-minus').addClass('fa-plus');\n $this.removeClass('active-icon');\n $this.parent().removeClass('active');\n }\n });\n\n $('.bulb-finder-mainheader .how-to-btn').on('click', (e) => {\n var $this = $(e.currentTarget);\n\n $('.save-vehicle-btn').removeClass('active');\n $('.save-vehicle-btn').removeClass('active-icon');\n $('.installation-guide-btn').removeClass('active');\n $('.installation-guide-btn').removeClass('active-icon');\n $('.guide-button-container').removeClass('active');\n $('.installation-guide-main-container').removeClass('active');\n $('.save-vehicle-main-container').removeClass('active');\n $this.toggleClass('active-icon');\n $this.toggleClass('active');\n $('.bulb-finder-mainheader').toggleClass('active');\n\n if ($this.hasClass('active-icon')) {\n $('.guide-button-container .tools-icon').attr('src' , 'https://i.ibb.co/bgFRk5D/tools-active.png');\n $('.guide-button-container .car-icon').attr('src' , 'https://i.ibb.co/jDWNRyf/car.png');\n $('.guide-button-container .bulb-icon').attr('src' , 'https://i.ibb.co/PwF0hLC/bulb.png');\n $('.installation-guide-btn .option-icon').removeClass('fa-minus').addClass('fa-plus');\n } else {\n $('.guide-button-container .tools-icon').attr('src' , 'https://i.ibb.co/PFSHK5X/tools.png');\n }\n\n setTimeout(() => { \n if($this.hasClass('slick-active')) {\n $this.removeClass('slick-active');\n \n $('.how-to-carousel-slider').slick({\n slidesToShow: 1,\n slidesToScroll: 1,\n arrows: true,\n fade: true,\n infinite: false,\n asNavFor: '.carousel-nav-for-how-to'\n });\n \n $('.carousel-nav-for-how-to').slick({\n slidesToShow: 7,\n arrows: false,\n slidesToScroll: 7,\n asNavFor: '.how-to-carousel-slider',\n dots: false,\n centerMode: true,\n infinite: false,\n focusOnSelect: true,\n responsive: [\n {\n breakpoint: 1024,\n settings: {\n slidesToShow: 6,\n centerMode: false,\n slidesToScroll: 1,\n infinite: false\n }\n },\n {\n breakpoint: 768,\n settings: {\n arrows: false,\n slidesToScroll: 1,\n slidesToShow: 5,\n centerMode: false\n }\n },\n {\n breakpoint: 480,\n settings: {\n slidesToScroll: 1,\n slidesToShow: 5,\n centerMode: false\n }\n }\n ]\n });\n }\n }, 100);\n });\n\n $('body').on('click','.nav-link-BulbFinder',function() {\n var currID = $(this).data('id');\n $('.bulb-finder-row-main .tab-pane.container').removeClass('active');\n $('.' + currID).addClass('active');\n });\n\n $('body').on('click','.bulb-btn-container',function() {\n $('.which-bulb-content').toggleClass('active');\n $('.which-bulb-footer').toggleClass('active');\n $('.consult-footer').toggleClass('active');\n $(this).toggleClass('active');\n $('.bulb-finder-row-main').toggleClass('none');\n\n if ($(this).hasClass('active')) {\n $('.bulb-btn-container .fas').removeClass('fa-plus');\n $('.bulb-btn-container .fas').addClass('fa-minus');\n } else {\n $('.bulb-btn-container .fas').addClass('fa-plus');\n $('.bulb-btn-container .fas').removeClass('fa-minus');\n }\n });\n\n $('body').on('click','.btn-position',function() {\n $('.btn-position').removeClass('active');\n $(this).addClass('active');\n var pos = $(this).data('type');\n $('.content-position').removeClass('active');\n $('.' + pos + '-bulb').addClass('active');\n });\n\n $('body').on('click','#isBulbFinder .edit-bulb-search',function() {\n $(this).toggleClass('active');\n $('.refinement-bar').toggleClass('active');\n $('.edit-background').toggleClass('active');\n $('#isBulbFinder .search-results .grid-wrapper').toggleClass('edit-active');\n $('.installation-guide-main-container').removeClass('active');\n $('.save-vehicle-main-container').removeClass('active');\n $('.save-vehicle-btn').removeClass('active');\n $('.save-vehicle-btn').removeClass('active-icon');\n $('.how-to-btn').removeClass('active');\n $('.how-to-btn').removeClass('active-icon');\n $('.bulb-finder-mainheader').removeClass('active');\n $('.installation-guide-btn').removeClass('active');\n $('.installation-guide-btn').removeClass('active-icon');\n $('.guide-button-container .car-icon').attr('src' , 'https://i.ibb.co/jDWNRyf/car.png');\n $('.guide-button-container .bulb-icon').attr('src' , 'https://i.ibb.co/PwF0hLC/bulb.png');\n $('.guide-button-container .tools-icon').attr('src' , 'https://i.ibb.co/PFSHK5X/tools.png');\n });\n};\n\nSearchCore.resetRefinementsBtn = function () {\n return;\n}\n\n\n\nmodule.exports = SearchCore;","'use strict';\n\n/**\n * Update DOM elements with Ajax results\n *\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n $(selector).empty().html($updates.html());\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n var activeDiv = $results.find('.' + $(this)[0].className.replace(/ /g, '.'));\n activeDiv.addClass('active');\n activeDiv.find('button.title').attr('aria-expanded', 'true');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements\n };\n\n // Update DOM elements that do not require special handling\n [\n '.grid-header',\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * This function retrieves another page of content to display in the content search grid\n * @param {JQuery} $element - the jquery element that has the click event attached\n * @param {JQuery} $target - the jquery element that will receive the response\n * @return {undefined}\n */\nfunction getContent($element, $target) {\n var showMoreUrl = $element.data('url');\n $.spinner().start();\n $.ajax({\n url: showMoreUrl,\n method: 'GET',\n success: function (response) {\n $target.append(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateSortOptions(response) {\n var $tempDom = $('
').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n}\n\nmodule.exports = {\n filter: function () {\n // Display refinements bar when Menu icon clicked\n $(document).on('click', 'button.filter-results', function () {\n $('.refinement-bar, .modal-background').show();\n $('.refinement-bar').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', true);\n $('.refinement-bar .close').focus();\n });\n },\n\n closeRefinements: function () {\n // Refinements close button\n $(document).on('click', '.refinement-bar button.close, .modal-background', function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n $('.btn.filter-results').focus();\n });\n },\n\n resize: function () {\n // Close refinement bar and hide modal background if user resizes browser\n $(window).resize(function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n });\n },\n\n sort: function () {\n // Handle sort order menu selection\n $(document).on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:sort', this.value);\n $.ajax({\n url: this.value,\n data: { selectedUrl: this.value },\n method: 'GET',\n success: function (response) {\n $('.product-grid').empty().html(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n showMore: function () {\n // Show more products\n $(document).on('click', '.show-more button', function (e) {\n e.stopPropagation();\n var showMoreUrl = $(this).data('url');\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:showMore', e);\n $.ajax({\n url: showMoreUrl,\n data: { selectedUrl: showMoreUrl },\n method: 'GET',\n success: function (response) {\n $('.grid-footer').replaceWith(response);\n updateSortOptions(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n applyFilter: function () {\n // Handle refinement value selection and reset click\n $(document).on(\n 'click',\n '.refinements li button, .refinement-bar button.reset, .filter-value button, .swatch-filter button',\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $.spinner().start();\n $(this).trigger('search:filter', e);\n $.ajax({\n url: $(this).data('href'),\n data: {\n page: $('.grid-footer').data('page-number'),\n selectedUrl: $(this).data('href')\n },\n method: 'GET',\n success: function (response) {\n parseResults(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n showContentTab: function () {\n // Display content results from the search\n $('.container').on('click', '.content-search', function () {\n if ($('#content-search-results').html() === '') {\n getContent($(this), $('#content-search-results'));\n }\n });\n\n // Display the next page of content results from the search\n $('.container').on('click', '.show-more-content button', function () {\n getContent($(this), $('#content-search-results'));\n $('.show-more-content').remove();\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","/** {@link github:taurgis/plugin_filternavigation} **/\n\nconst Search = require('base/search/search');\n\nSearch.initHistory = function () {\n let previousHistoryState;\n let doNotPushHistory = false;\n\n /**\n * Listen to all possible AJAX calls on a search page (Filters, sorting, show more, ...).\n */\n $(document).ajaxSuccess(\n function (event, xhr) {\n // Make the assumption that a product-tile being present in the response means a grid-refresh\n if (xhr.responseText.indexOf('
') >= 0) {\n if (!doNotPushHistory) {\n setTimeout(function () {\n history.pushState({ reapplyFilters: true }, document.title, decodeURI($('.permalink').val()));\n });\n }\n\n doNotPushHistory = false;\n }\n }\n );\n\n /**\n * Listen to the back and forward button of the browser to detect URL changes.\n */\n window.addEventListener('popstate', () => {\n if ((history.state && history.state.reapplyFilters)\n || (previousHistoryState && previousHistoryState.reapplyFilters)) {\n const $resetButton = $('.refinement-bar button.reset');\n\n previousHistoryState = history.state;\n\n // This async call should not cause a new history state to be pushed.\n doNotPushHistory = true;\n\n // Use the reset button listeners to do a refresh\n $resetButton.data('href', decodeURI(window.location.href));\n $resetButton.trigger('click');\n }\n });\n};\n\nSearch.resetRefinementsBtn = function () {\n\n /**\n * Listen to all possible AJAX calls on a search page (Filters, sorting, show more, ...).\n */\n $(document).ajaxSuccess(\n function (event, xhr) {\n // Make the assumption that if there are values in \".filter-bar\" that there are refinements applied,\n // Of there are, show the reset button, if not hide it\n if ($('.filter-bar .swatch-filter, .filter-bar .filter-value').length > 0) {\n $('.secondary-bar').removeClass('hide').addClass('show');\n } else {\n $('.secondary-bar').removeClass('show').addClass('hide');\n }\n }\n );\n};\n\nmodule.exports = Search;"],"sourceRoot":""}