{"version":3,"file":"default/js/productDetail.js","sources":["webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/clientSideValidation.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/keyboardAccessibility.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/base.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/product/detail.js","webpack://rws/./dependencies/storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/cart/cart.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/components/clientSideValidation.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/components/zoom-carousel.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/product/base.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/product/detail.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/product/productDetailsSection.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/product/swatchableAttribute.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/storeDrawer/storeDrawerPdp.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/util/matchBreakpoints.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/util/urlUtils.js","webpack://rws/./cartridges/app_rws/cartridge/client/default/js/productDetail.js"],"sourcesContent":["'use strict';\n\n/**\n * Validate whole form. Requires `this` to be set to form object\n * @param {jQuery.event} event - Event to be canceled if form is invalid.\n * @returns {boolean} - Flag to indicate if form is valid\n */\nfunction validateForm(event) {\n var valid = true;\n if (this.checkValidity && !this.checkValidity()) {\n // safari\n valid = false;\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n $(this).find('input, select').each(function () {\n if (!this.validity.valid) {\n $(this).trigger('invalid', this.validity);\n }\n });\n }\n return valid;\n}\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearForm(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = {\n invalid: function () {\n $('form input, form select').on('invalid', function (e) {\n e.preventDefault();\n this.setCustomValidity('');\n if (!this.validity.valid) {\n var validationMessage = this.validationMessage;\n $(this).addClass('is-invalid');\n if (this.validity.patternMismatch && $(this).data('pattern-mismatch')) {\n validationMessage = $(this).data('pattern-mismatch');\n }\n if ((this.validity.rangeOverflow || this.validity.rangeUnderflow)\n && $(this).data('range-error')) {\n validationMessage = $(this).data('range-error');\n }\n if ((this.validity.tooLong || this.validity.tooShort)\n && $(this).data('range-error')) {\n validationMessage = $(this).data('range-error');\n }\n if (this.validity.valueMissing && $(this).data('missing-error')) {\n validationMessage = $(this).data('missing-error');\n }\n $(this).parents('.form-group').find('.invalid-feedback')\n .text(validationMessage);\n }\n });\n },\n\n submit: function () {\n $('form').on('submit', function (e) {\n return validateForm.call(this, e);\n });\n },\n\n buttonClick: function () {\n $('form button[type=\"submit\"], form input[type=\"submit\"]').on('click', function () {\n // clear all errors when trying to submit the form\n clearForm($(this).parents('form'));\n });\n },\n\n functions: {\n validateForm: function (form, event) {\n validateForm.call($(form), event || null);\n },\n clearForm: clearForm\n }\n};\n","'use strict';\n\nmodule.exports = {\n setTabNextFocus: function (focusParams) {\n var KEYCODE_TAB = 9;\n var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n if (!isTabPressed) {\n return;\n }\n\n var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n if ($('.product-quickview.product-set').length > 0) {\n var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n lastFocusableEl = linkElements[linkElements.length - 1];\n }\n }\n\n if (focusParams.event.shiftKey) /* shift + tab */ {\n if ($(':focus').is(firstFocusableEl)) {\n lastFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n } else /* tab */ {\n if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n firstFocusableEl.focus();\n focusParams.event.preventDefault();\n }\n }\n }\n};\n","'use strict';\n\n// Customization: Added Enter key (13)\n\nmodule.exports = function (selector, keyFunctions, preFunction) {\n $(selector).on('keydown', function (e) {\n var key = e.which;\n var supportedKeyCodes = [37, 38, 39, 40, 27, 13];\n if (supportedKeyCodes.indexOf(key) >= 0) {\n e.preventDefault();\n }\n var returnedScope = preFunction.call(this);\n if (keyFunctions[key]) {\n keyFunctions[key].call(this, returnedScope);\n }\n });\n};\n","'use strict';\nvar focusHelper = require('../components/focus');\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n\n if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').find('.product-id').text();\n } else {\n pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n var quantitySelected;\n if ($el && $('.set-items').length) {\n quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n } else if ($el && $('.product-bundle').length) {\n var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n if (quantitySelectedModal.val() === undefined) {\n quantitySelected = quantitySelectedPDP;\n } else {\n quantitySelected = quantitySelectedModal;\n }\n } else {\n quantitySelected = $('.quantity-select');\n }\n return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchButton = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n } else {\n $attrValue.removeClass('selected');\n $attrValue.siblings('.selected-assistive-text').empty();\n }\n\n if (attrValue.url) {\n $swatchButton.attr('data-url', attrValue.url);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer, msgs);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
  • ' + response.resources.info_selectforstock + '
  • ';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
  • ' + message + '
  • ';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
    ' + attribute.label + ': '\n + attribute.value + '
    ';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n\t// Update options\n $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n var carousel = $productContainer.find('.carousel');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n $(carousel).empty().append('
      ' + $(carousel).data('prev') + '' + $(carousel).data('next') + '');\n for (var i = 0; i < imgs.length; i++) {\n $('
      \"'
      ').appendTo($(carousel).find('.carousel-inner'));\n $('
    1. ').appendTo($(carousel).find('.carousel-indicators'));\n }\n $($(carousel).find('.carousel-item')).first().addClass('active');\n $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n if (imgs.length === 1) {\n $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n }\n $(carousel).carousel();\n $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n var primaryImageUrls = response.product.images.large;\n createCarousel(primaryImageUrls, $productContainer);\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length\n ? $('.prices .price', $productContainer)\n : $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product, $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if ($productContainer.parent('.bonus-product-item').length <= 0) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.optionsHtml, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n $('body').trigger('product:afterAttributeSelect',\n { data: data, container: $productContainer });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
      ').append($.parseHTML(html));\n\n var body = $html.find('.choice-of-bonus-product');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n if ($('#chooseBonusProductModal').length !== 0) {\n $('#chooseBonusProductModal').remove();\n }\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n var htmlString = ''\n + '
      '\n + ''\n + '
      '\n + ''\n + '
      '\n + '
      '\n + ' ' + data.labels.selectprods + ''\n + ' '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      '\n + '
      ';\n $('body').append(htmlString);\n $('.modal-body').spinner().start();\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n $('#chooseBonusProductModal').modal('show');\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n if (response.newBonusDiscountLineItem\n && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n chooseBonusProducts(response.newBonusDiscountLineItem);\n } else {\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
      '\n );\n }\n\n $('.add-to-cart-messages').append(\n '
      '\n + response.message\n + '
      '\n );\n\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n var options = $productContainer\n .find('.product-option')\n .map(function () {\n var $elOption = $(this).find('.options-select');\n var urlValue = $elOption.val();\n var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n .data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n }).toArray();\n\n return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function () {\n // reporting urls hit on the server\n },\n error: function () {\n // no reporting urls hit on the server\n }\n });\n }\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n\n focusChooseBonusProductModal: function () {\n $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n $('#chooseBonusProductModal .close').focus();\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n });\n },\n\n trapChooseBonusProductModalFocus: function () {\n $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#chooseBonusProductModal',\n firstElementSelector: '.close',\n lastElementSelector: '.add-bonus-products'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n\n colorAttribute: function () {\n $(document).on('click', '[data-attr=\"color\"] button', function (e) {\n e.preventDefault();\n\n if ($(this).attr('disabled')) {\n return;\n }\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n attributeSelect($(this).attr('data-url'), $productContainer);\n });\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer);\n }\n });\n },\n\n addToCart: function () {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n var addToCartUrl;\n var pid;\n var pidsObj;\n var setPids;\n\n if ($(this).hasClass('disabled')) {\n return;\n }\n\n $('body').trigger('product:beforeAddToCart', this);\n\n if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n setPids = [];\n\n $('.product-detail').each(function () {\n if (!$(this).hasClass('product-set-detail')) {\n setPids.push({\n pid: $(this).find('.product-id').text(),\n qty: $(this).find('.quantity-select').val(),\n options: getOptions($(this))\n });\n }\n });\n pidsObj = JSON.stringify(setPids);\n }\n\n pid = getPidValue($(this));\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n }\n\n addToCartUrl = getAddToCartUrl();\n\n var form = {\n pid: pid,\n pidsObj: pidsObj,\n childProducts: getChildProducts(),\n quantity: getQuantitySelected($(this))\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $(this).trigger('updateAddToCartFormData', form);\n if (addToCartUrl) {\n $.ajax({\n url: addToCartUrl,\n method: 'POST',\n data: form,\n success: function (data) {\n handlePostCartAdd(data);\n $('body').trigger('product:afterAddToCart', data);\n $.spinner().stop();\n miniCartReportingUrl(data.reportingURL);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n },\n selectBonusProduct: function () {\n $(document).on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = parseInt($choiceOfBonusProduct.find('.bonus-quantity-select').val(), 10);\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = ''\n + '
      '\n + '
      '\n + $choiceOfBonusProduct.find('.product-name').html()\n + '
      '\n + '
      '\n + '
      '\n ;\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n },\n removeBonusProduct: function () {\n $(document).on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n var pid = response.product.id;\n $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption =\n parseInt($(this)\n .data('qty'), 10);\n\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = $(this).data('pid');\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n pid: $(this).data('pid'),\n qty: qtyOption,\n options: [option]\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('#chooseBonusProductModal').modal('hide');\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n $('.add-to-cart-messages').append(\n '
      '\n + data.errorMessage + '
      '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 3000);\n } else {\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').modal('hide');\n\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
      ');\n }\n $('.minicart-quantity').html(data.totalQty);\n $('.add-to-cart-messages').append(\n '
      '\n + data.msgSuccess + '
      '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n if ($('.cart-page').length) {\n location.reload();\n }\n }, 1500);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n miniCartReportingUrl: miniCartReportingUrl\n};\n","'use strict';\nvar base = require('./base');\n\n/**\n * Enable/disable UI elements\n * @param {boolean} enableOrDisable - true or false\n */\nfunction updateAddToCartEnableDisableOtherElements(enableOrDisable) {\n $('button.add-to-cart-global').attr('disabled', enableOrDisable);\n}\n\nmodule.exports = {\n methods: {\n updateAddToCartEnableDisableOtherElements: updateAddToCartEnableDisableOtherElements\n },\n\n availability: base.availability,\n\n addToCart: base.addToCart,\n\n updateAttributesAndDetails: function () {\n $('body').on('product:statusUpdate', function (e, data) {\n var $productContainer = $('.product-detail[data-pid=\"' + data.id + '\"]');\n\n $productContainer.find('.description-and-detail .product-attributes')\n .empty()\n .html(data.attributesHtml);\n\n if (data.shortDescription) {\n $productContainer.find('.description-and-detail .description')\n .removeClass('hidden-xl-down');\n $productContainer.find('.description-and-detail .description .content')\n .empty()\n .html(data.shortDescription);\n } else {\n $productContainer.find('.description-and-detail .description')\n .addClass('hidden-xl-down');\n }\n\n if (data.longDescription) {\n $productContainer.find('.description-and-detail .details')\n .removeClass('hidden-xl-down');\n $productContainer.find('.description-and-detail .details .content')\n .empty()\n .html(data.longDescription);\n } else {\n $productContainer.find('.description-and-detail .details')\n .addClass('hidden-xl-down');\n }\n });\n },\n\n showSpinner: function () {\n $('body').on('product:beforeAddToCart product:beforeAttributeSelect', function () {\n $.spinner().start();\n });\n },\n updateAttribute: function () {\n $('body').on('product:afterAttributeSelect', function (e, response) {\n if ($('.product-detail>.bundle-items').length) {\n response.container.data('pid', response.data.product.id);\n response.container.find('.product-id').text(response.data.product.id);\n } else if ($('.product-set-detail').eq(0)) {\n response.container.data('pid', response.data.product.id);\n response.container.find('.product-id').text(response.data.product.id);\n } else {\n $('.product-id').text(response.data.product.id);\n $('.product-detail:not(\".bundle-item\")').data('pid', response.data.product.id);\n }\n });\n },\n updateAddToCart: function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n // update local add to cart (for sets)\n $('button.add-to-cart', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n\n var enable = $('.product-availability').toArray().every(function (item) {\n return $(item).data('available') && $(item).data('ready-to-order');\n });\n module.exports.methods.updateAddToCartEnableDisableOtherElements(!enable);\n });\n },\n updateAvailability: function () {\n $('body').on('product:updateAvailability', function (e, response) {\n $('div.availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available);\n\n $('.availability-msg', response.$productContainer)\n .empty().html(response.message);\n\n if ($('.global-availability').length) {\n var allAvailable = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('available'); });\n\n var allReady = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('ready-to-order'); });\n\n $('.global-availability')\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg').empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n }\n });\n },\n sizeChart: function () {\n $('.size-chart a').on('click', function (e) {\n e.preventDefault();\n var url = $(this).attr('href');\n var $prodSizeChart = $(this).closest('.size-chart').find('.size-chart-collapsible');\n if ($prodSizeChart.is(':empty')) {\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $prodSizeChart.append(data.content);\n }\n });\n }\n $prodSizeChart.toggleClass('active');\n });\n\n var $sizeChart = $('.size-chart-collapsible');\n $('body').on('click touchstart', function (e) {\n if ($('.size-chart').has(e.target).length <= 0) {\n $sizeChart.removeClass('active');\n }\n });\n },\n copyProductLink: function () {\n $('body').on('click', '#fa-link', function () {\n event.preventDefault();\n var $temp = $('');\n $('body').append($temp);\n $temp.val($('#shareUrl').val()).select();\n document.execCommand('copy');\n $temp.remove();\n $('.copy-link-message').attr('role', 'alert');\n $('.copy-link-message').removeClass('d-none');\n setTimeout(function () {\n $('.copy-link-message').addClass('d-none');\n }, 3000);\n });\n },\n\n focusChooseBonusProductModal: base.focusChooseBonusProductModal()\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","'use strict';\n\nvar processThumbnailActiveStateQuickView = function ($thumbnail, thumbnailIndex) {\n if ($('.js-pdp-carousel').length) {\n $('.js-pdp-carousel').slick('slickGoTo', thumbnailIndex);\n\n // Toggle aria-current state\n $('.js-pdp-carousel-thumb').find('.js-slide-indicator.active').attr('aria-current', false);\n $($thumbnail).attr('aria-current', 'true');\n\n // Toggle active state\n $('.js-pdp-carousel-thumb').find('.js-slide-indicator').removeClass('active');\n $($thumbnail).addClass('active');\n }\n};\n\n/**\n * appends params to a url\n * @param {string} url - Original url\n * @param {Object} params - Parameters to append\n * @returns {string} result url with appended parameters\n */\nfunction appendToUrl(url, params) {\n var newUrl = url;\n newUrl += (newUrl.indexOf('?') !== -1 ? '&' : '?') + Object.keys(params).map(function (key) {\n return key + '=' + encodeURIComponent(params[key]);\n }).join('&');\n\n return newUrl;\n}\n\n/**\n * re-renders the order totals and the number of items in the cart\n * @param {Object} data - AJAX response from the server\n */\nfunction updateCartTotals(data) {\n if (data.resources && data.resources.numberOfItems) {\n $('.number-of-items').empty().append(data.resources.numberOfItems);\n }\n $('.shipping-cost').empty().append(data.totals.totalShippingCost);\n $('.tax-total').empty().append(data.totals.totalTax);\n $('.grand-total').empty().append(data.totals.grandTotal);\n $('.sub-total').empty().append(data.totals.subTotal);\n $('.minicart-quantity').empty().append(data.numItems);\n $('.minicart-link').attr({\n 'aria-label': data.resources.minicartCountOfItems,\n title: data.resources.minicartCountOfItems\n });\n if (data.totals.orderLevelDiscountTotal.value > 0) {\n $('.order-discount').removeClass('hide-order-discount');\n $('.order-discount-total').empty()\n .append('- ' + data.totals.orderLevelDiscountTotal.formatted);\n } else {\n $('.order-discount').addClass('hide-order-discount');\n }\n\n if (data.totals.shippingLevelDiscountTotal.value > 0) {\n $('.shipping-discount').removeClass('hide-shipping-discount');\n $('.shipping-discount-total').empty().append('- ' +\n data.totals.shippingLevelDiscountTotal.formatted);\n } else {\n $('.shipping-discount').addClass('hide-shipping-discount');\n }\n\n data.items.forEach(function (item) {\n if (data.totals.orderLevelDiscountTotal.value > 0) {\n $('.coupons-and-promos').empty().append(data.totals.discountsHtml);\n }\n if (item.renderedPromotions) {\n $('.item-' + item.UUID).empty().append(item.renderedPromotions);\n } else {\n $('.item-' + item.UUID).empty();\n }\n $('.uuid-' + item.UUID + ' .unit-price').empty().append(item.renderedPrice);\n $('.line-item-price-' + item.UUID + ' .unit-price').empty().append(item.renderedPrice);\n $('.item-total-' + item.UUID).empty().append(item.priceTotal.renderedPrice);\n });\n\n if (data.totals.cartType.isBopisOnlyOrder) {\n $('.js-order-pickup-line-item-total').removeClass('d-none');\n $('.js-shipping-line-item-total').addClass('d-none');\n $('.js-shipping-method-selection-cart').addClass('d-none');\n } else if (data.totals.cartType.isMixedCart) {\n $('.js-order-pickup-line-item-total').removeClass('d-none');\n $('.js-shipping-line-item-total').removeClass('d-none');\n $('.js-shipping-method-selection-cart').removeClass('d-none');\n } else {\n $('.js-order-pickup-line-item-total').addClass('d-none');\n $('.js-shipping-line-item-total').removeClass('d-none');\n $('.js-shipping-method-selection-cart').removeClass('d-none');\n }\n}\n\n/**\n * re-renders the approaching discount messages\n * @param {Object} approachingDiscounts - updated approaching discounts for the cart\n */\nfunction updateApproachingDiscounts(approachingDiscounts) {\n var html = '';\n $('.approaching-discounts').empty();\n if (approachingDiscounts.length > 0) {\n approachingDiscounts.forEach(function (item) {\n html += '
      '\n + item.discountMsg + '
      ';\n });\n }\n $('.approaching-discounts').append(html);\n}\n\n/**\n * Checks whether the basket is valid. if invalid displays error message and disables\n * checkout button\n * @param {Object} data - AJAX response from the server\n */\nfunction validateBasket(data) {\n if (data.valid.error) {\n if (data.valid.message) {\n var errorHtml = '
      ' +\n '' + data.valid.message + '
      ';\n\n $('.cart-error').append(errorHtml);\n } else {\n $('.cart').empty().append('
      ' +\n '
      ' +\n '

      ' + data.resources.emptyCartMsg + '

      ' +\n '
      ' +\n '
      '\n );\n $('.number-of-items').empty().append(data.resources.numberOfItems);\n $('.minicart-quantity').empty().append(data.numItems);\n $('.minicart-link').attr({\n 'aria-label': data.resources.minicartCountOfItems,\n title: data.resources.minicartCountOfItems\n });\n $('.js-minicart').empty();\n $('.js-minicart').modal('hide');\n }\n\n $('.checkout-btn').addClass('disabled');\n } else {\n $('.checkout-btn').removeClass('disabled');\n }\n}\n\n/**\n * re-renders the order totals and the number of items in the cart\n * @param {Object} message - Error message to display\n */\nfunction createErrorNotification(message) {\n var errorHtml = '
      ' +\n '' + message + '
      ';\n\n if ($('.cart-error').html().indexOf(errorHtml) === -1) {\n $('.cart-error').html(errorHtml);\n }\n}\n\nmodule.exports = function () {\n $('body').on('click', '.js-remove-product', function (e) {\n e.preventDefault();\n var $this = $(this);\n var productID = $this.data('pid');\n var url = $this.data('action');\n var uuid = $this.data('uuid');\n var urlParams = {\n pid: productID,\n uuid: uuid\n };\n\n url = appendToUrl(url, urlParams);\n\n $.spinner().start();\n\n $('body').trigger('cart:beforeUpdate');\n\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n if (data.basket.items.length === 0) {\n $('.cart').empty().append('
      ' +\n '
      ' +\n '

      ' + data.basket.resources.emptyCartMsg + '

      ' +\n '
      ' +\n '
      '\n );\n $('.number-of-items').empty().append(data.basket.resources.numberOfItems);\n $('.minicart-quantity').empty().append(data.basket.numItems);\n $('.minicart-link').attr({\n 'aria-label': data.basket.resources.minicartCountOfItems,\n title: data.basket.resources.minicartCountOfItems\n });\n $('.js-minicart').empty();\n $('.js-minicart').spinner().start();\n $('.js-minicart').modal('hide');\n } else {\n if (data.toBeDeletedUUIDs && data.toBeDeletedUUIDs.length > 0) {\n for (var i = 0; i < data.toBeDeletedUUIDs.length; i++) {\n $('.uuid-' + data.toBeDeletedUUIDs[i]).remove();\n }\n }\n var suuid = $this.parents('.js-card-product-info').data('shipment');\n $('.uuid-' + uuid).remove();\n if ($('.shipment-' + suuid).length < 2) {\n $('.shipment-' + suuid).parents('.js-product-card-container').remove();\n }\n if (!data.basket.hasBonusProduct) {\n $('.bonus-product').remove();\n }\n $('.coupons-and-promos').empty().append(data.basket.totals.discountsHtml);\n updateCartTotals(data.basket);\n updateApproachingDiscounts(data.basket.approachingDiscounts);\n $('body').trigger('setShippingMethodSelection', data.basket);\n validateBasket(data.basket);\n }\n $('body').trigger('cart:update', data);\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n $('.optional-promo').off('click').click(function (e) {\n e.preventDefault();\n $(this).toggleClass('is-expand');\n $('.js-promo-code-form').toggle(200);\n });\n\n $(document).off('click', '.select-bonus-product')\n .on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = parseInt($(this).parents('.choice-of-bonus-product').find('.bonus-quantity-select').val(), 10);\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $(this).parents('.choice-of-bonus-product').find('.product-option').data('option-id');\n var valueId = $(this).parents('.choice-of-bonus-product').find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = ''\n + '
      '\n + '
      '\n + $choiceOfBonusProduct.find('.product-name').html()\n + '
      '\n + '
      '\n + '
      '\n ;\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n\n $('body').on('shown.bs.modal', '#editProductModal', function () {\n var $pdpCarouselThumbs = $('.js-pdp-carousel-thumb');\n // If the thumbnail slider has less than 6 slides, we need to treat this as if it's not\n // a carousel. So, we have to modify a bunch of aria attributes. ADA-106\n $($pdpCarouselThumbs).on('init', function () {\n if (!$($pdpCarouselThumbs).hasClass('js-pdp-carousel-thumb--more-than-six')) {\n $($pdpCarouselThumbs).removeAttr('role').removeAttr('aria-label');\n $($pdpCarouselThumbs).find('.slick-instructions').attr('aria-hidden', true);\n $($pdpCarouselThumbs).find('.slick-slide').attr('role', 'listitem');\n $($pdpCarouselThumbs).find('.slick-track').attr('role', 'list');\n }\n });\n\n $('.js-pdp-carousel:not(.slick-initialized)').slick();\n $('.js-pdp-carousel-thumb:not(.slick-initialized)').slick();\n\n $('.js-pdp-carousel').on('afterChange', function (e, slick, currentSlide) {\n var $thumbnail = $('.c-image-carousel__thumbnails__item .js-slide-indicator').eq(currentSlide);\n var thumbnailIndex = $($thumbnail).data('slide-to');\n\n processThumbnailActiveStateQuickView($thumbnail, thumbnailIndex);\n });\n });\n\n $('body').on('change', '.js-fulfillment-method', function () {\n $.spinner().start();\n var $this = $(this);\n var $cardprodinfo = $this.parents('.js-card-product-info');\n var url = $cardprodinfo.find('div.js-sourcing-locations').attr('data-action');\n var sourcingLocation = $this.attr('data-value-id');\n var pickupID = $cardprodinfo.find('.js-fulfillment-method-store').attr('data-value-id');\n var ship = $cardprodinfo.find('.js-fulfillment-method-ship').attr('data-value-id');\n\n var uuid = $cardprodinfo.find('.js-remove-product').attr('data-uuid');\n var store = $(this).attr('data-store');\n var odOrderType = $this.attr('data-isodordertype');\n var dataObj = {\n sourcingLocation: sourcingLocation,\n uuid: uuid,\n pickupID: pickupID,\n ship: ship\n };\n $.ajax({\n url: url,\n type: 'post',\n data: dataObj,\n success: function success(data) {\n if (data.sourcingLocationUpdated && data.sourcingLocationUpdated.uuid) {\n $cardprodinfo.find('.js-remove-product').attr('data-uuid', data.sourcingLocationUpdated.uuid);\n $cardprodinfo.removeClass(function (index, className) {\n return (className.match(/(^|\\s)uuid-\\S+/g) || []).join(' ');\n });\n updateCartTotals(data.basket);\n $cardprodinfo.addClass('uuid-' + data.sourcingLocationUpdated.uuid);\n if (odOrderType === 'PIS') {\n $cardprodinfo.prevAll('.row').find('.js-card-product-info-header')\n .find('.js-shipping-fulfillment-method')\n .addClass('d-none');\n $cardprodinfo.prevAll('.row').find('.js-card-product-info-header')\n .find('.js-order-pick-up-fulfillment-method')\n .removeClass('d-none');\n $cardprodinfo.prevAll('.row').find('.js-card-product-info-header')\n .find('.js-order-pick-up-fulfillment-method .js-product-card-store-name')\n .text(store);\n } else {\n $cardprodinfo.prevAll('.row').find('.js-card-product-info-header')\n .find('.js-shipping-fulfillment-method')\n .removeClass('d-none');\n $cardprodinfo.prevAll('.row').find('.js-card-product-info-header')\n .find('.js-order-pick-up-fulfillment-method')\n .addClass('d-none');\n }\n }\n window.location.reload();\n },\n error: function error(err) {\n }\n });\n });\n\n $('.js-promo-code-form').submit(function (e) {\n e.preventDefault();\n $.spinner().start();\n $('.coupon-missing-error').hide();\n $('.coupon-error-message').empty();\n if (!$('.coupon-code-field').val()) {\n // Customization: Added input focus on error\n $('.js-promo-code-form .form-control').addClass('is-invalid').focus();\n $('.js-promo-code-form .form-control').attr('aria-describedby', 'missingCouponCode');\n $('.coupon-missing-error').show();\n $.spinner().stop();\n return false;\n }\n var $form = $('.js-promo-code-form');\n $('.js-promo-code-form .form-control').removeClass('is-invalid');\n $('.coupon-error-message').empty();\n $('body').trigger('promotion:beforeUpdate');\n\n $.ajax({\n url: $form.attr('action'),\n type: 'GET',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n if (data.error) {\n // Customization: Added input focus on error\n $('.js-promo-code-form .form-control').addClass('is-invalid').focus();\n $('.js-promo-code-form .form-control').attr('aria-describedby', 'invalidCouponCode');\n $('.coupon-error-message').empty().append(data.errorMessage);\n $('body').trigger('promotion:error', data);\n } else {\n $('.coupons-and-promos').empty().append(data.totals.discountsHtml);\n updateCartTotals(data);\n updateApproachingDiscounts(data.approachingDiscounts);\n validateBasket(data);\n $('body').trigger('promotion:success', data);\n if (data.hasBonusProduct) {\n location.reload();\n }\n }\n $('.coupon-code-field').val('');\n $.spinner().stop();\n },\n error: function (err) {\n $('body').trigger('promotion:error', err);\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.errorMessage);\n $.spinner().stop();\n }\n }\n });\n return false;\n });\n\n $('body').on('click', '.js-remove-coupon', function (e) {\n e.preventDefault();\n\n var couponCode = $(this).data('code');\n var uuid = $(this).data('uuid');\n var $deleteConfirmBtn = $('.js-delete-coupon-confirmation-btn');\n var $productToRemoveSpan = $('.coupon-to-remove');\n\n $deleteConfirmBtn.data('uuid', uuid);\n $deleteConfirmBtn.data('code', couponCode);\n\n $productToRemoveSpan.empty().append(couponCode);\n });\n\n $('body').on('click', '.js-delete-coupon-confirmation-btn', function (e) {\n e.preventDefault();\n\n var url = $(this).data('action');\n var uuid = $(this).data('uuid');\n var couponCode = $(this).data('code');\n var urlParams = {\n code: couponCode,\n uuid: uuid\n };\n\n url = appendToUrl(url, urlParams);\n\n $('body > .modal-backdrop').remove();\n\n $.spinner().start();\n $('body').trigger('promotion:beforeUpdate');\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $('.coupon-uuid-' + uuid).remove();\n updateCartTotals(data);\n updateApproachingDiscounts(data.approachingDiscounts);\n validateBasket(data);\n $.spinner().stop();\n $('body').trigger('promotion:success', data);\n window.location.reload();\n },\n error: function (err) {\n $('body').trigger('promotion:error', err);\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification(err.responseJSON.errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n};\n","'use strict';\n\nvar base = require('base/components/clientSideValidation');\n\n/**\n * @param {string} resp - The reCaptcha response data that will be passed to the form\n */\nfunction reCaptchaValidated(resp) {\n if (resp) {\n $('#g-recaptcha-response').removeClass('is-invalid');\n }\n}\n\n// Need to export to window so as to be accessible to the callback\nwindow.reCaptchaValidated = reCaptchaValidated;\n\n/**\n * Validate whole form. Requires `this` to be set to form object\n * @param {jQuery.event} event - Event to be canceled if form is invalid.\n * @returns {boolean} - Flag to indicate if form is valid\n */\nfunction validateForm(event) {\n var valid = true;\n if (this.checkValidity) {\n // safari\n valid = this.checkValidity();\n if (!valid) {\n if (event) {\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n\n $(this).find('input, select, textarea').each(function () {\n $(this).trigger('invalid', this.validity);\n });\n } else {\n $(this).find('input, select, textarea').removeClass('is-invalid');\n }\n }\n\n return valid;\n}\n\nmodule.exports = $.extend(true, {}, base, {\n // Add form textareas to invalid functionality\n invalid: function () {\n $('form input, form select, form textarea').on('invalid', function (e) {\n e.preventDefault();\n this.setCustomValidity('');\n if (!this.validity.valid) {\n var validationMessage;\n $(this).addClass('is-invalid');\n if (this.validity.patternMismatch && $(this).data('pattern-mismatch')) {\n validationMessage = $(this).data('pattern-mismatch');\n }\n if ((this.validity.rangeOverflow || this.validity.rangeUnderflow)\n && $(this).data('range-error')) {\n validationMessage = $(this).data('range-error');\n }\n if ((this.validity.tooLong || this.validity.tooShort)\n && $(this).data('range-error')) {\n validationMessage = $(this).data('range-error');\n }\n if (this.validity.valueMissing && $(this).data('missing-error')) {\n validationMessage = $(this).data('missing-error');\n }\n\n // IE 11 doesn't have property validity.tooShort, causing a different error message to show when\n // the input has a value that doesn't meet the minimum length. To not change any functionality,\n // new `data-default-error` attribute is used as a default error message if available.\n if (!validationMessage) {\n validationMessage = $(this).data('default-error')\n ? $(this).data('default-error')\n : this.validationMessage;\n }\n $(this).parents('.form-group').find('.invalid-feedback')\n .text(validationMessage);\n } else {\n // Add handling for a valid form\n $(this).removeClass('is-invalid');\n }\n });\n },\n\n submit: function () {\n $('form').on('submit', function (e) {\n return validateForm.call(this, e);\n });\n },\n\n functions: {\n /**\n * Calls validate form on a given form\n *\n * Updated from base to return the validity,\n * and to not render itself pointless by making form into a jQuery object\n *\n * @param {HTML} form - HTML form object\n * @param {Event} event - JS event\n * @returns {boolean} The validity of the form\n */\n validateForm: function (form, event) {\n return validateForm.call(form, event);\n },\n clearForm: base.functions.clearForm\n }\n});\n","'use strict';\n\n/**\n * Initializes the slick slider for the PDP Zoom, sets initial slide based on PDP carousel selection\n */\n\nvar $pdpZoomCarousel = $('.js-zoom-carousel');\n\nfunction adjustZoomCarousel() {\n $('body').on('click', '.js-zoom-button', function (e) {\n $('.js-carousel-item').removeClass('js-zoom-item');\n $(this).prevAll('.js-pdp-carousel').find('.slick-active .js-carousel-item').addClass('js-zoom-item');\n });\n\n $('body').on('hidden.bs.modal', '.js-pdp-carousel-modal', function () {\n // Destroy Zoom Slider, reset thumbnail state and aria attrs\n if ($pdpZoomCarousel.length) {\n $pdpZoomCarousel.slick('unslick');\n $('.js-zoom-thumbnails .js-slide-indicator').removeClass('active').attr('aria-current', 'false');\n }\n });\n\n $($pdpZoomCarousel).on('init afterChange lazyLoaded', function (e) {\n if ($(window).width() >= 1200) {\n const slideHeight = $('.js-zoom-carousel .slick-active .js-pdp-carousel__slider__item__img--zoom').height();\n const modalHeight = $('.js-pdp-img-zoom__body').height();\n const height = modalHeight > slideHeight ? modalHeight : slideHeight;\n $('.js-zoom-carousel, .js-pdp-img-zoom__item').height(height);\n }\n });\n\n // On zoom modal show, determine which image should be set to active\n $('body').on('shown.bs.modal', '.js-pdp-carousel-modal', function () {\n const zoomSlideIndex = $('.js-zoom-item').length ? $('.js-zoom-item').data('carouselIndex') : '0';\n\n if ($pdpZoomCarousel.length) {\n $pdpZoomCarousel.not('.slick-initialized').slick({\n initialSlide: parseInt(zoomSlideIndex, 10)\n });\n }\n\n // detect thumbnail match and apply active state and aria current\n var $activeThumbnail = $('.js-zoom-thumbnails .c-carousel-zoom__thumbnails__item .js-slide-indicator').eq(zoomSlideIndex);\n $($activeThumbnail).addClass('active').attr('aria-current', 'true');\n\n $('.js-zoom-carousel .js-pdp-img-zoom__item').each(function () {\n let itemWithData = $(this).find('.js-pdp-carousel__slider__item__img--zoom');\n let zoomURL = itemWithData.data('zoom-url');\n let magnify = 1.5;\n\n if ($(window).width() >= 1200) {\n $(this).find('.zoomImg').remove();\n $(this).zoom(\n {\n url: zoomURL,\n magnify: magnify,\n on: 'click',\n onZoomIn: function () {\n $(this).addClass('zoomImg--zoomed');\n var zoomImageLink = $(this).prev('.js-pdp-carousel__slider__item__img--zoom').attr('data-href');\n $('.js-zoom-image-link').attr('href', zoomImageLink);\n $('.js-zoom-image-link').removeClass('d-none');\n },\n onZoomOut: function () {\n $(this).removeClass('zoomImg--zoomed');\n $('.js-zoom-image-link').addClass('d-none');\n }\n });\n }\n });\n });\n}\n\nmodule.exports = {\n methods: {\n adjustZoomCarousel: adjustZoomCarousel\n },\n init() {\n const baseModule = this;\n let adjustZoomCarouselScoped = adjustZoomCarousel;\n\n if (baseModule && baseModule.methods && baseModule.methods.adjustZoomCarousel) {\n adjustZoomCarouselScoped = baseModule.methods.adjustZoomCarousel;\n }\n\n adjustZoomCarouselScoped();\n }\n};\n","'use strict';\nvar focusHelper = require('base/components/focus');\n\nfunction validateNamepatch(val) {\n var regex = new RegExp(/^[A-Za-z0-9- ]+$/);\n return regex.test(val);\n}\n\n/**\n * Customization - Add function to validate variation selection\n * @param {jquery} $element - DOM container for product detail options\n * @return {boolean} - returns true if all selections have been made\n */\nfunction validateProductAttributes($element) {\n var isValidate = true;\n // eslint-disable-next-line max-len\n var $productContainer = $element.hasClass('add-to-cart-global') ? $element.parents('.product-set-detail') : $element.parents('.st-product-detail');\n var $attributeContainers = $productContainer.find('.js-product-attribute-item');\n var $firstMissingAttributeContainer;\n var selectableElementClass = 'js-attribute-value';\n var selectedAttribute;\n var errorContainerSelector = '.js-add-to-cart-validation';\n var $errorContainer;\n $attributeContainers.each(function () {\n if (!$(this).hasClass('js-namepatch')) {\n selectedAttribute = $(this).find('.selected, input:checked');\n if (selectedAttribute && selectedAttribute.hasClass(selectableElementClass)) {\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.addClass('d-none');\n } else {\n $firstMissingAttributeContainer = !$firstMissingAttributeContainer ? $(this) : $firstMissingAttributeContainer;\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.removeClass('d-none');\n isValidate = false;\n }\n } else {\n // Only used for B2B & DTI\n var namePatch = $('.js-product-option .js-namepatch:visible input');\n if (namePatch.length > 0 && namePatch.val() !== '' && validateNamepatch(namePatch.val())) {\n $('.js-namepatch').parents('.js-product-option').find('.c-form-element__input--hidden').removeClass('js-product-attribute-item');\n } else {\n $firstMissingAttributeContainer = !$firstMissingAttributeContainer ? $(this) : $firstMissingAttributeContainer;\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.removeClass('d-none');\n isValidate = false;\n }\n }\n });\n\n // scroll to missing attribute\n if ($firstMissingAttributeContainer) {\n $('html, body').animate({\n scrollTop: $firstMissingAttributeContainer.offset().top - 80\n }, 700);\n }\n return isValidate;\n}\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n var pid;\n\n if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').find('.product-id').text();\n } else {\n pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n }\n\n return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n var quantitySelected;\n if ($el && $('.set-items').length) {\n quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n } else if ($el && $('.product-bundle').length) {\n var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n if (quantitySelectedModal.val() === undefined) {\n quantitySelected = quantitySelectedPDP;\n } else {\n quantitySelected = quantitySelectedModal;\n }\n } else {\n quantitySelected = $('.quantity-select');\n }\n return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchButton = $attrValue.parent();\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n } else {\n $attrValue.removeClass('selected');\n $attrValue.siblings('.selected-assistive-text').empty();\n }\n\n if (attrValue.url) {\n $swatchButton.attr('data-url', attrValue.url);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n\n // Disable if not selectable\n $attrValue.removeClass('selectable unselectable');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithSwatches = ['color'];\n\n attrs.forEach(function (attr) {\n if (attrsWithSwatches.indexOf(attr.id) > -1) {\n processSwatchValues(attr, $productContainer, msgs);\n } else {\n processNonSwatchValues(attr, $productContainer);\n }\n });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
    2. ' + response.resources.info_selectforstock + '
    3. ';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
    4. ' + message + '
    5. ';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
      ' + attribute.label + ': '\n + attribute.value + '
      ';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n // Update options\n $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n var carousel = $productContainer.find('.carousel');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n // eslint-disable-next-line max-len\n $(carousel).empty().append('
        ' + $(carousel).data('prev') + '' + $(carousel).data('next') + '');\n for (var i = 0; i < imgs.length; i++) {\n // eslint-disable-next-line max-len\n $('
        \"'
        ').appendTo($(carousel).find('.carousel-inner'));\n $('
      1. ').appendTo($(carousel).find('.carousel-indicators'));\n }\n $($(carousel).find('.carousel-item')).first().addClass('active');\n $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n if (imgs.length === 1) {\n $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n }\n $(carousel).carousel();\n $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n var primaryImageUrls = response.product.images.large;\n createCarousel(primaryImageUrls, $productContainer);\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length\n ? $('.prices .price', $productContainer)\n : $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product, $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if ($productContainer.parent('.bonus-product-item').length <= 0) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.optionsHtml, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n $('body').trigger('product:afterAttributeSelect',\n { data: data, container: $productContainer });\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n var $html = $('
        ').append($.parseHTML(html));\n\n var body = $html.find('.choice-of-bonus-product');\n var footer = $html.find('.modal-footer').children();\n\n return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n $('.modal-body').spinner().start();\n\n if ($('#chooseBonusProductModal').length !== 0) {\n $('#chooseBonusProductModal').remove();\n }\n var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n var htmlString = ''\n + '
        '\n + ''\n + '
        '\n + ''\n + '
        '\n + '
        '\n + ' ' + data.labels.selectprods + ''\n + ' '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        ';\n $('body').append(htmlString);\n $('.modal-body').spinner().start();\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $('#chooseBonusProductModal .modal-body').empty();\n $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n // Set a timeout on the bonus product selection modal since we've got the minicart on a timeout\n setTimeout(function () {\n $('#chooseBonusProductModal').modal('show');\n }, 6250);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n $('.minicart').trigger('count:update', response);\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n if (response.newBonusDiscountLineItem\n && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n chooseBonusProducts(response.newBonusDiscountLineItem);\n } else {\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append(\n '
        '\n );\n }\n if (response.showmodal) {\n var htmlString = ''\n + '
        '\n + '
        '\n + ''\n + '
        '\n + '
        '\n + response.modaltitle\n + ' '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        ';\n $('body').append(htmlString);\n\n var $dialog = $('#jsDetailErrorModal');\n $dialog.find('.modal-body').html(response.message);\n $dialog.modal('show');\n\n $('.btn-limitqty-continue').click(function () {\n $dialog.modal('hide');\n });\n } else {\n $('.add-to-cart-messages').append(\n '
        '\n + response.message\n + '
        '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n }\n }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n var childProducts = [];\n $('.bundle-item').each(function () {\n childProducts.push({\n pid: $(this).find('.product-id').text(),\n quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n });\n });\n\n return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Customization - change product options to account for checkbox/radios only\n * Retrieve product options\n *\n * @param {jQuery} $productForm - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productForm) {\n var options = $productForm\n .find('input.js-sourcing-location:checked')\n .map(function () {\n return {\n optionId: $(this).attr('data-option-id'),\n selectedValueId: $(this).attr('data-value-id')\n };\n }).toArray();\n\n return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n if (url) {\n $.ajax({\n url: url,\n method: 'GET',\n success: function () {\n // reporting urls hit on the server\n },\n error: function () {\n // no reporting urls hit on the server\n }\n });\n }\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n\n focusChooseBonusProductModal: function () {\n $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n $('#chooseBonusProductModal .close').focus();\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n });\n },\n\n trapChooseBonusProductModalFocus: function () {\n $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n var focusParams = {\n event: e,\n containerSelector: '#chooseBonusProductModal',\n firstElementSelector: '.close',\n lastElementSelector: '.add-bonus-products'\n };\n focusHelper.setTabNextFocus(focusParams);\n });\n },\n\n colorAttribute: function () {\n $(document).on('click', '[data-attr=\"color\"] button', function (e) {\n e.preventDefault();\n\n if ($(this).attr('disabled')) {\n return;\n }\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n attributeSelect($(this).attr('data-url'), $productContainer);\n });\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n attributeSelect(e.currentTarget.value, $productContainer);\n });\n },\n\n availability: function () {\n $(document).on('change', '.quantity-select', function (e) {\n e.preventDefault();\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n }\n\n if ($('.bundle-items', $productContainer).length === 0) {\n attributeSelect($(e.currentTarget).find('option:selected').data('url'),\n $productContainer);\n }\n });\n },\n\n addToCart: function () {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n var addToCartUrl;\n var pid;\n var pidsObj;\n var setPids;\n\n if ($(this).hasClass('disabled')) {\n return;\n }\n\n // Customization - check for variation selection\n if (!validateProductAttributes($(this))) {\n return;\n }\n\n $('body').trigger('product:beforeAddToCart', this);\n\n if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n setPids = [];\n\n $('.product-detail').each(function () {\n if (!$(this).hasClass('product-set-detail')) {\n setPids.push({\n pid: $(this).find('.product-id').text(),\n qty: $(this).find('.quantity-select').val(),\n options: getOptions($(this))\n });\n }\n });\n pidsObj = JSON.stringify(setPids);\n }\n\n pid = getPidValue($(this));\n\n var $productContainer = $(this).closest('.product-detail');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n }\n\n addToCartUrl = getAddToCartUrl();\n\n var form = {\n pid: pid,\n pidsObj: pidsObj,\n childProducts: getChildProducts(),\n quantity: getQuantitySelected($(this))\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n if ($('.js-swap-company').length) {\n form.logoPackage = $('.js-swap-company').children('option').filter(':selected').val();\n }\n\n if ($('.js-edit-product').length) {\n form.uuid = $('.js-edit-product').attr('data-uuid');\n }\n\n $(this).trigger('updateAddToCartFormData', form);\n if (addToCartUrl) {\n $.ajax({\n url: addToCartUrl,\n method: 'POST',\n data: form,\n success: function (data) {\n handlePostCartAdd(data);\n $('body').trigger('product:afterAddToCart', data);\n $.spinner().stop();\n miniCartReportingUrl(data.reportingURL);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n });\n $(document).on('change', '.js-qoe-view-refresh', function () {\n if ($('.product-option .js-namepatch').is(':visible') &&\n !$('.product-option .js-namepatch:visible').hasClass('js-product-attribute-item')) {\n $('.product-option .js-namepatch').removeClass('js-product-attribute-item');\n $('.product-option .js-namepatch:visible').addClass('js-product-attribute-item');\n }\n });\n $(document).on('click', 'input#namePatch', function () {\n $('.product-option .js-namepatch:visible').addClass('js-product-attribute-item');\n });\n },\n selectBonusProduct: function () {\n $(document).on('click', '.select-bonus-product', function () {\n var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n var pid = $(this).data('pid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = parseInt($choiceOfBonusProduct.find('.bonus-quantity-select').val(), 10);\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n totalQty += submittedQty;\n var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n if (totalQty <= maxPids) {\n var selectedBonusProductHtml = ''\n + '
        '\n + '
        '\n + $choiceOfBonusProduct.find('.product-name').html()\n + '
        '\n + '
        '\n + '
        '\n ;\n $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n $('.pre-cart-products').html(totalQty);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n } else {\n $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n }\n });\n },\n removeBonusProduct: function () {\n $(document).on('click', '.selected-pid', function () {\n $(this).remove();\n var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n var count = 0;\n if ($selected.length) {\n $selected.each(function () {\n count += parseInt($(this).data('qty'), 10);\n });\n }\n\n $('.pre-cart-products').html(count);\n $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n });\n },\n enableBonusProductSelection: function () {\n $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n $('button.select-bonus-product', response.$productContainer).attr('disabled',\n (!response.product.readyToOrder || !response.product.available));\n var pid = response.product.id;\n $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n });\n },\n showMoreBonusProducts: function () {\n $(document).on('click', '.show-more-bonus-products', function () {\n var url = $(this).data('url');\n $('.modal-content').spinner().start();\n $.ajax({\n url: url,\n method: 'GET',\n success: function (html) {\n var parsedHtml = parseHtml(html);\n $('.modal-body').append(parsedHtml.body);\n $('.show-more-bonus-products:first').remove();\n $('.modal-content').spinner().stop();\n },\n error: function () {\n $('.modal-content').spinner().stop();\n }\n });\n });\n },\n addBonusProductsToCart: function () {\n $(document).on('click', '.add-bonus-products', function () {\n var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n var queryString = '?pids=';\n var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n var pidsObject = {\n bonusProducts: []\n };\n\n $.each($readyToOrderBonusProducts, function () {\n var qtyOption =\n parseInt($(this)\n .data('qty'), 10);\n\n var option = null;\n if (qtyOption > 0) {\n if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n option = {};\n option.optionId = $(this).data('optionid');\n option.productId = $(this).data('pid');\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n pid: $(this).data('pid'),\n qty: qtyOption,\n options: [option]\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n $.spinner().start();\n $.ajax({\n url: url + queryString,\n method: 'POST',\n success: function (data) {\n $.spinner().stop();\n if (data.error) {\n $('#chooseBonusProductModal').modal('hide');\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
        ');\n }\n $('.add-to-cart-messages').append(\n '
        '\n + data.errorMessage + '
        '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 3000);\n } else {\n $('.configure-bonus-product-attributes').html(data);\n $('.bonus-products-step2').removeClass('hidden-xl-down');\n $('#chooseBonusProductModal').modal('hide');\n\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
        ');\n }\n $('.minicart-quantity').html(data.totalQty);\n $('.add-to-cart-messages').append(\n '
        '\n + data.msgSuccess + '
        '\n );\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n if ($('.cart-page').length) {\n location.reload();\n }\n }, 1500);\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n miniCartReportingUrl: miniCartReportingUrl,\n getOptions: getOptions\n};\n","'use strict';\n\nvar detailsBase = require('base/product/detail');\nvar baseModule = require('./base');\n\nvar matchBreakpoints = require('../util/matchBreakpoints');\n\n/**\n * Generates the modal window on the first call.\n * @param {string} id - the id adding to events\n */\nfunction getModalHtmlElement(id) {\n if ($('#' + id).length !== 0) {\n $('#' + id).remove();\n }\n var htmlString = ''\n + '
        '\n + '
        '\n + ''\n + '
        '\n + '
        '\n + ' '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        '\n + '
        ';\n $('body').append(htmlString);\n}\n\ndetailsBase.fixedATCscroll = function () {\n if (matchBreakpoints(['default', 'sm-up'])) {\n // Calculate the stop from the top of the container, which is always static,\n // to ensure proper positioning when recalculating while the button is sticky\n var $container = $('.js-product-detail-cta-container');\n var $button = $('.prices-add-to-cart-actions');\n var $window = $(window);\n var stop;\n var calculateStop = function () {\n stop = $container.offset().top;\n if ($window.scrollTop() >= stop) {\n $button.addClass('sticky');\n } else {\n $button.removeClass('sticky');\n }\n };\n\n calculateStop();\n\n $(window).on('resize', calculateStop);\n $(document).on('scroll', calculateStop);\n }\n};\n\ndetailsBase.sizeChart = function () {\n var $sizeChart = $('#sizeChartModal');\n $('.size-chart a').on('click', function (e) {\n e.preventDefault();\n var url = $(this).attr('href');\n if (!$sizeChart.length) {\n getModalHtmlElement('sizeChartModal');\n $sizeChart = $('#sizeChartModal');\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $sizeChart.attr('aria-modal', 'true').attr('aria-label', 'Size chart');\n $sizeChart.find('.modal-body').html(data.content);\n $sizeChart.find('.modal-header').prepend('

        Size Chart

        ');\n }\n });\n }\n $sizeChart.modal('show');\n $(document).on('click', '#sizeChartModal .close', function () {\n $('.size-chart-link').focus();\n setTimeout(function () {\n $(window).scrollTop($('.size-chart-link').position().top);\n }, 500);\n });\n });\n\n $('body').on('click touchstart', function (e) {\n if ($('.size-chart').has(e.target).length <= 0) {\n $sizeChart.removeClass('active');\n }\n });\n};\n\ndetailsBase.updateAddToCart = function () {\n $('body').on('product:updateAddToCart', function (e, response) {\n // update local add to cart (for sets)\n var selectedAttribute;\n var $attributeContainers = $('.js-product-attribute-item');\n var selectableElementClass = 'js-attribute-value';\n var errorContainerSelector = '.js-add-to-cart-validation';\n var $errorContainer;\n var addToCartTxt;\n var product = response.product;\n var pickup = product.sourcingLocations.pickup || {};\n\n if (pickup.isSelected && !pickup.isPickupInStoreEnabled && product.available) {\n $('button.add-to-cart', response.$productContainer).addClass('disabled').attr('disabled','true');\n $(this).find('.c-product-attribute__header .js-add-to-cart-validation').removeClass('d-none');\n addToCartTxt = $('.st-product-detail__add-to-cart').data('addtocart');\n $('button.add-to-cart').text(addToCartTxt);\n } else if (product.readyToOrder && !product.available) {\n $('button.add-to-cart', response.$productContainer).addClass('disabled').attr('disabled','true');\n $(this).find('.c-product-attribute__header .js-add-to-cart-validation').removeClass('d-none');\n addToCartTxt = $('.st-product-detail__add-to-cart').data('oos');\n $('button.add-to-cart').text(addToCartTxt);\n } else {\n $('button.add-to-cart', response.$productContainer).removeClass('disabled').removeAttr('disabled');\n $(this).find('.c-product-attribute__header .js-add-to-cart-validation').addClass('d-none');\n addToCartTxt = $('.st-product-detail__add-to-cart').data('addtocart');\n $('button.add-to-cart').text(addToCartTxt);\n }\n $attributeContainers.each(function () {\n selectedAttribute = $(this).find('.selected, input:checked');\n if (selectedAttribute && selectedAttribute.hasClass(selectableElementClass)) {\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.addClass('d-none');\n } else {\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.removeClass('d-none');\n }\n });\n });\n};\n\ndetailsBase.updateAvailability = function () {\n $('body').on('product:updateAvailability', function (e, response) {\n $('div.availability', response.$productContainer)\n .data('ready-to-order', response.product.readyToOrder)\n .data('available', response.product.available);\n\n $('.availability-msg', response.$productContainer)\n .empty().html(response.message);\n\n if ($('.global-availability').not('.product-quickview .global-availability').length) {\n var allAvailable = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('available'); });\n\n var allReady = $('.product-availability').toArray()\n .every(function (item) { return $(item).data('ready-to-order'); });\n\n $('.global-availability')\n .data('ready-to-order', allReady)\n .data('available', allAvailable);\n\n $('.global-availability .availability-msg').empty()\n .html(allReady ? response.message : response.resources.info_selectforstock);\n }\n });\n};\n\ndetailsBase.warranty = function () {\n var $warrantyContent = $('#warrantyModal');\n $('.js-warranty-content-link').on('click', function (e) {\n e.preventDefault();\n var url = $(this).attr('href');\n if (!$warrantyContent.length) {\n getModalHtmlElement('warrantyModal');\n $warrantyContent = $('#warrantyModal');\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $warrantyContent.find('.modal-body').html(data.content);\n }\n });\n }\n $warrantyContent.modal('show');\n });\n\n $('body').on('click touchstart', function (e) {\n if ($('.js-warranty-content-link').has(e.target).length <= 0) {\n $warrantyContent.removeClass('active');\n }\n });\n};\n\ndetailsBase.availability = baseModule.availability;\ndetailsBase.addToCart = baseModule.addToCart;\ndetailsBase.focusChooseBonusProductModal = baseModule.focusChooseBonusProductModal;\n\nmodule.exports = detailsBase;\n","module.exports = function () {\n $('.js-products-carousel').on('init', function (event, slick) {\n $(this).removeClass('row')\n .closest('.s-slick')\n .removeClass('c-recommendation--slick-uninitialized')\n .find('.st-product-grid__item')\n .removeClass('col-6 col-md-3');\n });\n\n // Set tech icons as unfocusable when slide not active\n $('.js-products-carousel').on('init afterChange', function () {\n $('.slick-slide[aria-hidden=true]').find('.c-product-tile__tech-icons__icon').attr('tabindex', '-1');\n });\n\n $('.js-products-carousel:not(.slick-initialized)').slick({\n slidesToShow: 4,\n responsive: [\n {\n breakpoint: 1025,\n settings: {\n slidesToShow: 3\n }\n },\n {\n breakpoint: 769,\n settings: {\n slidesToShow: 2\n }\n },\n {\n breakpoint: 544,\n settings: {\n slidesToShow: 1\n }\n }\n ]\n });\n\n $('.js-family-carousel').on('init', function (event, slick) {\n $(this).removeClass('row')\n .closest('.s-slick')\n .removeClass('st-product-detail__product-families--slick-uninitialized')\n .find('.st-product-detail__carousel-item')\n .removeClass('col-12 col-md-4');\n });\n\n $('.js-family-carousel').slick({\n slidesToShow: 3,\n responsive: [\n {\n breakpoint: 769,\n settings: {\n slidesToShow: 2\n }\n },\n {\n breakpoint: 544,\n settings: {\n slidesToShow: 1\n }\n }\n ]\n });\n\n $('.js-has-carousel-tab').on('focus click collapsible:toggleVisibility', function () {\n $('.js-products-carousel').slick('refresh');\n });\n\n $(document).on('click', '.c-product-promo__details-link', function () {\n $(this).addClass('details-link-active');\n });\n $(document).on('click', '#contentModal .close', function () {\n $('.details-link-active').trigger('focus');\n $('.c-product-promo__details-link').removeClass('details-link-active');\n });\n};\n","const productBase = require('./base');\n\nvar keyboardAccessibility = require('base/components/keyboardAccessibility');\nconst clientSideValidation = require('app_rws/components/clientSideValidation');\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n return $el && $('.set-items').length\n ? $($el).closest('.product-detail').find('.quantity-select')\n : $('.quantity-select');\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n $defaultOption.attr('value', attr.resetUrl);\n\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer\n .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n $attrValue.attr('value', attrValue.url)\n .removeAttr('disabled');\n\n if (!attrValue.selectable) {\n $attrValue.attr('disabled', true);\n }\n });\n}\n\nfunction setTabIndex() {\n // Set tab index on first focusable variation option, if variation in group is not already selected\n var variationAttribute = $('.js-product-attribute-item');\n $(variationAttribute).each(function () {\n var $this = this;\n var hasSelectedItem = $($this).find('.selected').length > 0;\n if (!(hasSelectedItem)) {\n $($this).find('.selectable:not(.selected)').first().attr('tabindex', '0');\n }\n });\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n * selected. If there is no variant that corresponds to a specific combination of attribute\n * values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} resources - relevant resource file entries\n */\nfunction processSwatchValues(attr, $productContainer, resources) {\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' +\n attrValue.value + '\"]');\n var $swatchAnchor = $attrValue.parent().attr('data-href') ? $attrValue.parent() : $attrValue;\n\n if (attrValue.selected) {\n $attrValue.addClass('selected');\n $attrValue.attr('aria-checked', 'true');\n $attrValue.attr('tabindex', '0');\n } else {\n $attrValue.removeClass('selected');\n $attrValue.attr('aria-checked', 'false');\n $attrValue.attr('tabindex', '-1');\n }\n\n // Clear out all classes and attributes\n $attrValue.removeClass('selectable unselectable d-none');\n $attrValue.removeAttr('aria-label');\n\n $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n if (!(attrValue.selectable)) {\n $attrValue.attr('aria-label', resources.label_aria_variation_notinstock)\n }\n $attrValue.addClass(attrValue.invalid ? 'd-none' : '');\n\n if (attrValue.url) {\n $swatchAnchor.attr('data-href', attrValue.url);\n } else {\n $swatchAnchor.removeAttr('data-href');\n }\n });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n * swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} resources - relevant resource file entries\n */\nfunction updateAttrs(attrs, $productContainer, resources ) {\n // Currently, the only attribute type that has image swatches is Color.\n var attrsWithoutSwatches = [];\n\n attrs.forEach(function (attr) {\n if (attrsWithoutSwatches.indexOf(attr.id) > -1) {\n processNonSwatchValues(attr, $productContainer);\n } else {\n processSwatchValues(attr, $productContainer,resources);\n }\n });\n\n setTabIndex();\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n * attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n var availabilityValue = '';\n var availabilityMessages = response.product.availability.messages;\n if (!response.product.readyToOrder) {\n availabilityValue = '
        ' + response.resources.info_selectforstock + '
        ';\n } else {\n availabilityMessages.forEach(function (message) {\n availabilityValue += '
        ' + message + '
        ';\n });\n }\n\n $($productContainer).trigger('product:updateAvailability', {\n product: response.product,\n $productContainer: $productContainer,\n message: availabilityValue,\n resources: response.resources\n });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n if (!attributes) {\n return '';\n }\n\n var html = '';\n\n attributes.forEach(function (attributeGroup) {\n if (attributeGroup.ID === 'mainAttributes') {\n attributeGroup.attributes.forEach(function (attribute) {\n html += '
        ' + attribute.label + ': '\n + attribute.value + '
        ';\n });\n }\n });\n\n return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} options - Ajax response options from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(options, $productContainer) {\n options.forEach(function (option) {\n var $optionEl = $productContainer.find('.product-option[data-option-id*=\"' + option.id\n + '\"]');\n option.values.forEach(function (value) {\n var valueEl = $optionEl.find('option[data-value-id*=\"' + value.id + '\"]');\n valueEl.val(value.url);\n });\n });\n}\n\n/**\n * Generates html for promotions section\n *\n * @param {array} promotions - list of promotions\n * @param {Object} resources - relevant resource file entries\n * @return {string} - Compiled HTML\n */\nfunction getPromotionsHtml(promotions, resources) {\n if (!promotions) {\n return '';\n }\n\n var html = '';\n\n promotions.forEach(function (promotion) {\n html += '
        ' + promotion.calloutMsg;\n if (typeof promotion.details !== 'undefined' && promotion.details !== null && promotion.details.length > 0) {\n html += '' + resources.link_promoDetailsHeader + '\">'\n + resources.link_promoDetails\n + '
        '\n + '
        '\n + promotion.details\n + '
        '\n + '
        '\n + '
        ';\n }\n html += '
        ';\n });\n\n return html;\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n * attributes have been selected. Used partially to\n * determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n var isChoiceOfBonusProducts =\n $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n var isVaraint;\n if (response.product.variationAttributes) {\n updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n isVaraint = response.product.productType === 'variant';\n if (isChoiceOfBonusProducts && isVaraint) {\n $productContainer.parent('.bonus-product-item')\n .data('pid', response.product.id);\n\n $productContainer.parent('.bonus-product-item')\n .data('ready-to-order', response.product.readyToOrder);\n }\n }\n\n // Update primary images\n var primaryImageUrls = response.product.images;\n primaryImageUrls.large.forEach(function (imageUrl, idx) {\n $productContainer.find('.primary-images').find('img').eq(idx)\n .attr('src', imageUrl.url);\n });\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n var $priceSelector = $('.prices .price', $productContainer).length\n ? $('.prices .price', $productContainer)\n : $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n $('.promotions').empty().html(getPromotionsHtml(response.product.promotions, response.resources));\n\n updateAvailability(response, $productContainer);\n\n if (isChoiceOfBonusProducts) {\n var $selectButton = $productContainer.find('.select-bonus-product');\n $selectButton.trigger('bonusproduct:updateSelectButton', {\n product: response.product, $productContainer: $productContainer\n });\n } else {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n product: response.product, $productContainer: $productContainer\n }).trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty()\n .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n * etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n if (!($productContainer.parent('.bonus-product-item').length > 0)) {\n var optionsHtml = quantities.map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n }).join('');\n getQuantitySelector($productContainer).empty().html(optionsHtml);\n }\n}\n\nfunction updateLocation($container, location) {\n var $input = $container.find('input.js-sourcing-location');\n\n $input.attr('data-value-id', location.ID);\n $input.attr('data-href', location.productVariationUrl);\n $input.attr('aria-checked', location.isSelected);\n if (!location.isSelected) {\n $input.removeProp('checked');\n } else {\n $input.prop('checked', true);\n }\n\n var $productAvailability = $container.find('.js-product-availability');\n $productAvailability.removeClass('c-store-card__availability__status--green');\n $productAvailability.removeClass('c-store-card__availability__status');\n\n var $inventoryElement = $('.js-inventory-text');\n var $pickupElement = $('.js-pickup-text');\n var $pickupAvailable = $('.js-store-pickup-available');\n\n if (!!location.isPickupInStoreEnabled && location.ID && location.ID.length >= 5) {\n $inventoryElement.addClass('d-none');\n $pickupElement.removeClass('d-none');\n } else {\n $inventoryElement.removeClass('d-none');\n $pickupElement.addClass('d-none');\n }\n\n $pickupAvailable.addClass('d-none');\n if (!location.isPickupInStoreEnabled && location.ID && location.ID.length >= 5) {\n $pickupAvailable.removeClass('d-none');\n }\n\n // Update the product availability style based on availability status\n switch (location.productAvailability) {\n case 'available':\n $productAvailability.addClass('c-store-card__availability__status--green');\n if (!location.isPickupInStoreEnabled && location.ID && location.ID.length >= 5) {\n $pickupAvailable.removeClass('d-none');\n }\n break;\n case 'unavailable':\n $productAvailability.addClass('c-store-card__availability__status');\n $pickupAvailable.addClass('d-none');\n break;\n case 'valid':\n $pickupAvailable.addClass('d-none');\n break;\n default:\n break;\n }\n $productAvailability.html(location.productAvailabilityMessage);\n $container.find('.js-fulfillment-label').html(location.fulFillmentlabel);\n}\n\nfunction updateSourcingLocations(sourcingLocations, $productContainer) {\n updateLocation($productContainer.find('.js-sourcing-location-ship'), sourcingLocations.shipping);\n updateLocation($productContainer.find('.js-sourcing-location-pickup'), sourcingLocations.pickup);\n $('.js-pdp-store-drawer-open').attr('data-href', sourcingLocations.pickup.productVariationUrl);\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $('body').trigger('product:beforeAttributeSelect',\n { url: selectedValueUrl, container: $productContainer });\n\n $.ajax({\n url: selectedValueUrl,\n method: 'GET',\n success: function (data) {\n handleVariantResponse(data, $productContainer);\n updateOptions(data.product.options, $productContainer);\n updateQuantities(data.product.quantities, $productContainer);\n updateSourcingLocations(data.product.sourcingLocations, $productContainer);\n\n $('body').trigger('product:afterAttributeSelect',\n { data: data, container: $productContainer });\n var $attributeContainers = $productContainer.find('.js-product-attribute-item');\n var errorContainerSelector = '.js-add-to-cart-validation';\n var $errorContainer;\n $attributeContainers.each(function () {\n $errorContainer = $(this).find(errorContainerSelector);\n $errorContainer.addClass('d-none');\n });\n if ('customization' in data.product && data.product.customization && $('.js-product-customization-load').length > 0) {\n $('.js-product-customization-load').html(data.product.customization);\n $('.js-swap-company').trigger('change');\n }\n\n $('.js-required-field').on('blur', function (e) {\n var $this = this;\n var $form = $($this).parents('.js-validate-form');\n if ($(this).val()) {\n $(this).val().trim();\n e.preventDefault();\n var isFormValid = clientSideValidation.functions.validateForm($form[0], e);\n if (isFormValid) {\n $(this).addClass('selected');\n } else {\n $(this).removeClass('selected');\n }\n } else {\n $(this).removeClass('selected');\n }\n });\n\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n }\n}\n\nmodule.exports = {\n attributeSelect: attributeSelect,\n function() {\n $(document).on('click', '[data-attr] button[data-attr-value]', function (e) {\n e.preventDefault();\n\n let $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n let options = productBase.getOptions($productContainer);\n let url = $(e.currentTarget).attr('data-href');\n attributeSelect(`${url}&options=${options}`, $productContainer);\n });\n\n $('body').on('change', 'input.js-sourcing-location', function (e) {\n e.preventDefault();\n\n let $productContainer = $(this).closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n }\n\n let options = productBase.getOptions($productContainer);\n let url = $(e.currentTarget).attr('data-href');\n attributeSelect(`${url}&options=${options}`, $productContainer);\n });\n\n keyboardAccessibility('.js-attribute-value',\n {\n 39: function () { // right\n if ($(this).is(':focus')) {\n $(':focus').next('.js-attribute-value').trigger('click').trigger('focus');\n }\n },\n 37: function () { // left\n if ($(this).is(':focus')) {\n $(':focus').prev('.js-attribute-value').trigger('click').trigger('focus');\n }\n },\n 40: function () { // down\n if ($(this).is(':focus')) {\n $(':focus').next('.js-attribute-value').trigger('click').trigger('focus');\n }\n },\n 38: function () { // up\n if ($(this).is(':focus')) {\n $(':focus').prev('.js-attribute-value').trigger('click').trigger('focus');\n }\n }\n },\n function () {\n return $(this).parent();\n }\n );\n\n setTabIndex();\n }\n};\n","'use strict';\n\nconst swatchableAttribute = require('../product/swatchableAttribute');\nconst productBase = require('../product/base');\nconst urlUtils = require('../util/urlUtils');\n\nmodule.exports = {\n openStoreDrawer: function () {\n $('.js-pdp-store-drawer-open').on('click', function() {\n const queryString = $(this).attr('data-href');\n const urlParameters = urlUtils.getQueryParams(queryString);\n\n $('body').trigger('store-drawer:open', {\n pid: urlParameters.get('pid'),\n search: true,\n showInventoryLimit: urlParameters.get('readyToOrder')\n });\n });\n },\n selectStorePdp: function () {\n $('body').on('click', '.js-select-store-link', function (e) {\n e.preventDefault();\n\n const storeID = $(this).data('store-id');\n const $location = $('input[type=\"radio\"][name=sourcing-location]:checked');\n let $productContainer = $location.closest('.set-item');\n if (!$productContainer.length) {\n $productContainer = $location.closest('.product-detail');\n }\n const options = productBase.getOptions($productContainer);\n let tempOptions = JSON.parse(options);\n tempOptions.forEach((item) => {\n if (item.optionId === 'sourcingLocation') {\n item.selectedValueId = String(storeID);\n }\n });\n let url = $location.attr('data-href');\n swatchableAttribute.attributeSelect(`${url}&options=${JSON.stringify(tempOptions)}`, $productContainer);\n });\n }\n};\n","/**\n * @function\n * @description Checks if current screen size breakpoint matches with the needed\n * @param {string} breakpoints size name to check\n * @returns {boolean} breakpoints match result\n */\nmodule.exports = function (breakpoints) {\n var screenSize = '';\n var matches = false;\n\n if (window.getComputedStyle) {\n // get screen size as defined in _grid-settings.scss\n screenSize = getComputedStyle(document.querySelector('body'), ':after').content.replace(/[^a-z-]/ig, '');\n matches = (breakpoints.indexOf(screenSize) >= 0 || !screenSize);\n }\n\n return matches;\n};\n","'use strict';\n\nfunction getQueryParams(url) {\n const urlParts = url.split('?'); // Split the URL into [baseUrl, queryString]\n return new URLSearchParams(urlParts[1] || ''); // If no query string, it's empty\n}\n\n/**\n * Adds parameters to the url\n * @param {string} url - base url either with or without parameters\n * @param {Object} params - key value pair to add as parameters to the url\n * @returns {string} full url string with parameters\n */\nfunction addQueryParams(url, params) {\n const urlParts = url.split('?'); // Split the URL into [baseUrl, queryString]\n const baseUrl = urlParts[0];\n\n // Parse the existing query string into an object\n let queryParams = getQueryParams(url);\n\n // Add new parameters (or update existing ones)\n $.each(params, function (key, value) {\n queryParams.set(key, value); // Adds or updates the parameter\n });\n\n // Rebuild the full URL\n return baseUrl + '?' + queryParams.toString();\n}\n\nmodule.exports = {\n addQueryParams: addQueryParams,\n getQueryParams: getQueryParams\n};\n","'use strict';\n\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./product/detail'));\n processInclude(require('./product/productDetailsSection'));\n processInclude(require('./components/zoom-carousel'));\n processInclude(require('./storeDrawer/storeDrawerPdp'));\n processInclude(require('./cart/cart'));\n});\n"],"names":["processThumbnailActiveStateQuickView","$thumbnail","thumbnailIndex","$","appendToUrl","url","params","newUrl","Object","key","encodeURIComponent","updateCartTotals","data","item","updateApproachingDiscounts","approachingDiscounts","html","validateBasket","errorHtml","createErrorNotification","message","module","e","$this","productID","uuid","urlParams","i","suuid","err","window","document","$choiceOfBonusProduct","pid","maxPids","submittedQty","parseInt","totalQty","optionID","valueId","selectedBonusProductHtml","$pdpCarouselThumbs","slick","currentSlide","$cardprodinfo","sourcingLocation","pickupID","ship","store","odOrderType","dataObj","success","index","className","error","$form","location","couponCode","$deleteConfirmBtn","$productToRemoveSpan","base","require","reCaptchaValidated","resp","validateForm","event","valid","validationMessage","form","$pdpZoomCarousel","adjustZoomCarousel","slideHeight","modalHeight","height","zoomSlideIndex","$activeThumbnail","itemWithData","zoomURL","magnify","zoomImageLink","baseModule","adjustZoomCarouselScoped","focusHelper","validateNamepatch","val","regex","RegExp","validateProductAttributes","$element","isValidate","$productContainer","$attributeContainers","$firstMissingAttributeContainer","selectableElementClass","selectedAttribute","errorContainerSelector","$errorContainer","namePatch","getPidValue","$el","getQuantitySelector","quantitySelected","quantitySelectedModal","quantitySelectedPDP","undefined","getQuantitySelected","processSwatchValues","attr","msgs","attrValue","$attrValue","$swatchButton","processNonSwatchValues","$attr","$defaultOption","updateAttrs","attrs","attrsWithSwatches","updateAvailability","response","availabilityValue","availabilityMessages","getAttributesHtml","attributes","attributeGroup","attribute","updateOptions","optionsHtml","createCarousel","imgs","carousel","carouselId","handleVariantResponse","isChoiceOfBonusProducts","isVaraint","primaryImageUrls","$priceSelector","$selectButton","updateQuantities","quantities","quantity","selected","attributeSelect","selectedValueUrl","getAddToCartUrl","parseHtml","$html","body","footer","chooseBonusProducts","bonusUrl","htmlString","parsedHtml","setTimeout","handlePostCartAdd","messageType","$dialog","getChildProducts","childProducts","JSON","getOptions","$productForm","options","miniCartReportingUrl","focusParams","addToCartUrl","pidsObj","setPids","$selected","count","$readyToOrderBonusProducts","queryString","pidsObject","qtyOption","option","detailsBase","matchBreakpoints","getModalHtmlElement","id","$container","$button","$window","stop","calculateStop","$sizeChart","addToCartTxt","product","pickup","allAvailable","allReady","$warrantyContent","productBase","keyboardAccessibility","clientSideValidation","setTabIndex","variationAttribute","hasSelectedItem","resources","$swatchAnchor","attrsWithoutSwatches","$optionEl","value","valueEl","getPromotionsHtml","promotions","promotion","imageUrl","idx","updateLocation","$input","$productAvailability","$inventoryElement","$pickupElement","$pickupAvailable","updateSourcingLocations","sourcingLocations","isFormValid","swatchableAttribute","urlUtils","urlParameters","storeID","$location","tempOptions","String","breakpoints","screenSize","matches","getComputedStyle","getQueryParams","urlParts","URLSearchParams","addQueryParams","baseUrl","queryParams","processInclude"],"mappings":";;;;AAAa;;AAEb;AACA;AACA,WAAW,cAAc;AACzB,aAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA,WAAW,SAAS;AACpB,aAAa;AACb;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;;;;;AClFa;;AAEb,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;;;;;;AClCa;;AAEb;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;AChBa;AACb,kBAAkB,mBAAO,CAAC,4JAAqB;;AAE/C;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA,cAAc,qDAAqD;;AAEnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,0CAA0C;AAChE;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;;AAEA,aAAa;AACb;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;;;;;ACn1Ba;AACb,WAAW,mBAAO,CAAC,2IAAQ;;AAE3B;AACA;AACA,WAAW,SAAS;AACpB;AACA;AACA;AACA;;AAEA,cAAc;AACd;AACA;AACA,KAAK;;AAEL;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb,YAAY,sBAAsB;AAClC,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,6CAA6C,mCAAmC;;AAEhF;AACA,6CAA6C,wCAAwC;;AAErF;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;;;;;;ACtJa;;AAEb,cAAc;AACd;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;ACZa;AAEb,IAAIA,uCAAuC,SAAUC,UAAU,EAAEC,cAAc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