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hB,GAER,C,GCXIiuC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBz5C,IAAjB05C,EACH,OAAOA,EAAa/5C,QAGrB,IAAID,EAAS65C,EAAyBE,GAAY,CAGjD95C,QAAS,CAAC,GAOX,OAHAg6C,EAAoBF,GAAU7zC,KAAKlG,EAAOC,QAASD,EAAQA,EAAOC,QAAS65C,GAGpE95C,EAAOC,OACf,CCrBA65C,EAAoBlxC,EAAI,SAAS5I,GAChC,IAAIk6C,EAASl6C,GAAUA,EAAOm6C,WAC7B,WAAa,OAAOn6C,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADA85C,EAAoBhU,EAAEoU,EAAQ,CAAEpxC,EAAGoxC,IAC5BA,CACR,ECNAJ,EAAoBhU,EAAI,SAAS7lC,EAASm6C,GACzC,IAAI,IAAIxuC,KAAOwuC,EACXN,EAAoB5yC,EAAEkzC,EAAYxuC,KAASkuC,EAAoB5yC,EAAEjH,EAAS2L,IAC5ExF,OAAOkC,eAAerI,EAAS2L,EAAK,CAAE7D,YAAY,EAAMsyC,IAAKD,EAAWxuC,IAG3E,ECPAkuC,EAAoB5yC,EAAI,SAAS4/B,EAAK2S,GAAQ,OAAOrzC,OAAOkB,UAAUgzC,eAAep0C,KAAK4gC,EAAK2S,EAAO,ECCtGK,EAAoBryC,EAAI,SAASxH,GACX,oBAAXkH,QAA0BA,OAAOozC,aAC1Cn0C,OAAOkC,eAAerI,EAASkH,OAAOozC,YAAa,CAAEz4C,MAAO,WAE7DsE,OAAOkC,eAAerI,EAAS,aAAc,CAAE6B,OAAO,GACvD,ECNA,IAAM04C,EAAiB97C,EAAQ,MAC/Ba,SAAS6oB,iBAAiB,oBAAoB,WAC1CoyB,EAAe97C,EAAQ,KAC3B,G","sources":["webpack://app_custom_lilly_pulitzer/../link_afterpay/cartridges/int_afterpay_ext/cartridge/client/default/js/afterpay.js","webpack://app_custom_lilly_pulitzer/../link_googleanalytics/cartridges/link_googleanalytics/cartridge/client/default/js/util/analytics-util.js","webpack://app_custom_lilly_pulitzer/../link_googleanalytics/cartridges/link_googleanalytics/cartridge/client/default/js/util/constants.js","webpack://app_custom_lilly_pulitzer/../link_secretsauce/cartridges/link_secretsauce/cartridge/client/default/js/product/secretsauce.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/carousel.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/etmc.js","webpack://app_custom_lilly_pulitzer/../link_bolt/cartridges/int_bolt_sfra_lp/cartridge/client/default/js/bolt/boltHelpers.js","webpack://app_custom_lilly_pulitzer/../link_bolt/cartridges/int_bolt_sfra_lp/cartridge/client/default/js/bolt/account.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/cart/cart.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/pickUpInStore/ispuHelper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/pickUpInStore.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/constants.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/components/shippingPreference/shippingPreferenceHelper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/constants.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/domUtil.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/googleMaps.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/popover.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/base.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/product/helper.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/templates.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/util.js","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/wishlist/helper.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/components/formValidation.js","webpack://app_custom_lilly_pulitzer/../storefront-reference-architecture/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack://app_custom_lilly_pulitzer/webpack/bootstrap","webpack://app_custom_lilly_pulitzer/webpack/runtime/compat get default export","webpack://app_custom_lilly_pulitzer/webpack/runtime/define property getters","webpack://app_custom_lilly_pulitzer/webpack/runtime/hasOwnProperty shorthand","webpack://app_custom_lilly_pulitzer/webpack/runtime/make namespace object","webpack://app_custom_lilly_pulitzer/./cartridges/app_custom_lilly_pulitzer/cartridge/client/default/js/cartPickUpInStore.js"],"sourcesContent":["'use strict';\n\nconst { getProductData, queryFirst, queryAll } = require('lilly/domUtil');\nconst { formatMessage } = require('lilly/util');\nconst afterpayTimeout = Date.now() + 5000;\n\n/**\n * Converts an array of selectors/elements to an array of elements (Uses queryAll to query selector strings)\n * @param {string|element|array} items A selector, element, or array of selectors/elements\n * @param {element|array} [scope] The scope(s) in which to search for elements\n * @returns {array} An array of elements\n */\nconst elementArray = (items, scope) => {\n if (!Array.isArray(items)) items = [items];\n if (!Array.isArray(scope)) scope = [scope || document];\n\n return items.reduce((results, item) => {\n if (typeof item === 'string') {\n scope.forEach(parent => {\n if (!!parent.matches && parent.matches(item)) {\n results.push(parent);\n } else {\n results = results.concat(queryAll(item, parent));\n }\n });\n } else {\n results.push(item);\n }\n\n return results;\n }, []);\n};\n\n/**\n * Initializes Afterpay messaging\n * @param {object} options Afterpay configuration options\n * @param {boolean} [options.alwaysShow] Whether the Afterpay messaging should always show, even when outside the threshold range (Default: true)\n * @param {string|element|array|NodeList} options.anchors The anchor element(s) referenced when rendering Afterpay messaging\n * @param {number} [options.price] The static price of the product in any format (if possible, use a priceTarget instead)\n * @param {string|element|array} options.observerTargets A selector, element or array of selectors/elements to observe for price changes and trigger Afterpay messaging updates (if a selector is passed, it will be queried relative to the anchor)\n * @param {string|element|array} options.priceTargets A selector, element or array of selectors/elements to use for price values. The \"value\" will be used if possible, or the innerText as a fallback\n * @param {string} [options.renderMode] The mode to use when rendering Afterpay messaging (E.g. adjacent, append, before, replace [Default: append])\n * @param {string|element} [options.renderTarget] The selector or element to use in conjunction with the renderMode (Defaults to the anchor)\n * @param {boolean} [options.showExcluded] Whether to show Afterpay messaging when a product is excluded\n * @param {object} [options.thresholds] The min/max thresholds to determine when Afterpay messaging shows (E.g. { min: 100, max: 1000 })\n * @param {string} [options.logoPosition] How to position the logo in Afterpay messaging (E.g. before, after [Default: after])\n */\nmodule.exports = function afterpay(options = {}) {\n let { alwaysShow = true, anchors, observerTargets, price, priceTargets, renderMode, renderTarget, showExcluded = true, thresholds = {}, logoPosition = 'after' } = options;\n\n // No anchors OR no observerTargets OR (no price AND no price targets)\n if (!anchors || !anchors.length || !observerTargets || !observerTargets.length || (!price && (!priceTargets || !priceTargets.length))) return false;\n\n // Waiting for Afterpay API\n if (!window.presentAfterpay) return (Date.now() >= afterpayTimeout) ? false : setTimeout(function (args) { afterpay.apply(this, args); }.bind(this, arguments), 250);\n\n // Anchors to array\n anchors = elementArray(anchors);\n\n // Missing anchor(s)\n if (!anchors.length) return false;\n\n // Afterpay preferences element\n const afterpayPrefsEl = document.getElementById('afterpayEnabled');\n\n // Afterpay is disabled\n if (!afterpayPrefsEl || afterpayPrefsEl.value !== 'true') return false;\n\n // Afterpay preferences data\n const afterpayPrefs = afterpayPrefsEl.dataset;\n\n // Base config\n const apConfig = {\n afterpayLogoColor: 'black',\n currency: 'USD',\n locale: 'en_US'\n };\n\n // Get product exclusions\n const exclusions = JSON.parse(afterpayPrefs.exclusions || '[]');\n\n // Threshold mixin\n if (thresholds) {\n const apThresholds = apConfig.minMaxThreshold = {};\n let { min, max } = thresholds;\n\n // Threshold fallbacks\n if (!min) min = afterpayPrefs.min;\n if (!max) max = afterpayPrefs.max;\n\n // Afterpay wants cents\n if (min) apThresholds.min = min * 100;\n if (max) apThresholds.max = max * 100;\n }\n\n /**\n * Updates the product price in an Afterpay config object\n * @param {object} config Afterpay config object\n * @param {*} price Price in any format\n */\n const updateAmount = (config, price) => {\n const stringValue = String(price);\n const isDecimalValue = ~stringValue.indexOf('.');\n const intValue = parseInt(stringValue.replace(/[^0-9]/g, '').trim(), 10);\n const amount = config.amount = intValue * (isDecimalValue ? 1 : 100);\n\n return amount;\n };\n\n /**\n * Gets the price target value for the given observer target\n * @param {element} observerTarget The observer target to search within\n * @returns {*} Returns the price, the price target's text content, or an empty string\n */\n const getPrice = observerTarget => {\n return (priceTargets ? elementArray(priceTargets, observerTarget) : [observerTarget]).reduce((value, element) => {\n if (value) return value;\n return element.value || element.innerText || '';\n }, '');\n };\n\n /**\n * Renders Afterpay messaging\n * @param {object} instance Afterpay instance\n * @param {element} anchor Anchor element\n * @param {string} [mode] Render mode (E.g. adjacent, append, before, replace [Default: append]) \n */\n const renderAfterpay = (instance, anchor, mode) => {\n const { config } = instance;\n const { amount, minMaxThreshold = {} } = config;\n const { min, max } = minMaxThreshold;\n const { utag_data: uData } = window;\n const notWithinThreshold = (min && min > amount) || (max && max < amount);\n const excluded = [];\n const hidden = 'hide';\n\n let excludedMessageKey = 'defaultExcludedMessage';\n let productElements = [anchor];\n\n // If this is the cart, we're displaying with the context of all products\n if (uData?.action?.split('-').shift().toLowerCase() === 'cart') {\n excludedMessageKey = 'excludedMessage';\n productElements = queryAll('#myTote .cart-product-line-item');\n }\n\n // Look for any exclusions\n productElements.forEach(element => {\n const { masterId, productName } = getProductData(element);\n\n if (~exclusions.indexOf(masterId) && !~excluded.indexOf(productName)) {\n excluded.push(productName);\n }\n });\n\n let renderMode = (!alwaysShow && notWithinThreshold) ? hidden : mode.toLowerCase();\n\n if (excluded.length && !showExcluded) {\n renderMode = hidden;\n }\n\n const afterpayNode = renderMode === hidden ? document.createElement('p') : instance.renderAfterpay();\n const afterpayMessage = queryFirst('span[class^=\"afterpay-text\"]', afterpayNode);\n\n if (afterpayMessage) {\n if (logoPosition === 'after') {\n const { parentElement } = afterpayMessage;\n\n parentElement.insertBefore(afterpayMessage, parentElement.firstChild);\n }\n\n if (excluded.length) {\n if (showExcluded) {\n const lastToken = excluded.pop();\n const tokenText = excluded.length ? `${excluded.join(', ')}${afterpayPrefs.excludedMultiSuffix} ${lastToken}` : lastToken;\n\n afterpayMessage.textContent = formatMessage(afterpayPrefs[excludedMessageKey], `${tokenText} `);\n }\n } else if (notWithinThreshold) {\n afterpayMessage.textContent = `${afterpayPrefs.notWithinThresholdMessage} `;\n }\n }\n\n const instanceNode = instance.afterpayNode;\n const target = (typeof renderTarget === 'string' ? queryFirst(renderTarget, anchor) : renderTarget) || anchor;\n\n instance.afterpayNode = afterpayNode;\n\n switch (renderMode) {\n case 'adjacent':\n return target.insertAdjacentElement('afterend', afterpayNode);\n\n case 'before':\n return target.parentElement.insertBefore(afterpayNode, target);\n\n case hidden:\n case 'replace':\n return instanceNode && instanceNode.parentElement && instanceNode.parentElement.replaceChild(afterpayNode, instanceNode);\n\n default:\n return target.appendChild(afterpayNode);\n }\n };\n\n [].slice.call(anchors, 0).forEach(anchor => {\n const instanceConfig = Object.assign({}, apConfig);\n const anchorObserverTargets = elementArray(observerTargets, anchor);\n\n if (price) {\n updateAmount(instanceConfig, price);\n } else {\n const priceValue = anchorObserverTargets.reduce((result, target) => {\n if (result) return result;\n return getPrice(target);\n }, 0);\n\n updateAmount(instanceConfig, priceValue);\n }\n\n if (isNaN(instanceConfig.amount)) return;\n\n const apInstance = new presentAfterpay(instanceConfig);\n const observer = new MutationObserver(mutations => {\n const { afterpayNode } = apInstance;\n\n if (!afterpayNode) return;\n\n updateAmount(apInstance.config, getPrice(mutations[0].target));\n renderAfterpay(apInstance, afterpayNode, 'replace');\n });\n\n anchorObserverTargets.forEach(target => {\n observer.observe(target, { childList: true, subtree: true });\n });\n\n renderAfterpay(apInstance, anchor, renderMode);\n });\n};\n","'use strict';\n\nconst { bind, queryAll, queryFirst, hasClass } = require('lilly/domUtil');\nconst { toDatasetKey, hashValue } = require('lilly/util');\nconst { VIEW_PROMO, SELECT_PROMO, SELECT_ITEM, VIEW_ITEM_LIST, ADD_TO_CART, P_PRODUCT_LIST_KEY, P_PROMO_NAME_KEY, P_PROMO_CREATIVE_NAME } = require('./constants');\n\n// Persisted Data Constants\nconst PERSISTED_DATA_NAME = 'utag_persisted';\nconst STORAGE_EXP_TIME = 30 * 60 * 1000; // 30 minutes\n\nconst gaInitKeyPrefix = 'ga-init';\nconst gaRetriggerFlag = 'gaRetrigger';\nconst gaFieldPipe = '|';\nconst customEventPattern = /\\W/;\n\n// Bindings registry\nif (!window.gaBindings) window.gaBindings = {};\nconst { gaBindings } = window;\n\n// A list of properties that, when set by the user, should be updated in the UDO.\n// More easily put, anything that you want an up-to-date value for, which would be\n// sent with ANY event type, should be in this list.\nconst UDOProperties = [\n 'logged_in_status',\n 'page_type',\n 'page_category',\n 'page_subcategory',\n 'product_id',\n 'product_name',\n 'product_color',\n 'product_category',\n 'product_variant',\n 'product_quantity',\n 'product_price',\n 'product_size',\n 'product_sku',\n 'product_original_price',\n 'variant_group',\n 'product_is_preorder',\n 'affiliation',\n 'product_badge'\n];\n\n// A list of properties that should be preserved as arrays, not converted to piped strings.\nconst UDOArrays = [\n 'product_id',\n 'product_name',\n 'product_color',\n 'product_category',\n 'product_variant',\n 'product_quantity',\n 'product_price',\n 'product_size',\n 'product_sku',\n 'product_original_price',\n 'promo_id',\n 'promo_name',\n 'promo_creative',\n 'promo_position',\n 'product_is_preorder',\n 'affiliation',\n 'product_list_id',\n 'product_list_name',\n 'product_list_price',\n 'product_list_position',\n 'product_list_original_price',\n 'product_badge',\n 'product_list_category',\n 'product_list_sku'\n];\n\n// A list of GA4 events (event_name) which should include promotional information if available.\n// begin_checkout and purchase also need this information, but are handled in the events themselves\nconst promoSensitiveEvents = [VIEW_PROMO, SELECT_PROMO, ADD_TO_CART];\n// a list of GA4 events (event_name) which should include product_list information if available\n// begin_checkout and purchase also need this information, but are handled in the events themselves\nconst productListSensitiveEvents = [VIEW_ITEM_LIST, SELECT_ITEM, ADD_TO_CART];\n\n/**\n * Normalizes analytics data to ensure consistency.\n * @param {*} fields - Analytics data\n * @returns {string} - Normalized analytics value\n * @example normalize(['a','b','c'], 1,2,3, 'x','y','z') // a|b|c|1|2|3|x|y|z\n */\nconst normalize = (...fields) =>\n fields\n .map(field => {\n if (!Array.isArray(field)) field = [field];\n\n return field\n .reduce((result, item) => {\n if (String(item) === '[object Object]') {\n result = result.concat(Object.values(item));\n } else if (Array.isArray(item)) {\n result = result.concat(normalize(item));\n } else {\n result.push(item);\n }\n\n return result;\n }, [])\n .map(text => (typeof text === 'undefined' ? '' : String(text).toLowerCase().trim()))\n .join(gaFieldPipe);\n })\n .join(gaFieldPipe);\n\n/**\n * Normalizes analytics data to ensure consistency.\n * @param {*} field - Analytics data\n * @returns {Array} - Normalized analytics array of values\n * @example normalizeArray(['A','b','C', true, false, ['X', 'Y', 3], 0]) // [\"a\", \"b\", \"c\", \"true\", \"false\", \"x|y|3\", \"0\"]\n */\nconst normalizeArray = field => {\n if (!Array.isArray(field)) field = [field];\n\n return field.map(value => normalize(value));\n};\n\n/**\n * Normalizes a value to a string or an array based on UDOArrays\n * @param {string} key The key whose value is being normalized\n * @param {*} value The value to be normalized\n * @returns {string|Array} Normalized array or string value\n */\nconst smartNormalize = (key, value) => (UDOArrays.includes(key) ? normalizeArray(value) : normalize(value));\n\n/**\n * Normalizes an analytics payload to ensure consistency, preserving UDO properties as arrays.\n * @param {Object} payload - Analytics data object\n * @returns {Object} - Normalized analytics object\n * @example normalizePayload({ event_category: \"SOME CATEGORY\", event_action: \"SOME ACTION\", event_label: undefined }) // { event_category: \"some category\", event_action: \"some action\", event_label: \"\" }\n */\nconst normalizePayload = payload =>\n Object.entries(payload).reduce((result, [key, value]) => {\n result[key] = smartNormalize(key, value);\n\n return result;\n }, {});\n\n/**\n * Retrieves contextual data about the page.\n * @param {element} srcElement - The element that triggered the event\n * @param {Object} [options={}] - options object from bindGA\n * @returns {Object} - Plain object keyed with custom dimensions\n */\nconst getPageContext = (srcElement, options = {}) => {\n const { utag_data: uData = {} } = window;\n let sectionSrcElement = srcElement;\n const dialog = srcElement.closest && srcElement.closest('.modal');\n\n // Dialogs should provide context into what triggered them\n if (dialog) {\n sectionSrcElement = $(dialog).data('srcElement') || srcElement;\n\n if (sectionSrcElement instanceof jQuery) {\n sectionSrcElement = sectionSrcElement[0] || srcElement;\n }\n }\n\n // Try to determine the page section & subsection\n let pageSection = 'content';\n let pageSubsection = '';\n\n if (sectionSrcElement && srcElement) {\n if (sectionSrcElement.closest) {\n // Section\n if (sectionSrcElement.closest('#minicart')) {\n pageSection = 'mini tote drawer';\n } else if (sectionSrcElement.closest('.recently-viewed')) {\n pageSection = 'recently viewed';\n } else if (sectionSrcElement.closest('.style-component-container')) {\n pageSection = 'pdp style component';\n } else if (sectionSrcElement.closest('.product-recommendations.ways-to-wear')) {\n pageSection = 'ways to wear';\n } else if (sectionSrcElement.closest('.recommendations.related-products')) {\n pageSection = 'related products';\n } else if (sectionSrcElement.closest('.shop-the-print')) {\n pageSection = 'shop the print';\n } else if (sectionSrcElement.closest('.full-suggestions')) {\n pageSection = 'search recommendations';\n } else if (sectionSrcElement.closest('.shop-the-print-tiles')) {\n pageSection = 'shop the print';\n } else if (sectionSrcElement.closest('.product-recommendations')) {\n pageSection = 'product recommendations';\n } else if (sectionSrcElement.closest('.shop-by-style')) {\n pageSection = 'clp filter product carousel';\n } else if (sectionSrcElement.closest('.category-landing-page .product-recommendations')) {\n pageSection = 'clp top product carousel';\n } else if (sectionSrcElement.closest('.refinement-bar')) {\n pageSection = 'filters';\n } else if (sectionSrcElement.closest('.main-nav')) {\n pageSection = 'main navigation';\n } else if (sectionSrcElement.closest('.product-grid-container')) {\n pageSection = 'product grid';\n } else if (sectionSrcElement.closest('.product-detail')) {\n pageSection = 'product details';\n } else if (sectionSrcElement.closest('.main-header')) {\n pageSection = 'header';\n } else if (sectionSrcElement.closest('footer')) {\n pageSection = 'footer';\n }\n }\n\n if (srcElement.closest) {\n // Subsection\n if (srcElement.closest('.quick-view-dialog')) {\n pageSubsection = 'quickview dialog';\n } else if (srcElement.closest('.quickview-container')) {\n pageSubsection = 'quickview inline';\n } else if (srcElement.closest('.wishlist-details-tab')) {\n pageSubsection = 'wishlist';\n }\n\n // page_subsection for cart nav/SFL\n const isCartPage = queryFirst('.cart-page');\n const cartNav = srcElement.closest('.cart-nav');\n const removeDialog = srcElement.closest('.remove-product-dialog'); // remove dialog is not within cart-nav\n if (isCartPage) {\n if (cartNav || removeDialog) {\n const selectedTab = queryFirst('.sfl-tabs-selected');\n pageSubsection = hasClass(selectedTab, 'save-for-later-tab') ? 'saved for later' : 'my tote';\n } else {\n // sfl disabled\n pageSubsection = 'my tote';\n }\n }\n }\n }\n\n let uaAttributes = {\n // Defaults only - these should be set at the bind level or in data attributes\n event_label: '',\n event_category: '',\n event_action: ''\n };\n\n // Remove UA defaults if the omitUADefaults option is true\n if (options.omitUADefaults) {\n uaAttributes = {};\n }\n\n return {\n page_section: pageSection,\n page_subsection: pageSubsection,\n\n // Set in Tealium TagHelper\n caching_enabled: uData.caching_enabled,\n logged_in_status: uData.user_loggedin_status,\n affiliation: uData.affiliation,\n loyalty_status: uData.loyalty_status,\n loyalty_program_member: uData.loyalty_program_member,\n page_name: document.title,\n page_type: uData.page_type,\n page_category: uData.page_category,\n page_subcategory: uData.page_subcategory,\n\n product_category: uData.product_category,\n product_color: uData.product_color,\n product_id: uData.product_id,\n product_original_price: uData.product_original_price,\n product_name: uData.product_name,\n product_price: uData.product_price,\n product_quantity: uData.product_quantity && uData.product_quantity.length ? uData.product_quantity : [1],\n product_size: uData.product_size,\n product_variant: uData.product_variant,\n product_badge: uData.product_badge,\n\n ...uaAttributes\n };\n};\n\n/**\n * Retrieves the requested data from the persisted data in Local Storage\n * @param {string|undefined} key - the key to pull -- otherwise the entire object will be returned.\n * @returns {string|Object|undefined} the value corresponding to the supplied key (if available), the entire object (if no key was given) or undefined (if no suitable value was found)\n */\nfunction getStoredDataLayerInfo(key) {\n const { localStorage } = window;\n const dataStr = localStorage.getItem(PERSISTED_DATA_NAME);\n if (!dataStr) return undefined;\n\n let data;\n try {\n data = JSON.parse(dataStr);\n } catch (e) {\n console.error(e);\n localStorage.removeItem(PERSISTED_DATA_NAME);\n return undefined;\n }\n\n // if there is no key, return the full data object.\n if (typeof key === 'undefined') return data;\n\n // if the key does not exist in the data, return undefined\n if (!(key in data)) return undefined;\n\n // check if the data is still valid\n const { value, timestamp } = data[key];\n const validUntil = timestamp + STORAGE_EXP_TIME;\n\n // if the data has expired, delete it, save back to local storage, and return undefined.\n if (validUntil < Date.now()) {\n delete data[key];\n localStorage.setItem(PERSISTED_DATA_NAME, JSON.stringify(data));\n return undefined;\n }\n\n return value;\n}\n\n/**\n * Persists the given data to Local Storage\n * @param {string} key - the key for this item\n * @param {string} value - the value for this item\n */\nfunction setStoredDataLayerInfo(key, value) {\n const { localStorage } = window;\n const data = getStoredDataLayerInfo() || {};\n data[key] = {\n value,\n timestamp: Date.now()\n };\n\n localStorage.setItem(PERSISTED_DATA_NAME, JSON.stringify(data));\n}\n\n/**\n * Stores any data that should be persisted from the payload in Local Storage\n * @param {Object} payload - The payload sent to Tealium\n */\nfunction storePersistentData(payload) {\n const { event_name: eventName, category_id: productList, promo_name: promoName, promo_creative: promoCreative } = payload;\n\n if (promoName && !Array.isArray(promoName)) {\n console.warn(`promo_name for event ${eventName} is not an array!`);\n }\n\n if (eventName === VIEW_ITEM_LIST && productList) setStoredDataLayerInfo(P_PRODUCT_LIST_KEY, productList);\n if (eventName === SELECT_PROMO && promoName) setStoredDataLayerInfo(P_PROMO_NAME_KEY, promoName);\n if (eventName === SELECT_PROMO && promoCreative) setStoredDataLayerInfo(P_PROMO_CREATIVE_NAME, promoCreative);\n}\n\n/**\n * Sends an event to GA\n * @param {Object} data - The data to send (usually contains an event_category, event_action, and event_label)\n * @param {string} eventType - The type of event to send (e.g. link, view, etc)\n * @returns {Promise} a Promise\n */\nfunction sendEventGA(data, eventType = 'link') {\n return new Promise((resolve, reject) => {\n const { utag } = window;\n\n if (utag && typeof utag[eventType] === 'function') {\n utag[eventType](data, () => {\n resolve();\n });\n } else {\n reject(new Error(`utag is missing or utag.${eventType} does not exist`));\n }\n });\n}\n\n/**\n * Sends a GA event with context and normalized payload options\n * @param {Object} data - the baseline payload to send\n * @param {HTMLElement} [contextElem] - The element to reference for context (typically the element with which the user interacted). Default: first container in main-content.\n * @param {string} [eventType='link'] - The type of event to send (e.g. link, view, etc)\n * @param {boolean} [normalizeData=true] - whether to run the payload through the normalization function\n * @returns {Promise} a promise\n */\nfunction sendEventGAWithContext(data, contextElem = queryFirst('#main-content > .container'), eventType = 'link', normalizeData = true) {\n // omit UA defaults by default -- we shouldn't be using any UA properties anymore\n const pageContext = getPageContext(contextElem, { omitUADefaults: true });\n\n // merge context and data, data gets precedence\n let payload = Object.assign({}, pageContext, data);\n\n if (normalizeData) {\n payload = normalizePayload(payload);\n }\n\n return sendEventGA(payload, eventType);\n}\n\n/**\n * Sets up a middleware GA handler for an element\n * @param {Element} elements - The element to bind to\n * @param {Object|function} data - The data to send to GA or a callback that returns the data to send\n * @param {Object} [options={}] - Additional options to configure the event binding\n * @param {Object} [options.bindOptions={}] - Options passed to the bind method as its options parameter\n * @param {function} [options.callback] - Callback to run after the event is triggered and data is sent to GA\n * @param {string} [options.eventType='click'] - The type of event to listen for (E.g. click, change, etc)\n * @param {function} [options.eventCondition] - A function that runs when the event is triggered, but before the data is sent to GA. Returning false will abort sending data to GA.\n * @param {boolean} [options.isCustomEvent=false] - Whether the event is custom. Event types containing non-word characters are flagged custom. Custom events are bound using jQuery.\n * @param {boolean} [options.normalize=true] - Whether the data payload should be normalized.\n * @param {boolean} [options.retriggerEvent=true] - Whether to retrigger the original event, after sending data to GA. Usually you don't want to retrigger custom events.\n * @param {boolean} [options.usesContext=true] - Whether to mix page context in with the data payload.\n * @param {boolean} [options.usesDataset=true] - Whether to pull event category, action and label from from the element's dataset.\n * @param {boolean} [options.updatesUDO=true] - Whether the Universal Data Object should be updated with any applicable values from the data payload after it is sent to GA.\n * @param {boolean} [options.omitUADefaults=false] - Whether UA/360 attributes should be omitted when adding default values to this event. If false, event label, action, and category will be added.\n */\nfunction bindGA(elements, data, options = {}) {\n const {\n bindOptions = {},\n callback,\n eventType = 'click',\n eventCondition,\n isCustomEvent = false,\n normalize: usesNormalize = true,\n retriggerEvent = true,\n usesContext = true,\n usesDataset = true,\n updatesUDO = true,\n gaEventType = 'link',\n omitUADefaults = false\n } = options;\n\n const { utag_data: uData } = window;\n\n let nodeList = elements;\n\n // Convert NodeList to array\n if (elements instanceof NodeList) {\n nodeList = [].slice.call(elements, 0);\n } else if (!Array.isArray(elements)) {\n nodeList = [elements];\n }\n\n // Default once to false (GA will filter duplicates per Shelly)\n if (typeof bindOptions.once !== 'boolean') {\n bindOptions.once = false;\n }\n\n if (typeof bindOptions.eventCondition !== 'function') {\n bindOptions.eventCondition = eventCondition;\n }\n\n // Custom events are bound with jQuery\n if (isCustomEvent || customEventPattern.test(eventType)) {\n bindOptions.bindEngine = 'jQuery';\n }\n\n const initFlag = [gaInitKeyPrefix, eventType, toDatasetKey(bindOptions.targetSelectors || 'root'), hashValue(data)].join('-');\n\n nodeList.forEach(element => {\n const binding = gaBindings[initFlag];\n const isRebind = binding && binding.includes(element);\n\n if (element && !isRebind) {\n // Register this binding to the element\n if (!binding) gaBindings[initFlag] = [];\n\n gaBindings[initFlag].push(element);\n\n bind(\n element,\n eventType,\n (e, target) => {\n // Don't retrigger if we're holding down a modifier key, since we cannot retrigger using modifiers without user interaction\n const willRetrigger = retriggerEvent && !e.ctrlKey && !e.shiftKey;\n\n // Ignore clicks triggered by bindGA\n if (e.gaRetriggered || (target.dataset && target.dataset[gaRetriggerFlag] === initFlag)) {\n e.gaRetriggered = true;\n\n if (target.dataset) {\n delete target.dataset[gaRetriggerFlag];\n }\n\n return;\n }\n\n const tagPayload = {};\n\n // Pull the payload from the target element dataset\n if (usesDataset && target.dataset) {\n const { eventCategory, eventAction, eventLabel } = target.dataset;\n\n tagPayload.event_category = eventCategory;\n tagPayload.event_action = eventAction;\n tagPayload.event_label = eventLabel;\n }\n\n // Get the bindGA payload\n const bindPayload = typeof data === 'function' ? data(element, target, e, tagPayload) : data;\n\n // Trigger was aborted by callback\n if (bindPayload === false) {\n return;\n }\n\n // if event is promo or product list sensitive, add that data to tagPayload\n const { event_name: eventName } = bindPayload;\n if (eventName) {\n if (promoSensitiveEvents.includes(eventName)) {\n const promoName = getStoredDataLayerInfo(P_PROMO_NAME_KEY);\n if (promoName) Object.assign(tagPayload, { promo_name: promoName });\n }\n\n if (productListSensitiveEvents.includes(eventName)) {\n const productListName = getStoredDataLayerInfo(P_PRODUCT_LIST_KEY);\n if (productListName) Object.assign(tagPayload, { product_list: productListName, product_list_category: [productListName] });\n }\n if (promoSensitiveEvents.includes(eventName)) {\n const promoCreativeName = getStoredDataLayerInfo(P_PROMO_CREATIVE_NAME);\n if (promoCreativeName) Object.assign(tagPayload, { promo_creative: promoCreativeName });\n }\n }\n\n // Merge payloads (bindGA data takes priority)\n let payload = Object.assign({}, tagPayload, bindPayload);\n\n // Stop everything until we re-trigger\n if (willRetrigger) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n // Common page context\n const pageContext = getPageContext(target, options);\n\n if (usesContext) {\n payload = Object.assign({}, pageContext, payload);\n }\n\n // Remove product data from promo events - PT-11362\n if ([VIEW_PROMO, SELECT_PROMO].includes(eventName)) {\n payload = Object.fromEntries(Object.entries(payload).filter(([key]) => !/^product_/.test(key)));\n }\n\n // Preserved UDO Properties\n // Any properties beginning with double underscore (__) will be sent with the payload,\n // but will be reverted in the UDO after sending\n const preservedUDOProperties = Object.keys(payload).reduce((result, key) => {\n if (key.substring(0, 2) !== '__') return result;\n\n const property = key.slice(2);\n payload[property] = payload[key];\n delete payload[key];\n result[property] = uData[property];\n return result;\n }, {});\n\n // Do we have any lazy UDO updates?\n const lazyUDOProperties = Object.keys(payload).reduce((result, key) => {\n if (key.charAt(0) !== '_') return result;\n\n const property = key.slice(1);\n payload[property] = payload[key];\n result.push(property);\n delete payload[key];\n\n return result;\n }, []);\n\n // Normalize all values\n if (usesNormalize) {\n payload = normalizePayload(payload);\n }\n\n // If this updates the UDO, store the updates.\n // The UDO will be updated after the payload is sent.\n const UDOUpdates = updatesUDO\n ? Object.keys(payload).reduce((result, key) => {\n // UDO properties only\n if (!UDOProperties.includes(key)) return result;\n\n // Store the updated value\n result[key] = payload[key];\n\n // For lazy properties, send the old UDO value in the payload. We'll update after.\n if (lazyUDOProperties.includes(key)) {\n payload[key] = usesNormalize ? smartNormalize(key, uData[key]) : uData[key];\n }\n\n return result;\n }, {})\n : {};\n\n storePersistentData(payload);\n\n sendEventGA(payload, gaEventType).finally(() => {\n if (typeof callback === 'function') callback(element, target, e);\n\n if (willRetrigger) {\n target.dataset[gaRetriggerFlag] = initFlag;\n\n // Without a teeny tiny timeout our click gets trapped\n setTimeout(() => {\n try {\n target[eventType]();\n } catch (e) {\n $(target).trigger(eventType);\n }\n }, 0);\n }\n\n // Update Tealium UDO\n // This can only happen if we're updating the MAIN product,\n // not another product on the same page (E.g. quickview, recommendations, etc)\n if (updatesUDO && pageContext.page_section === 'product details') {\n // Product sets need to be updated based on index\n if (pageContext.page_type === 'product set') {\n const productSetItem = target.closest('.product-set-item');\n const productSetItems = queryAll('.product-set-item', target.closest('.product-set-detail'));\n const productSetIndex = productSetItems.indexOf(productSetItem);\n\n if (productSetIndex !== -1) {\n Object.keys(UDOUpdates).forEach(key => {\n const value = UDOUpdates[key];\n\n if (UDOArrays.includes(key)) {\n if (!uData[key]) uData[key] = new Array(productSetItems.length).fill('');\n if (!Array.isArray(uData[key])) uData[key] = String(uData[key]).split(gaFieldPipe);\n\n if (~String(value).indexOf(gaFieldPipe)) {\n uData[key][productSetIndex] = String(value).split(gaFieldPipe)[productSetIndex] || '';\n } else {\n uData[key][productSetIndex] = normalize(value);\n }\n } else {\n uData[key] = value;\n }\n });\n }\n } else {\n Object.keys(UDOUpdates).forEach(key => {\n const value = UDOUpdates[key];\n\n uData[key] = Array.isArray(value) ? value : [value];\n });\n }\n }\n\n // Restore preserved UDO property values\n if (Object.keys(preservedUDOProperties).length) {\n Object.assign(uData, preservedUDOProperties);\n }\n });\n },\n bindOptions\n );\n } else if (isRebind) {\n console.warn('WARNING: Attempted duplicate', eventType, 'binding on', element);\n }\n });\n}\n\n/**\n * Gets the text node content of an element\n * @param {HTMLElement} elem - The element whose text node content will be returned\n * @returns {String} The content of the text node or empty string if no text node is found\n */\nfunction getText(elem) {\n const textNode = [...elem.childNodes].find(child => child.nodeType === Node.TEXT_NODE);\n return (textNode && textNode.textContent.trim().replace(/\\s+/g, ' ')) || '';\n}\n\nmodule.exports = {\n bindGA,\n sendEventGA,\n sendEventGAWithContext,\n getPageContext,\n normalize,\n normalizePayload,\n delimiter: gaFieldPipe,\n getText,\n storePersistentData,\n getStoredDataLayerInfo\n};\n","module.exports = {\n // Asset Ids\n EXCLUSIVE_EXPERIENCES_TOOLTIP_CID: 'loyalty-dashboard-exclusive-experiences-tool-tip',\n REWARDS_TOOLTIP_CID: 'loyalty-dashboard-rewards-tool-tip',\n OFFERS_TOOLTIP_CID: 'loyalty-dashboard-offers-tool-tip',\n BENEFITS_TOOLTIP_CID: 'loyalty-dashboard-benefits-tool-tip',\n TELL_A_FRIEND_TOOLTIP_CID: 'loyalty-dashboard-tell-a-friend-tool-tip',\n STYLE_QUIZ_TOOLTIP_CID: 'loyalty-dashboard-style-quiz-tool-tip',\n MEMBERSHIP_FAQ_TOOLTIP_CID: 'loyalty-dashboard-faq-tool-tip',\n\n // Selectors\n TOOL_TIP_CONTENT: '.tool-tip-content',\n LOYALTY_TOOLTIP_ICON: '.loyalty-tooltip-icon',\n ANALYTIC_EVENT_CLASS: '.analytic-event-class',\n BENEFIT_MODAL_CLOSE_ICON: '.benefit-detail-modal .close',\n BENEFIT_DETAIL_MODAL: '.benefit-detail-dialog',\n BENEFIT_SWATCH_THUMBNAIL_MODAL: '.img-wallpaper',\n BENEFIT_SWATCH_TITLE: '.title-text',\n DOWNLOAD_SWATCH_CTA: '.download-cta',\n GO_TO_ACCOUNT_CTA: '.go-to-my-account-btn',\n BENEFIT_SWATCH_TAB: '.tab-pane.active',\n REFER_FRIEND_CTA: '.loyalty-referral-drawer-link',\n REFER_FRIEND_CTA_LINK: '.referral-cta-link',\n REFER_FRIEND_TEXT_FIELD: '.referral-link',\n STYLE_QUIZ_PENDING_QUIZ: '.finished-quiz',\n MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_CTA: '.membership-loyalty-expand-collapse',\n MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_ALL_CTA: '.membership-loyalty-expand-all',\n MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LINK: '.loyalty-terms-and-conditions .faq-link',\n EXCLUSIVE_ARROW_RIGHT: '.exclusive-carousel .chevron-right',\n EXCLUSIVE_ARROW_LEFT: '.exclusive-carousel .chevron-left',\n EXCLUSIVE_PIP: '.exclusive-carousel .pip-content',\n ARROW_CLICKS: 'arrow clicks',\n EXCLUSIVE_PIP_ACTION: 'pip',\n MODULE_CHANGE: 'module change',\n ARROW_NEXT: 'next',\n ARROW_PREVIOUS: 'previous',\n EXCLUSIVE_VIEWALL: '.exclusive-dashboard-section .view-all-label',\n EXCLUSIVE_EXPERIENCE_CTA: '.cta-styling',\n EXCLUSIVE_RIGHT_SECTION: '.exclusive-right-section',\n EXCLUSIVE_CONTENT_SLOTS_CLICK: 'content slots click',\n EXCLUSIVE_SELECT_CONTENT: 'select_content',\n EXCLUSIVE_EXPERIENCE_NAME: 'exclusive experience name',\n EXCLUSIVE_CLICK_TO_VIEWALL: 'click to view all',\n EXCLUSIVE_VIEWALL_EXCLUSIVE_EXPERIENCES: 'view all exclusive experiences',\n EXCLUSIVE_TOOLTIP: '.exclusive-dashboard-section .custom-info-icon',\n REFER_FRIEND_TOOLTIP: '.refer-dashboard-section .custom-info-icon',\n EXCLUSIVE_OPEN_TOOLTIP: 'open tooltip',\n HOW_TO_EARN_LINK: '.loyalty-how-to-earn-drawer-link',\n VIEW_POINT_ACTIVITY_CTA: '.view-point-activity-cta',\n REWARD_START_SHOPPING: '.reward-start-shopping',\n REWARD_VIEW_CODE_CTA: '.view-code-cta',\n VOUCHER_MODAL_CLOSE_CTA: '.loyalty-reward-in-store-dialog .close',\n OFFER_FLIP_CARD_CTA: '.flip-card-front',\n VIEW_COPY_CODE_CTA: '.view-copy-code-cta',\n OFFER_DETAIL_CLOSE: '.offer-detail-modal .close',\n BONUS_POINTS_DAY: 'Bonus points day',\n EARLY_ACCESS: 'Early Access: New Fall Arrivals',\n LOYALTY_PROGRAM_MODAL: '#loyalty-program-modal .close',\n LOYALTY_ACCOUNT_CARD: '.loyalty-card-dropdown-cta',\n VIEW_LOYALTY_DASHBOARD: '.view-dashboard',\n LOYALTY_DRAWER_LINK: '.loyalty-program-drawer-link',\n LOYALTY_OPT_IN_CHECKBOX: '.add-to-loyalty-program-checkbox',\n ORDER_CONFIRM_REGISTER_MODAL: '.loyalty-order-confirmation-container.show',\n ORDER_CONFIRM_GUEST_ELEMENT: '.order-confirm-loyalty-guest-content',\n CREATE_ACCOUNT_ORDER_CONFIRM: '.create-loyalty-account-btn',\n LOYALTY_NEXT_BUTTON: '.loyalty-welcome-cta',\n CLOSE_WELCOME_MODAL: '.loyalty-welcome-dialog .close-enrollnow-model',\n CLOSE_ENROLL_NOW_MODAL: '.loyalty-enrollnow-dialog .close-enrollnow-model',\n ENROLL_LOYALTY_CTA: '.loyalty-enroll-cta',\n GUEST_LOYALTY_ENROLL: '.guest-create-and-enroll',\n STYLE_QUIZ_START_CTA: '.style-quiz-start-cta',\n STYLE_QUIZ_GO_TO_DASHBOARD: '.style-quiz-go-to-dashboard',\n SWATCH_SELECTION_WRAPPER: '.js-swatch-selection-wrapper .swatch-container',\n NEXT_QUESTION_CTA: '.loyalty-next-question-cta',\n PREVIOUS_QUESTION_CTA: '.loyalty-previous-question-cta',\n SUBMIT_QUIZ_CTA: '.loyalty-submit-quiz-cta',\n SKIP_THIS_QUESTION_CTA: '.loyalty-skip-question-cta',\n FINISH_LATER_CTA: '.loyalty-finish-later-cta',\n START_SHOPPING_CTA: '.style-quiz-start-shopping-cta',\n CONTENT_SLOT_SELECTORS: [\n '.content-module',\n '.promo-asset',\n '.promo-default',\n '.product-recommendations.ways-to-wear',\n '.curalate-content',\n '.product-detail .shop-the-print',\n '.style-component-container',\n '.sfl-empty',\n '.homepage .recommendations .product-listing',\n '.is-recommendation-carousel',\n '.blog-posts-item'\n ],\n\n // GA Event category, label, action, page name strings\n LOYALTY_BENEFIT_LABEL: 'loyalty benefits',\n LOYALTY_ANNUAL_GIFT_ID: 'annual-member-gift',\n ANNUAL_GIFT_LABEL: 'Annual Member',\n LOYALTY_BIRTHDAY_TREAT_LABEL: 'birthday treat',\n LOYALTY_DIGITAL_WALLPAPER_LABEL: 'digital wallpaper',\n MODAL_CLOSE_LABEL: 'close',\n MODAL_VOUCHER_CLOSE_LABEL: 'close modal',\n MODAL_SELECTED_LABEL: 'select',\n MODAL_DOWNLOAD_LABEL: 'download',\n CLICK_EVENT_ACTION: 'click',\n SHARE_EVENT_ACTION: 'share link',\n LOYALTY_DASHBOARD_LABEL: 'loyalty dashboard',\n LOYALTY_BENEFIT_TOOLTIP_LABEL: 'benefits tooltip',\n BENEFIT_LABEL: 'benefits',\n LOYALTY_EXCLUSIVE_EXPERIENCE_TOOLTIP_LABEL: 'exclusive experiences tooltip',\n LOYALTY_EXCLUSIVE_EXPERIENCE_LABEL: 'exclusive experiences',\n LOYALTY_MEMBERSHIP_FAQ_TOOLTIP_LABEL: 'membership faq tooltip',\n TOOLTIP_LABEL: 'tooltip',\n OPEN_TOOLTIP_LABEL: 'open tooltip',\n CLOSE_TOOLTIP_LABEL: 'close tooltip',\n STYLE_QUIZ_TOOLTIP_LABEL: 'style quiz tooltip',\n STYLE_QUIZ_PAGE_SECTION: 'style quiz',\n LOYALTY_REFER_A_FRIEND_SECTION: 'content or footer',\n LOYALTY_MEMBERSHIP_FAQ_SECTION: 'membership faq',\n LOYALTY_MODAL_PAGE_SUBSECTION: 'web pop up',\n LOYALTY_REFER_A_FRIEND_LABEL_SECTION: 'refer a friend',\n LOYALTY_REFER_A_FRIEND_TOOLTIP: 'refer a friend tooltip',\n LOYALTY_EVENT_LABEL: 'finish your quiz',\n MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ACTION: 'expand question or collapse question',\n MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ALL_ACTION: 'expand all',\n MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LABEL: 'loyalty t&c link',\n REWARDS_TOOLTIP_LABEL: 'rewards tooltip',\n REWARDS_PAGE_SECTION_LABEL: 'rewards',\n EVENT_CLICK_LINK_ACTION: 'click link',\n REWARDS_HOW_TO_EARN_EVENT_LABEL: 'how to earn',\n REWARDS_VIEW_POINT_ACTIVITY_LABEL: 'view points activity',\n REWARDS_START_SHOPPING_LABEL: 'start shopping',\n REWARDS_VIEW_CODE_ACTION: 'click to view',\n REWARDS_VIEW_CODE_LABEL: 'reward vouchers code',\n REWARDS_VOUCHER_MODAL: 'voucher modal',\n REWARDS_VOUCHER_LABEL: 'voucher',\n REWARDS_VOUCHER_PAGE_SECTION: 'modal',\n OFFER_TOOLTIP_LABEL: 'offers tooltip',\n OFFER_PAGE_SECTION: 'offers',\n TAP_TO_REVEAL_ACTION: 'tap to reveal',\n VIEW_AND_OFFER_CODE_CTA: 'view and copy offer code',\n OFFER_CLOSE_EVENT_LABEL: 'offer modal',\n LOYALTY_PROGRAM_LABEL: 'loyalty',\n LOYALTY_PROGRAM_ACTION: 'initiate enrollment',\n LOYALTY_PROGRAM_SUCCESS_ENROLL: 'successful enrollment',\n ENROLL_LOYALTY: 'start enroll',\n LOYALTY_DASHBOARD_ACTION: 'dashboard',\n OPEN_LABEL: 'open',\n MY_ACCOUNT_NAME: 'my account',\n ACCOUNT_PAGE_TYPE: 'account',\n MY_ACCOUNT_TAB: 'account tab',\n LOYALTY_PROGRAM_DETAILS: 'program details',\n LOYALTY_OPT_IN_ACTION: 'opt-in',\n LOYALTY_OPT_IN_CHECKBOX_SELECT_ACTION: 'select',\n LOYALTY_OPT_IN_CHECKBOX_DESELECT_ACTION: 'deselect',\n ACCOUNT_SIGN_IN_CATEGORY: 'account sign in',\n CREATE_AN_ACCOUNT_ACTION: 'create an account',\n SUBMIT_LOYALTY_OPT_IN: 'submit|opt-in loyalty:true',\n SUBMIT_LOYALTY_NOT_OPT_IN: 'submit|opt-in loyalty:false',\n LOYALTY_PROGRAM_WELCOME: 'welcome',\n LOYALTY_PROGRAM_ENROLLMENT: 'enrollment',\n LOYALTY_PROGRAM_ENROLL_SUCCESS: 'enroll:success',\n LOYALTY_STYLE_QUIZ_LABEL: 'loyalty style quiz',\n LOYALTY_STYLE_QUIZ_GET_STARTED_ACTION: 'get started',\n LOYALTY_STYLE_QUIZ_GO_TO_DASHBOARD: 'go to dashboard',\n LOYALTY_STYLE_QUIZ_PAGE_NAME: 'style quiz|cover',\n LOYALTY_STYLE_QUIZ_QUESTION: 'style quiz|q',\n OPTION_SELECTED: 'select',\n OPTION_DESELECTED: 'deselect',\n STYLE_QUIZ_NEXT_CTA: 'next',\n STYLE_QUIZ_PREVIOUS_CTA: 'previous',\n STYLE_QUIZ_SUBMIT_CTA: 'submit',\n STYLE_QUIZ_SKIP_THIS_QUESTION_CTA: 'skip',\n STYLE_QUIZ_FINISH_LATER: 'finish later',\n START_SHOPPING: 'start shopping',\n STYLE_QUIZ_THANK_YOU_PAGE: 'style quiz|thank you',\n PDP_SELECTIONS: 'pdp selections',\n PDP_INTERACTION: 'pdp_interaction',\n CHANGE_STORE: 'change store',\n VIEW_PROMO: 'view_promotion',\n SELECT_PROMO: 'select_promotion',\n VIEW_ITEM_LIST: 'view_item_list',\n VIEW_ITEM: 'view_item',\n SELECT_ITEM: 'select_item',\n SIGN_IN_OR_CREATE_ACCOUNT_ACTION: 'sign in or create account',\n START_LABEL: 'start',\n PDP_PAGE_NAME: 'pdp',\n PRODUCT_PAGE_TYPE: 'product',\n CREATE_ACCOUNT_ACTION: 'create account',\n SUBMIT_EVENT_LABEL: 'submit or success or failure',\n JOIN_CLUB_LILLY_EVENT: 'join club lilly',\n INITIATE_ACTION: 'initiate',\n LOYALTY_ENROLLMENT_CATEGORY: 'loyalty enrollment',\n ACCOUNT_DASHBOARD_PAGE: 'account dashboard',\n GET_DIRECTIONS: 'get directions',\n STORE_INTERACTION: 'store_interaction',\n ADD_TO_CART: 'add_to_cart',\n\n LOYALTY_VIEW_VOUCHER_CODE_LABEL: 'view voucher code',\n REWARDS_POINT_ACTIVITY_LABEL: 'points activity',\n REWARDS_SHOP_TAB_LABEL: 'shop tab',\n\n SHARED_WISHLIST_CREATE_ACCOUNT_CATEGORY: 'account sign in',\n SHARED_WISHLIST_CREATE_ACCOUNT_ACTION: 'sign in or create account',\n SHARED_WISHLIST_CREATE_ACCOUNT_LABEL: 'start',\n SHARED_WISHLIST_PAGE_SUBSECTION: 'wishlist',\n SHARED_WISHLIST_NON_LOYALTY_CATEGORY: 'loyalty enrollment',\n SHARED_WISHLIST_NON_LOYALTY_ACTION: 'initiate',\n SHARED_WISHLIST_NON_LOYALTY_LABEL: 'join club lilly',\n LOYALTY_ENROLL_MODAL_INTERACTION_TYPE: 'loyalty enroll modal',\n SIGN_IN_OR_SIGN_UP_ENROLL_MODAL: 'sign in/up to enroll modal',\n LOYALTY_ENROLLMENT_EVENT_NAME: 'loyalty_enrollment',\n LOYALTY_VOUCHERS_EVENT_NAME: 'loyalty_dashboard_vouchers',\n BOLT_INTERACTION: 'bolt_interaction',\n LOYALTY_DASHBOARD_REWARDS_EVENT_NAME: 'loyalty_dashboard_rewards',\n BOLT_MODAL_PROCEED: 'otp:proceed',\n BOLT_MODAL_CLOSE: 'otp:close',\n LOYALTY_REWARDS_EVENT_NAME: 'loyalty_rewards',\n BOLT_SIGN_OUT: 'otp:sign out',\n NEWSLETTER_SIGNUP_COMPLETE: 'newsletter_signup_complete',\n NEWSLETTER_SIGNUP_FAILURE: 'newsletter_signup_failure',\n P_PRODUCT_LIST_KEY: 'product_list',\n P_PROMO_NAME_KEY: 'promo_name',\n P_PROMO_CREATIVE_NAME: 'promo_creative'\n};\n","'use strict';\n\nconst isFitPredictorEnabled = !!document.getElementById('fitPredictorEnabled');\nconst noop = function () { };\n\n/**\n * Native querySelector to find first element in the dom with given selector\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {Object} returns the target as a DOM node\n */\nconst queryFirst = (selector, parent = document) => {\n if (!parent) return null;\n return parent.querySelector(selector);\n};\n\n/**\n * Native querySelectorAll to find all the dom element with given selector.\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {nodeList | Array} Returns the target as a DOM node.\n */\nconst queryAll = (selector, parent = document) => {\n if (!parent) return null;\n return [].slice.call(parent.querySelectorAll(selector), 0);\n};\n\n/**\n * Looks for availability of class or classes in the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n * @return {boolean} Returns availability of class in the target element.\n */\nconst hasClass = (el, ...classes) => {\n const { classList } = el;\n for (let c = 0, n = classes.length; c < n; c++) {\n if (!classList.contains(classes[c])) return false;\n }\n return true;\n};\n\n/**\n * Wraps a method to set up feature flagging\n * \n * @param {function} method The method to run\n * @return {function} Returns the method passed in if the feature is enabled, otherwise returns a noop method\n */\nconst featureSwitch = method => (isFitPredictorEnabled && method) || noop;\n\n/**\n * This function sets the site context for Secret Sauce based on the channel type\n */\nfunction siteContext() {\n const deviceWidth = window.screen.width;\n let channelValue = 'desktop';\n if (deviceWidth >= 768 && deviceWidth < 1024) {\n channelValue = 'tablet';\n } else if (deviceWidth < 768) {\n channelValue = 'mobile';\n }\n ssp('set', 'site', {\n layout: channelValue,\n currency: 'USD',\n language: 'en',\n market: 'US',\n shippingCountry: 'US'\n });\n}\n\n/**\n * This function sets the customer context for Secret Sauce\n */\nfunction custContext() {\n const custID = document.getElementById('ssCustomer').value;\n const email = document.getElementById('ssEmail').value;\n if (custID && custID !== '') {\n ssp('set', 'user', {\n userId: custID,\n emailHash: email\n });\n }\n}\n\n/**\n * This function sets the page context for Secret Sauce based on the product page type\n * @param {string | Object} bc breadcrumb value.\n * @param {string | Object} pt product page type.\n */\nfunction pageContext(bc, pt) {\n ssp('set', 'page', {\n breadcrumb: bc, // 'Home > Sweaters > SSP Sweater'\n type: pt // 'cat', 'pdp', 'pdp-set', 'quickview'\n });\n}\n\n/**\n * This function retrieves the price of the product from price container for Secret Sauce\n * @param {Object} container product container\n * @param {string | Object} priceContainerId price container Id.\n * @return {float} returns price\n */\nfunction getPriceFromContainer(priceContainerId, container) {\n const price = queryFirst(priceContainerId, container);\n if (price && price.value) {\n return parseFloat(price.value.replace('$', ''));\n }\n return 0.0;\n}\n\n/**\n * This function retrieves the standard price of the product for Secret Sauce\n * @param {Object} container product continer\n * @return {float} returns standard price\n */\nfunction getPrice(container) {\n return getPriceFromContainer('.ssPrice', container);\n}\n\n/**\n * This function sets the standard price of the product for Secret Sauce\n * @param {float} newPrice standard price\n * @param {Object} container product container\n */\nfunction setPrice(newPrice, container) {\n const priceElement = queryFirst('.ssPrice', container);\n if (priceElement) {\n priceElement.value = newPrice;\n }\n}\n\n/**\n * This function retrieves the sale price of the product for Secret Sauce\n * @param {Object} container product container\n * @return {float} returns sale price\n */\nfunction getSalePrice(container) {\n return getPriceFromContainer('.ssSalesPrice', container);\n}\n\n/**\n * This function sets the sale price of the product for Secret Sauce\n * @param {float} newSalePrice sale price\n * @param {Object} container product container\n */\nfunction setSalePrice(newSalePrice, container) {\n const salesPriceElement = queryFirst('.ssSalesPrice', container);\n if (salesPriceElement) {\n salesPriceElement.value = newSalePrice;\n }\n}\n\n/**\n * This function retrieves the selected color of the product for Secret Sauce\n * @param {Object} container product container\n * @return {string} returns selected product color\n */\nfunction getSelectedColor(container) {\n const colorElement = queryFirst('.ssColor', container);\n return colorElement ? colorElement.value : 'unknown';\n}\n\n/**\n * This function sets the selected color of the product for Secret Sauce\n * @param {string} newColor selected product color\n * @param {Object} container product container\n */\nfunction setSelectedColor(newColor, container) {\n const colorElement = queryFirst('.ssColor', container);\n if (colorElement) {\n colorElement.value = newColor;\n }\n}\n\n/**\n * This function retrieves the selected size of the product for Secret Sauce\n * @param {Object} container product container\n * @return {string} returns selected product size\n */\nfunction getSelectedSize(container) {\n const sizeElement = queryFirst('.ssSize', container);\n return sizeElement ? sizeElement.value : 'unknown';\n}\n\n/**\n * This function sets the selected size of the product for Secret Sauce\n * @param {string} newSize selected product size\n * @param {Object} container product container\n */\nfunction setSelectedSize(newSize, container) {\n const sizeElement = queryFirst('.ssSize', container);\n if (sizeElement) {\n sizeElement.value = newSize;\n }\n}\n\n/**\n * This function updates product data for Secret Sauce\n * @param {string} color selected product color\n * @param {string} size selected product size\n * @param {float} price selected product standard price\n * @param {float} salePrice selected product sale price\n * @param {Object} container product container\n */\nfunction updateProductData(color, size, price, salePrice, container) {\n if (getSelectedColor(container) !== color) setSelectedColor(color, container);\n if (getSelectedSize(container) !== size) setSelectedSize(size, container);\n if (getPrice(container) !== price) setPrice(price, container);\n if (getSalePrice(container) !== salePrice) setSalePrice(salePrice, container);\n}\n\n/**\n * This function retrieves the available sizes for the product swatch selected\n * @param {Object} container product container\n * @return {Array} returns sizes list of the product\n */\nfunction getSizes(container) {\n let sizeArray = [];\n queryAll('.size-container .size-list .size-btn', container).forEach((element) => {\n const size = element.dataset.attrValue;\n if (size !== '' && size !== undefined) {\n sizeArray.push(size);\n }\n });\n return sizeArray;\n}\n\n/**\n * This function retrieves the variant ID of the selected product\n * @return {string} returns product ID\n */\nfunction getVariant() {\n return $('.product-detail').attr('data-masterid');\n}\n\n/**\n * This function enables the Fit Predictor link from Secret Sauce\n */\nfunction startFP() {\n ssp('start', 'fitpredictor');\n}\n\n/**\n * This function enables the Style Finder link from Secret Sauce\n */\nfunction startSF() {\n ssp('show', 'stylefinder');\n}\n\n/**\n * This function enables the Outfit Maker link from Secret Sauce\n */\nfunction startOM() {\n ssp('show', 'outfitmaker');\n}\n\n/**\n * This function retrieves the available sizes that are in stock for the product swatch selected\n * @param {Object} container product container\n * @return {Array} returns sizes list of the product\n */\nfunction getAvailableSizes(container) {\n let sizeArray = [];\n queryAll('.size-container .size-list .size-btn', container).forEach((element) => {\n let size = element.dataset.attrValue;\n if (size !== '') {\n if (!hasClass(element, 'not-available')) {\n sizeArray.push(size);\n }\n }\n });\n return sizeArray;\n}\n\n/**\n * This function updates the product context for Secret Sauce\n * @param {Object} $container product container\n * @param {string} context secret sauce initiation context\n */\nfunction updateProductSetData($container, context) {\n if ($container && $container.length > 0) {\n let sizes = [];\n let availableSizes = [];\n $container.find('.size-container .size-list .size-btn').each(function () {\n let size = $(this).attr('data-attr-value');\n if (size && size !== '') {\n sizes.push(size);\n if (!$(this).hasClass('not-available')) {\n availableSizes.push(size);\n }\n }\n });\n const productId = $container.data('masterid').toString();\n const price = $container.find('.ssPrice').first().val();\n const salePrice = $container.find('.ssSalesPrice').first().val();\n const color = $container.find('.ssColor').first().val();\n const size = $container.find('.ssSize').first().val();\n ssp('set', 'product', {\n productId,\n sizeType: 'regular',\n price,\n salePrice,\n color,\n sizes: sizes,\n availableSizes: availableSizes,\n size\n });\n if (context && context === 'variationUpdate') {\n startFP();\n }\n }\n}\n\n/**\n * This function sets the product context for Secret Sauce\n * @param {string} context secret sauce initiation context\n */\nfunction productContext(context, container) {\n // skip call for gift cards\n const $giftCardAmount = $('input[name=\"giftcert_amount\"]');\n if ($giftCardAmount && $giftCardAmount.length > 0) {\n // If we are on gift card, do not fire secretsauce\n return;\n }\n\n const isMaster = 'true';\n\n if (context === 'load') {\n const pid = container[0].dataset.masterid;\n const price = getPrice(container[0]);\n const salePrice = getSalePrice(container[0]);\n let useSale = true;\n if (price === salePrice) {\n useSale = false;\n }\n if (container[0].closest('.set-items')) {\n $('.set-items .product-detail.product-wrapper').each(function () {\n let $container = $(this);\n updateProductSetData($container, context);\n });\n return;\n }\n\n if (isMaster === 'true') {\n if (useSale) {\n ssp('set', 'product', {\n productId: pid,\n sizeType: 'regular',\n price,\n salePrice,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0])\n });\n } else {\n ssp('set', 'product', {\n productId: pid,\n sizeType: 'regular',\n price,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0])\n });\n }\n } else if (useSale) {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n sizeType: 'regular',\n price,\n salePrice,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0]),\n size: getSelectedSize(container[0])\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n sizeType: 'regular',\n price,\n color: getSelectedColor(container[0]),\n sizes: getSizes(container[0]),\n availableSizes: getAvailableSizes(container[0]),\n size: getSelectedSize(container[0])\n });\n }\n }\n if (context === 'color') {\n const pid = container.dataset.masterid;\n const price = getPrice(container);\n const salePrice = getSalePrice(container);\n let useSale = true;\n if (price === salePrice) {\n useSale = false;\n }\n if (isMaster === 'true') {\n if (useSale) {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price,\n salePrice\n });\n } else {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price\n });\n }\n } else if (useSale) {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price,\n salePrice\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n price\n });\n }\n }\n if (context === 'size') {\n const pid = container.dataset.masterid;\n const price = getPrice(container);\n if (isMaster === 'true') {\n ssp('set', 'product', {\n productId: pid,\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n size: getSelectedSize(container),\n price\n });\n } else {\n ssp('set', 'product', {\n productId: $('#ssMasterPID').val(),\n variantId: getVariant(),\n color: getSelectedColor(container),\n sizes: getSizes(container),\n availableSizes: getAvailableSizes(container),\n size: getSelectedSize(container),\n price\n });\n }\n }\n}\n\n/**\n * This function initiates Secret Sauce based on product's color change\n * @param {Object} container product container\n */\nfunction handleColor(container) {\n const attribute = queryFirst('.ssColor', container);\n if (attribute && attribute.value !== null || 'unknown') {\n productContext('color', container);\n }\n}\n\n/**\n * This function initiates Secret Sauce based on product's size change\n * @param {Object} container product container\n */\nfunction handleSize(container) {\n const attribute = queryFirst('.ssSize', container);\n if (attribute && attribute.value !== 'unknown' || null) {\n productContext('size', container);\n }\n}\n\n/**\n * This function returns page bread crumb\n * @return {string} returns page bread crumb\n */\nfunction getCrumbs() {\n let crumb = '';\n $('.breadcrumb .breadcrumb-item').each(function () {\n if (crumb === '') {\n crumb = $(this).html;\n } else {\n crumb = crumb + ' > ' + $(this).html;\n }\n });\n return crumb;\n}\n\n/**\n * This function fires at the beginning\n * To prevent looping of the change event, which fires an ajax call which reloads everything, then concludes\n * with calling the predictor again, we need to setup some way to track, hence the use of a trigger.\n * @param {Object} container product container\n */\nfunction prediction(container) {\n // The subscription seems to only allow itself to be set once.\n // i.e. future subscription handlers are discarded.\n // References to container will revert to the initial subscription,\n // which won't always be what we were looking for.\n // So I'm attaching the container to the function itself.\n prediction.container = container;\n\n ssp('subscribe', 'prediction', function (event) {\n queryAll('.product-detail.product-wrapper[data-masterid=\"' + event.productId + '\"]').forEach(productContainer => {\n //check for an instance of the trigger\n const trigger = productContainer.getAttribute('data-sstrigger-first-time');\n if (trigger === 'true' && event.service === 'fitpredictor' && event.size) {\n const sizeOption = $('.size-container .size-list .size-btn[data-attr-value=\"' + event.size + '\"]', productContainer);\n if (sizeOption) {\n sizeOption.trigger('click');\n }\n productContainer.setAttribute('data-sstrigger-first-time', 'false');\n $('body').trigger('fitPredictorSizeSelected', productContainer);\n }\n });\n });\n}\n\n/**\n * This function sets Add to Cart context for Secret Sauce\n * @param {Object} container product container\n * @return {boolean} returns status if or not add to cart context is set for secret sauce\n */\nfunction ssAddToCart(container) {\n if (ssp) {\n const { pid, masterid } = container.dataset;\n ssp('track', 'addVariantToCart', {\n variantId: pid,\n productId: masterid,\n quantity: 1\n });\n return true;\n }\n return false;\n}\n\n/**\n * This function sets flag for Secret Sauce initiation\n * @param {Object} container product's container\n */\nfunction setupTrigger(container) {\n container.attr('data-sstrigger-first-time', 'true');\n}\n\n/**\n * This function sets all the context for Secret Sauce initiation and triggers Secret Sauce services\n * @param {Object} container product's container\n */\nfunction initializeDom(container) {\n siteContext();\n custContext();\n let pt = 'pdp';\n if (container[0].closest('.search-results-container')) {\n pt = 'cat';\n } else if (container[0].closest('.product-set-detail')) {\n pt = 'pdp-set';\n } else if (hasClass(container[0], 'product-quickview')) {\n pt = 'quickview';\n }\n const crumbs = getCrumbs();\n pageContext(crumbs, pt);\n productContext('load', container);\n startFP();\n setupTrigger(container);\n prediction(container);\n}\n\n/**\n * This function initiates Secret Sauce\n * @param {Object} container product's container\n */\nfunction sauce(container) {\n initializeDom(container);\n}\n\nmodule.exports = Object.entries({\n handleColor,\n handleSize,\n prediction,\n sauce,\n ssAddToCart,\n startFP,\n startOM,\n startSF,\n updateProductData,\n updateProductSetData\n}).reduce((exported, [alias, method]) => {\n exported[alias] = featureSwitch(method);\n return exported;\n}, {});\n","'use strict';\n\nconst { queryFirst, queryAll, addClass, removeClass, hasClass, debounce } = require('../domUtil');\n\nconst SCROLLABLE_CONTENT_SELECTOR = queryAll('.scrollable-content');\nconst LEFT_ARROW_SELECTOR = '.scroll-left-arrow';\nconst RIGHT_ARROW_SELECTOR = '.scroll-right-arrow';\n\nfunction initSpecificCarousel(scrollableContainerEl) {\n const parentEl = scrollableContainerEl.parentElement;\n\n // Attaching events on Left arrow click\n const leftArrowEl = queryFirst(LEFT_ARROW_SELECTOR, parentEl);\n if (leftArrowEl) {\n leftArrowEl.addEventListener('click', () => {\n scrollableContainerEl.scrollTo({\n left: Math.max(0, scrollableContainerEl.scrollLeft - scrollableContainerEl.offsetWidth),\n behavior: 'smooth'\n });\n });\n }\n\n // Attaching events on Right arrow click\n const rightArrowEl = queryFirst(RIGHT_ARROW_SELECTOR, parentEl);\n if (rightArrowEl) {\n rightArrowEl.addEventListener('click', () => {\n scrollableContainerEl.scrollTo({\n left: Math.min(scrollableContainerEl.scrollWidth, scrollableContainerEl.scrollLeft + scrollableContainerEl.offsetWidth),\n behavior: 'smooth'\n });\n });\n }\n\n // Hide left arrow on carousel initialization.\n addClass(leftArrowEl, 'hide');\n\n // Hide both the arrows, if the items are not scrollable.\n if (scrollableContainerEl.scrollWidth <= scrollableContainerEl.offsetWidth) {\n addClass(rightArrowEl, 'hide');\n } else {\n const callback = () => {\n const { scrollWidth, scrollLeft, offsetWidth } = scrollableContainerEl;\n const offsetValue = 5;\n if (scrollWidth - scrollLeft - offsetWidth < offsetValue) {\n // Hide the right arrow, if content is scrolled to right end.\n if (hasClass(leftArrowEl, 'hide')) {\n removeClass(leftArrowEl, 'hide');\n }\n if (!hasClass(rightArrowEl, 'hide')) {\n addClass(rightArrowEl, 'hide');\n }\n } else if (scrollLeft === 0) {\n // Hide the left arrow, if content is scrolled to left end.\n if (!hasClass(leftArrowEl, 'hide')) {\n addClass(leftArrowEl, 'hide');\n }\n if (hasClass(rightArrowEl, 'hide')) {\n removeClass(rightArrowEl, 'hide');\n }\n } else {\n // Display both the arrows, if content is scrolled neither of the ends.\n if (hasClass(leftArrowEl, 'hide')) {\n removeClass(leftArrowEl, 'hide');\n }\n if (hasClass(rightArrowEl, 'hide')) {\n removeClass(rightArrowEl, 'hide');\n }\n }\n };\n scrollableContainerEl.addEventListener('scroll', debounce(callback, 300));\n }\n}\n\nmodule.exports = {\n initCarousel: function() {\n SCROLLABLE_CONTENT_SELECTOR.forEach(scrollableContainerEl => {\n initSpecificCarousel(scrollableContainerEl);\n });\n },\n initSpecificCarousel: initSpecificCarousel\n};\n","/* global _etmc */\n'use strict';\n\nconst hasEtmc = typeof _etmc !== 'undefined';\n\n/**\n * Send trackCart event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackCart(data) {\n if (hasEtmc && 'trackCart' in _etmc) {\n _etmc.trackCart(data);\n }\n}\n\n/**\n * Send trackPageView event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackPageView(data) {\n if (hasEtmc && 'trackPageView' in _etmc) {\n _etmc.trackPageView(data);\n }\n}\n\n/**\n * Send trackWishlist event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function trackWishlist(data) {\n if (hasEtmc && 'trackWishlist' in _etmc) {\n _etmc.trackWishlist(data);\n }\n}\n\n/**\n * Send setUserInfo event to SFMC\n * @param {Object} data data to send to SFMC\n */\nexport function setUserInfo(data) {\n if (hasEtmc && 'setUserInfo' in _etmc) {\n _etmc.setUserInfo(data);\n }\n}\n","import { getISOCodeByLocale } from './util';\nconst { queryFirst, addClass, scrollTo } = require('lilly/domUtil');\nconst { errorTextTemplate } = require('lilly/templates');\nconst showClass = 'show';\n\n/**\n * making an ajax call to sfcc backend to clear bolt account data\n */\nasync function logout(e, customerEmail) {\n const boltPublishableKey = queryFirst('.bolt-publishable-key').value;\n const locale = queryFirst('.bolt-locale').value;\n\n const boltEmbedded = Bolt(boltPublishableKey, {\n language: getISOCodeByLocale(locale)\n });\n await boltEmbedded.helpers.logout();\n const url = queryFirst('.data-bolt-platform-side-logout-url').value;\n $.spinner().start();\n\n let requestObj = {\n url: url,\n method: 'POST',\n success: function (data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON.message) {\n const errorElement = queryFirst('.error-message');\n errorElement.innerHTML = errorTextTemplate(err.responseJSON.message);\n addClass(errorElement, showClass);\n scrollTo(0);\n }\n $.spinner().stop();\n }\n };\n\n // add customerEmail to request to set it in Basket\n if (customerEmail) requestObj.data = { customerEmail: customerEmail };\n\n $.ajax(requestObj);\n}\n\nexport { logout };\n","import { EventAccountRecognitionCheckPerformed } from './constant.js';\nimport { logout as autoLogout } from './boltHelpers.js';\nimport { getISOCodeByLocale } from './util.js';\nimport { HIDDEN_CLASS } from 'lilly/constants';\n\nconst { removeClass, queryFirst, addClass } = require('lilly/domUtil');\n\n/**\n * Log the user into their bolt account\n * @param {string} email - input email\n * @returns {Promise} The returned promise to fetch account details\n */\nasync function login(email) {\n const loginModal = Bolt.create('login_modal', {\n autoDetectEmail: false\n });\n\n loginModal.attemptLogin({\n email\n }).then((authorizeResp) => {\n return authorizeCustomer(authorizeResp, email);\n });\n\n}\n\nexport async function authorizeCustomer(authorizeResp, email) {\n if (!authorizeResp || authorizeResp instanceof Error) {\n // If the user closed the OTP modal then change the payment method to CREDIT_CARD if it is BOLT_PAY \n const checkoutContainer = queryFirst('.data-checkout-stage');\n\n if (checkoutContainer && ($('.payment-information').attr('data-payment-method-id') === 'BOLT_PAY')) {\n const creditCardContent = queryFirst('.credit-card-content');\n creditCardContent.id = 'credit-card-content';\n queryFirst('[data-method-id=\"CREDIT_CARD\"] a').click();\n removeClass(queryFirst('.credit-card-tab-list'), 'payment-options-hide');\n addClass(queryFirst('.bolt-pay-tab-list'), HIDDEN_CLASS);\n }\n\n // trigger only in case if OTP modal was closed \n if (email) $('body').trigger('bolt:closeOtpModal');\n\n return;\n }\n\n const OAuthResp = await authenticateUserWithCode(\n authorizeResp.authorizationCode,\n authorizeResp.scope\n );\n\n return getAccountDetails(OAuthResp.accessToken); // eslint-disable-line consistent-return\n}\n\n/**\n * This function uses the authCode and scope returned from authorizeWithEmail\n * after the user enters the 6 digits OTP code\n * It makes a call to Bolt-FetchOAuthToken controller to fetch Oauth token & refresh token\n * @param {string} authCode - auth Code\n * @param {string} scope - scope, both params are returned from authorizeWithEmail\n * @returns {Object} - an Ajax call to fetch oAuth token\n */\nfunction authenticateUserWithCode(authCode, scope) {\n const authenticateUserUrl = $('.authenticate-bolt-user').val();\n const reqBody = {\n code: authCode,\n scope: scope\n };\n return $.ajax({\n url: authenticateUserUrl,\n method: 'GET',\n data: reqBody,\n error: function (jqXHR, error) {\n console.log(error);\n }\n });\n}\n\n/**\n * Get Account Details.\n * This function passes the Oauth token to bolt and retrieve the account details of a shopper\n * @param {string} oAuthToken - oAuth Token\n * @returns {Object} - an ajax call to fetch account details\n */\nfunction getAccountDetails(oAuthToken) {\n const accountDetailUrl = $('.get-bolt-account-details').val();\n const reqBody = {\n bearerToken: oAuthToken\n };\n $.spinner().start();\n return $.ajax({\n url: accountDetailUrl,\n method: 'GET',\n data: reqBody,\n success: function (data) {\n $('body').trigger('bolt:proceedOtpModal');\n //Remove the bolt logout cookie\n document.cookie = 'bolt_sfcc_session_logout=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';\n window.location.href = data.redirectUrl;\n },\n error: function (jqXHR, error) {\n $.spinner().stop();\n console.log(error);\n }\n });\n}\n\n/**\n * Check Account And Fetch Detail\n * This function makes a call to bolt backend with the user email,\n * and log the user into their bolt account if the user has one\n * at the end of the login flow we redirect the user to the final page\n * where they can click place order so this function\n * doesn't return anything\n * @returns {void}\n */\nexport function checkAccountAndFetchDetail() {\n const emailInput = $('#email-guest');\n const customerEmail = emailInput.val();\n const checkBoltAccountUrl = $('.check-bolt-account-exist').val() + '=' + encodeURIComponent(customerEmail);\n const $accountCheckbox = $('#acct-checkbox');\n const $boltCheckboxInfo = $('#acc-checkbox-info');\n const boltCheckbox = queryFirst('#bolt-acct-check');\n const boltPublishableKey = queryFirst('.bolt-publishable-key').value;\n if ($accountCheckbox) {\n $accountCheckbox.show();\n $boltCheckboxInfo.show();\n }\n $.spinner().start();\n $.ajax({\n url: checkBoltAccountUrl,\n headers: { \"X-Publishable-Key\": boltPublishableKey },\n method: 'GET',\n success(data) {\n if (!data) return;\n\n if (data.has_bolt_account) {\n const localeEl = queryFirst('.bolt-locale');\n const locale = localeEl?.value || '';\n const boltKeyEl = queryFirst('.bolt-publishable-key');\n const boltKey = boltKeyEl?.value || '';\n Bolt(boltKey, { language: getISOCodeByLocale(locale) });\n login(customerEmail);\n if ($accountCheckbox) {\n $accountCheckbox.hide();\n $boltCheckboxInfo.hide();\n if (boltCheckbox) {\n boltCheckbox.checked = false;\n $(boltCheckbox).trigger('change');\n }\n }\n } else {\n const boltCheckboxContainer = queryFirst('#acct-checkbox');\n const isBoltUserLoggedIn = queryFirst('.bolt-is-shopper-logged-in');\n\n if (boltCheckboxContainer) {\n $('body').trigger('bolt:createAccountCheckbox');\n if (boltCheckbox) {\n boltCheckbox.checked = true;\n $(boltCheckbox).trigger('change');\n }\n\n } else if (isBoltUserLoggedIn && isBoltUserLoggedIn.value === 'true') {\n // sign out of a Bolt customer automatically if it is not a Bolt account\n autoLogout(false, customerEmail);\n }\n $('.submit-customer').removeAttr('disabled'); // enable checkout button for non Bolt shopper\n }\n $.spinner().stop();\n window.BoltAnalytics.checkoutStepComplete(EventAccountRecognitionCheckPerformed, { hasBoltAccount: data.has_bolt_account, detectionMethod: 'email' });\n },\n error: function (jqXHR, error) {\n $.spinner().stop();\n console.log(error);\n }\n });\n}\n\n/**\n * making an ajax call to sfcc backend to clear bolt account data\n */\nexport function logout() {\n const url = $('.data-bolt-platform-side-logout-url').val();\n $.ajax({\n url: url,\n method: 'POST',\n success: function (data) {\n if (data.redirectUrl) {\n window.location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.message) {\n $('.error-message').show();\n $('.error-message-text').text(err.responseJSON.message);\n }\n }\n });\n}\n\n/**\n * Get cookie from browser\n * @param {string} cookieName - cookie name\n * @returns {string} cookie value\n */\nexport function getCookie(cookieName) {\n let name = cookieName + '=';\n let decodedCookie = decodeURIComponent(document.cookie);\n let ca = decodedCookie.split(';');\n for (let i = 0; i < ca.length; i++) { // eslint-disable-line no-plusplus\n let c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return '';\n}\n","/**\n * OOTB SFRA JS code\n */\n\nimport base from '../product/base';\nimport { queryFirst, addClass, removeClass, queryAll, remove, emptyCart, hasClass, scrollTo, throttle } from '../domUtil';\nimport { appendToUrl, getJSON, formatMessage, getNestedValue } from '../util';\nimport { trackCart } from '../components/etmc';\nimport { HIDDEN_CLASS, INVALID_CLASS } from '../constants';\nimport { checkAccountAndFetchDetail } from 'bolt/bolt/account';\nconst { cart: cartTemplates, approachingDiscounts: approachingDiscountsTemplates, promo: promoTemplates, emptySFL: emptySFLTemplates } = require('../templates');\nconst checkoutContainer = queryFirst('.data-checkout-stage');\nconst formValidation = require('base/components/formValidation');\nconst displayFlex = 'd-flex';\nconst selectedTabClass = 'sfl-tabs-selected';\nconst $body = $('body');\nconst loyaltyVoucherApplied = 'applied-reward-bg';\nconst lpRegisteredUserEmailEl = queryFirst('.registered-user-email');\nconst lpRegisteredUserEmail = lpRegisteredUserEmailEl ? lpRegisteredUserEmailEl.value : '';\nconst boltCheckoutAccountExistEl = queryFirst('.check-bolt-account-exist');\n\n/**\n * Displays cart error message\n * @param {string} message - Error message to display\n */\nfunction createErrorNotification(message) {\n const errorHtml = formatMessage(cartTemplates.errorMessage, message);\n $('.cart-container .cart-error')\n .empty()\n .append(errorHtml);\n}\n\n/**\n * Update the GWP HTML if contained in an ajax response\n * @param {Object} data The response data from an ajax call containing a 'gwpProductsHtml' attribute\n * @param {string} data.gwpProductsHtml The GWP HTML to insert\n */\nfunction updateGWP(data) {\n if ('gwpProductsHtml' in data) {\n $('.gwp-container-js, #checkout-main .gwp-container').html(data.gwpProductsHtml);\n }\n}\n\n/**\n * enable or disables the checkout button\n */\nfunction enableOrDisableCheckoutButton() {\n const checkoutButtonElement = queryFirst('.checkout-btn');\n\n if (!checkoutButtonElement) return;\n\n const expressCheckoutSection = queryFirst('.express-checkout-actions');\n const gwpProductsLength = queryAll('.gwp-option-bonus.product-info').length;\n const errorMessage = queryFirst('.cart-container .cart-error .cart-error-message');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n const oosProduct = queryFirst('.line-item-attributes.out-of-stock', (cartWithSFLElement || document));\n const chooseGwpMessage = queryFirst('.gwp-message');\n const monogramRestrictionLength = queryAll('.js-monogram-restriction').length;\n const numLowInventoryWarnings = queryAll('.low-inventory-warning').length;\n\n if (gwpProductsLength || errorMessage || oosProduct || monogramRestrictionLength || numLowInventoryWarnings) {\n addClass(checkoutButtonElement, 'disabled');\n checkoutButtonElement.removeAttribute('href');\n addClass(expressCheckoutSection, HIDDEN_CLASS);\n } else {\n removeClass(checkoutButtonElement, 'disabled');\n checkoutButtonElement.setAttribute('href', checkoutButtonElement.dataset.href);\n const grandTotalVal = queryFirst('.grand-total-value.grand-total');\n const cartPage = queryFirst('.cart-page');\n\n if (grandTotalVal && cartPage && grandTotalVal.textContent === cartPage.dataset.zeroTotal) {\n addClass(expressCheckoutSection, HIDDEN_CLASS);\n } else {\n removeClass(expressCheckoutSection, HIDDEN_CLASS);\n }\n }\n\n if (chooseGwpMessage) {\n if (gwpProductsLength && !errorMessage) {\n removeClass(chooseGwpMessage, HIDDEN_CLASS);\n } else {\n addClass(chooseGwpMessage, HIDDEN_CLASS);\n }\n }\n\n if (!hasClass(checkoutButtonElement, 'disabled')) {\n const boltCheckoutCtaEl = queryFirst('.bolt-checkout-wrapper');\n const { isBoltEnable, isBoltUserLoggedIn } = checkoutButtonElement.dataset;\n\n addClass(boltCheckoutCtaEl, HIDDEN_CLASS);\n\n if (isBoltEnable === 'true' && isBoltUserLoggedIn !== 'true' && lpRegisteredUserEmail && boltCheckoutAccountExistEl) {\n const checkBoltAccountUrl = boltCheckoutAccountExistEl.value + '=' + encodeURIComponent(lpRegisteredUserEmail);\n $.ajax({\n url: checkBoltAccountUrl,\n method: 'GET',\n success(data) {\n if (data && data.has_bolt_account) {\n removeClass(boltCheckoutCtaEl, HIDDEN_CLASS);\n }\n },\n error: function () { }\n });\n }\n }\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 createErrorNotification(data.valid.message);\n } else {\n emptyCart(data.resources.emptyCartMsg);\n $('.number-of-items').empty();\n $('.minicart-quantity')\n .empty()\n .append(data.numItems);\n $('.minicart .popover').empty();\n $('.minicart .popover').removeClass('show');\n }\n } else {\n const cartErrors = queryFirst('.cart-container .cart-error');\n if (cartErrors) {\n cartErrors.textContent = '';\n }\n }\n $('.minicart-link').attr({\n 'aria-label': data.resources.minicartCountOfItems,\n title: data.resources.minicartCountOfItems\n });\n\n const couponErrorMessage = queryFirst('.coupon-error-message');\n if (couponErrorMessage) {\n couponErrorMessage.textContent = '';\n }\n enableOrDisableCheckoutButton();\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 const { giftWrapQuantity, giftWrapTotalPrice, totals, giftWrapISPUTotalPrice, giftWrapISPUQuantity, numItems } = data;\n const giftWrapContainer = queryFirst('.gift-wrap-container');\n const giftWrapISPUContainer = queryFirst('.gift-wrap-ispu-container');\n const nonCouponContainer = queryFirst('.non-coupon-price-container');\n if (giftWrapContainer) {\n if (giftWrapQuantity > 0) {\n queryFirst('.gift-wrap-quantity', giftWrapContainer).textContent = giftWrapQuantity.toString();\n queryFirst('.gift-wrap-price', giftWrapContainer).textContent = giftWrapTotalPrice.toString();\n if (!hasClass(giftWrapContainer, displayFlex)) {\n removeClass(giftWrapContainer, HIDDEN_CLASS);\n addClass(giftWrapContainer, displayFlex);\n }\n } else {\n removeClass(giftWrapContainer, displayFlex);\n addClass(giftWrapContainer, HIDDEN_CLASS);\n }\n }\n if (giftWrapISPUContainer) {\n if (giftWrapISPUQuantity > 0) {\n const { freeprice } = giftWrapISPUContainer.dataset;\n queryFirst('.gift-wrap-ispu-quantity', giftWrapISPUContainer).textContent = giftWrapISPUQuantity.toString();\n queryFirst('.gift-wrap-ispu-price', giftWrapISPUContainer).textContent = giftWrapISPUTotalPrice.totalPrice == 0 ? freeprice : giftWrapISPUTotalPrice.formattedPrice.toString();\n if (!hasClass(giftWrapISPUContainer, displayFlex)) {\n removeClass(giftWrapISPUContainer, HIDDEN_CLASS);\n addClass(giftWrapISPUContainer, displayFlex);\n }\n } else {\n removeClass(giftWrapISPUContainer, displayFlex);\n addClass(giftWrapISPUContainer, HIDDEN_CLASS);\n }\n }\n const cartWithSFLCountTotal = queryFirst('.cart-items-count .item-count-tote');\n if (cartWithSFLCountTotal) {\n cartWithSFLCountTotal.textContent = numItems;\n }\n $('.number-of-items')\n .empty()\n .append(data.resources.numberOfItems);\n $('.grand-total')\n .empty()\n .append(data.totals.subTotal);\n $('.sub-total')\n .empty()\n .append(data.totals.totalAmount);\n $('.tax-total')\n .empty()\n .append(data.totals.totalTax);\n $('.minicart-quantity')\n .empty()\n .append(data.numItems);\n if (data.totals.orderLevelDiscountTotal.value > 0) {\n $('.order-discount').removeClass('hide-order-discount');\n $('.order-discount-total')\n .empty()\n .append('- ' + data.totals.orderLevelDiscountTotal.formatted);\n } else {\n $('.order-discount').addClass('hide-order-discount');\n }\n\n const cartErrors = queryAll('.cart-error');\n if (!data.valid.error) {\n addClass(cartErrors, HIDDEN_CLASS);\n } else {\n removeClass(cartErrors, HIDDEN_CLASS);\n }\n\n if (nonCouponContainer) {\n let nonCouponPromotionsHTML = '';\n if (totals.nonCouponBasedAdjustments && totals.nonCouponBasedAdjustments.length) {\n totals.nonCouponBasedAdjustments.forEach(function (couponItem) {\n nonCouponPromotionsHTML += formatMessage(approachingDiscountsTemplates.nonCouponBasedAdjustmentTemplate, couponItem.promoTitle, couponItem.discountPrice, couponItem.callOutMsg);\n });\n }\n nonCouponContainer.innerHTML = nonCouponPromotionsHTML;\n }\n\n data.items.forEach(function (item) {\n if (item.renderedPromotions) {\n $('.item-' + item.UUID)\n .empty()\n .append(item.renderedPromotions);\n }\n if (item.priceTotal && item.priceTotal.renderedPrice) {\n $('.item-total-' + item.UUID)\n .empty()\n .append(item.priceTotal.renderedPrice);\n }\n });\n}\n\n/**\n * re-renders the approaching discount messages\n * @param {Object} approachingDiscounts - updated approaching discounts for the cart\n * @param {Object} approachingDiscountsLabels - Approaching discount label description (contains show more / show less)\n */\nfunction updateApproachingDiscounts(approachingDiscounts, approachingDiscountsLabels) {\n let $approachingDiscountsEl = $('.approaching-discounts');\n if ((approachingDiscounts || []).length) {\n let html = '';\n let item = null;\n if (!$approachingDiscountsEl.length) {\n $('.discounts-section').append(approachingDiscountsTemplates.discountContainerTemplate);\n $approachingDiscountsEl = $('.approaching-discounts');\n } else {\n $approachingDiscountsEl.empty();\n }\n if (approachingDiscounts.length === 1) {\n item = approachingDiscounts[0].discountMsg;\n html += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, item);\n $approachingDiscountsEl.removeClass('multiple-approaching-discounts');\n } else if (approachingDiscounts.length > 1 && approachingDiscountsLabels) {\n item = approachingDiscounts[0].discountMsg;\n html += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, item);\n const remainingDiscounts = approachingDiscounts.slice(1, approachingDiscounts.length);\n let remainingDiscountsHtml = '';\n remainingDiscounts.forEach(function (discount) {\n remainingDiscountsHtml += formatMessage(approachingDiscountsTemplates.singleDiscountTemplate, discount.discountMsg);\n });\n html += formatMessage(approachingDiscountsTemplates.multipleDiscountsTemplate, remainingDiscountsHtml, approachingDiscountsLabels.showMore, approachingDiscountsLabels.showLess);\n $approachingDiscountsEl.addClass('multiple-approaching-discounts');\n }\n $approachingDiscountsEl.append(html);\n } else {\n $approachingDiscountsEl.remove();\n }\n}\n\n/**\n * Updates the availability of a product line item\n * @param {Object} data - AJAX response from the server\n * @param {string} uuid - The uuid of the product line item to update\n */\nfunction updateAvailability(data, uuid) {\n var lineItem;\n var messages = '';\n\n for (var i = 0; i < data.items.length; i++) {\n if (data.items[i].UUID === uuid) {\n lineItem = data.items[i];\n break;\n }\n }\n\n $('.availability-' + lineItem.UUID).empty();\n\n if (lineItem.availability) {\n if (lineItem.availability.messages) {\n lineItem.availability.messages.forEach(function (message) {\n messages += `

${message}

`;\n });\n }\n }\n\n $('.availability-' + lineItem.UUID).html(messages);\n}\n\n/**\n * Finds an element in the array that matches search parameter\n * @param {array} array - array of items to search\n * @param {function} match - function that takes an element and returns a boolean indicating if the match is made\n * @returns {Object|null} - returns an element of the array that matched the query.\n */\nfunction findItem(array, match) {\n for (var i = 0, l = array.length; i < l; i++) {\n if (match.call(this, array[i])) {\n return array[i];\n }\n }\n return null;\n}\n\n/**\n * Updates details of a product line item\n * @param {Object} data - AJAX response from the server\n * @param {string} uuid - The uuid of the product line item to update\n * @param {boolean} giftWrapAvailable - flag to check gift wrap applicability\n */\nfunction updateProductDetails(data, uuid, giftWrapAvailable) {\n var lineItem = findItem(data.cartModel.items, function (item) {\n return item.UUID === uuid;\n });\n\n if (lineItem.variationAttributes) {\n var colorAttr = findItem(lineItem.variationAttributes, function (attr) {\n return attr.attributeId === 'color';\n });\n\n if (colorAttr) {\n var colorSelector = '.Color-' + uuid;\n $(colorSelector)\n .find('.line-item-text')\n .text(colorAttr.displayValue);\n }\n\n var sizeAttr = findItem(lineItem.variationAttributes, function (attr) {\n return attr.attributeId === 'size';\n });\n\n if (sizeAttr) {\n var sizeSelector = '.Size-' + uuid;\n $(sizeSelector)\n .find('.line-item-text')\n .text(sizeAttr.displayValue);\n }\n\n const { newProductId } = data || {};\n if (newProductId) {\n const skuElement = queryFirst(`.sku-${uuid}`);\n const skuLabel = skuElement && skuElement.dataset.skuLabel;\n\n if (skuElement && skuLabel) {\n skuElement.textContent = `${skuLabel} ${newProductId}`;\n }\n }\n\n var imageSelector = '.card.product-info.uuid-' + uuid + ' .item-image > img';\n $(imageSelector).attr('src', lineItem.images.small[0].url);\n $(imageSelector).attr('srcset', lineItem.images.small[0].srcset);\n $(imageSelector).attr('alt', lineItem.images.small[0].alt);\n $(imageSelector).attr('title', lineItem.images.small[0].title);\n }\n\n if (lineItem.options && lineItem.options.length) {\n var option = lineItem.options[0];\n var optSelector = '.lineItem-options-values[data-option-id=\"' + option.optionId + '\"]';\n $(optSelector).attr('data-value-id', option.selectedValueId);\n $(optSelector + ' .line-item-attributes').text(option.displayName);\n }\n\n var qtySelector = '.quantity[data-uuid=\"' + uuid + '\"]';\n $(qtySelector).val(lineItem.quantity);\n $(qtySelector).data('pid', data.newProductId);\n\n $('.remove-product[data-uuid=\"' + uuid + '\"], .move-to-wishlist-' + uuid + ' a, .gift-wrap-input[data-uuid=\"' + uuid + '\"], .btn-in-store-pickup[data-uuid=\"' + uuid + '\"], .home-delivery-link[data-uuid=\"' + uuid + '\"], .quantity[data-uuid=\"' + uuid + '\"], .cart-product-line-item[data-uuid=\"' + uuid + '\"]').attr(\n 'data-pid',\n data.newProductId\n );\n const cartStoreLinksSelector = '.product-info.uuid-' + uuid + ' .cart-store-links';\n if (giftWrapAvailable === 'false') {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', false);\n $(cartStoreLinksSelector + ' form').addClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').addClass(HIDDEN_CLASS);\n } else if ($(cartStoreLinksSelector).closest('.cart-pickup-products').length === 0) {\n $(cartStoreLinksSelector + ' form').removeClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').removeClass(HIDDEN_CLASS);\n }\n\n var priceSelector = '.line-item-price-' + uuid + ' .sales .value';\n $(priceSelector).text(lineItem.price.sales.formatted);\n $(priceSelector).attr('content', lineItem.price.sales.decimalPrice);\n\n if (lineItem.price.list) {\n var listPriceSelector = '.line-item-price-' + uuid + ' .list .value';\n $(listPriceSelector).text(lineItem.price.list.formatted);\n $(listPriceSelector).attr('content', lineItem.price.list.decimalPrice);\n }\n\n if (lineItem.isGiftCard) {\n const { giftCardAmount } = lineItem;\n\n const giftCardHiddenAmountField = queryFirst(`.product-info.uuid-${uuid} .gift-card-amount`);\n if (giftCardHiddenAmountField) {\n giftCardHiddenAmountField.value = giftCardAmount;\n }\n\n queryAll(`.move-to-wishlist-${uuid} .move`).forEach(el => {\n el.dataset.giftCardAmount = giftCardAmount;\n });\n queryFirst(`.remove-product-${uuid}`).dataset.giftCardAmount = giftCardAmount;\n }\n}\n\n/**\n * This method sets the data of line item to be deleted in the delete confirmation modal\n * @param {string} actionUrl - url to be used to remove product\n * @param {string} productID - pid\n * @param {string} productName - product name\n * @param {string} uuid - uuid\n */\nfunction confirmDelete(actionUrl, productID, productName, uuid, tealium = '{}') {\n const deleteConfirmBtn = queryFirst('.cart-page .cart-delete-confirmation-btn');\n deleteConfirmBtn.dataset.pid = productID;\n deleteConfirmBtn.dataset.action = actionUrl;\n deleteConfirmBtn.dataset.uuid = uuid;\n deleteConfirmBtn.dataset.name = productName;\n deleteConfirmBtn.dataset.tealium = tealium;\n}\n\n/**\n * Lilly Customization changes start\n */\n\n/**\n * Update promo code details\n * @param {array} discounts - updated discounts data\n * @param {Object} shippingMethod - Shipping method detail object\n */\nfunction updatePromoCodeDetails(discounts, shippingMethod) {\n const promotionsListContainer = queryFirst('.promo-code-section');\n const cartShippingMethodContainer = queryFirst('.cart-shipping-method');\n const checkoutShippingMethodContainer = queryFirst('.shipping-method-price-container');\n const checkoutShippingMethodTitle = queryFirst('.shipping-method-title');\n let promotionsHtml = '';\n if (discounts && discounts.length) {\n const promoTemplate = document.getElementById('promo-code-details-template').cloneNode(true);\n const promoContainer = queryFirst('.price-container', promoTemplate);\n const promoText = queryFirst('.price-text', promoContainer);\n const promoTitle = promoText.dataset.promoTitle;\n const promoValue = queryFirst('.price-value', promoContainer);\n const description = queryFirst('.promo-description', promoContainer);\n discounts.forEach(eachDiscount => {\n if (eachDiscount.type === 'coupon' && eachDiscount.applied) {\n const couponData = eachDiscount.relationship;\n promoText.textContent = `${promoTitle} ${eachDiscount.couponCode}`;\n if (couponData && couponData.length) {\n promoValue.textContent = eachDiscount.totalPrice;\n description.textContent = couponData[0].name;\n } else {\n promoValue.textContent = '';\n description.textContent = '';\n }\n promotionsHtml += promoTemplate.innerHTML;\n }\n });\n if (cartShippingMethodContainer) {\n if (shippingMethod && shippingMethod.isDiscounted) {\n cartShippingMethodContainer.innerHTML = formatMessage(promoTemplates.shippingMethod, shippingMethod.shippingLabel, shippingMethod.displayName, shippingMethod.shippingCost, shippingMethod.estimatedArrivalTime);\n } else {\n cartShippingMethodContainer.innerHTML = '';\n }\n }\n\n if (checkoutShippingMethodContainer) {\n if (shippingMethod && shippingMethod.isDiscounted) {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutDiscountShipping, shippingMethod.shippingCost, shippingMethod.adjustedShippingCost);\n } else {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutNormalShipping, shippingMethod.shippingCost);\n }\n }\n } else if (cartShippingMethodContainer) {\n cartShippingMethodContainer.innerHTML = '';\n } else if (checkoutShippingMethodContainer) {\n checkoutShippingMethodContainer.innerHTML = formatMessage(promoTemplates.checkoutNormalShipping, shippingMethod.shippingCost);\n }\n if (checkoutShippingMethodTitle) {\n checkoutShippingMethodTitle.innerHTML = shippingMethod.displayName;\n }\n if (promotionsListContainer) {\n promotionsListContainer.innerHTML = promotionsHtml;\n }\n}\n\n/**\n * This function updates Form Object for Gift card values\n * @param {Object} formObject - object to edit to add gift card amount\n * @param {HTMLElement} formEl - form node to fetch gift card amount\n */\nfunction updateFormObjectForGiftCard(formObject, formEl) {\n const amountField = queryFirst('.gift-card-amount', formEl);\n\n if (amountField) {\n formObject.giftCardAmount = amountField.value;\n }\n}\n\n/**\n * updates the monogram elements on cart page\n * @param {Object} data - update quantity and remove from cart ajax response\n */\nfunction updateMonogramDetails(data) {\n const { monogramPrice, monogramQuantity } = data;\n const monogramContainer = queryFirst('.cart-totals .monogram-container');\n if (monogramContainer) {\n queryFirst('.price-value', monogramContainer).textContent = monogramPrice;\n\n queryFirst('.monogram-quantity', monogramContainer).textContent = monogramQuantity;\n if (!monogramQuantity) {\n addClass(monogramContainer, 'd-none');\n } else {\n removeClass(monogramContainer, 'd-none');\n }\n }\n}\n\n/**\n * toggle cart summary section in mobile and when tab switched from SFL to MY Tote and vice-versa\n */\nfunction hideShowSummarySection() {\n const sflTabElement = queryFirst('.save-for-later-tab');\n const sflCartElement = queryFirst('.cart-sfl-summary');\n const isCartEmpty = queryFirst('.js-cart-empty');\n const isSFLSelected = hasClass(sflTabElement, selectedTabClass);\n if (window.matchMedia('(max-width: 768px)').matches) {\n if (isSFLSelected) {\n addClass(sflCartElement, HIDDEN_CLASS);\n } else if (!isCartEmpty || hasClass(isCartEmpty, HIDDEN_CLASS)) {\n removeClass(sflCartElement, HIDDEN_CLASS);\n }\n }\n else if (!isCartEmpty || hasClass(isCartEmpty, HIDDEN_CLASS)) {\n removeClass(sflCartElement, HIDDEN_CLASS);\n }\n}\n/**\n * updates the Save for later on cart page\n * @param {Object} data - add product to tote from SFL cart ajax response\n */\nfunction updateSaveForLaterDetails(data) {\n const { saveForLaterHtml, sflCountMsg, count, isLoggedIn } = data;\n const sflProductElement = queryFirst('.sfl-cart-products');\n const sflTitleCount = queryFirst('.number-of-items-sfl');\n const signInSFLBottomEl = queryFirst('.sfl-login-wrapper');\n const moveAllToCartCTA = queryFirst('.move-all-items-to-tote');\n\n if (sflProductElement) {\n sflProductElement.innerHTML = saveForLaterHtml;\n }\n\n if (sflTitleCount) {\n sflTitleCount.textContent = sflCountMsg;\n }\n if (count === 0) {\n addClass([signInSFLBottomEl, moveAllToCartCTA], HIDDEN_CLASS);\n hideShowSummarySection();\n if (isLoggedIn) {\n const loginSFL = queryFirst('.sfl-login-btn');\n addClass(loginSFL, HIDDEN_CLASS);\n }\n }\n}\n/**\n * Updates the loyalty rewards and offers in cart and checkout page\n * @param {Object} summarySection - Rewards or Offers Section\n * @param {Object} couponData - data of the rewards or offers\n * @param {number} couponCount - count of redeemed rewards/offers\n * @param {string} couponPrice - total price of redeemed rewards/offers\n * @param {string} ctaClass - wrapper class for apply and remove CTAs in offers and rewards\n */\nfunction updateLoyaltyRewardsOffers(summarySection, couponData, couponCount, couponPrice, ctaClass) {\n if (couponCount) {\n removeClass(summarySection, HIDDEN_CLASS);\n const redeemedCouponCountEl = queryFirst('.loyalty-cart-reward-quantity', summarySection);\n const redeemedCouponPriceEl = queryFirst('.loyalty-cart-reward-price', summarySection);\n redeemedCouponCountEl.textContent = couponCount;\n redeemedCouponPriceEl.textContent = couponPrice;\n queryAll(ctaClass).forEach((el) => {\n const { voucherCode } = el.dataset;\n const removeCouponCta = queryFirst('.remove-voucher-tote-cta', el);\n const applyCouponCta = queryFirst('.apply-voucher-tote-cta', el);\n const couponCardEl = el.closest('.voucher-card-content');\n const matchingCoupon = couponData.find(voucher => voucher.code === voucherCode);\n if (matchingCoupon) {\n const { applied, UUID } = matchingCoupon;\n if (applied) {\n removeClass(removeCouponCta, HIDDEN_CLASS);\n addClass(applyCouponCta, HIDDEN_CLASS);\n addClass(couponCardEl, loyaltyVoucherApplied);\n el.dataset.uuid = UUID;\n } else {\n addClass(removeCouponCta, HIDDEN_CLASS);\n removeClass(applyCouponCta, HIDDEN_CLASS);\n removeClass(couponCardEl, loyaltyVoucherApplied);\n }\n }\n });\n } else {\n queryAll(ctaClass).forEach((el) => {\n const removeCouponCta = queryFirst('.remove-voucher-tote-cta', el);\n const applyCouponCta = queryFirst('.apply-voucher-tote-cta', el);\n const couponCardEl = el.closest('.voucher-card-content');\n addClass(removeCouponCta, HIDDEN_CLASS);\n removeClass(applyCouponCta, HIDDEN_CLASS);\n removeClass(couponCardEl, loyaltyVoucherApplied);\n });\n addClass(summarySection, HIDDEN_CLASS);\n }\n}\n\n/**\n * updates the loyalty vouchers on cart page\n * @param {Object} data - add product to tote from SFL cart ajax response\n */\nfunction updateLoyaltyVouchers(data) {\n const { loyalty, subTotal } = data.totals;\n if (loyalty) {\n const { memberVouchers, memberOffers, redeemedVouchersCount, redeemedVoucherPrice, redeemedOffersCount, redeemedOffersPrice } = loyalty;\n const loyaltyVouchersSummarySection = queryFirst('.loyalty-cart-reward-section');\n const loyaltyOffersSummarySection = queryFirst('.loyalty-cart-offer-section');\n const applyVoucherCtas = queryAll('.apply-voucher-tote-cta');\n if (loyaltyVouchersSummarySection) {\n updateLoyaltyRewardsOffers(loyaltyVouchersSummarySection, memberVouchers, redeemedVouchersCount, redeemedVoucherPrice, '.js-vouchers-cta');\n }\n if (loyaltyOffersSummarySection) {\n updateLoyaltyRewardsOffers(loyaltyOffersSummarySection, memberOffers, redeemedOffersCount, redeemedOffersPrice, '.js-offers-cta');\n }\n applyVoucherCtas.forEach((applyCta) => {\n const voucherCardContentEl = applyCta.closest('.voucher-card-content');\n const voucherCardDisabledClass = 'voucher-card-disabled';\n if (subTotal === '$0' && !hasClass(applyCta, HIDDEN_CLASS)) {\n applyCta.disabled = true;\n addClass(voucherCardContentEl, voucherCardDisabledClass);\n } else {\n applyCta.disabled = false;\n removeClass(voucherCardContentEl, voucherCardDisabledClass);\n }\n });\n }\n}\n/**\n * Handle the spacing in Promo Section\n */\nfunction couponsAndPromotionSpacingHandle() {\n const promoAccordionEl = queryFirst('.promo-accordion-container');\n if (promoAccordionEl) {\n const couponsAndPromos = queryFirst('.coupons-and-promos', promoAccordionEl);\n const couponItems = queryFirst('.coupon-price-adjustment', couponsAndPromos);\n const couponCodeField = queryFirst('.coupon-code-field');\n const couponError = queryFirst('.coupon-error');\n if (!couponItems) {\n addClass(couponsAndPromos, 'mt-0');\n addClass(couponCodeField, 'mb-2');\n removeClass(couponError, 'mt-2');\n } else {\n const couponErrorMessageEl = queryFirst('.coupon-error-message');\n const couponMissingErrorEl = queryFirst('.coupon-missing-error');\n addClass(couponError, 'mt-2');\n removeClass(couponsAndPromos, 'mt-0');\n if (couponErrorMessageEl && !couponErrorMessageEl.textContent && couponMissingErrorEl && couponMissingErrorEl.style.display === 'none') {\n removeClass(couponCodeField, 'is-invalid');\n }\n removeClass(couponCodeField, 'mb-2');\n }\n }\n}\n\n/**\n * Get the account details for Bolt User\n * @param {string} checkoutUrl - URL to redirect to Checkout page if error comes from the API call\n */\nfunction fetchBoltAccountDetails(checkoutUrl) {\n const accountDetailUrl = queryFirst('.get-bolt-account-details').value;\n $.ajax({\n url: accountDetailUrl,\n method: 'GET',\n success: function ({ success, redirectUrl }) {\n //Remove the bolt logout cookie\n document.cookie = 'bolt_sfcc_session_logout=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';\n window.location.href = (success && redirectUrl) || checkoutUrl;\n },\n error: function () {\n window.location.href = checkoutUrl;\n }\n });\n}\n/**\n * Lilly Customization changes end\n */\n\n/**\n * Initializes the event handlers\n */\nfunction init() {\n $body.on('click', '.cart-nav-list.save-for-later-tab, .see-items-sfl', function (e) {\n const sflTab = queryFirst('.cart-nav-list.save-for-later-tab');\n if (!hasClass(sflTab, selectedTabClass)) {\n const myToteTab = queryFirst('.cart-nav-list.my-tote-tab');\n let toTab = 'saved for later';\n removeClass(myToteTab, selectedTabClass);\n addClass(sflTab, selectedTabClass);\n hideShowSummarySection();\n const queryParam = { view: 'saved' };\n const cartUrl = location.href;\n const urlWithParam = appendToUrl(cartUrl, queryParam);\n if (hasClass(this, 'js-see-items-sfl')) {\n const selectSFLTab = queryFirst('.js-save-for-later-select');\n const selectSFLContent = queryFirst('#saveForLater');\n const selectedMyToteTab = queryFirst('.js-my-tote-selected');\n const selectedMyToteContent = queryFirst('#myTote');\n removeClass([selectedMyToteTab, selectedMyToteContent], 'active');\n addClass([selectSFLTab, selectSFLContent], 'active');\n scrollTo($body.offset().top, 0);\n toTab += ': see items';\n }\n history.replaceState({}, '', urlWithParam);\n $body.trigger('tote:selectTab', { fromTab: 'my tote', toTab });\n }\n });\n\n $body.on('click', '.cart-nav-list.my-tote-tab', function (e) {\n if (!hasClass(this, selectedTabClass)) {\n const safeForLaterTab = queryFirst('.cart-nav-list.save-for-later-tab');\n removeClass(safeForLaterTab, selectedTabClass);\n addClass(this, selectedTabClass);\n hideShowSummarySection();\n history.replaceState({}, '', location.href.split('?')[0]);\n $body.trigger('tote:selectTab', { fromTab: 'saved for later', toTab: 'my tote' });\n }\n });\n\n $body.on('click', '.move-to-sfl', function (e) {\n e.preventDefault();\n $.spinner().start();\n const { href, actionUrl, pid, quantity, name, uuid, isGiftCard, isMonogram, giftCardAmount, monogramColor, monogramLocation, monogramStyle,\n monogramLetter1, monogramLetter2, monogramLetter3, monogramInitials, giftCardRecipientEmail, giftCardRecipientName, giftCardSenderName, giftCardEmailMessage } = this.dataset;\n const monogramOptions = {\n itemPersonalizationColor: monogramColor,\n itemPersonalizationLocation: monogramLocation,\n itemPersonalizationLetterStyle: monogramStyle,\n itemPersonalizationLetter1: monogramLetter1,\n itemPersonalizationLetter2: monogramLetter2,\n itemPersonalizationLetter3: monogramLetter3,\n itemPersonalizationLetters: monogramInitials\n }\n\n const form = {\n pid,\n qty: quantity,\n isGiftCard,\n isMonogram,\n giftCardAmount,\n monogramOptions: JSON.stringify(monogramOptions),\n giftCardRecipientEmail,\n giftCardRecipientName,\n giftCardSenderName,\n giftCardEmailMessage\n };\n $.ajax({\n url: href,\n type: 'post',\n data: form,\n dataType: 'json',\n success: function (data) {\n if (data.success) {\n const { count, isLoggedIn } = data;\n const signInSFLBottomWrapperEl = queryFirst('.sfl-login-wrapper');\n const signInSFLBottomEl = queryFirst('.sfl-sign-in');\n confirmDelete(actionUrl, pid, name, uuid);\n $('.cart-page .cart-delete-confirmation-btn').trigger('click');\n if (count !== 0) {\n if (!isLoggedIn) {\n removeClass([signInSFLBottomEl, signInSFLBottomWrapperEl], HIDDEN_CLASS);\n }\n }\n }\n else {\n $.spinner().stop();\n }\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.remove-sfl-product', function (e) {\n e.preventDefault();\n const { action, pid, name, uuid, quantity } = this.dataset;\n const url = appendToUrl(action, { pid, uuid, qty: quantity });\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n $.spinner().stop();\n if (data.success) {\n const { count, emptySFLMsg, continueShopURL, continueShopMsg, signInMsg, isLoggedIn, signInSFLURL } = data;\n const signInSFLBottomEl = queryFirst('.sfl-login-wrapper');\n const itemsCountSFL = queryFirst('.cart-items-count .item-count-sfl');\n const numberItemsSFL = queryFirst('.number-of-items-sfl');\n const removedSFLProductCard = queryFirst('.sfl-product-info.uuid-' + uuid);\n itemsCountSFL.textContent = count;\n numberItemsSFL.textContent = count;\n removedSFLProductCard.remove();\n if (count === 0) {\n const moveAllToCartCTA = queryFirst('.move-all-items-to-tote');\n const sflProductCardItems = queryFirst('.sfl-cart-products');\n addClass(moveAllToCartCTA, HIDDEN_CLASS);\n const emptySFLMarkup = emptySFLTemplates(emptySFLMsg, continueShopURL, continueShopMsg, signInMsg, signInSFLURL);\n sflProductCardItems.outerHTML = emptySFLMarkup;\n const loginSFLBtn = queryFirst('.sfl-empty .sfl-login-btn');\n if (isLoggedIn) {\n addClass(loginSFLBtn, HIDDEN_CLASS);\n }\n else {\n addClass(signInSFLBottomEl, HIDDEN_CLASS);\n removeClass(loginSFLBtn, HIDDEN_CLASS);\n }\n }\n }\n },\n error: function (err) {\n $.spinner().stop();\n }\n });\n confirmDelete(action, pid, name, uuid);\n });\n\n $body.on('click', '.remove-product', function (e) {\n e.preventDefault();\n const { action, pid, name, uuid, tealium } = this.dataset;\n confirmDelete(action, pid, name, uuid, tealium);\n });\n\n $body.on('afterRemoveFromCart', function (e, data) {\n e.preventDefault();\n const { actionUrl, productID, productName, uuid } = data;\n confirmDelete(actionUrl, productID, productName, uuid);\n });\n\n $('.cart-container, .mini-cart-container').on('cart:updateTotals', function (e, data) {\n const { basket } = data;\n const { bonusProductLineItems } = basket;\n updateCartTotals(basket, true);\n if (bonusProductLineItems) {\n const { nonOptionBonusProducts = [], hasOptionBonusProducts } = bonusProductLineItems;\n\n const hasNonOptionsBonusProducts = !!nonOptionBonusProducts.length;\n const hasBonusProduct = hasNonOptionsBonusProducts || hasOptionBonusProducts;\n\n if (!hasNonOptionsBonusProducts) {\n remove(queryAll('.gwp-no-option-bonus'));\n }\n\n if (!hasOptionBonusProducts) {\n remove(queryAll('.gwp-option-bonus'));\n }\n\n if (!hasBonusProduct) {\n remove(queryAll('.gwp-container'));\n }\n }\n enableOrDisableCheckoutButton();\n });\n\n $body.on('click', '.cart-page .cart-delete-confirmation-btn', function (e) {\n e.preventDefault();\n const { target } = e;\n const { pid, action, uuid } = target.dataset;\n const urlParams = { pid, uuid };\n const url = appendToUrl(action, urlParams);\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n const storePickupGroupElement = cartProductCard.closest('.store-pickup-group');\n const cartShipProductsEl = cartProductCard.closest('.cart-ship-products');\n $('body > .modal-backdrop').remove();\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n updateGWP(data);\n const { saveForLater, isSFLEnabled, basket, saveForLaterHtml } = data;\n if (isSFLEnabled) {\n const productCountSFL = saveForLater.count || 0;\n const cartSummaryEl = queryFirst('.cart-sfl-summary');\n const cartWithSFLItemsTotal = queryFirst('.cart-items-count .item-count-tote');\n if (cartWithSFLItemsTotal) {\n cartWithSFLItemsTotal.textContent = basket.numItems;\n }\n $('.cart-items-count .item-count-sfl')\n .empty()\n .append(productCountSFL);\n $('.number-of-items-sfl')\n .empty()\n .append(productCountSFL);\n if (basket.items.length === 0) {\n addClass(cartSummaryEl, HIDDEN_CLASS);\n }\n else {\n removeClass(cartSummaryEl, HIDDEN_CLASS);\n }\n\n if (saveForLater && getNestedValue(saveForLater, 'items.length')) {\n const sflCartProducts = queryFirst('.sfl-cart-products');\n if (sflCartProducts) {\n sflCartProducts.innerHTML = saveForLaterHtml;\n }\n }\n }\n if (basket.items.length === 0) {\n if (isSFLEnabled) {\n const emptyCartWithSFLElement = queryFirst('.js-cart-container .js-cart-empty');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n removeClass(emptyCartWithSFLElement, HIDDEN_CLASS);\n addClass(cartWithSFLElement, HIDDEN_CLASS);\n }\n else {\n emptyCart(basket.resources.emptyCartMsg);\n }\n $('.number-of-items').empty();\n $('.minicart-quantity')\n .empty()\n .append(data.basket.numItems);\n $('.minicart-link').attr({\n 'aria-label': data.basket.resources.minicartCountOfItems,\n title: data.basket.resources.minicartCountOfItems\n });\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 $('.uuid-' + uuid).remove();\n $('.coupons-and-promos')\n .empty()\n .append(data.basket.totals.discountsHtml);\n updatePromoCodeDetails(data.basket.totals.discounts, data.basket.selectedShippingMethod);\n updateCartTotals(data.basket);\n updateLoyaltyVouchers(data.basket);\n updateApproachingDiscounts(data.basket.approachingDiscounts, data.basket.approachingDiscountsLabels);\n const { updatedStoreQuantity, storeGroupMessage, enablePayPal } = data.basket;\n if (cartShipProductsEl && !queryFirst('.cart-product-line-item', cartShipProductsEl)) {\n cartShipProductsEl.remove();\n }\n\n const paypalContainerEl = queryFirst('.checkout-continue');\n if (paypalContainerEl) {\n if (enablePayPal) {\n removeClass(paypalContainerEl, HIDDEN_CLASS);\n } else {\n addClass(paypalContainerEl, HIDDEN_CLASS);\n }\n }\n\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n } else if (storePickupGroupElement) {\n storePickupGroupElement.remove();\n }\n\n if (data.basket.inStoreProductLineItems && !data.basket.inStoreProductLineItems.length) {\n addClass(queryFirst('.cart-pickup-products'), HIDDEN_CLASS);\n addClass(queryFirst('.mini-cart-store-title'), HIDDEN_CLASS);\n }\n $body.trigger('setShippingMethodSelection', data.basket);\n\n $('.cart-container, .mini-cart-container').trigger('cart:updateTotals', data);\n validateBasket(data.basket);\n updateMonogramDetails(data.basket);\n }\n\n $body.trigger('cart:update');\n const applePayButton = queryFirst('.dw-apple-pay-button');\n if (data.basket.enableApplePay) {\n removeClass(applePayButton, HIDDEN_CLASS);\n } else {\n addClass(applePayButton, HIDDEN_CLASS);\n }\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\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\n $body.on('change', '.quantity-form > .quantity', function () {\n const self = this;\n const $this = $(self);\n var preSelectQty = $this.data('pre-select-qty');\n var quantity = $this.val();\n var productID = $this.data('pid');\n var url = $this.data('action');\n var uuid = $this.data('uuid');\n const storeId = $this.data('store-id');\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n const storePickupGroupElement = cartProductCard.closest('.store-pickup-group');\n var urlParams = {\n pid: productID,\n quantity: quantity,\n uuid: uuid,\n storeId\n };\n url = appendToUrl(url, urlParams);\n const origPositionY = self.getBoundingClientRect().y;\n $this\n .parents('.card')\n .spinner()\n .start();\n\n $.ajax({\n url: url,\n type: 'get',\n context: this,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n $(this).val(parseInt(preSelectQty, 10));\n }\n $.spinner().stop();\n } else {\n $('.quantity[data-uuid=\"' + uuid + '\"]').val(quantity);\n const { updatedStoreQuantity, storeGroupMessage, cartProductsHtml } = data;\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n }\n const lineItem = data.items.find(element => element.UUID === uuid);\n if (lineItem && !storePickupGroupElement) {\n const { giftWrapAvailableFlag, hasGiftWrap } = lineItem;\n const cartStoreLinksSelector = '.product-info.uuid-' + uuid + ' .cart-store-links';\n if (!giftWrapAvailableFlag) {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', false);\n $(cartStoreLinksSelector + ' form').addClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').addClass(HIDDEN_CLASS);\n } else {\n $('.gift-wrap-input[data-uuid=\"' + uuid + '\"]').prop('checked', hasGiftWrap);\n $(cartStoreLinksSelector + ' form').removeClass(HIDDEN_CLASS);\n $(cartStoreLinksSelector + ' .seperator').removeClass(HIDDEN_CLASS);\n }\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n updateGWP(data);\n updateMonogramDetails(data);\n validateBasket(data);\n\n $body.trigger('cart:update');\n\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\n $.spinner().stop();\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n const { errorMessage } = err.responseJSON;\n createErrorNotification(errorMessage);\n $(this).val(parseInt(preSelectQty, 10));\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('click', '.apply-voucher-tote-cta', function (e) {\n e.preventDefault();\n const applyRewardEl = this;\n const voucherCardEl = this.closest('.voucher-card-content');\n const removeRewardEl = queryFirst('.remove-voucher-tote-cta', voucherCardEl);\n const { couponCode } = voucherCardEl.dataset;\n const csrfTokenInput = queryFirst('.csrf-token', voucherCardEl);\n let csrfToken;\n if (csrfTokenInput) {\n csrfToken = csrfTokenInput.value;\n }\n $.spinner().start();\n $.ajax({\n url: this.dataset.action,\n type: 'POST',\n dataType: 'json',\n data: { csrf_token: csrfToken, couponCode },\n success: function (data) {\n if (data.error) {\n const promoCodeFormControlEl = queryFirst('.promo-code-form .form-control');\n addClass(promoCodeFormControlEl, INVALID_CLASS);\n promoCodeFormControlEl.setAttribute('aria-describedby', 'invalidCouponCode');\n $('.coupon-missing-error').hide();\n couponsAndPromotionSpacingHandle();\n $(queryFirst('.coupon-error-message'))\n .empty()\n .append(data.errorMessage);\n $.spinner().stop();\n } else {\n const { loyalty, discounts, discountsHtml } = data.totals;\n if (loyalty && (loyalty.redeemedVouchersCount || loyalty.redeemedOffersCount)) {\n addClass(applyRewardEl, HIDDEN_CLASS);\n removeClass(removeRewardEl, HIDDEN_CLASS);\n addClass(voucherCardEl, loyaltyVoucherApplied);\n const { memberVouchers, memberOffers } = loyalty;\n const voucherCardCtaEl = applyRewardEl.closest('.js-vouchers-cta');\n const offerCardCtaEl = applyRewardEl.closest('.js-offers-cta');\n if (voucherCardCtaEl) {\n const { voucherCode } = voucherCardCtaEl.dataset;\n memberVouchers.forEach(voucher => {\n const { applied, code } = voucher;\n if (applied && code === voucherCode) {\n voucherCardCtaEl.dataset.uuid = voucher.UUID;\n }\n });\n }\n if (offerCardCtaEl) {\n const { voucherCode } = offerCardCtaEl.dataset;\n memberOffers.forEach(offer => {\n const { applied, code } = offer;\n if (applied && code === voucherCode) {\n offerCardCtaEl.dataset.uuid = offer.UUID;\n }\n });\n }\n updateLoyaltyVouchers(data);\n if (discounts) {\n updateGWP(data);\n updatePromoCodeDetails(discounts, data.selectedShippingMethod);\n }\n updateCartTotals(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n }\n $('.coupons-and-promos')\n .empty()\n .append(discountsHtml);\n $.spinner().stop();\n }\n },\n error: function (err) {\n if (err.responseJSON && err.responseJSON.csrfError) {\n $body.trigger('csrf:error');\n } else {\n createErrorNotification(err.errorMessage);\n }\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.remove-voucher-tote-cta', function (e) {\n e.preventDefault();\n const removeRewardEl = this;\n const voucherCardEl = this.closest('.voucher-card-content');\n const voucherCardCtaEl = queryFirst('.js-vouchers-cta', voucherCardEl);\n const offerCardCtaEl = queryFirst('.js-offers-cta', voucherCardEl);\n const applyRewardEl = queryFirst('.apply-voucher-tote-cta', voucherCardEl);\n const { action } = this.dataset;\n const { uuid, voucherCode } = voucherCardCtaEl ? voucherCardCtaEl.dataset : offerCardCtaEl.dataset;\n const url = appendToUrl(action, { code: voucherCode, uuid });\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n const { discounts } = data.totals;\n addClass(removeRewardEl, HIDDEN_CLASS);\n removeClass(applyRewardEl, HIDDEN_CLASS);\n removeClass(voucherCardEl, loyaltyVoucherApplied);\n updateLoyaltyVouchers(data);\n updateGWP(data);\n updateCartTotals(data);\n if (discounts) {\n updatePromoCodeDetails(discounts, data.selectedShippingMethod);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n $.spinner().stop();\n }\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\n $('.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 $('.promo-code-form .form-control').addClass('is-invalid');\n $('.promo-code-form .form-control').attr('aria-describedby', 'missingCouponCode');\n $('.coupon-missing-error').show();\n couponsAndPromotionSpacingHandle();\n $.spinner().stop();\n return false;\n }\n var $form = $('.promo-code-form');\n $('.promo-code-form .form-control').removeClass('is-invalid');\n $('.coupon-error-message').empty();\n\n $.ajax({\n url: $form.attr('action'),\n type: 'POST',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n queryFirst('.coupon-code-field').value = '';\n if (data.error) {\n $('.promo-code-form .form-control').addClass('is-invalid');\n $('.promo-code-form .form-control').attr('aria-describedby', 'invalidCouponCode');\n $('.coupon-error-message')\n .empty()\n .append(data.errorMessage);\n } else {\n updateGWP(data);\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n }\n if (!checkoutContainer) {\n $('.cart-container').trigger('add-coupon', data);\n } else {\n $(checkoutContainer).trigger('add-coupon', data);\n }\n couponsAndPromotionSpacingHandle();\n $.spinner().stop();\n },\n error: function (err) {\n if (err.responseJSON && err.responseJSON.csrfError) {\n $body.trigger('csrf:error');\n } else {\n createErrorNotification(err.errorMessage);\n }\n $.spinner().stop();\n }\n });\n return false;\n });\n\n $body.on('click', '.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 $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n success: function (data) {\n updateGWP(data);\n $('.coupon-uuid-' + uuid).remove();\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n updateCartTotals(data);\n if (!checkoutContainer) {\n updateApproachingDiscounts(data.approachingDiscounts, data.approachingDiscountsLabels);\n validateBasket(data);\n } else {\n $(checkoutContainer).trigger('coupon-update', data).trigger('togglePaymentMethods', data);\n }\n $('.coupons-and-promos')\n .empty()\n .append(data.totals.discountsHtml);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateLoyaltyVouchers(data);\n couponsAndPromotionSpacingHandle();\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\n $body.on('click', '.cart-page .bonus-product-button', function (event) {\n event.stopPropagation();\n $.spinner().start();\n $(this).addClass('launched-modal');\n $.ajax({\n url: $(this).data('url'),\n method: 'GET',\n dataType: 'json',\n success: function (data) {\n base.methods.editBonusProducts(data);\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n\n $body.on('click', '.move-product-to-tote .move-sfl, .move-all-to-tote', function (event) {\n event.preventDefault();\n const self = this;\n const $this = $(self);\n const {\n qtyValue: quantity,\n pid: productID,\n action: url,\n uuid,\n isGiftCard,\n isMonogram: hasMonogram\n } = self.dataset;\n const cartProductCard = queryFirst(`.card.product-info.uuid${uuid ? '-' + uuid : ''}`);\n const storePickupGroupElement = uuid ? cartProductCard.closest('.store-pickup-group') : queryFirst('.store-pickup-group');\n const urlParams = {};\n if (productID) {\n urlParams.pid = productID;\n }\n if (quantity) {\n urlParams.qty = parseInt(quantity);\n }\n if (uuid) {\n urlParams.uuid = uuid;\n }\n if (isGiftCard) {\n urlParams.isGiftCard = isGiftCard;\n }\n if (hasMonogram) {\n urlParams.isMonogram = hasMonogram;\n }\n const origPositionY = self.getBoundingClientRect().y;\n if (hasClass(self, 'move-sfl')) {\n $this\n .parents('.card')\n .spinner()\n .start();\n }\n else {\n $.spinner().start();\n }\n $.ajax({\n url: url,\n type: 'post',\n data: urlParams,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n }\n $.spinner().stop();\n } else {\n // When we come from Order Reciept page we do not have basket, so\n // things like PayPal skip to initilize. As workaround for this case\n // we force page to reload.\n const currentBasketStatusElement = document.querySelector('[data-has-initial-basket]');\n if (\n currentBasketStatusElement &&\n currentBasketStatusElement.getAttribute('data-has-initial-basket') === 'false'\n ) {\n trackCart(data.mcAnalyticsArray); // update Marketing Cloud Analytics trackCart event\n history.replaceState({}, '', location.href.split('?')[0]);\n location.reload();\n return;\n }\n\n const emptyCartWithSFLElement = queryFirst('.js-cart-container .js-cart-empty');\n const cartWithSFLElement = queryFirst('.js-cart-container .js-cart-with-items');\n addClass(emptyCartWithSFLElement, HIDDEN_CLASS);\n removeClass(cartWithSFLElement, HIDDEN_CLASS);\n const { cartModel, count, toteCount } = data;\n const { updatedStoreQuantity, storeGroupMessage, cartProductsHtml } = cartModel;\n queryFirst('.cart-items-count .item-count-sfl').textContent = count;\n queryFirst('.cart-items-count .item-count-tote').textContent = toteCount;\n if (toteCount > 0) {\n hideShowSummarySection();\n }\n if (storePickupGroupElement && updatedStoreQuantity && storeGroupMessage) {\n const storeGroupMessageElement = queryFirst('.store-product-items-message', storePickupGroupElement);\n if (storeGroupMessageElement) {\n storeGroupMessageElement.textContent = storeGroupMessage;\n }\n }\n const couponsPromosEl = queryFirst('.coupons-and-promos');\n if (couponsPromosEl) {\n couponsPromosEl.innerHTML = cartModel.totals.discountsHtml;\n }\n updatePromoCodeDetails(cartModel.totals.discounts, cartModel.selectedShippingMethod);\n updateCartTotals(cartModel);\n updateLoyaltyVouchers(cartModel);\n updateApproachingDiscounts(cartModel.approachingDiscounts, cartModel.approachingDiscountsLabels);\n updateGWP(cartModel);\n const cartProductElement = queryFirst('.cart-products');\n if (cartProductElement) {\n cartProductElement.innerHTML = cartProductsHtml;\n const seeAllItemElement = queryFirst('.see-all-items-wrapper');\n removeClass(seeAllItemElement, HIDDEN_CLASS);\n }\n updateMonogramDetails(cartModel);\n updateSaveForLaterDetails(data);\n validateBasket(cartModel);\n $body.trigger('cart:update');\n\n // update Marketing Cloud Analytics trackCart event\n trackCart(data.mcAnalyticsArray);\n\n $.spinner().stop();\n if (!hasClass(self, 'move-all-to-tote')) {\n const originalScroll = document.defaultView.scrollY;\n const newPositionY = self.getBoundingClientRect().y;\n scrollTo(originalScroll + newPositionY - origPositionY, 0);\n }\n else {\n scrollTo($body.offset().top, 0);\n }\n }\n },\n error: function (err) {\n const { responseJSON = {} } = err;\n const { errorMessage, redirectUrl } = responseJSON;\n if (redirectUrl) {\n window.location.href = redirectUrl;\n }\n else {\n createErrorNotification(errorMessage);\n $.spinner().stop();\n }\n }\n });\n });\n\n $body.on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n if ($('.cart-page').length) {\n $('.launched-modal .btn-outline-primary').trigger('focus');\n $('.launched-modal').removeClass('launched-modal');\n } else {\n $('.product-detail .add-to-cart').focus();\n }\n });\n\n $body.on('product:afterAttributeSelect', function (_e, response) {\n const responseContainer = response.container[0];\n const { product } = response.data;\n const { categoryUrl, isCartPage } = responseContainer.dataset;\n const availabilityMessageEl = queryFirst('.product-availability .availability-message-text', responseContainer);\n\n if (!product.available && isCartPage && categoryUrl) {\n const message = availabilityMessageEl.innerText;\n availabilityMessageEl.innerHTML = cartTemplates.cartAvailabilityMessageOOS(message, categoryUrl);\n }\n\n const updateCartButton = queryFirst('.update-cart-product-global', responseContainer);\n if (updateCartButton) {\n updateCartButton.disabled = !product.readyToOrder || !product.available || product.isDirectlyPurchasable === false;\n }\n });\n\n $body.on('product:notifyMeHidden', function (_e, productContainer) {\n const updateCartButton = queryFirst('.update-cart-product-global', productContainer);\n removeClass(updateCartButton, 'd-none');\n });\n\n $body.on('product:notifyMeShown', function (_e, productContainer) {\n const updateCartButton = queryFirst('.update-cart-product-global', productContainer);\n addClass(updateCartButton, 'd-none');\n });\n\n $body.on('change', '.quantity-select', function () {\n var selectedQuantity = $(this).val();\n $('.modal.show .update-cart-url').data('selected-quantity', selectedQuantity);\n });\n\n $body.on('change', '.options-select', function () {\n var selectedOptionValueId = $(this)\n .children('option:selected')\n .data('value-id');\n $('.modal.show .update-cart-url').data('selected-option', selectedOptionValueId);\n });\n\n $body.on('click', '.update-cart-product-global', function (e) {\n e.preventDefault();\n const { target } = e;\n const buttonContainer = target.closest('.cart-and-ipay');\n const updateCartHiddenField = queryFirst('.update-cart-url', buttonContainer);\n const updateProductUrl = updateCartHiddenField.value;\n const { selectedQuantity, selectedOption, uuid } = updateCartHiddenField.dataset;\n const { storeId } = target.dataset;\n const form = {\n uuid: uuid,\n pid: base.getPidValue($(this)),\n quantity: selectedQuantity,\n selectedOptionValueId: selectedOption,\n storeId\n };\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n $('#quickViewModal')\n .spinner()\n .start();\n\n const giftCardFormEl = buttonContainer.closest('.gift-card');\n if (giftCardFormEl) {\n updateFormObjectForGiftCard(form, giftCardFormEl);\n }\n\n $(this)\n .parents('.card')\n .spinner()\n .start();\n if (updateProductUrl) {\n $.ajax({\n url: updateProductUrl,\n type: 'post',\n context: this,\n data: form,\n dataType: 'json',\n success: function (data) {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n }\n $('#quickViewModal')\n .modal('hide')\n .spinner()\n .stop();\n } else if (data.success) {\n $('#quickViewModal')\n .modal('hide')\n .spinner()\n .stop();\n\n $('.coupons-and-promos')\n .empty()\n .append(data.cartModel.totals.discountsHtml);\n updatePromoCodeDetails(data.cartModel.totals.discounts, data.cartModel.selectedShippingMethod);\n updateCartTotals(data.cartModel);\n updateLoyaltyVouchers(data.cartModel);\n updateApproachingDiscounts(data.cartModel.approachingDiscounts, data.cartModel.approachingDiscountsLabels);\n updateAvailability(data.cartModel, uuid);\n updateProductDetails(data, uuid, target.dataset.giftWrapAvailable);\n updateGWP(data.cartModel);\n if (data.uuidToBeDeleted) {\n $('.uuid-' + data.uuidToBeDeleted).remove();\n }\n\n validateBasket(data.cartModel);\n\n const { enablePayPal, enableApplePay } = data.cartModel;\n\n const paypalContainerEl = queryFirst('.checkout-continue');\n if (paypalContainerEl) {\n if (enablePayPal) {\n removeClass(paypalContainerEl, HIDDEN_CLASS);\n } else {\n addClass(paypalContainerEl, HIDDEN_CLASS);\n }\n }\n\n const applePayButton = queryFirst('.dw-apple-pay-button');\n if (applePayButton) {\n if (enableApplePay) {\n removeClass(applePayButton, HIDDEN_CLASS);\n } else {\n addClass(applePayButton, HIDDEN_CLASS);\n }\n }\n\n $body.trigger('cart:update');\n } else {\n formValidation(giftCardFormEl, data);\n }\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 });\n\n const cartPage = $('.cart-page');\n\n // Event listener for home delivery method link in cart page\n cartPage.on('click', '.home-delivery-link', event => {\n const { target } = event;\n const { uuid, pid, actionUrl } = target.dataset;\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n const cartProductCard = queryFirst('.card.product-info.uuid-' + uuid);\n $.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n {\n uuid,\n pid,\n quantity\n },\n data => {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n const availabilityFlashMessageEl = queryFirst('.availability-flash-message', cartProductCard);\n if (lineItemErrorMessage && availabilityFlashMessageEl) {\n removeClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n availabilityFlashMessageEl.textContent = lineItemErrorMessage;\n setTimeout(() => {\n addClass(availabilityFlashMessageEl, HIDDEN_CLASS);\n }, 10000);\n }\n $.spinner().stop();\n } else {\n const { cartProductsHtml, totals } = data;\n const { discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (cartProductsHtml) {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n updateLoyaltyVouchers(data);\n validateBasket(data);\n $body.trigger('cart:update');\n $.spinner().stop();\n }\n }\n },\n () => {\n $.spinner().stop();\n }\n );\n });\n\n // Event listener for product gift wrap checkbox\n cartPage.on('click', '.gift-wrap-input', event => {\n const { target } = event;\n const { pid, uuid, actionUrl, ispu } = target.dataset;\n let isGiftWrap = target.checked;\n let isGiftwrapISPU = false;\n let removeGwpISPU = false;\n if (ispu === 'true') {\n if (isGiftWrap) {\n isGiftWrap = false;\n isGiftwrapISPU = true;\n } else {\n removeGwpISPU = true;\n }\n }\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n $.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n {\n uuid,\n pid,\n quantity,\n isGiftWrap,\n isGiftwrapISPU,\n removeGwpISPU\n },\n data => {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n updateCartTotals(data);\n enableOrDisableCheckoutButton();\n $.spinner().stop();\n },\n () => {\n $.spinner().stop();\n }\n );\n });\n\n $body.on('checkout:updateCheckoutView', function (e, data) {\n const { totals, shipping } = data.order;\n const { discounts, discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (discounts.length) {\n shipping.forEach(eachShipping => {\n const { selectedShippingMethod } = eachShipping;\n if (selectedShippingMethod && !selectedShippingMethod.storePickupEnabled) {\n updatePromoCodeDetails(discounts, selectedShippingMethod);\n }\n });\n }\n });\n\n $body.on('click', '.loyalty-cart-coupons-collapse', function (e) {\n const loyaltyCouponsAccordionBtn = this;\n const couponsAccordionContainerEl = queryFirst('#vouchers-accordion');\n const couponsCardBodyEl = queryFirst('.card-body', couponsAccordionContainerEl);\n const { totalCoupons } = loyaltyCouponsAccordionBtn.dataset;\n const totalCouponsNum = parseInt(totalCoupons, 10);\n const cardBodyMarginTop = 'mt-3';\n if (totalCouponsNum > 2 && !hasClass(loyaltyCouponsAccordionBtn, 'collapsed')) {\n if (couponsCardBodyEl) {\n removeClass(couponsCardBodyEl, cardBodyMarginTop);\n }\n addClass(loyaltyCouponsAccordionBtn, 'collapsed-voucher-padding');\n } else {\n removeClass(loyaltyCouponsAccordionBtn, 'collapsed-voucher-padding');\n if (couponsCardBodyEl) {\n addClass(couponsCardBodyEl, cardBodyMarginTop);\n }\n }\n });\n\n const checkoutContinueCta = queryFirst('.checkout-continue-section .checkout-btn');\n if (checkoutContinueCta) {\n checkoutContinueCta.addEventListener('click', e => {\n e.preventDefault();\n const { target } = e;\n const { href, isBoltUserLoggedIn } = target.dataset;\n if (isBoltUserLoggedIn === 'true' && boltCheckoutAccountExistEl) {\n if (lpRegisteredUserEmail) {\n const checkBoltAccountUrl = boltCheckoutAccountExistEl.value + '=' + encodeURIComponent(lpRegisteredUserEmail);\n $.ajax({\n url: checkBoltAccountUrl,\n method: 'GET',\n success(data) {\n if (data && data.has_bolt_account) {\n fetchBoltAccountDetails(href);\n } else {\n window.location.href = href;\n }\n },\n error: function () {\n window.location.href = href;\n }\n });\n } else {\n fetchBoltAccountDetails(href);\n }\n } else {\n window.location.href = href;\n }\n });\n }\n\n $body.on('click', '.bolt-checkout-cta', function (e) {\n e.preventDefault();\n checkAccountAndFetchDetail();\n });\n\n enableOrDisableCheckoutButton();\n\n // Afterpay\n require('afterpay/afterpay')({\n anchors: '.grand-total-container',\n observerTargets: '.grand-total-container',\n priceTargets: '.grand-total-value',\n renderMode: 'adjacent'\n });\n\n base.selectAttribute();\n base.colorAttribute();\n base.removeBonusProduct();\n base.selectBonusProduct();\n base.enableBonusProductSelection();\n base.showMoreBonusProducts();\n base.addBonusProductsToCart();\n base.focusChooseBonusProductModal();\n base.trapChooseBonusProductModalFocus();\n base.onClosingChooseBonusProductModal();\n window.setTimeout(function () {\n base.revealRecommendations();\n $body.trigger('search:updateProducts');\n }, 2000);\n\n window.onpageshow = function (event) {\n if (event.persisted) {\n window.location.reload();\n }\n };\n window.addEventListener('resize', throttle(() => {\n hideShowSummarySection();\n }));\n}\n\nexport { updateCartTotals, updatePromoCodeDetails, updateApproachingDiscounts, validateBasket };\nexport default init;\n","import { queryFirst, queryAll, addClass, removeClass } from '../../domUtil';\nimport { geolocate } from '../../util';\n\nconst hiddenClass = 'd-none';\n\n/**\n * This method toggles the location icon state in pick up in store drawer\n * @param {boolean} isGeolocationAllowed -geo location permission\n * @param {HTMLElement} container - ISPU container\n */\nfunction toggleLocationIcon(isGeolocationAllowed, container) {\n const locationInactiveIcon = queryFirst('.geolocation-not-activated', container);\n const locationActiveIcon = queryFirst('.geolocation-activated', container);\n if (isGeolocationAllowed) {\n removeClass(locationActiveIcon, hiddenClass);\n addClass(locationInactiveIcon, hiddenClass);\n } else {\n removeClass(locationInactiveIcon, hiddenClass);\n addClass(locationActiveIcon, hiddenClass);\n }\n}\n\n/**\n * This method handles event on clicking 'use my location' link\n * @param {Event} event - on click event object\n * @param {HTMLElement} ispuContainer - ISPU container\n * @param {Function} handleInStore - Success callback handler\n */\nfunction handleDetectLocation(event, ispuContainer, handleInStore) {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const mixinData = { actionUrl, forceGeoLocation: true };\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n queryFirst('.find-store-input', ispuContainer).value = '';\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n geolocate(handleInStore, mixinData, () => {\n removeClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n addClass([storeResults, noStoresMessage], hiddenClass);\n });\n}\n\n/**\n * This method cleans up the state on closing ISPU modal\n * @param {HTMLElement} ispuContainer - ISPU container\n */\nfunction handleISPUModalClose(ispuContainer) {\n queryFirst('.find-store-input', ispuContainer).value = '';\n removeClass(queryAll('.pickup-in-store-product, .find-stores-form', ispuContainer), hiddenClass);\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const confirmSection = queryFirst('.pick-up-confirm-section', ispuContainer);\n const geolocateError = queryFirst('.geo-location-error', ispuContainer);\n confirmSection.innerHTML = '';\n addClass([confirmSection, noStoresMessage, geolocateError], hiddenClass);\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n}\n\nexport {\n handleISPUModalClose,\n handleDetectLocation,\n toggleLocationIcon\n};\n","'use strict';\n\nimport { queryFirst, queryAll, addClass, removeClass } from '../domUtil';\nimport {\n getJSON,\n geolocate,\n setItemInLocalStorage,\n getItemFromLocalStorage\n} from '../util';\nimport { includeGoogleMaps, getLatLong } from '../googleMaps';\nimport { PREFERRED_STORE_ID } from '../constants';\nimport { updateCartTotals, updatePromoCodeDetails, validateBasket } from '../cart/cart';\nimport { toggleLocationIcon } from './pickUpInStore/ispuHelper';\n\nconst $body = $('body');\nconst hiddenClass = 'd-none';\nlet ispuContainer = queryFirst('.pickup-in-store-container');\nlet ispuModalContainer = $('.lp-slideout-modal[id*=\"pick-up-in-store\"]');\nconst pickUpInStoreButton = queryFirst('.btn-in-store-pickup');\nconst isRecognizedUser = pickUpInStoreButton && pickUpInStoreButton.dataset.isRecognizedUser === 'true';\nconst ispuClosestParent = $('.product-detail, .cart-page');\n\n/**\n * This method checks if the user is on cart page\n * @returns {boolean} is cart page or not\n */\nfunction isInCartPage() {\n const cartPage = queryFirst('.cart-page');\n return !!cartPage;\n}\n\n/**\n * This method checks if the user is on PDP page\n * @returns {boolean} is PDP page or not\n */\nfunction isInPdpPage() {\n const pdpPage = queryFirst('.pdp-container');\n return !!pdpPage;\n}\n\n/**\n * This method returns ISPU cart line items details\n * @returns {Object} ISPU cart line items details\n */\nfunction getIspuCartLineItemDetails() {\n const storePickupInfo = queryFirst('.cart-page .store-pickup-info');\n const ispuLineItems = queryAll('.cart-product-line-item', storePickupInfo);\n let ispuLineItemsData = [];\n if (ispuLineItems) {\n ispuLineItems.forEach(ispuLineItem => {\n const { pid, uuid } = ispuLineItem.dataset;\n const quantity = queryFirst('.quantity', ispuLineItem).value;\n ispuLineItemsData.push({\n pid,\n uuid,\n quantity\n });\n });\n }\n return ispuLineItemsData;\n}\n\n/**\n * This method handles the store results content\n * @param {Object} data store results\n */\nfunction handleStoreResults(data) {\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n const productDetails = queryFirst('.pickup-in-store-product', ispuContainer);\n addClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n if (data.storesResultsHtml) {\n storeResults.innerHTML = data.storesResultsHtml;\n noStoresMessage.textContent = '';\n if (!data.isCartPage) {\n removeClass(productDetails, hiddenClass);\n }\n removeClass(storeResults, hiddenClass);\n addClass(noStoresMessage, hiddenClass);\n\n if (isRecognizedUser && data.preferredStore) {\n setItemInLocalStorage(PREFERRED_STORE_ID, data.preferredStore.ID);\n }\n } else if (data.noStoresErrorMessage) {\n noStoresMessage.innerHTML = data.noStoresErrorMessage;\n if (!data.isCartPage) {\n addClass(productDetails, hiddenClass);\n }\n addClass(storeResults, hiddenClass);\n removeClass(noStoresMessage, hiddenClass);\n }\n ispuModalContainer.spinner().stop();\n}\n\n/**\n * This method handles the store confirmation results content\n * @param {Object} data store results\n */\nfunction handleConfirmStoreResults(data) {\n const storeConfirm = queryFirst('.pick-up-confirm-section', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n const storeForm = queryFirst('.find-stores-form', ispuContainer);\n storeConfirm.innerHTML = data.storesResultsHtml;\n if (data.storesResultsHtml) {\n removeClass(storeConfirm, hiddenClass);\n addClass([storeResults, storeForm], hiddenClass);\n }\n ispuModalContainer.spinner().stop();\n}\n\n/**\n * This method is an error handler of ajax call\n */\nfunction errorCallBack() {\n ispuModalContainer.spinner().stop();\n}\n\n// Event listener to retrieve store results on click of Pick up in store in PDP\n$('.pdp-in-store-inventory, .cart-page').on('click', '.btn-in-store-pickup', event => {\n const { target } = event;\n const { actionUrl, pid, googleKey, productName, swatchName, masterId } = target.dataset;\n const isCartPage = isInCartPage();\n const ispuContainerDataset = ispuContainer.dataset;\n const mixinData = {\n products: pid,\n isCartPage\n };\n includeGoogleMaps(googleKey);\n if (!isCartPage) {\n ispuModalContainer = $(target).closest('.product-detail').find('.lp-slideout-modal[id*=\"pick-up-in-store\"]');\n ispuContainer = queryFirst('.lp-slideout-modal .pickup-in-store-container', target.closest('.product-detail'));\n }\n ispuContainerDataset.pid = pid;\n ispuContainerDataset.productName = productName;\n ispuContainerDataset.swatchName = swatchName;\n ispuContainerDataset.masterId = masterId;\n if (isRecognizedUser) {\n const storeId = getItemFromLocalStorage(PREFERRED_STORE_ID);\n\n if (storeId) {\n mixinData.storeID = storeId;\n }\n }\n if (ispuContainerDataset.selectStoreView === 'true') {\n mixinData.selectStoreView = true;\n }\n if (isCartPage) {\n const quantity = queryFirst('.quantity', target.closest('.cart-product-line-item')).value;\n mixinData.quantity = quantity;\n const { uuid } = target.dataset;\n ispuContainerDataset.uuid = uuid;\n ispuContainerDataset.quantity = quantity;\n addClass(queryFirst('.pickup-in-store-product'), hiddenClass);\n }\n geolocate(data => {\n ispuModalContainer.spinner().start();\n toggleLocationIcon(true, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n }, mixinData, data => {\n toggleLocationIcon(false, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n });\n});\n\n// Event listener to select a store from ISPU drawer\nispuClosestParent.on('click', '.btn-select-store', event => {\n const { target } = event;\n const { storeId } = target.dataset;\n const productContainer = target.closest('.product-detail');\n\n $body.trigger('product:updateStoreInventory', { storeId, productContainer });\n\n $(target)\n .closest('.lp-slideout-modal')\n .modal('hide');\n});\n\n// Event Listener for edit pick up store link in cart page\n$('.cart-page').on('click', '.btn-edit-store-pickup', event => {\n ispuContainer.dataset.editStore = 'true';\n const products = null;\n const { actionUrl, googleKey } = event.target.dataset;\n includeGoogleMaps(googleKey);\n addClass(queryFirst('.pickup-in-store-product'), hiddenClass);\n const mixinData = {\n products,\n isCartPage: true\n };\n geolocate(data => {\n ispuModalContainer.spinner().start();\n toggleLocationIcon(true, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n }, mixinData, data => {\n toggleLocationIcon(false, ispuContainer);\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n });\n});\n\n/**\n * This method retrieves store results based on zipcode, city or state\n * @param {Object} locationData google location data based on input value\n */\nfunction handleInStore(locationData) {\n const { latitude, longitude, address, actionUrl, forceGeoLocation } = locationData;\n const ispuContainerDataset = ispuContainer.dataset;\n const isEditStore = JSON.parse(ispuContainerDataset.editStore || 'false');\n let products = null;\n if (!isEditStore) {\n products = ispuContainerDataset.pid + ':' + ispuContainerDataset.quantity;\n }\n const isCartPage = isInCartPage();\n const data = {\n products,\n latitude,\n longitude,\n inputSearchParameter: address,\n isCartPage,\n forceGeoLocation\n };\n if (ispuContainerDataset.selectStoreView === 'true') {\n data.selectStoreView = true;\n }\n if (isRecognizedUser) {\n const storeId = getItemFromLocalStorage(PREFERRED_STORE_ID);\n if (storeId) {\n data.storeID = storeId;\n }\n }\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'GET', data, handleStoreResults, errorCallBack);\n}\n\n// Event listener to retrieve store results based on input search in pick up in store drawer\nispuClosestParent.on('submit', '.find-stores-form', event => {\n event.preventDefault();\n const { target } = event;\n const actionUrl = target.getAttribute('action');\n const address = queryFirst('.find-store-input', target.closest('.find-stores-form')).value;\n if (address) {\n getLatLong(handleInStore, {\n address,\n actionUrl\n });\n }\n});\n\n/**\n * This method retrieves store results based on zipcode, city or state after preferred store slection\n * @param {Object} locationData google location data based on input value\n */\nfunction handlePreferredStore(locationData) {\n const url = queryFirst('.preferred-store-input').dataset.actionUrl;\n const isCartPage = isInCartPage();\n const { latitude, longitude, address, storeID, products } = locationData;\n const data = {\n products,\n latitude,\n longitude,\n inputSearchParameter: address,\n storeID,\n isCartPage,\n selectStoreView: isInPdpPage()\n };\n ispuModalContainer.spinner().start();\n getJSON(url, 'POST', data, handleStoreResults, errorCallBack);\n}\n\n// Event listener to update preferred store and rerender store results\nispuClosestParent.on('click', '.preferred-store-input', event => {\n const { target } = event;\n const isEditStore = JSON.parse(ispuContainer.dataset.editStore);\n let products = null;\n if (!isEditStore) {\n products = ispuContainer.dataset.pid;\n }\n const address = queryFirst('.find-store-input').value;\n const { dataset } = target;\n const { actionUrl, storeId } = dataset;\n const isCartPage = isInCartPage();\n const mixinData = {\n products,\n storeID: storeId,\n isCartPage\n };\n if (isCartPage && !isEditStore) {\n mixinData.quantity = ispuContainer.dataset.quantity;\n }\n if (address) {\n mixinData.address = address;\n getLatLong(handlePreferredStore, mixinData);\n } else {\n const isCartPage = isInCartPage();\n geolocate(\n data => {\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'POST', data, handleStoreResults);\n },\n {\n products,\n storeID: storeId,\n isCartPage,\n selectStoreView: isInPdpPage()\n },\n data => {\n getJSON(actionUrl, 'POST', data, handleStoreResults);\n }\n );\n }\n});\n\n// Event listener to render pick up in store confirmation template\nispuClosestParent.on('click', '.pick-up-confirm-button', event => {\n const { dataset } = event.target;\n const { actionUrl, storeId } = dataset;\n const isCartPage = isInCartPage();\n const data = {\n storeID: storeId,\n isCartPage\n };\n ispuModalContainer.spinner().start();\n getJSON(actionUrl, 'GET', data, handleConfirmStoreResults, errorCallBack);\n});\n\n// Event listener to ISPU store confirmation in cart\nispuClosestParent.on('click', '.store-confirm-button', event => {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const storeID = target.closest('.store-details').dataset.storeId;\n const isEditStore = JSON.parse(ispuContainer.dataset.editStore);\n let data;\n if (isEditStore) {\n const productsInfo = JSON.stringify(getIspuCartLineItemDetails());\n data = {\n productsInfo,\n storeID\n };\n } else {\n const { pid, uuid, quantity } = ispuContainer.dataset;\n data = {\n pid,\n uuid,\n quantity,\n storeID\n };\n }\n ispuModalContainer.spinner().start();\n getJSON(\n actionUrl,\n 'POST',\n data,\n data => {\n if (data.error) {\n const { lineItemErrorMessage } = data;\n ispuModalContainer.spinner().stop();\n ispuModalContainer.modal('hide');\n $('.add-to-cart-messages').remove();\n if ($('.add-to-cart-messages').length === 0) {\n $('body').append('
');\n }\n $('.add-to-cart-messages').append('
' + lineItemErrorMessage + '
');\n setTimeout(function () {\n $('.add-to-basket-alert').remove();\n }, 5000);\n } else {\n const { cartProductsHtml, totals } = data;\n const { discountsHtml } = totals;\n const couponsEl = queryFirst('.coupons-and-promos');\n\n if (couponsEl && discountsHtml) {\n couponsEl.innerHTML = discountsHtml;\n }\n if (cartProductsHtml) {\n document.cookie = `dwapupreq=${new Date().getTime()}; `;\n queryFirst('.cart-products').innerHTML = cartProductsHtml;\n removeClass(queryFirst('.cart-pickup-products'), hiddenClass);\n updatePromoCodeDetails(data.totals.discounts, data.selectedShippingMethod);\n updateCartTotals(data);\n validateBasket(data);\n $('body').trigger('cart:update');\n ispuModalContainer.spinner().stop();\n ispuModalContainer.modal('hide');\n }\n }\n },\n () => {\n ispuModalContainer.spinner().stop();\n }\n );\n});\n\n// Event listener to toggle store details accordion label\nispuClosestParent.on('click', '.store-locator-container .store-btn-link', event => {\n const { target } = event;\n queryFirst('.collapsed', target).classList.toggle(hiddenClass);\n queryFirst('.expanded', target).classList.toggle(hiddenClass);\n});\n\n// Event listener to show stores to select on click of change location on pickup confirmation page\nispuClosestParent.on('click', '.change-location-link', () => {\n addClass(queryFirst('.pick-up-confirm-section'), hiddenClass);\n removeClass(queryAll('.pick-up-in-stores, .find-stores-form'), hiddenClass);\n});\n\n// Event listener to remove no stores error message on change of ISPU search input\nispuClosestParent.on('keyup', '.find-store-input', (event) => {\n queryFirst('.store-locator-no-results', ispuModalContainer[0]).textContent = '';\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n addClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n const findStoreSubmit = queryFirst('.find-store-submit', ispuContainer);\n if (event.target.value) {\n findStoreSubmit.removeAttribute('disabled');\n } else {\n findStoreSubmit.disabled = true;\n }\n});\n\n$('.lp-slideout-modal[id*=\"pick-up-in-store\"]').on('hidden.bs.modal', () => {\n queryFirst('.find-store-input', ispuContainer).value = '';\n removeClass(queryAll('.pickup-in-store-product, .find-stores-form', ispuContainer), hiddenClass);\n queryFirst('.pick-up-in-stores', ispuContainer).innerHTML = '';\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const confirmSection = queryFirst('.pick-up-confirm-section', ispuContainer);\n const geolocateError = queryFirst('.geo-location-error', ispuContainer);\n confirmSection.innerHTML = '';\n addClass([confirmSection, noStoresMessage, geolocateError], hiddenClass);\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n if (isInCartPage()) {\n ispuContainer.dataset.editStore = 'false';\n }\n});\n\n// Event listener to retrieve geo location based store results on click of use current location\nispuClosestParent.on('click', '.detect-location', event => {\n const { target } = event;\n const { actionUrl } = target.dataset;\n const mixinData = { actionUrl, forceGeoLocation: true };\n const noStoresMessage = queryFirst('.store-locator-no-results', ispuContainer);\n const storeResults = queryFirst('.pick-up-in-stores', ispuContainer);\n queryFirst('.find-store-input', ispuContainer).value = '';\n queryFirst('.find-store-submit', ispuContainer).disabled = true;\n geolocate(handleInStore, mixinData, () => {\n removeClass(queryFirst('.geo-location-error', ispuContainer), hiddenClass);\n addClass([storeResults, noStoresMessage], hiddenClass);\n });\n});\n","// Classnames\nconst DISABLED_CLASS = 'disabled-section';\nconst NOT_AVAILABLE_CLASS = 'not-available';\nconst ISPU_STORE_NAME_CLASS = 'store-name';\nconst ISPU_SERVICE_ERROR_ATTR_NAME = 'data-ispu-service-down';\nconst ISPU_SERVICE_BLOCKED = 'service-blocked';\nconst PRE_ORDER_CLASS = 'pre-order';\nconst SHIP_TO_LOW_INVENTORY_CLASS = 'ship-to-low-inventory';\nconst CHECKOUT_HIDDEN_CLASS = 'checkout-hidden';\n\n// Container selectors\nconst PRODUCT_DETAIL_CONTAINER_SELECTOR = '.product-detail';\nconst PDP_CONTAINER_SELECTOR = '.pdp-container';\nconst SHIPPING_PREFERENCES_CONTAINER_SELECTOR = '.shipping-preferences';\nconst STORE_DETAIL_CONTAINER_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .store-detail-container';\n\n// Radio buttons classes\nconst PREFERENCE_SELECTOR = 'input[name=\"shipping-preference\"]:checked';\nconst ISPU_PREFERENCE_CONTAINER_SELECTOR = '.ispu-preference-container';\nconst ISPU_PREFERENCE_CONTENT_SELECTOR = ISPU_PREFERENCE_CONTAINER_SELECTOR + ' .content';\nconst SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR = 'input[name=shipping-preference]';\nconst ISPU_RADIO_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .preference-ispu';\nconst SHIP_TO_ADDRESS_RADIO_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .preference-ship-to-address';\nconst SHIP_TO_ADDRESS_CONTENT_SELECTOR = '.ship-to-address-preference-container .content';\nconst RADIO_BUTTON_LABEL_SELECTOR = '.form-check-label';\n\n// Radio button values\nconst SHIPPING_PREFERENCE_KEY = 'SHIPPING_PREFERENCE';\nconst ISPU_RADIO_VALUE = 'ISPU';\nconst SHIP_TO_RADIO_VALUE = 'SHIP_TO_ADDRESS';\nconst BOLT_PAY = 'BOLT_PAY';\n\n// Change Store link\nconst CHANGE_STORE_LINK_SELECTOR = '.change-store-link';\n\n// Store name and store address section\nconst STORE_DETAIL_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .store-detail';\n\n// Inventory and service messages\nconst STORE_SERVICE_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .service-info-message';\nconst STORE_AVAILABILITY_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .inventory-message';\n\nconst ISPU_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .ispu-info-message';\nconst SHIP_TO_INFO_MESSAGE_SELECTOR = SHIPPING_PREFERENCES_CONTAINER_SELECTOR + ' .ship-to-info-message';\n\nconst ISPU_SELECT_STYLE_MESSAGE_SELECTOR = ISPU_PREFERENCE_CONTAINER_SELECTOR + ' .select-size-info-msg';\n\n//Availability Message Element\nconst AVAILABILITY_MSG_SELECTOR = '.product-availability .availability-message-text';\n//Inventory Message Element of ISPU\nconst INVENTORY_MSG_SELECTOR = '.inventory-message .availability-message-text';\n//Low Stock Message Element of ISPU\nconst LOW_STOCK_ISPU_SELECTOR = '.product-availability .ispu-low-stock-msg';\n//Regular Expression for Valid WishList Name\nconst WISHLIST_NAME_REGEX = /^[ A-Za-z0-9\\]\\.()[{},;:\"'?!\\u2026\\u2018\\u2019\\u201B\\u201C\\u201D\\u2014\\u2013-]*$/;\n//Regular Expression for Valid Postal Code for Loyalty\nconst LOYALTY_POSTAL_CODE_REGEX = /^\\d{5}$/;\n\nconst TRACKER_FUNCTIONAL_COOKIE = 'C0003';\nconst MY_ACCOUNT = 'myAccount';\nconst ORDER_CONFIRMATION = 'orderConfirmation';\n\nmodule.exports = {\n DISABLED_CLASS,\n NOT_AVAILABLE_CLASS,\n ISPU_STORE_NAME_CLASS,\n PRE_ORDER_CLASS,\n SHIP_TO_LOW_INVENTORY_CLASS,\n ISPU_SERVICE_ERROR_ATTR_NAME,\n ISPU_SERVICE_BLOCKED,\n CHECKOUT_HIDDEN_CLASS,\n\n PRODUCT_DETAIL_CONTAINER_SELECTOR,\n PDP_CONTAINER_SELECTOR,\n SHIPPING_PREFERENCES_CONTAINER_SELECTOR,\n STORE_DETAIL_CONTAINER_SELECTOR,\n\n PREFERENCE_SELECTOR,\n ISPU_PREFERENCE_CONTAINER_SELECTOR,\n ISPU_PREFERENCE_CONTENT_SELECTOR,\n SHIP_TO_ADDRESS_CONTENT_SELECTOR,\n SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR,\n ISPU_RADIO_SELECTOR,\n SHIP_TO_ADDRESS_RADIO_SELECTOR,\n RADIO_BUTTON_LABEL_SELECTOR,\n SHIPPING_PREFERENCE_KEY,\n ISPU_RADIO_VALUE,\n SHIP_TO_RADIO_VALUE,\n BOLT_PAY,\n\n CHANGE_STORE_LINK_SELECTOR,\n STORE_DETAIL_SELECTOR,\n STORE_SERVICE_INFO_MESSAGE_SELECTOR,\n STORE_AVAILABILITY_MESSAGE_SELECTOR,\n ISPU_INFO_MESSAGE_SELECTOR,\n SHIP_TO_INFO_MESSAGE_SELECTOR,\n ISPU_SELECT_STYLE_MESSAGE_SELECTOR,\n AVAILABILITY_MSG_SELECTOR,\n INVENTORY_MSG_SELECTOR,\n LOW_STOCK_ISPU_SELECTOR,\n WISHLIST_NAME_REGEX,\n TRACKER_FUNCTIONAL_COOKIE,\n LOYALTY_POSTAL_CODE_REGEX,\n MY_ACCOUNT,\n ORDER_CONFIRMATION\n};\n","'use strict';\n\nconst { queryFirst, addClass, removeClass, hasClass } = require('../../domUtil');\nconst { getItemFromLocalStorage, getNestedValue } = require('../../util');\nconst {\n PREFERENCE_SELECTOR, ISPU_STORE_NAME_CLASS, SHIPPING_PREFERENCES_CONTAINER_SELECTOR,\n ISPU_RADIO_SELECTOR, SHIP_TO_ADDRESS_RADIO_SELECTOR, CHANGE_STORE_LINK_SELECTOR,\n ISPU_PREFERENCE_CONTENT_SELECTOR, SHIP_TO_ADDRESS_CONTENT_SELECTOR, DISABLED_CLASS,\n SHIPPING_PREFERENCE_KEY, SHIP_TO_RADIO_VALUE, RADIO_BUTTON_LABEL_SELECTOR, SHIP_TO_LOW_INVENTORY_CLASS,\n STORE_AVAILABILITY_MESSAGE_SELECTOR, INVENTORY_MSG_SELECTOR, ISPU_RADIO_VALUE, AVAILABILITY_MSG_SELECTOR, LOW_STOCK_ISPU_SELECTOR\n} = require('./constants');\nconst { HIDDEN_CLASS } = require('../../constants')\n\n/**\n * Function to get shipping preferences container within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getChangeStoreLinkEl(productContainerEl) {\n return queryFirst(CHANGE_STORE_LINK_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get shipping preferences container within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShippingPreferencesContainerEl(productContainerEl) {\n return queryFirst(SHIPPING_PREFERENCES_CONTAINER_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ISPU radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getISPUradioButtonEl(productContainerEl) {\n return queryFirst(ISPU_RADIO_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get Ship To section's content within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShipToAddressContentEl(productContainerEl) {\n return queryFirst(SHIP_TO_ADDRESS_CONTENT_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ship to address radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getShipToAddressradioButtonEl(productContainerEl) {\n return queryFirst(SHIP_TO_ADDRESS_RADIO_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get ISPU content radio button within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getISPUPreferenceContentEl(productContainerEl) {\n return queryFirst(ISPU_PREFERENCE_CONTENT_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get selected radio button preference within product container\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getSelectedPreferenceEl(productContainerEl) {\n return queryFirst(PREFERENCE_SELECTOR, productContainerEl);\n}\n\n/**\n * Function to get add a ISPU required class to make ISPU - ADD TO CART work\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement?} storeNameEl - optional store name element\n */\nfunction addStoreNameClass(productContainerEl, storeNameEl) {\n storeNameEl = storeNameEl || queryFirst('.store-detail .name', productContainerEl);\n if (storeNameEl) {\n addClass(storeNameEl, ISPU_STORE_NAME_CLASS);\n }\n}\n\n/**\n * Function to get remove a ISPU required class to make SHIP TO - ADD TO CART work\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement?} storeNameEl - optional store name element\n */\nfunction removeStoreNameClass(productContainerEl, storeNameEl) {\n storeNameEl = storeNameEl || queryFirst('.store-detail .name', productContainerEl);\n if (storeNameEl) {\n removeClass(storeNameEl, ISPU_STORE_NAME_CLASS);\n }\n}\n\n/**\n * Function to check if a size is selected or not\n * @param {HTMLElement} productContainerEl - Product container Element\n * @returns {Object} returns the target as a DOM node\n */\nfunction getSelectedSizeEl(productContainerEl) {\n return queryFirst('.size-btn.selected', productContainerEl);\n}\n\n/**\n * Function to update Visibility Of Low Inventory Msg for ISPU and Ship To an address\n * @param {HTMLElement} productContainerEl - Product container Element\n */\nfunction updateVisibilityOfLowInventoryMsg(productContainerEl) {\n const ispuLowStockEl = queryFirst(LOW_STOCK_ISPU_SELECTOR);\n const availabilityElement = queryFirst(AVAILABILITY_MSG_SELECTOR);\n const ispuLowInventory = queryFirst(STORE_AVAILABILITY_MESSAGE_SELECTOR);\n const ispuLowInventoryMsg = queryFirst(INVENTORY_MSG_SELECTOR);\n const ispuRadioButtonEl = getISPUradioButtonEl(productContainerEl);\n // If ISPU enabled, setting the message only after ispu inventory is created\n // one of the radio button is selected\n if (ispuRadioButtonEl && window.ispuProductInventory) {\n if (ispuRadioButtonEl.checked) {\n addClass(availabilityElement, HIDDEN_CLASS);\n if (ispuLowInventoryMsg) {\n removeClass([ispuLowInventory, ispuLowStockEl], HIDDEN_CLASS);\n }\n else {\n addClass(ispuLowStockEl, HIDDEN_CLASS)\n }\n }\n else {\n addClass([ispuLowInventory, ispuLowStockEl], HIDDEN_CLASS);\n removeClass(availabilityElement, HIDDEN_CLASS);\n }\n }\n}\n/**\n * Function to select ISPU radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} ispuRadioButtonEl - ISPU radio button element\n * @param {boolean} enableISPUSection - flag to remove fade out style to ispu section's content\n */\nfunction selectISPURadioButton(productContainerEl, ispuRadioButtonEl, enableISPUSection) {\n ispuRadioButtonEl = ispuRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!ispuRadioButtonEl) return;\n\n ispuRadioButtonEl.disabled = false;\n removeClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, ispuRadioButtonEl.parentElement), DISABLED_CLASS);\n\n ispuRadioButtonEl.checked = true;\n\n addStoreNameClass(productContainerEl);\n\n if (enableISPUSection) {\n const ispuContentEl = getISPUPreferenceContentEl(productContainerEl);\n removeClass(ispuContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to disable & deselect Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} ispuRadioButtonEl - ISPU radio button element\n * @param {boolean} disableISPUSection - flag to add fade out style ispu section's content\n */\nfunction disableISPURadioButton(productContainerEl, ispuRadioButtonEl, disableISPUSection) {\n ispuRadioButtonEl = ispuRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!ispuRadioButtonEl) return;\n\n ispuRadioButtonEl.disabled = true;\n addClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, ispuRadioButtonEl.parentElement), DISABLED_CLASS);\n\n ispuRadioButtonEl.checked = false;\n\n removeStoreNameClass(productContainerEl);\n\n if (disableISPUSection) {\n const ispuContentEl = getISPUPreferenceContentEl(productContainerEl);\n addClass(ispuContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to select Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} shipToRadioButtonEl - Ship to address radio button element\n * @param {boolean} enableShipToContent - flag to add fade out style shipTo section's content\n */\nfunction selectShipToRadioButton(productContainerEl, shipToRadioButtonEl, enableShipToContent) {\n shipToRadioButtonEl = shipToRadioButtonEl || getShipToAddressradioButtonEl(productContainerEl);\n if (!shipToRadioButtonEl) return;\n\n shipToRadioButtonEl.disabled = false;\n removeClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, shipToRadioButtonEl.parentElement), DISABLED_CLASS);\n\n shipToRadioButtonEl.checked = true;\n\n removeStoreNameClass(productContainerEl);\n\n if (enableShipToContent) {\n const shipToContentEl = getShipToAddressContentEl(productContainerEl);\n removeClass(shipToContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to disable & deselect Ship To radio button\n * @param {HTMLElement} productContainerEl - Product container Element\n * @param {HTMLElement} shipToRadioButtonEl - Ship to address radio button element\n * @param {boolean} disableShipToContent - flag to remove fade out style from shipTo section's content\n */\nfunction disableShipToRadioButton(productContainerEl, shipToRadioButtonEl, disableShipToContent) {\n shipToRadioButtonEl = shipToRadioButtonEl || getISPUradioButtonEl(productContainerEl);\n if (!shipToRadioButtonEl) return;\n\n shipToRadioButtonEl.disabled = true;\n addClass(queryFirst(RADIO_BUTTON_LABEL_SELECTOR, shipToRadioButtonEl.parentElement), DISABLED_CLASS);\n\n shipToRadioButtonEl.checked = false;\n\n if (disableShipToContent) {\n const shipToContentEl = getShipToAddressContentEl(productContainerEl);\n addClass(shipToContentEl, DISABLED_CLASS);\n }\n}\n\n/**\n * Function to get preferred shipping preference\n * @returns {string} - Preferred shipping preference value\n */\nfunction getPreferedShippingPreference() {\n let shippingPreferenceValue = getItemFromLocalStorage(SHIPPING_PREFERENCE_KEY);\n if (!shippingPreferenceValue) {\n const shippingPreferencesConfig = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig') || {};\n const { activeStoreFilter } = shippingPreferencesConfig;\n shippingPreferenceValue = activeStoreFilter ? ISPU_RADIO_VALUE : SHIP_TO_RADIO_VALUE;\n }\n return shippingPreferenceValue;\n}\n\nmodule.exports = {\n getChangeStoreLinkEl,\n getSelectedPreferenceEl,\n getShippingPreferencesContainerEl,\n getISPUradioButtonEl,\n getShipToAddressradioButtonEl,\n getShipToAddressContentEl,\n getISPUPreferenceContentEl,\n getSelectedSizeEl,\n addStoreNameClass,\n removeStoreNameClass,\n selectISPURadioButton,\n disableISPURadioButton,\n selectShipToRadioButton,\n disableShipToRadioButton,\n getPreferedShippingPreference,\n updateVisibilityOfLowInventoryMsg\n};\n","module.exports = {\n breakpoints: {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 1024,\n xl: 1362\n },\n\n // Stores\n PREFERRED_STORE_ID: 'PREFERRED_STORE_ID',\n\n // Constant values\n EMPTY_STRING: '',\n\n // DOM Class\n HIDDEN_CLASS: 'd-none',\n INVALID_CLASS: 'is-invalid',\n INVISIBLE_CLASS: 'invisible',\n NO_SCROLL_CLASS: 'no-scroll',\n IS_STICKY_CLASS: 'is-sticky',\n SELECTED_CLASS: 'selected',\n\n // Product status\n PREORDER_STATUS: 'PREORDER',\n IN_STOCK_STATUS: 'IN_STOCK',\n NOT_AVAILABLE_STATUS: 'NOT_AVAILABLE',\n\n // Custom DOM events\n\n // Control keys\n\n // Event KeyCodes\n KEYCODE_TAB: 9,\n KEYCODE_ESCAPE: 27,\n KEYCODE_UP: 38,\n KEYCODE_DOWN: 40,\n KEYCODE_ENTER: 13,\n EVENT_KEY_ENTER: 'Enter',\n\n // Search types\n SEARCH_TYPE: 'searchType',\n SEARCH_SUBMIT: 'search submit',\n SEARCH_SUGGESTIONS: 'search suggestions',\n POPULAR_SEARCHES: 'popular searches'\n};\n","/**\n * DOM utilities to use native browser capabilities and avoid dependencies.\n *\n * @module dom.dom-util\n * @version 1.0.0\n * @since Sept 26 2019\n *\n * @typedef {Object} ProductData\n * @property {string} colorCode - The product color code (E.g. 002)\n * @property {string} masterId - The product master ID (E.g. 003168)\n * @property {string} originalPrice - The product original price (E.g. 148.00)\n * @property {string} productColor - The product color name (E.g. Onyx)\n * @property {string} productId - The product SKU (E.g. 889069580469)\n * @property {string} productName - The product name (E.g. Keegan Lace Top)\n * @property {string} productPrice - The product sale price (E.g. 98.00)\n * @property {string} productSize - The product size (E.g. M)\n * @property {string} variationGroupId - The product variation group ID (E.g. 003168-onyx)\n * @property {string} productBadge - The product is of Early Access or not (E.g. Early Access)\n */\n\nconst { breakpoints } = require('./constants');\n\n/**\n * Native querySelector to find first element in the dom with given selector\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {Object} returns the target as a DOM node\n */\nconst queryFirst = exports.queryFirst = (selector, parent = document) => {\n if (!parent) return null;\n return parent.querySelector(selector);\n};\n/**\n * loadScript to asynchronously load a script tag in DOM\n *\n * @param {string} source Script tag src value\n * @param {boolean} isAsync Set script to async true or false\n */\nexports.loadScript = (source, isAsync = false) => {\n return new Promise((resolve) => {\n const script = document.createElement('script');\n script.src = source;\n script.async = isAsync;\n script.onload = () => {\n resolve();\n }\n document.body.append(script);\n });\n};\n/**\n * loadInput to load an input tag in DOM\n *\n * @param {string} referrerID Referrer ID value\n * @param {Array} formElement Form element\n */\nexports.loadInput = (referrerID, formElement) => {\n const input = document.createElement('input');\n input.setAttribute('type', 'hidden');\n input.setAttribute('name', 'referrerID');\n input.setAttribute('class', 'referrerID');\n input.setAttribute('value', referrerID);\n formElement.appendChild(input);\n};\n/**\n * Native querySelectorAll to find all the dom element with given selector.\n *\n * @param {string | Object} selector Target selector element.\n * @param {string | Object} parent Parent element, if it not provided\n * fallback to document.\n * @return {nodeList | Array} Returns the target as a DOM node.\n */\nconst queryAll = exports.queryAll = (selector, parent = document) => {\n if (!parent) return null;\n return [].slice.call(parent.querySelectorAll(selector), 0);\n};\n\n/**\n * Returns the value(s) for the specified CSS rule(s), or all computed styles if no rule is specified\n *\n * @param {Element} element Target element\n * @param {string} rule CSS rule name (E.g. padding-top)\n * @return {string | Array | Object} Returns a string value, array of values, or styles object\n */\nconst getStyles = exports.getStyles = (element, ...rules) => {\n const styles = getComputedStyle(element);\n\n if (!rules.length) {\n return styles;\n } else if (rules.length === 1) {\n return styles[rules[0]];\n }\n return rules.map(rule => styles[rule]);\n};\n\n/**\n * Remove DOM element\n *\n * @param {string | Object} el Target element.\n */\nexports.remove = el => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.parentElement.removeChild(node);\n }\n } else {\n el.parentElement.removeChild(el);\n }\n};\n\n/**\n * Set attribute to single or multiple elements\n *\n * @param {string | Object} el Target element.\n * @param {string} attr attribute that need to be added.\n * @param {string | boolean} val value that need to be set for an attribute.\n */\nexports.setAttribute = (el, attr, val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.setAttribute(attr, val);\n }\n } else {\n el.setAttribute(attr, val);\n }\n};\n\n/**\n * Remove attribute to single or multiple elements\n *\n * @param {string | Object} el Target element.\n * @param {string} attr attribute that need to be removed.\n */\nexports.removeAttribute = (el, attr) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.removeAttribute(attr);\n }\n } else {\n el.removeAttribute(attr);\n }\n};\n\n/**\n * Adds class or classes to the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.addClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.add(...val);\n }\n } else {\n el.classList.add(...val);\n }\n};\n\n/**\n * Removes class or classes from the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.removeClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.remove(...val);\n }\n } else {\n el.classList.remove(...val);\n }\n};\n\n/**\n * Toggles class or classes to the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n */\nexports.toggleClass = (el, ...val) => {\n if (!el) return;\n if (Array.isArray(el) || el instanceof NodeList) {\n for (let i = 0, n = el.length; i < n; i++) {\n const node = el[i];\n if (node) node.classList.toggle(...val);\n }\n } else {\n el.classList.toggle(...val);\n }\n};\n\n/**\n * Looks for availability of class or classes in the classList of particular element.\n *\n * @param {string | Object} el Target element.\n * @param {string | Array} val class name or class names as list of arguments.\n * @return {boolean} Returns availability of class in the target element.\n */\nexports.hasClass = (el, ...classes) => {\n if (!el) return false;\n\n const { classList } = el;\n\n return !!classList && classes.every(className => classList.contains(className));\n};\n\n/**\n * Throttle util to prevent repeatative callbacks\n *\n * @param {function} callback Callback function.\n * @param {number} limit Timeout upon which throttle callback need to be called.\n * fallback to document.\n * @param {function} waitCallback The callback to fire while the function is being throttled.\n * @return {function} Throttle closure function.\n */\nexports.throttle = (callback, limit = 250, waitCallback = function () { }) => {\n let isThrottling = false;\n\n return (...args) => {\n if (isThrottling) return waitCallback(...args);\n\n const returnValue = callback.apply(this, args);\n isThrottling = true;\n\n setTimeout(() => {\n isThrottling = false;\n }, limit);\n\n return returnValue;\n };\n};\n\n/**\n * Throttle util to prevent repeatative callbacks\n *\n * @param {function} callback - Callback function.\n * @param {number} minimumDelay - Delay upon which debounce callback need to be called.\n * @param {object} [options] - Additional options to control debouncing behavior\n * @param {function} [options.condition] - A function that will cause debouncing to be ignored for one cycle if it returns true\n * @param {function} [options.callback] - A function that will run without restriction, each time the debounced method is called\n * @return {function} Debounce closure function.\n */\nexports.debounce = (callback, minimumDelay = 250, options = {}) => {\n const { condition, callback: unrestrictedCallback } = options;\n let timer;\n\n return (...args) => {\n clearTimeout(timer);\n\n if (typeof unrestrictedCallback === 'function') unrestrictedCallback(...args);\n\n if (typeof condition === 'function' && condition(...args)) {\n callback(...args);\n } else {\n timer = setTimeout(() => {\n callback(...args);\n }, minimumDelay);\n }\n };\n};\n\nexports.toArray = (...args) => {\n const makeArray = target => {\n let newTarget;\n if (!Array.isArray(target)) {\n const array = [].slice.call(target);\n newTarget = array.length ? array : [target];\n }\n return newTarget;\n };\n return args.reduce((results, arg) => {\n return results.concat(makeArray(arg));\n }, []);\n};\n\n/**\n * Height util to get outer height of element including margins\n *\n * @param {string | Object} el target element\n * @return {string} height of element\n */\nexports.outerHeight = el => {\n const styles = getStyles(el);\n\n return el.offsetHeight + parseInt(styles.marginTop, 0) + parseInt(styles.marginBottom, 0);\n};\n\n/**\n * Determine if an element is in the viewport\n * (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param {Node} el The element\n * @return {boolean} Returns true if element is in the viewport\n */\nexports.isInViewportCheck = el => {\n const scroll = window.scrollY || window.pageYOffset;\n const boundsTop = el.getBoundingClientRect().top + scroll;\n\n const numberOfViewportToCheck = el.dataset.nextViewportLazyLoad ? 2 : 1;\n\n const viewport = {\n top: scroll,\n bottom: scroll + window.innerHeight * numberOfViewportToCheck\n };\n\n const bounds = {\n top: boundsTop,\n bottom: boundsTop + el.clientHeight\n };\n\n return (bounds.bottom >= viewport.top && bounds.bottom <= viewport.bottom) || (bounds.top <= viewport.bottom && bounds.top >= viewport.top);\n};\n\n/**\n * Determine if an element is in the viewport\n * (c) 2017 Chris Ferdinandi, MIT License, https://gomakethings.com\n * @param {Node} el The element\n * @return {boolean} Returns true if element is in the viewport\n */\nexports.isInViewport = el => {\n var rect = el.getBoundingClientRect();\n\n return rect.bottom > 0 &&\n rect.right > 0 &&\n rect.left < (window.innerWidth || document.documentElement.clientWidth) &&\n rect.top < (window.innerHeight || document.documentElement.clientHeight);\n};\n\n/**\n * Displays empty cart message\n * @param {string} message - Error message to display\n */\nexports.emptyCart = message => {\n const cartElements = queryAll('.cart');\n cartElements.forEach(cartElement => {\n cartElement.innerHTML = `

${message}

Continue Shopping
`;\n });\n};\n\n/**\n * Animates scrolling the page to the specified Y coordinate\n * @param {number} y - The Y coordinate to scroll to\n * @param {number} duration - The duration of the animation in milliseconds\n * @param {function} callback - The callback to run when the animation is complete\n * @returns {JQuery}\n */\nexports.scrollTo = (y, duration = 600, callback = function () { }) => $('html, body').scrollTo(y, duration, callback);\n\n/**\n * Finds the last element sibling on the same line as the specified element\n * @param {Element} element - The element to reference when looking for siblings\n * @returns {Element} - returns last element in the row\n */\nexports.getLastElementInRow = element => {\n if (!element.nextElementSibling) return element;\n\n const bottom = element.offsetTop + element.scrollHeight;\n let sibling;\n\n while ((sibling = element.nextElementSibling)) {\n if (sibling.offsetTop >= bottom) return sibling.previousElementSibling;\n element = sibling;\n }\n\n return element;\n};\n\n/**\n * Update url with query parameter to handle remember placement\n *\n * @param {DocumentFragment} fragment - A DocumentFragment object\n * @return {undefined}\n */\nexports.updateUrlQueryParam = fragment => {\n const queryParamsElement = queryFirst('.append-params', fragment);\n const permaLink = queryFirst('.permalink', fragment);\n\n if (permaLink) {\n window.history.pushState({ path: permaLink.value }, '', permaLink.value);\n } else if (queryParamsElement) {\n const newUrl = window.location.href.split('?')[0] + '?' + queryParamsElement.value;\n window.history.pushState({ path: newUrl }, '', newUrl);\n }\n};\n\n/**\n * This method returns character count\n * @param {HTMLElement} element - current element for which count has to be calculated\n * @return {number} character count\n */\nexports.getCharacterCount = function (element) {\n if (!element) {\n return 0;\n }\n return element.value.length;\n};\n\n/**\n * Waits for a specified element to exist.\n * @param {string} selector - The selector to match\n * @param {element} scope - The containing element to search within (default: document)\n * @param {number} timeout - How long (in milliseconds) to wait before rejecting the promise\n * @returns a Promise containing all matched elements\n */\nexports.waitForElement = (selector, scope = document, timeout = 0) =>\n new Promise((resolve, reject) => {\n const elements = queryAll(selector, scope);\n\n if (elements.length) return resolve(elements);\n\n const observer = new MutationObserver((mutations, self) => {\n const elements = queryAll(selector, scope);\n\n if (elements.length) {\n self.disconnect();\n resolve(elements);\n }\n });\n\n observer.observe(scope, { childList: true, subtree: true });\n\n if (timeout) {\n setTimeout(() => {\n observer.disconnect();\n reject('Timed out');\n }, timeout);\n }\n });\n\n/**\n * Binds an event listener to a callback using native methods and selector matching.\n * @param {element} element - The element to attach the listener to\n * @param {string|array} eventTypes - The type of events to listen for\n * @param {function} callback - The method to run when the event is fired\n * @param {object} [options={}] - Additional options to configure the event binding\n * @param {function} [options.eventCondition] - A function that returns a boolean indicating whether to proceed with the callback when the event is triggered\n * @param {string} [options.bindEngine='native'] - The engine to use when binding the event (native or jQuery)\n * @param {boolean} [options.once=false] - Whether to fire the event callback only once and then unbind\n */\nexports.bind = (element, eventTypes, callback, options = {}) => {\n const {\n eventCondition,\n bindEngine = 'native',\n once = false\n } = options;\n\n if (!Array.isArray(eventTypes)) eventTypes = eventTypes.split(',').map(type => type.trim());\n\n const useJQuery = (String(bindEngine).toLowerCase() === 'jquery');\n let { targetSelectors = [] } = options;\n\n if (typeof targetSelectors === 'string') {\n targetSelectors = [targetSelectors];\n }\n\n const handler = (e, extraData) => {\n let { target } = e;\n\n if (extraData instanceof Element || extraData === document) {\n target = extraData;\n } else if (extraData instanceof jQuery.Event) {\n target = extraData.target;\n } else {\n e.data = extraData;\n }\n\n let targetElement = target;\n\n if (Array.isArray(targetSelectors) && targetSelectors.length) {\n // If an array of selectors is provided, store a reference to the closest element that is matched\n targetElement = targetSelectors.reduce((result, selector) => {\n if (result) return result;\n const node = target.closest(selector);\n if (node) result = { node, selector };\n return result;\n }, false);\n }\n\n // We need a target element as context or we don't execute our callback\n if (!targetElement) return;\n\n const { node, selector } = targetElement;\n\n // Only execute the callback if the eventCondition allows\n if (typeof eventCondition === 'function' && !eventCondition(e, node || targetElement)) {\n return;\n }\n\n if (once) {\n if (useJQuery) {\n const $element = $(element);\n\n eventTypes.forEach(eventType => {\n $element.off(eventType, handler);\n });\n } else {\n eventTypes.forEach(eventType => {\n element.removeEventListener(eventType, handler, true);\n });\n }\n }\n\n if (node && selector) {\n callback(e, node, selector);\n } else {\n callback(e, targetElement);\n }\n };\n\n if (useJQuery) {\n const $element = $(element);\n\n eventTypes.forEach(eventType => {\n $element.on(eventType, handler);\n });\n } else {\n eventTypes.forEach(eventType => {\n element.addEventListener(eventType, handler, true);\n });\n }\n};\n\n/**\n * Function to get product data\n * @param {HTMLElement} element - Product container element or srcElement\n * @returns {ProductData} - Product data\n */\nexports.getProductData = element => {\n const { getNestedValue } = require('./util');\n const PREORDER_STATUS = 'PREORDER';\n\n element = element.closest('.color-attribute, .product-tile-swatch, .tile-img-link, .add-to-cart, .account-login-btn, .create-account-btn') || element;\n\n const container = element.closest('.product, .product-detail') || element.closest('.product-info') || element.closest('.cart-product-line-item') || element;\n const { dataset } = element;\n const { dataset: containerData } = container;\n const { monetatePid } = containerData;\n const isQuickview = !!container.closest('.product-quickview');\n\n let { productInfo, productInventory } = window;\n\n // Update the product data where possible\n let pid = containerData.wishlistId || containerData.pid || dataset.pid;\n let masterId = dataset.masterid || containerData.masterid;\n let productName = dataset.productName || containerData.productName;\n let productSize = dataset.productSize || containerData.productSize;\n let swatchName = dataset.swatchName || containerData.swatchName;\n let { attrValue: colorCode, productSet } = dataset;\n const { productBadge } = dataset;\n\n let variationGroupId;\n let originalPrice;\n let productPrice;\n let isPreorder;\n\n let productId = [dataset.productId, containerData.productId, pid].find(id => {\n if (id && ~id.indexOf('-')) {\n if (!variationGroupId) variationGroupId = id;\n\n return false;\n }\n\n return id;\n }) || '';\n\n // We need the color code, which is only available on the swatch\n if (!swatchName || !element.closest('.color-attribute, .product-tile-swatch')) {\n const colorEl = queryFirst('.color-attribute .swatch-circle.selected, .product-tile-swatch.selected', container) || queryFirst('.selected-swatch-name', container) || queryFirst('.tile-img-link', container);\n const swatchButton = (colorEl && colorEl.closest('.color-attribute'));\n\n swatchName = (colorEl && (colorEl.dataset.attrDisplayvalue || colorEl.dataset.swatchName || colorEl.textContent.trim())) || '';\n colorCode = (colorEl && colorEl.dataset.attrValue) || '';\n variationGroupId = variationGroupId || (swatchButton && swatchButton.dataset.productId) || '';\n }\n\n // Use the PID if the productId is missing or set to master\n if (!productId || (productId.length <= 6 && pid)) productId = pid;\n\n // We need the master ID to look up the product\n if (!masterId && monetatePid) {\n masterId = monetatePid.split('-')[0] || '';\n }\n\n if (!masterId) {\n if (pid && (~pid.indexOf('-') || pid.length <= 6)) {\n masterId = pid.split('-')[0];\n } else if (productId && ~productId.indexOf('-')) {\n masterId = productId.split('-')[0];\n } else {\n const tileEl = element.closest('.product-tile');\n masterId = ((tileEl && tileEl.dataset.monetatePid) || '').split('-')[0];\n }\n }\n\n // QuickView productInfo\n if (isQuickview) {\n productInfo = getNestedValue(window, 'quickviewProductInfo.productInfo');\n productInventory = getNestedValue(window, 'quickviewProductInfo.productInventory');\n }\n\n // Now we can check the productInfo\n if (productInfo && masterId && colorCode) {\n let productData;\n if (isQuickview) {\n productData = getNestedValue(productInfo, 'variants.{0}', colorCode);\n } else {\n productData = getNestedValue(productInfo, '{0}.variants.{1}', masterId, colorCode);\n }\n\n if (productData) {\n originalPrice = productData.standardPrice + '.00';\n productPrice = productData.price + '.00';\n variationGroupId = productData.groupId;\n isPreorder = productData.isPreorder;\n }\n }\n\n if (!productName) {\n const productNameEl = queryFirst('.product-name, .line-item-name', container);\n productName = (productNameEl && productNameEl.textContent.trim()) || '';\n }\n\n if (!productSize) {\n const productSizeEl = queryFirst('.size-btn.selected, .wishlist-item-attribute-size .wishlist-detail-value', container);\n productSize = (productSizeEl && (productSizeEl.dataset.valueId || productSizeEl.textContent.trim())) || '';\n }\n\n if (productSize && pid) {\n isPreorder = getNestedValue(productInventory, 'variants[{0}].availabilityStatus', pid) === PREORDER_STATUS;\n }\n\n if (!originalPrice) {\n const originalPriceEl = queryFirst('.price-section .ssPrice', container);\n originalPrice = ((originalPriceEl && originalPriceEl.value) || '').split('$').pop();\n }\n\n if (originalPrice && !~originalPrice.indexOf('.')) {\n originalPrice += '.00';\n }\n\n if (!productPrice) {\n const productPriceEl = queryFirst('.price-section .sales .ssSalesPrice', container);\n productPrice = ((productPriceEl && productPriceEl.value) || '').split('$').pop();\n }\n\n if (productPrice && !~productPrice.indexOf('.')) {\n productPrice += '.00';\n }\n\n if (!swatchName) {\n const productColorEl = queryFirst('.wishlist-item-attribute-color .wishlist-detail-value', container);\n swatchName = (productColorEl && productColorEl.textContent.trim()) || '';\n }\n\n // Sanity check\n if (masterId && masterId.length > 6) masterId = '';\n if (productId && (~productId.indexOf('-') || productId.length <= 6)) productId = '';\n if (variationGroupId && !~variationGroupId.indexOf('-')) variationGroupId = '';\n if (productSet === 'null') productSet = ''; // not all PLP tiles have data-product-set\n\n return {\n colorCode,\n masterId,\n originalPrice,\n productColor: swatchName,\n productId,\n productName,\n productPrice,\n productSize,\n variationGroupId,\n isPreorder,\n productBadge,\n productSet\n };\n};\n\n/**\n * Check whether the device matches the specified breakpoint at a minimum (i.e. min-width)\n * @param {string} breakpoint - The breakpoint to match against (xs; sm; md; lg; xl)\n * @returns {boolean} - Whether the device matches the breakpoint\n */\nexports.matchesBreakpoint = breakpoint => breakpoint in breakpoints && window.matchMedia(`(min-width: ${breakpoints[breakpoint]}px)`).matches;\n\nexports.getCSRFToken = (scope = document.body) => {\n const token = scope.querySelector('.csrf-token');\n return (token && token.value) || '';\n};\n\n/**\n * Renders a string into a template and returns the DOM Fragment.\n * @param {string} html - the html content.\n * @returns {DocumentFragment} - The input string as a document fragment\n */\nexports.renderFragment = html => {\n const template = document.createElement('template');\n template.innerHTML = html;\n return template.content;\n};\n\n/**\n * Gets all accessible cookies and creates a plain key/value object\n * @returns {Object} Plain object containing cookie names and values\n */\nexports.getCookieMap = () => document.cookie.split(';').reduce((result, keyValue) => {\n const [key, value] = keyValue.trim().split('=');\n result[key] = decodeURIComponent(value);\n return result;\n}, {});\n\n/**\n * Sets a cookie\n * @param {string} key - the name of the cookie\n * @param {string} value - the value of the cookie\n * @param {number} [minutes] - how long until the cookie expires in minutes\n */\nexports.setCookie = (key, value, minutes) => {\n let date;\n if (minutes) {\n date = new Date();\n date.setTime(date.getTime() + (minutes * 60 * 1000));\n }\n\n document.cookie = `${key}=${value}${date ? `; expires=${date.toGMTString()}` : ''}; path=/`;\n};\n\n/**\n * Validating the date as per month\n */\nexports.validateDate = () => {\n const monthSelector = document.getElementById('birthdaymonth');\n const dateSelector = document.getElementById('birthdaydate');\n\n if (monthSelector && dateSelector) {\n const { message } = dateSelector.dataset;\n /**\n * Validating date\n */\n function validateDateOption() {\n const m = monthSelector.value;\n const d = dateSelector.value;\n const mlength = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m];\n dateSelector.length = 0;\n const labelOption = new Option();\n labelOption.text = message;\n labelOption.value = '';\n dateSelector.add(labelOption);\n for (let i = 1; i <= mlength; i++) {\n const option = new Option();\n option.value = i;\n option.text = i;\n if (i.toString() === d) option.selected = true;\n dateSelector.add(option);\n }\n }\n monthSelector.addEventListener('change', validateDateOption);\n }\n};\n\n/**\n * Returns whether an element's content is visible to the user\n * Note that this differs from existing implementations like JQuery :visible -- this will return false\n * for elements which are visibility: hidden or which are overflow hidden with 0 height.\n * @param {HTMLElement} element - The element whose visibility to check\n * @returns {boolean} true if the element is visible, false otherwise.\n */\nexports.isVisible = function(element) {\n if (!element instanceof HTMLElement) return false;\n\n // Check if the element is hidden using more performant methods first\n // We can't check for d-none here because we use conventions like \"d-none d-md-block\" on the site.\n if (exports.hasClass(element, 'invisible') || element.offsetParent === null) return false;\n\n const style = window.getComputedStyle(element);\n return !(style.display === 'none' || style.visibility === 'hidden' || (style.overflowY === 'hidden' && (style.height === '0px' || style.maxHeight === '0px')));\n};\n\n/**\n * Converts a basic object to FormData\n * @param {Object} obj - the object to convert to FormData\n * @param {boolean} [includeUndefined=false] - include undefined values in the result\n * @returns {FormData} FormData representation of the object\n */\nexports.toFormData = (obj, includeUndefined = false) => Object.keys(obj).reduce((formData, key) => {\n const value = obj[key];\n if (typeof value !== 'undefined' || includeUndefined) formData.append(key, value);\n return formData;\n}, new FormData());\n\nexports.getStyles = getStyles;\nexports.queryAll = queryAll;\n","'use strict';\n\n// OOTB Code\nlet googleMapScript;\nlet geocoder;\n\n/**\n * This method includes google api for using google maps\n * @param {string} googleKey google api key\n */\nfunction includeGoogleMaps(googleKey) {\n if (!googleMapScript && googleKey) {\n googleMapScript = document.createElement('script');\n googleMapScript.src = `https://maps.googleapis.com/maps/api/js?key=${googleKey}`;\n document.head.append(googleMapScript);\n }\n}\n\n/**\n * This method renders location from google maps based on address\n * @param {function} callBack callback function\n * @param {Object} mixin additional parameters\n */\nfunction getLatLong(callBack, mixin = {}) {\n const { address } = mixin;\n geocoder = new google.maps.Geocoder();\n if (!(geocoder && address)) return;\n const data = Object.assign({}, mixin);\n geocoder.geocode({ address }, function (results, status) {\n if (status === google.maps.GeocoderStatus.OK) {\n const { location } = results[0].geometry;\n data.latitude = location.lat();\n data.longitude = location.lng();\n }\n callBack(data);\n });\n}\n\nexport { includeGoogleMaps, getLatLong };\n","'use strict';\n\n/**\n * Helper module for initialization popover elements\n *\n * @module popover\n */\n\nconst { queryFirst, queryAll, hasClass } = require('./domUtil');\n\nconst phInfoPopover = queryFirst('.ph-number-info-popover .content-asset');\nconst fpoInfoPopover = queryFirst('.fpo-info-popover .content-asset');\nconst checkoutBenefitsInfoPopover = queryFirst('.checkout-benefits-info .checkout-benefits-info-content');\nconst cvvInfoPopover = queryFirst('.cvv-info-popover .cvv-info-popover-content');\nconst giftCardInfoPopover = queryFirst('.gift-card-number-info-popover .content-asset');\nconst birthdayInfoPopover = queryFirst('.birthday-info-popover .content-asset');\nconst deliveryFeeInfoPopover = queryFirst('.delivery-fee-info-popover .content-asset');\nconst boltSignoutMessage = queryFirst('.bolt-logout-button .bolt-sign-out');\nconst earlyAccessMessage = queryFirst('.loyalty-early-access-lock-container .early-access-container-tooltip');\nconst giftReturnNumberInfoPopover = queryFirst('.gift-return-order-no-popover .content-asset');\nconst keepUserSignedInPopover = queryFirst('.remember-me .keep-user-signed-in');\nconst keepUserSignedInContainer = queryFirst('.remember-me .logged-in-user-notification');\nconst earlyAccessLockedSelector = '.loyalty-early-access-locked';\nconst pdpChatWrapper = queryFirst('.pdp-chat');\nconst pdpChatPopover = queryFirst('.pdp-chat-label');\nconst pdpChatContainer = queryFirst('.pdp-chat-container');\n\nconst initPopover = (selector, ...options) => $(selector).popover(Object.assign({}, ...options));\n\n// default popover options\nconst POPOVER_CLICK_BOTTOM = {\n trigger: 'click',\n placement: 'bottom',\n html: true\n};\n/*\n * Handle clicks outside of popover in order to close it\n */\nconst initPopoverClose = () => {\n // since it can be called dynamically, first we get rid of old events\n $('[data-toggle=\"popover\"]')\n .off('shown.bs.popover')\n .on('shown.bs.popover', function (e) {\n const { target } = e;\n $(document).one('click', function (clickEvent) {\n const clicked = clickEvent.target;\n if (clicked !== target && clicked.parentElement !== target && $('.popover.show').length) {\n $(target).trigger('click');\n }\n });\n });\n};\n/*\n * Assign custom close event on custom selector\n */\nconst initPopoverCloseSelector = () => {\n $('[data-close-popover-selector]').on('click', function () {\n const tooltipSelector = $(this).data('close-popover-selector');\n $(tooltipSelector).popover('hide');\n });\n};\n\n/**\n * Initializing popover for promotions on a page\n */\nconst initPopoverPromotions = () => {\n queryAll('.promotions-info').forEach((button) => {\n const popoverContent = queryFirst('.promotions-info-popover .promotions-info-popover-content', button.parentElement);\n\n $(button).popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: popoverContent\n });\n });\n};\n/**\n * Initializing popover for strike hearts on a page\n */\nconst initPopoverWishList = () => {\n queryAll('.strike-wish-list').forEach((button) => {\n const popoverContent = button.dataset.content;\n $(button).popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: popoverContent\n });\n });\n};\n\n/**\n * Early access locked message popover\n */\nconst initPopoverEarlyAccessLocked = () => {\n const earlyAccessMessage = queryFirst('.loyalty-early-access-lock-container .early-access-container-tooltip');\n\n if (hasClass(queryFirst(earlyAccessLockedSelector), 'has-early-access-container')) {\n initPopover(earlyAccessLockedSelector, POPOVER_CLICK_BOTTOM, {\n content: earlyAccessMessage\n });\n }\n};\n\n/**\n * All of usual popover elements on site\n * TODO: Ideally refactor to something dynamical, when it appear in DOM - initialize it\n */\nconst initPopoverAll = () => {\n initPopover('.ph-number-info', POPOVER_CLICK_BOTTOM, {\n content: phInfoPopover\n });\n\n const popoverIcons = queryAll('.loyalty-tooltip-icon');\n popoverIcons.forEach((tooltipIcon) => {\n const popContent = queryFirst('.loyalty-tooltip-popover', tooltipIcon.parentElement);\n\n initPopover(tooltipIcon, POPOVER_CLICK_BOTTOM, {\n content: popContent,\n placement: 'auto'\n });\n });\n\n initPopover('.birthday-info', POPOVER_CLICK_BOTTOM, {\n content: birthdayInfoPopover\n });\n\n initPopover('.fpo-info', POPOVER_CLICK_BOTTOM, {\n content: fpoInfoPopover\n });\n\n initPopover('.checkout-benefits-info', POPOVER_CLICK_BOTTOM, {\n container: '.new-customers',\n offset: '160 0',\n content: checkoutBenefitsInfoPopover\n });\n\n initPopover('.cvv-info', POPOVER_CLICK_BOTTOM, {\n content: cvvInfoPopover\n });\n\n initPopover('.gift-return-order-no', POPOVER_CLICK_BOTTOM, {\n content: giftReturnNumberInfoPopover\n });\n\n initPopover('.gift-card-number-info', POPOVER_CLICK_BOTTOM, {\n content: giftCardInfoPopover\n });\n\n initPopover('.delivery-fee-info', POPOVER_CLICK_BOTTOM, {\n content: deliveryFeeInfoPopover\n });\n\n initPopover('.bolt-logout-button-container', POPOVER_CLICK_BOTTOM, {\n content: boltSignoutMessage\n });\n\n initPopoverPromotions();\n initPopoverWishList();\n\n if (hasClass(queryFirst(earlyAccessLockedSelector), 'has-early-access-container')) {\n initPopover(earlyAccessLockedSelector, POPOVER_CLICK_BOTTOM, {\n content: earlyAccessMessage\n });\n }\n\n initPopover(keepUserSignedInPopover, POPOVER_CLICK_BOTTOM, {\n content: keepUserSignedInContainer\n });\n\n initPopover(pdpChatPopover, {\n html: true,\n container: pdpChatWrapper,\n placement: 'bottom',\n content: pdpChatContainer\n });\n\n initPopoverClose();\n initPopoverCloseSelector();\n};\n\nmodule.exports.POPOVER_CLICK_BOTTOM = POPOVER_CLICK_BOTTOM;\n// export the initialization function for places where popover may be initialized dynamically\nmodule.exports.initPopoverClose = initPopoverClose;\nmodule.exports.initPopoverCloseSelector = initPopoverCloseSelector;\n// export function for single initialization of popover\nmodule.exports.initPopover = initPopover;\nmodule.exports.initPopoverPromotions = initPopoverPromotions;\nmodule.exports.initPopoverEarlyAccessLocked = initPopoverEarlyAccessLocked;\nmodule.exports.initPopoverAll = initPopoverAll;\nmodule.exports.initPopoverWishList = initPopoverWishList;\n","/**\n * OOTBS SFRA JS code\n * DRP-180 updated addToCart product set code on line 772 for custom designs\n */\n\n'use strict';\nconst focusHelper = require('base/components/focus');\nimport { queryFirst, queryAll, addClass, removeClass, hasClass, remove, renderFragment, toFormData } from '../domUtil';\nimport { formatMessage, getJSON, getNestedValue, tokenize } from '../util';\nimport { updateProductData, handleColor } from 'fitpredictor/product/secretsauce';\nimport { getStoredDataLayerInfo } from 'analytics/util/analytics-util';\nimport { P_PRODUCT_LIST_KEY, P_PROMO_NAME_KEY, P_PROMO_CREATIVE_NAME } from 'analytics/util/constants';\nimport { setWishlistProductId, showStrikeHearts } from '../wishlist/helper';\n\nconst { trackPageView } = require('../components/etmc');\nconst { toggleSelectSizeInfo, isEarlyAccessElement } = require('./helper');\nconst { swatchNameTemplate, sizeOptionTemplate, sizeButtonTemplate, gwpSizeTemplate, dialogTemplate, loyalty: loyaltyTemplates } = require('../templates');\nconst $body = $('body');\nconst $gwpDialog = $('#chooseBonusProductModal');\nconst hiddenClass = 'd-none';\nconst readyClass = 'ready-to-add';\nconst selectedProductClass = 'selected-product';\nconst notAvailable = 'not-available';\nconst { updateVisibilityOfLowInventoryMsg } = require('../components/shippingPreference/shippingPreferenceHelper');\nconst isFitPredictorEnabled = !!queryFirst('#fitPredictorEnabled');\nconst { PRODUCT_DETAIL_CONTAINER_SELECTOR } = require('../components/shippingPreference/constants');\nconst { HIDDEN_CLASS } = require('../constants');\nconst loyaltyProfile = getNestedValue(window, 'lillyUtils.profile') || {};\nconst { isLoyaltyProgramMember, isLoyaltyAuthenticated, isLoyaltyEnabled } = loyaltyProfile;\nlet observer;\nlet isContentModulesFetched = false;\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').attr('data-pid');\n } else if ($('.quickview-container').length && !$('.product-set').length) {\n pid = $($el).closest('.quickview-container').find('.product-quickview').attr('data-pid');\n } else if ($('.product-set-detail').length || $('.product-set').length) {\n pid = $($el).closest('.product-detail').find('.product-id').first().text();\n } else {\n pid = $($el).closest('.product-detail').find('.product-id').first().text();\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 return $el && $('.set-items').length ? $el.closest('.product-detail').find('.quantity-select') : $('.quantity-select');\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 var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n attr.values.forEach(function (attrValue) {\n var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"' + 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 const { bonusVariationUrl, url } = attrValue;\n\n if (isChoiceOfBonusProducts) {\n if (bonusVariationUrl) {\n $swatchButton.attr('data-url', bonusVariationUrl);\n } else {\n $swatchButton.removeAttr('data-url');\n }\n } else if (url) {\n $swatchButton.attr('data-url', 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 const $bonusProductItem = $productContainer.parent('.bonus-product-item');\n if ($bonusProductItem.length) {\n const sizes = attr.values;\n const sizeContainer = queryFirst('.selected-size-container', $bonusProductItem[0]);\n if (!sizes.length || !sizeContainer) {\n return;\n }\n\n if (sizes.length === 1) {\n sizeContainer.innerHTML = formatMessage(gwpSizeTemplate.singleSize, sizes[0].displayValue);\n } else {\n const loopStatus = sizeContainer.dataset.loopStatus;\n const resetUrl = attr.resetUrl;\n const selectLabel = sizeContainer.dataset.selectLabel;\n const selectId = `bonus-size-${loopStatus.count || '1'}`;\n\n let sizeOptions = formatMessage(gwpSizeTemplate.multiDefaultSizeOption, resetUrl, selectLabel);\n sizeOptions += sizes\n .map(function (size) {\n const selected = size.selected ? ' selected ' : '';\n const className = !size.inStock || size.forceOutOfStock ? notAvailable : '';\n if (className) {\n const outOfStockMsg = sizeContainer.dataset.outOfStock;\n size.displayValue += ' - ' + outOfStockMsg;\n }\n return formatMessage(gwpSizeTemplate.multiSizeOption, size.url, size.value, selected, size.displayValue, className, className ? 'disabled' : '');\n })\n .join('');\n sizeContainer.innerHTML = formatMessage(gwpSizeTemplate.multiSize, selectId, sizeOptions);\n }\n } else {\n var $attr = '[data-attr=\"' + attr.id + '\"]';\n const selectSizeEl = $productContainer.find('.select-size')[0];\n let selectedValue = '';\n if (selectSizeEl) {\n $(selectSizeEl).find('option').not(':first').remove();\n $(selectSizeEl).find('option:first').attr('value', attr.resetUrl);\n }\n attr.values.forEach(function (attrValue) {\n if (selectSizeEl) {\n const assistiveElement = queryFirst('.selected-assistive-text', selectSizeEl.closest('.size-list'));\n assistiveElement.textContent = selectSizeEl.selectedOptions[0].dataset.attrValue;\n if (!attrValue.isOffline) {\n selectSizeEl.innerHTML += sizeOptionTemplate(attrValue.url, attrValue.value);\n }\n if (attrValue.selected) {\n selectedValue = attrValue.value;\n }\n } else {\n var $attrValue = $productContainer.find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n const sizeListItemEl = $attrValue.closest('.size-list');\n if (!attrValue.isOffline) {\n sizeListItemEl.removeClass(hiddenClass);\n } else {\n sizeListItemEl.addClass(hiddenClass);\n }\n if ($attrValue.length > 0) {\n $attrValue.val(attrValue.url).attr('data-attr-url', attrValue.url).removeClass(notAvailable);\n const assistiveElement = queryFirst('.selected-assistive-text', $attrValue[0].closest('.size-list'));\n assistiveElement.textContent = '';\n const { selectedText, outOfStock } = assistiveElement.dataset;\n if (hasClass($attrValue[0], 'selected')) {\n assistiveElement.textContent += selectedText;\n }\n if (!attrValue.inStock || attrValue.forceOutOfStock) {\n $attrValue.addClass(notAvailable);\n assistiveElement.textContent += outOfStock;\n }\n }\n }\n });\n if (selectSizeEl && selectedValue) {\n const optionEl = queryFirst('[data-attr-value=\"' + selectedValue + '\"]', selectSizeEl);\n if (optionEl) {\n optionEl.selected = true;\n } else {\n selectSizeEl.selectedIndex = 0;\n }\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 const { isDirectlyPurchasable } = response.product;\n const availabilityMsgEl = queryFirst('.availability-msg', $productContainer[0]);\n if (isDirectlyPurchasable === false && availabilityMsgEl) {\n availabilityValue = `
  • ${availabilityMsgEl.dataset.notPurchasable}

  • `;\n } else if (response.product.readyToOrder) {\n availabilityMessages.forEach(function (message) {\n availabilityValue += `
  • \n ${message}\n

  • `;\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 + ': ' + attribute.value + '
    ';\n });\n }\n });\n\n return html;\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 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 * Handles the CTAs to be shown for Early Access Product\n * @param {jQuery} productContainer - DOM element for current product\n * @param {boolean} isEarlyAccessProduct - Is the product Early Access Product\n */\nfunction handleEarlyAccessCta(productContainer, isEarlyAccessProduct) {\n const earlyAccessLockIcon = queryFirst('.loyalty-early-access-lock-container', productContainer);\n const earlyAccessWishlistIcon = queryFirst('.add-to-wish-list-container', productContainer);\n const earlyAccessCta = queryFirst('.loyalty-early-access-restricted', productContainer);\n const addToCartCta = queryFirst('.add-to-cart', productContainer);\n const earlyAccessPdpEl = queryFirst('.loyalty-product-pdp-badge', productContainer);\n if (isLoyaltyEnabled && earlyAccessCta) {\n if (earlyAccessPdpEl) {\n addClass([earlyAccessPdpEl, earlyAccessCta], hiddenClass);\n }\n if (isEarlyAccessProduct) {\n if (isLoyaltyProgramMember) {\n addClass([earlyAccessLockIcon, earlyAccessCta], HIDDEN_CLASS);\n if (earlyAccessWishlistIcon && addToCartCta) {\n removeClass([earlyAccessWishlistIcon, addToCartCta], HIDDEN_CLASS);\n }\n } else {\n removeClass([earlyAccessLockIcon, earlyAccessCta], HIDDEN_CLASS);\n if (earlyAccessWishlistIcon && addToCartCta) {\n addClass([earlyAccessWishlistIcon, addToCartCta], HIDDEN_CLASS);\n }\n const earlyAccessGuest = queryFirst('.early-access-guest', earlyAccessCta);\n const earlyAccessRegistered = queryFirst('.early-access-registered', earlyAccessCta);\n if (isLoyaltyAuthenticated) {\n addClass(earlyAccessGuest, HIDDEN_CLASS);\n removeClass(earlyAccessRegistered, HIDDEN_CLASS);\n } else {\n removeClass(earlyAccessGuest, HIDDEN_CLASS);\n addClass(earlyAccessRegistered, HIDDEN_CLASS);\n }\n }\n if (earlyAccessPdpEl) {\n removeClass(earlyAccessPdpEl, hiddenClass);\n }\n } else {\n if (earlyAccessWishlistIcon && addToCartCta) {\n removeClass([earlyAccessWishlistIcon, addToCartCta], hiddenClass);\n }\n addClass([earlyAccessLockIcon, earlyAccessCta], hiddenClass);\n }\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 * @param {boolean} isEarlyAccess - Check if the product is early access product\n * @param {boolean} earlyAccessText - Early Access badge text\n * @param {string} videoUrl - Selected variant group video url\n */\nfunction createCarousel(imgs, $productContainer, isEarlyAccess, earlyAccessText, videoUrl) {\n var carousel = $productContainer.find('.carousel:not(.tile-carousel)');\n $(carousel).carousel('dispose');\n var carouselId = $(carousel).attr('id');\n\n const displayCounter = $productContainer.hasClass('product-quickview');\n\n $(carousel)\n .empty()\n .append(\n '
      ' +\n $(carousel).data('prev') +\n '' +\n $(carousel).data('next') +\n ''\n );\n let i;\n for (i = 0; i < imgs.length; i++) {\n let counterHtml = '';\n if (displayCounter && imgs.length > 1) {\n counterHtml = `${i + 1} ${'/'} ${imgs.length}`;\n }\n\n const imageZoomUrl = carousel.data('image');\n const imagePresetUrl = carousel.data('preset');\n const enableCache = carousel.data('cache');\n\n let dataSrc = '';\n if (imgs[i].url.includes(imagePresetUrl)) {\n dataSrc = imgs[i].url.replace(imagePresetUrl, imageZoomUrl);\n } else {\n dataSrc = imgs[i].url + '?$' + imageZoomUrl + '$';\n }\n $(\n '
      ' +\n (i === 0 && earlyAccessText ? formatMessage(loyaltyTemplates.carouselBadge, earlyAccessText) : '') +\n '\"' ' +\n counterHtml +\n '
      '\n ).appendTo($(carousel).find('.carousel-inner'));\n $(\n '
    1. '\n ).appendTo($(carousel).find('.carousel-indicators'));\n }\n const productContainer = $productContainer[0];\n const earlyAccessPdpEl = queryFirst('.loyalty-product-pdp-badge', productContainer);\n const addToWishlistIconPdp = queryFirst('.add-to-wish-list-container', productContainer);\n const loyaltyEarlyAccessEl = queryFirst('.loyalty-early-access-restricted', productContainer);\n const addToCartButtonPdp = queryFirst('.pdp-container .add-to-cart', productContainer);\n const pdpNonEarlyAccessLoginEl = queryFirst('.pdp-sign-in-create-account-section', productContainer);\n\n if (pdpNonEarlyAccessLoginEl) {\n const { isLoyaltyEnabled } = pdpNonEarlyAccessLoginEl.dataset;\n if (isLoyaltyEnabled === 'true' && !isEarlyAccess) {\n removeClass(pdpNonEarlyAccessLoginEl, hiddenClass);\n } else {\n addClass(pdpNonEarlyAccessLoginEl, hiddenClass);\n }\n }\n if (addToCartButtonPdp) {\n removeClass(addToCartButtonPdp, hiddenClass);\n }\n if (earlyAccessPdpEl && loyaltyEarlyAccessEl) {\n addClass([earlyAccessPdpEl, loyaltyEarlyAccessEl], hiddenClass);\n }\n removeClass(addToWishlistIconPdp, hiddenClass);\n if (isEarlyAccess) {\n const loyaltyEarlyAccessLockContainer = queryFirst('.primary-images .loyalty-early-access-lock-container', productContainer);\n if (loyaltyEarlyAccessLockContainer) {\n addClass(loyaltyEarlyAccessLockContainer, hiddenClass);\n }\n }\n handleEarlyAccessCta(productContainer, isEarlyAccess);\n\n const firstImageElement = queryFirst('.carousel-inner .carousel-item img.img-fluid', $productContainer[0]);\n if (firstImageElement) {\n firstImageElement.addEventListener('load', () => {\n $body.trigger('product:imageLoad', {\n container: $productContainer[0]\n });\n });\n }\n if (videoUrl) {\n // LP customizations start\n const productContainer = $productContainer[0];\n const videoTemplate = queryFirst('.product-video-template').cloneNode(true);\n const templateVideoElement = queryFirst('.carousel-item video', videoTemplate);\n if (templateVideoElement) {\n templateVideoElement.setAttribute('poster', imgs[0].url);\n queryAll('source', templateVideoElement).forEach(eachElement => {\n eachElement.setAttribute('src', videoUrl);\n });\n queryFirst('.carousel-inner', carousel[0]).appendChild(queryFirst('.carousel-item', videoTemplate));\n queryFirst('.carousel-item video', productContainer).load();\n }\n // LP customizations end\n\n $('
    2. ').appendTo(\n $(carousel).find('.carousel-indicators')\n );\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 = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n const { variationAttributes, productType, readyToOrder, bonusVariationAtrributes, isFinalSale, isDirectlyPurchasable, earlyAccess } = response.product;\n const saleMessageEl = queryFirst('.on-sale-message', $productContainer[0]);\n if (saleMessageEl) {\n if (isFinalSale) {\n removeClass(saleMessageEl, hiddenClass);\n } else {\n addClass(saleMessageEl, hiddenClass);\n }\n }\n\n if (isChoiceOfBonusProducts) {\n if (bonusVariationAtrributes) {\n updateAttrs(bonusVariationAtrributes, $productContainer, response.resources);\n }\n if (productType === 'variant') {\n $productContainer.parent('.bonus-product-item').data('ready-to-order', readyToOrder);\n }\n } else if (variationAttributes) {\n updateAttrs(variationAttributes, $productContainer, response.resources);\n if (isDirectlyPurchasable === false) {\n const sizeElements = queryAll('.size-btn', $productContainer[0]);\n addClass(sizeElements, notAvailable);\n }\n }\n\n // Update primary images\n var primaryImageUrls = isChoiceOfBonusProducts ? response.product.images.checkout : response.product.images.large;\n\n const productContainer = $productContainer[0];\n if (isChoiceOfBonusProducts) {\n // LP customization changes start\n const { alt, url, srcset } = primaryImageUrls[0] || {};\n const productImageElement = queryFirst('.product-image', productContainer);\n productImageElement.setAttribute('src', url);\n productImageElement.setAttribute('srcset', srcset);\n productImageElement.setAttribute('alt', alt);\n // LP customization changes end\n } else if (hasClass(productContainer, 'custom-set-product')) {\n const setModalImages = response.product.images.ispu;\n if (setModalImages) {\n const { alt, url, srcset } = setModalImages[0] || {};\n const productImageElement = queryFirst('.custom-set-detail-modal-img img', productContainer);\n productImageElement.setAttribute('src', url);\n productImageElement.setAttribute('srcset', srcset);\n productImageElement.setAttribute('alt', alt);\n }\n } else {\n createCarousel(primaryImageUrls, $productContainer, earlyAccess && earlyAccess.isEarlyAccessProduct);\n }\n\n // Updated logic here\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const selectedSwatch = queryFirst('.swatch-circle.selected', productContainer);\n let selectedSwatchName = '';\n if (selectedSwatch) {\n selectedSwatchName = selectedSwatch.dataset.swatchName;\n }\n if (swatchNameElement) {\n swatchNameElement.textContent = selectedSwatchName;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, selectedSwatchName);\n const selectedSwatchElement = queryFirst('.selected-swatch', productContainer);\n if (selectedSwatchElement) {\n selectedSwatchElement.innerHTML = swatchHtml;\n }\n }\n\n // Update pricing\n if (!isChoiceOfBonusProducts) {\n let $priceSelector = $('.prices .price', $productContainer);\n if (!$priceSelector.length) $priceSelector = $('.prices .price');\n $priceSelector.replaceWith(response.product.price.html);\n }\n\n // Update promotions\n const promotionElement = queryFirst('.promotions', productContainer);\n if (promotionElement) {\n promotionElement.innerHTML = response.product.promotionsHtml;\n }\n\n const promotionsPopover = queryFirst('.promotions-info-popover .promotions-info-popover-content');\n $('.custom-set-detail').find('.promotions-info').popover({\n trigger: 'click',\n placement: 'bottom',\n html: true,\n content: promotionsPopover\n });\n $('[data-toggle=\"popover\"]').off('shown.bs.popover').on('shown.bs.popover', function (e) {\n var target = e.target;\n $(document).one('click', function (clickEvent) {\n var clicked = clickEvent.target;\n if (clicked !== target && clicked.parentElement !== target) {\n $(target).trigger('click');\n }\n });\n });\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,\n $productContainer: $productContainer\n });\n } else if ($productContainer.closest('#productSetModal').length > 0) {\n // Enable \"Add to Cart\" button if all required attributes have been selected\n $('button.add-to-cart-global, button.update-cart-product-global')\n .trigger('product:updateAddToCart', {\n product: response.product,\n $productContainer: $productContainer\n })\n .trigger('product:statusUpdate', response.product);\n }\n\n // Update attributes\n $productContainer.find('.main-attributes').empty().html(getAttributesHtml(response.product.attributes));\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 const $bonusProductItem = $productContainer.parent('.bonus-product-item');\n if (!($bonusProductItem.length > 0)) {\n var optionsHtml = quantities\n .map(function (quantity) {\n var selected = quantity.selected ? ' selected ' : '';\n return '';\n })\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 * @param {Object} selectedSizeElement - DOM element for selected size button\n */\nfunction attributeSelect(selectedValueUrl, $productContainer, selectedSizeElement) {\n if (selectedValueUrl) {\n $body.trigger('product:beforeAttributeSelect', {\n url: selectedValueUrl,\n container: $productContainer\n });\n\n // Updated logic here\n const $choiceOfBonusProductEl = $productContainer.closest('.choice-of-bonus-product');\n if ($choiceOfBonusProductEl.length) {\n $productContainer.spinner().start();\n }\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 $body.trigger('product:afterAttributeSelect', {\n data: data,\n container: $productContainer,\n selectedSizeElement\n });\n if ($choiceOfBonusProductEl.length) {\n $choiceOfBonusProductEl.trigger('bonus:afterAttributeSelect');\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\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 selectColorAttribute(selectedValueUrl, $productContainer) {\n if (selectedValueUrl) {\n $body.trigger('product:beforeAttributeSelect', {\n url: selectedValueUrl,\n container: $productContainer\n });\n\n // Updated logic here\n const $choiceOfBonusProductEl = $productContainer.closest('.choice-of-bonus-product');\n if ($choiceOfBonusProductEl.length) {\n $productContainer.spinner().start();\n }\n\n getJSON(\n selectedValueUrl,\n 'GET',\n null,\n data => {\n const { options, quantities, uuid } = data.product;\n handleVariantResponse(data, $productContainer);\n updateOptions(options, $productContainer);\n updateQuantities(quantities, $productContainer, uuid);\n const selectedSizeElement = queryFirst('.size-btn.selected', $productContainer[0]);\n $body.trigger('product:afterAttributeSelect', {\n data: data,\n container: $productContainer,\n selectedSizeElement\n });\n if ($choiceOfBonusProductEl.length) {\n const sizeEl = queryFirst('.select-size', $choiceOfBonusProductEl[0]);\n if (sizeEl) sizeEl.selectedIndex = 0;\n $choiceOfBonusProductEl.trigger('bonus:afterAttributeSelect');\n }\n const swatchContainer = queryFirst('.color-container', $productContainer[0]);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const selectedSwatchElement = queryFirst('.swatch-circle.selected', $productContainer[0]);\n const assistiveTextElement = queryFirst('.selected-assistive-text', selectedSwatchElement.closest('.color-list'));\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n },\n () => {\n $.spinner().stop();\n }\n );\n }\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} data - Shop the print data\n * @param {Object} productContainer - DOM container for a given product\n */\nfunction updateShopThePrint(data, productContainer) {\n const shopThePrintElement = queryFirst('.shop-the-print', productContainer);\n if (shopThePrintElement) {\n if (data) {\n shopThePrintElement.outerHTML = data;\n } else {\n shopThePrintElement.outerHTML = '
      ';\n }\n }\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {int} price - product sale price\n * @param {int} standardPrice - product standard price\n * @param {Object} productContainer - DOM container for a given product\n */\nfunction updateProductPrice(price, standardPrice, productContainer) {\n const priceTemplate = document.getElementById('price-template').cloneNode(true);\n const priceSection = queryFirst('.prices .price', productContainer);\n const priceContainer = queryFirst('.price-section', priceTemplate);\n const strikeThroughContainer = queryFirst('.strike-through-section', priceContainer);\n const priceElement = queryFirst('.strike-through-price', strikeThroughContainer);\n const salesContainer = queryFirst('.sales', priceContainer);\n const salesPriceElement = queryFirst('.price-value', salesContainer);\n let fixedPrice = price;\n let fixedStandardPrice = standardPrice;\n\n // Fix decimal places for non-whole-number prices\n if (price % 1 !== 0) {\n fixedPrice = price.toFixed(2);\n }\n if (standardPrice % 1 !== 0) {\n fixedStandardPrice = standardPrice.toFixed(2);\n }\n\n removeClass(strikeThroughContainer, hiddenClass);\n priceElement.textContent = `$${fixedStandardPrice}`;\n salesPriceElement.textContent = `$${fixedPrice}`;\n if (price === standardPrice) {\n addClass(strikeThroughContainer, hiddenClass);\n }\n priceSection.innerHTML = priceTemplate.innerHTML;\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} sizes - sizes object\n * @param {Object} productContainer - DOM container for a given product\n * @param {Object} variantsList - Variations list data\n */\nfunction updateSizeElements(sizes, productContainer, variantsList) {\n const isQuickView = hasClass(productContainer, 'cached-quick-view');\n const { variants } = isQuickView ? window.quickviewProductInfo.productInventory : window.productInventory;\n const sizeContainer = queryFirst('.size-container', productContainer);\n\n if (!sizeContainer) return;\n\n const { selectedText, outOfStock, label, describedby, attrValue } = sizeContainer.dataset;\n let sizeButtonHtml = '';\n\n variantsList.forEach((eachVariant, index) => {\n const eachSize = sizes[eachVariant];\n const sizeElement = queryFirst('[data-attr=\"size\"] [data-attr-value=\"' + eachVariant + '\"]', productContainer);\n const sizeId = eachSize.ID;\n const { forceOutOfStock } = eachSize;\n const inventoryData = variants[sizeId];\n const variantData = {\n value: eachVariant,\n forceOutOfStock,\n selected: sizeElement ? hasClass(sizeElement, 'selected') : false,\n inStock: inventoryData.availabilityStatus !== 'NOT_AVAILABLE'\n };\n const ariaLabelValue = label + ' ' + attrValue + ' ' + eachVariant;\n sizeButtonHtml += sizeButtonTemplate(variantData, ariaLabelValue, describedby + eachVariant + index, selectedText, outOfStock);\n });\n remove(queryAll('.size-list', sizeContainer));\n sizeButtonHtml += sizeContainer.innerHTML;\n sizeContainer.innerHTML = sizeButtonHtml;\n}\n\n/**\n * Function to update Ways to wear content based on the response\n * @param {string} groupId - selected variation group id\n * @param {string} variationUrl - url to fetch the content\n * @param {HTMLElement} waysToWearContainer - container with recommendations\n */\nfunction updateContentModules(groupId, variationUrl, waysToWearContainer, entry) {\n if (isContentModulesFetched || !entry.isIntersecting) { return; }\n\n $(waysToWearContainer).spinner().start();\n $.ajax({\n url: variationUrl,\n method: 'post',\n data: {\n variationGroup: groupId\n }\n }).done(function (response) {\n if (response) {\n waysToWearContainer.innerHTML = response;\n } else {\n waysToWearContainer.innerHTML = '';\n }\n $body.trigger('search:updateProducts');\n }).always(function () {\n $(waysToWearContainer).spinner().stop();\n isContentModulesFetched = true;\n });\n\n destroyContentModulesIntersectionObserver(waysToWearContainer);\n}\n\n/**\n * Fetch Ways to Wear components only when user scroll near their position\n * @param {string} groupId - selected variation group id\n * @param {string} variationUrl - url to fetch the content\n */\nfunction dynamicallyFetchContentModules(groupId, variationUrl) {\n const waysToWearContainer = queryFirst('.ways-to-wear');\n if (!waysToWearContainer) { return; }\n\n observer = new IntersectionObserver(\n ([entry]) => updateContentModules(groupId, variationUrl, waysToWearContainer, entry),\n { rootMargin: '500px', threshold: 0 }\n );\n observer.observe(waysToWearContainer);\n}\n\n/**\n * Destroy Intersection Observer of Ways to Wear components since it needed only once\n * @param {HTMLElement} waysToWearContainer - container with recommendations\n */\nfunction destroyContentModulesIntersectionObserver(waysToWearContainer) {\n if (observer instanceof IntersectionObserver) {\n observer.unobserve(waysToWearContainer);\n observer = null;\n }\n}\n\n/**\n * updates image urls and presets by appending the scene7 url\n * @param {Object} images - images array to be updated\n * @returns {Object} - updated images array\n */\nfunction updateImageDetails(images) {\n const updatedImages = images.map(imageObj => {\n const srcsetPresets = JSON.parse(imageObj.srcset);\n let srcsetString = [];\n srcsetPresets.forEach(function (item) {\n srcsetString.push(imageObj.imageScene7 + '?' + item.preset + ' ' + item.breakpoint);\n });\n return {\n alt: imageObj.alt,\n url: imageObj.imageScene7 + imageObj.url,\n srcset: srcsetString.join(', '),\n title: imageObj.title\n };\n });\n return updatedImages;\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {Object} currentElement - selected color element\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateProductDetails(currentElement, $productContainer) {\n const { promotionMessageTmpl } = require('../templates').productDetail;\n const { initPopoverPromotions, initPopoverClose } = require('../popover');\n const elementData = currentElement.dataset;\n const variantGroupId = elementData.attrValue;\n const productContainer = $productContainer[0];\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const swatchContainer = queryFirst('.color-container', productContainer);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const assistiveTextElement = queryFirst('.selected-assistive-text', currentElement.closest('.color-list'));\n const monogramBtn = queryFirst('.monogram-btn', productContainer);\n const masterId = productContainer.dataset.masterid;\n const productInfo = window.productInfo[masterId];\n const { groupId, sizes, images, shopThePrint, price, standardPrice, videoUrl, variantsList, mgFlag, mgLocs, hasWaysToWear, isFinalSale, isDirectlyPurchasable, earlyAccess, promotions } = productInfo.variants[variantGroupId];\n productContainer.dataset.wishlistId = groupId;\n setWishlistProductId(groupId, productContainer);\n const colorElements = queryAll('.color-attribute .swatch-circle', productContainer);\n const { attrDisplayvalue, customPageTitle, pageTitle, includeLillyColor, lillyColorName, customPageDescription, pageDescription } = elementData;\n const titleElement = queryFirst('.meta-page-title');\n const descriptionElement = queryFirst('.meta-page-description');\n const waysToWearEl = queryFirst('.ways-to-wear', productContainer);\n const variationGridUrl = waysToWearEl.dataset.variationGridUrl;\n const earlyAccessBadgeTextEl = queryFirst('.loyalty-product-pdp-badge .product-tile-badge-text', productContainer);\n const earlyAccessText = earlyAccessBadgeTextEl.textContent;\n // update Marketing Analytics trackWishlist event\n let marketingCloudPageAnalytics = [{ item: groupId }];\n trackPageView(marketingCloudPageAnalytics);\n // Updated logic here\n if (swatchNameElement) {\n const selectedSwatchElement = queryFirst('.selected-swatch', productContainer);\n const colorlabel = selectedSwatchElement.dataset.colorLabel;\n swatchNameElement.textContent = colorlabel + attrDisplayvalue;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, attrDisplayvalue);\n queryFirst('.selected-swatch', productContainer).innerHTML = swatchHtml;\n }\n\n if (customPageTitle && titleElement) {\n titleElement.textContent = customPageTitle;\n } else if (pageTitle && titleElement) {\n titleElement.textContent = pageTitle;\n }\n const longDescriptionElement = queryFirst('.long-description-container .long-description', productContainer);\n if (longDescriptionElement) {\n const { longDescription } = longDescriptionElement.dataset;\n let description;\n if (includeLillyColor !== 'false' && lillyColorName) {\n description = tokenize(longDescription, { lillyColor: lillyColorName }, '{{', '}}');\n } else {\n description = tokenize(longDescription, { lillyColor: '' }, '
    3. {{', '}}
    4. ');\n }\n longDescriptionElement.innerHTML = description;\n }\n if (customPageDescription && descriptionElement) {\n descriptionElement.content = customPageDescription;\n } else if (pageDescription && descriptionElement) {\n descriptionElement.content = pageDescription;\n }\n\n removeClass(colorElements, 'selected');\n addClass(queryFirst('.swatch-circle', currentElement), 'selected');\n queryFirst('.product-id', productContainer).textContent = masterId;\n\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n\n const productFinalSaleMessage = queryFirst('.on-sale-message', productContainer);\n const productFreeReturnsMessage = queryFirst('.pdp-header-promo');\n if (productFinalSaleMessage) {\n if (isFinalSale) {\n removeClass(productFinalSaleMessage, hiddenClass);\n addClass(productFreeReturnsMessage, 'd-none');\n } else {\n addClass([productFinalSaleMessage], hiddenClass);\n removeClass(productFreeReturnsMessage, 'd-none');\n }\n }\n\n if (mgFlag && mgLocs && mgLocs.length > 0) {\n removeClass(monogramBtn, hiddenClass);\n } else {\n addClass(monogramBtn, hiddenClass);\n }\n\n if (hasWaysToWear) {\n isContentModulesFetched = false;\n dynamicallyFetchContentModules(groupId, variationGridUrl);\n } else {\n waysToWearEl.innerHTML = '';\n }\n updateSizeElements(sizes, productContainer, variantsList);\n\n $body.trigger('product:updateStoreInventory', {\n productContainer\n });\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n updateShopThePrint(shopThePrint, productContainer);\n updateProductPrice(price, standardPrice, productContainer);\n const ssColor = currentElement.dataset.attrDisplayvalue;\n const ssSizeElement = queryFirst('.size-btn.selected', productContainer);\n const ssSize = ssSizeElement ? ssSizeElement.dataset.attrValue : 'unknown';\n\n if (isFitPredictorEnabled) {\n updateProductData(ssColor, ssSize, standardPrice, price, productContainer);\n handleColor(productContainer);\n }\n\n if (!ssSizeElement) {\n $('.availability-msg', $productContainer).empty();\n // update promotion messages display for selected color (size not selected yet here)\n queryFirst('.promotions').innerHTML = promotions ? promotions.filter((promotion) => promotion.calloutMsg).map((promotion, promotionIdx) => {\n return promotionMessageTmpl(promotion.calloutMsg, promotion.details, promotionIdx);\n }).join('') : '';\n // pick new promotion popover elements\n initPopoverPromotions();\n initPopoverClose();\n }\n // Update primary images\n var primaryImageUrls = updateImageDetails(images.large);\n\n if (window.matchMedia('(max-width: 767.98px)').matches) {\n const carouselContainerEl = queryFirst('.carousel.image-slider', productContainer);\n const carouselContainerHeight = carouselContainerEl.offsetHeight;\n carouselContainerEl.style.minHeight = carouselContainerHeight + 'px';\n }\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccess);\n createCarousel(primaryImageUrls, $productContainer, isEarlyAccessItem, earlyAccessText, videoUrl);\n $body.trigger('product:afterAttributeChange', {\n container: $productContainer,\n variantGroupId,\n groupId\n });\n $body.trigger('product:handleImageZoom');\n const wishlistButton = queryFirst('.add-to-wish-list', productContainer);\n if (wishlistButton && hasClass(wishlistButton, 'added-to-wish-list')) {\n removeClass(wishlistButton, 'added-to-wish-list');\n wishlistButton.disabled = false;\n const assistiveText = wishlistButton.getAttribute('data-assistive-text');\n wishlistButton.setAttribute('aria-label', assistiveText);\n }\n // Updated logic here\n const swatchParam = `?dwvar_${masterId}_color`;\n const queryParams = location.search;\n let UpdatedParams = `${swatchParam}=${variantGroupId}`;\n if (queryParams) {\n UpdatedParams = queryParams\n .split('&')\n .map(eachParam => {\n if (eachParam.indexOf(swatchParam) > -1) {\n return `${swatchParam}=${variantGroupId}`;\n }\n return eachParam;\n })\n .join('&');\n }\n history.replaceState({ variantGroupId }, document.title, UpdatedParams);\n}\n\n/**\n * updates the quick view when a product attribute is selected or deselected or when\n * changing quantity\n * @param {Object} currentElement - selected color element\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateQuickViewDetails(currentElement, $productContainer) {\n const elementData = currentElement.dataset;\n const variantGroupId = elementData.attrValue;\n const productContainer = $productContainer[0];\n const swatchNameElement = queryFirst('.selected-swatch-name', productContainer);\n const swatchContainer = queryFirst('.color-container', productContainer);\n const assistiveElements = queryAll('.selected-assistive-text', swatchContainer);\n const assistiveTextElement = queryFirst('.selected-assistive-text', currentElement.closest('.color-list'));\n const quickViewInfo = window.quickviewProductInfo;\n const { productInfo } = quickViewInfo;\n const { groupId, sizes, images, price, standardPrice, variantsList, isDirectlyPurchasable, pdpBreadCrumbs, earlyAccess } = productInfo.variants[variantGroupId];\n productContainer.dataset.wishlistId = groupId;\n setWishlistProductId(groupId, productContainer);\n handleEarlyAccessCta(productContainer, (earlyAccess && earlyAccess.isEarlyAccessProduct));\n const colorElements = queryAll('.color-attribute .swatch-circle', productContainer);\n const { attrDisplayvalue } = elementData;\n // Updated logic here\n if (swatchNameElement) {\n swatchNameElement.textContent = attrDisplayvalue;\n } else {\n const swatchHtml = formatMessage(swatchNameTemplate.swatchNameHtml, attrDisplayvalue);\n queryFirst('.selected-swatch', productContainer).innerHTML = swatchHtml;\n }\n removeClass(colorElements, 'selected');\n addClass(queryFirst('.swatch-circle', currentElement), 'selected');\n\n assistiveElements.forEach(eachElement => {\n eachElement.textContent = '';\n });\n\n assistiveTextElement.textContent = assistiveTextElement.dataset.selectedText;\n\n updateSizeElements(sizes, productContainer, variantsList);\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n\n updateProductPrice(price, standardPrice, productContainer);\n const ssColor = currentElement.dataset.attrDisplayvalue;\n const ssSizeElement = queryFirst('.size-btn.selected', productContainer);\n const ssSize = ssSizeElement ? ssSizeElement.dataset.attrValue : 'unknown';\n\n if (isFitPredictorEnabled) {\n updateProductData(ssColor, ssSize, standardPrice, price, productContainer);\n handleColor(productContainer);\n }\n\n if (!ssSizeElement) {\n $('.availability-msg', $productContainer).empty();\n }\n // Update primary images\n var primaryImageUrls = updateImageDetails(images.large);\n if (window.matchMedia('(min-width: 1024px)').matches) {\n const carouselContainerEl = queryFirst('.carousel', productContainer);\n const carouselContainerHeight = carouselContainerEl.offsetHeight;\n carouselContainerEl.style.minHeight = carouselContainerHeight + 'px';\n }\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccess);\n createCarousel(primaryImageUrls, $productContainer, isEarlyAccessItem);\n $body.trigger('product:quickViewAttributeChange', {\n container: $productContainer,\n variantGroupId,\n groupId,\n productContainer,\n monetateData: {\n pdpBreadCrumbs\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('.bonus-acordion-container');\n var selectedProducts = $html.find('.selected-products-container');\n var footer = $html.find('.modal-footer');\n\n return {\n body,\n footer,\n selectedProducts\n };\n}\n\n/**\n * Function to update GWP elements on swatch or size change\n */\nfunction updateGwpElements() {\n $('.choice-of-bonus-product').on('bonus:afterAttributeSelect', function () {\n const productDialog = queryFirst('.choose-bonus-product-dialog');\n const accordionContainer = this.closest('.bonus-acordion-container', productDialog);\n const bonusAccordionElements = queryAll('.bonus-acordion-container', productDialog);\n const addToCart = queryFirst('.add-bonus-products', productDialog);\n const sizeEl = queryFirst('.select-size', this);\n const isSizeSelected = sizeEl ? !!sizeEl.selectedIndex : true;\n const selectedSwatch = queryFirst('.color-attribute .swatch-circle.selected', this);\n const isSelectedSizeUnavailable = sizeEl && hasClass($(sizeEl).children('option:selected')[0], notAvailable);\n\n if (sizeEl) {\n const firstOption = queryFirst('option', sizeEl);\n\n // Force this option's resetUrl to remove the size\n firstOption.value = firstOption.value.replace(/(_size=)[^&]+/, '$1');\n }\n\n if (isSelectedSizeUnavailable) {\n addClass(sizeEl, notAvailable);\n } else {\n removeClass(sizeEl, notAvailable);\n }\n\n let isEnabled = true;\n const maxItems = parseInt(accordionContainer.dataset.maxItems, 10);\n const selectedItemsCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n\n if (selectedItemsCount < maxItems) {\n isEnabled = false;\n }\n\n if (isEnabled && isSizeSelected && !!selectedSwatch && !isSelectedSizeUnavailable) {\n addClass(accordionContainer, readyClass);\n } else {\n isEnabled = false;\n removeClass(accordionContainer, readyClass);\n }\n\n const validProducts = queryAll('.bonus-acordion-container.ready-to-add', productDialog);\n\n addToCart.disabled = !isEnabled || hasClass(addToCart, notAvailable) || bonusAccordionElements.length !== validProducts.length;\n });\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 var bonusUrl;\n if (data.bonusChoiceRuleBased) {\n bonusUrl = data.showProductsUrlRuleBased;\n } else {\n bonusUrl = data.showProductsUrlListBased;\n }\n\n const { maxBonusItems, addToCartUrl, uuid, pliUUID, pageSize, showProductsUrlRuleBased, bonusChoiceRuleBased, bonusDiscountLineItems } = data;\n $('.choose-bonus-product-dialog').attr({\n 'data-total-qty': maxBonusItems,\n 'data-addToCartUrl': addToCartUrl,\n 'data-UUID': uuid,\n 'data-pliUUID': pliUUID,\n 'data-pageStart': 0,\n 'data-pageSize': pageSize,\n 'data-moreURL': showProductsUrlRuleBased,\n 'data-bonusChoiceRuleBased': bonusChoiceRuleBased,\n 'data-bonus-items': JSON.stringify(bonusDiscountLineItems)\n });\n\n $.ajax({\n url: bonusUrl,\n method: 'GET',\n dataType: 'json',\n success: function (response) {\n var parsedHtml = parseHtml(response.renderedTemplate);\n $gwpDialog.find('.enter-message').text(response.enterDialogMessage);\n $gwpDialog.find('.modal-body').html(parsedHtml.body);\n $gwpDialog.find('.modal-footer, .selected-products-container').remove();\n $gwpDialog.find('.modal-content').append(parsedHtml.footer);\n $(parsedHtml.selectedProducts).insertAfter($gwpDialog.find('.modal-header'));\n // LP custom changes start\n const { selectedBonusProducts } = response;\n if ((selectedBonusProducts || []).length) {\n const modalDialog = queryFirst('.choose-bonus-product-dialog');\n let selectedProductsCount = 0;\n selectedBonusProducts.forEach(eachProductList => {\n if (eachProductList.length) {\n const bonusAccordionContainer = queryFirst(`.bonus-acordion-container[data-uuid=\"${eachProductList[0].uuid}\"]`, modalDialog);\n const maxCount = parseInt(bonusAccordionContainer.dataset.maxItems, 10);\n const productListLength = eachProductList.length;\n if (maxCount === productListLength) {\n addClass(bonusAccordionContainer, 'selected');\n addClass(bonusAccordionContainer, readyClass);\n }\n const bonusItemCount = queryFirst('.bonus-item-count span', bonusAccordionContainer);\n bonusItemCount.textContent = productListLength;\n selectedProductsCount += productListLength;\n eachProductList.forEach(eachProduct => {\n const selectedProduct = queryFirst(`.choice-of-bonus-product[data-pid=\"${eachProduct.pid}\"][data-uuid=\"${eachProduct.uuid}\"]`);\n const selectBonusCheckbox = queryFirst('.select-bonus-product', selectedProduct);\n\n if (selectBonusCheckbox) {\n selectBonusCheckbox.checked = true;\n }\n\n addClass(selectedProduct, selectedProductClass);\n setControlsEnabled(selectedProduct, true);\n });\n }\n });\n const addToCart = queryFirst('.add-bonus-products', modalDialog);\n addToCart.disabled = maxBonusItems !== selectedProductsCount;\n }\n\n // Default all size dropdowns that aren't selected products\n $('.bonus-product-item:not(.selected-product) .select-size').each(function () {\n this.selectedIndex = 0;\n });\n\n updateGwpElements();\n // LP custom changes end\n $gwpDialog.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 if (!response.error) {\n return;\n }\n\n if (response.displayModal) {\n let addToCartWarningDialog = queryFirst('#add-to-cart-warning-dialog');\n\n if (!addToCartWarningDialog) {\n const isOnCartPage = (window.location.pathname === '/cart/');\n const fragment = renderFragment(dialogTemplate({\n buttons: isOnCartPage ? [{ text: 'OK', primary: true }] : [{ text: 'Close' }, { text: 'Review Tote', primary: true, link: response.redirectLink }],\n modalContentHeading: response.messageHeading,\n modalContentBody: isOnCartPage ? response.messageBodyOnCart : response.messageBodyOffCart,\n id: 'add-to-cart-warning-dialog'\n }));\n\n document.body.appendChild(fragment);\n addToCartWarningDialog = queryFirst('#add-to-cart-warning-dialog');\n }\n\n $(addToCartWarningDialog).modal('show');\n } else {\n var messageType = response.error ? 'alert-danger' : 'alert-success';\n // show add to cart toast\n $('.add-to-cart-messages').remove();\n if ($('.add-to-cart-messages').length === 0) {\n $body.append('
      ');\n }\n\n $('.add-to-cart-messages').append('
      ' + response.message + '
      ');\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 + '\"]').data('value-id');\n return {\n optionId: $(this).data('option-id'),\n selectedValueId: selectedValueId\n };\n })\n .toArray();\n\n return JSON.stringify(options);\n}\n\n/**\n * Enables or disables the color/size controls in a container\n * @param {HTMLElement} container - The container element\n * @param {boolean} enable - Whether to enable the controls (false to disable)\n */\nfunction setControlsEnabled(container, enable) {\n const controls = queryAll('button:not(.select-add):not(.select-remove), select', container);\n const blocker = queryAll('.bonus-product-blocker', container);\n const blockerActiveClass = 'active';\n\n controls.forEach(control => {\n control.disabled = !enable;\n });\n\n if (enable) {\n blocker.forEach(blockElement => {\n const sizeElement = queryFirst('select', blockElement.closest('.product-detail'));\n\n if (sizeElement) {\n $(sizeElement).trigger('change');\n }\n });\n\n removeClass(blocker, blockerActiveClass);\n } else {\n addClass(blocker, blockerActiveClass);\n }\n}\n\n/**\n * Get analytics data to be associated with a product line item when adding to cart\n * @returns {Object} analytics data\n */\nfunction getAddToCartAnalyticsData() {\n const promoName = getStoredDataLayerInfo(P_PROMO_NAME_KEY);\n const promoCreativeName = getStoredDataLayerInfo(P_PROMO_CREATIVE_NAME);\n const listName = getStoredDataLayerInfo(P_PRODUCT_LIST_KEY);\n const data = {};\n\n if (promoName && Array.isArray(promoName)) data.utagPromoName = promoName[0]; // promo_name should always be an array, but we don't want to store it that way on the BE\n if (promoCreativeName && Array.isArray(promoCreativeName)) data.utagPromoCreativeName = promoCreativeName[0];\n if (listName) data.utagListName = listName;\n\n return data;\n}\n\nexport default {\n methods: {\n editBonusProducts: function (data) {\n chooseBonusProducts(data);\n }\n },\n attributeSelect,\n updateProductDetails,\n updateImageDetails,\n focusChooseBonusProductModal: function () {\n $gwpDialog.on('shown.bs.modal', () => {\n $gwpDialog.siblings().attr('aria-hidden', 'true');\n $gwpDialog.find('.close').trigger('focus');\n });\n },\n\n onClosingChooseBonusProductModal: function () {\n $gwpDialog.on('hidden.bs.modal', () => {\n $gwpDialog.siblings().attr('aria-hidden', 'false');\n removeClass(queryFirst('.choose-bonus-product-dialog'), 'selected');\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.color-attribute', function (e) {\n e.preventDefault();\n const productDetailContainer = queryFirst(PRODUCT_DETAIL_CONTAINER_SELECTOR);\n\n if ($(this).attr('disabled') || hasClass(queryFirst('.swatch-circle', this), 'selected')) {\n return;\n }\n var $productContainer = $(this).closest('.set-items .product-detail, .choose-bonus-product-modal .product-detail, .gift-card-main, .product-quickview');\n if ($productContainer.hasClass('cached-quick-view')) {\n updateQuickViewDetails(this, $productContainer);\n } else if (!$productContainer.length) {\n $productContainer = $(this).closest('.product-detail');\n updateProductDetails(this, $productContainer);\n } else {\n selectColorAttribute($(this).attr('data-url'), $productContainer);\n }\n $body.trigger('swatchChangeEvent', this);\n $body.trigger('search:updateProducts');\n updateVisibilityOfLowInventoryMsg(productDetailContainer);\n });\n },\n\n renderSizeElements: function () {\n const swatchEl = queryFirst('.pdp-container:not(.gift-card-main) button.color-attribute .swatch-circle.selected');\n\n if (swatchEl) {\n const productContainer = queryFirst('.pdp-container');\n const selectedSizeEl = queryFirst('.size-btn.selected', productContainer);\n\n if (!selectedSizeEl) {\n const selectedSwtachBtn = swatchEl.parentElement;\n const variantGroupId = selectedSwtachBtn.dataset.attrValue;\n const masterId = productContainer.dataset.masterid;\n const productInfo = window.productInfo[masterId];\n const { sizes, variantsList, isDirectlyPurchasable, wishlistDisabled, isFinalSale } = productInfo.variants[variantGroupId];\n\n updateSizeElements(sizes, productContainer, variantsList);\n if (!isDirectlyPurchasable) {\n const sizeElements = queryAll('.size-btn', productContainer);\n addClass(sizeElements, notAvailable);\n }\n if (wishlistDisabled || !isDirectlyPurchasable || isFinalSale) {\n showStrikeHearts(productContainer);\n }\n }\n\n $body.trigger('product:updateStoreInventory', {\n productContainer: productContainer\n });\n }\n },\n\n selectAttribute: function () {\n $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n if (!e.target.closest('.fp-root')) {\n e.preventDefault();\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\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'), $productContainer);\n }\n });\n },\n\n addToCart: () => {\n $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', async e => {\n // Elements\n const { target } = e;\n const $target = $(target);\n const productContainer = target.closest('.product-detail');\n const $productContainer = $(productContainer);\n const storeLocatorContainer = queryFirst('.store-locator-container');\n const ispuAddToCart = queryFirst('.add-to-cart', storeLocatorContainer);\n\n if (ispuAddToCart) {\n ispuAddToCart.disabled = true;\n }\n\n const pdpSetData = {};\n let isPDPSet = false;\n\n // PDP Set - add all to cart button\n if (hasClass(target, 'add-to-cart-global')) {\n isPDPSet = true;\n const setPids = [];\n\n const setModal = target.closest('.custom-set-detail-modal');\n // all visible set products -- \"removed\" set products are not included (removed set products do not have the custom-set-product class)\n const modalProducts = queryAll('.custom-set-items.set-items .custom-set-product', setModal);\n\n // set products which have a selected size\n const sizeSelectedProducts = modalProducts.filter(modalProduct => {\n toggleSelectSizeInfo(modalProduct);\n const sizeSelected = queryFirst('.size-btn.selected', modalProduct);\n\n if (sizeSelected) {\n // collect some data for the ATC call while we're looping anyway\n setPids.push({\n pid: queryFirst('.product-id', modalProduct)?.textContent,\n options: getOptions($(modalProduct))\n });\n }\n\n return !!sizeSelected;\n });\n\n // exit if not all sizes are selected\n if (sizeSelectedProducts.length !== modalProducts.length) {\n return;\n }\n\n Object.assign(pdpSetData, {\n pidsObj: JSON.stringify(setPids)\n });\n } else {\n // Not PDP Set -- Check if size is selected on single product PDP\n toggleSelectSizeInfo(productContainer);\n if (!queryFirst('.size-btn.selected', productContainer)) {\n return;\n }\n }\n\n $body.trigger('product:beforeAddToCart', target);\n\n const analyticsData = getAddToCartAnalyticsData();\n\n const form = {\n pid: getPidValue($target),\n childProducts: getChildProducts(),\n ...pdpSetData,\n ...analyticsData\n };\n\n if (!$('.bundle-item').length) {\n form.options = getOptions($productContainer);\n }\n\n $target.trigger('updateAddToCartFormData', form);\n\n let addToCartUrl = getAddToCartUrl();\n\n // it needs for cases when mincart has a recommendation block with empty value in the '.add-to-cart-url'\n if (!addToCartUrl && hasClass(productContainer, 'is-stylitics-gallery')) {\n let closestUrl = queryFirst('.add-to-cart-url', productContainer);\n if (closestUrl && closestUrl.value) addToCartUrl = closestUrl.value;\n }\n\n if (addToCartUrl) {\n try {\n const res = await fetch(addToCartUrl, {\n method: 'POST',\n body: toFormData(form)\n });\n\n if (!res.ok) throw new Error('Add to cart response was not OK');\n\n const resData = await res.json();\n\n if (isPDPSet) {\n $('#productSetModal').modal('hide');\n }\n\n if (ispuAddToCart) {\n ispuAddToCart.disabled = false;\n $productContainer.find('.lp-slideout-modal[id*=\"pick-up-in-store\"]').modal('hide');\n }\n\n handlePostCartAdd(resData);\n\n $.spinner().stop();\n $body.trigger('product:afterAddToCart', resData);\n\n // send analytics data (trackAddItemToCart) if it is Stylitics Gallery QuickView on PLP\n // and Stylitics Gallery Widget exists\n if (hasClass(productContainer, 'is-stylitics-gallery')) {\n $body.trigger('stylitics:gallery:addItem', {\n pid: form.pid,\n price: queryFirst('.price-section .sales .ssSalesPrice', productContainer)?.value\n });\n }\n } catch (err) {\n $.spinner().stop();\n if (ispuAddToCart) {\n ispuAddToCart.disabled = false;\n }\n console.error('addToCart error:', err.message);\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 = $choiceOfBonusProduct.data('pid');\n var uuid = $choiceOfBonusProduct.data('uuid');\n var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n var submittedQty = 1;\n var totalQty = 0;\n $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n totalQty += $(this).data('qty');\n });\n\n // LP customization changes start\n const { checked } = this;\n const productDialog = queryFirst('.choose-bonus-product-dialog');\n const choiceOfBonusProduct = $choiceOfBonusProduct[0];\n const addToCart = queryFirst('.add-bonus-products', productDialog);\n const selectedProductElement = queryFirst(`.selected-pid[data-pid=\"${pid}\"][data-uuid=\"${uuid}\"]`, productDialog);\n let bonusAccordionElements = queryAll('.bonus-acordion-container', productDialog);\n let accordionContainer = this.closest('.bonus-acordion-container', productDialog);\n const bonusCountElement = queryFirst('.bonus-item-count span', accordionContainer);\n const selectedCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n const maxCount = parseInt(accordionContainer.dataset.maxItems, 10);\n let sizeEl = queryFirst('.select-size', choiceOfBonusProduct);\n let selectedSwatch = queryFirst('.color-attribute .swatch-circle.selected', choiceOfBonusProduct);\n let isSizeSelected = sizeEl ? !!sizeEl.selectedIndex : true;\n\n if (selectedCount < maxCount) {\n removeClass(accordionContainer, 'selected');\n } else {\n addClass(accordionContainer, 'selected');\n }\n bonusCountElement.textContent = selectedCount;\n\n let enableAddTocart = true;\n const maxItems = parseInt(accordionContainer.dataset.maxItems, 10);\n const selectedItemsCount = queryAll('.select-bonus-product:checked', accordionContainer).length;\n if (selectedItemsCount < maxItems) {\n enableAddTocart = false;\n }\n enableAddTocart = isSizeSelected && !!selectedSwatch && enableAddTocart;\n\n if (enableAddTocart) {\n addClass(accordionContainer, readyClass);\n } else {\n removeClass(accordionContainer, readyClass);\n }\n\n let validProducts = queryAll('.bonus-acordion-container.ready-to-add', productDialog);\n\n if (!hasClass(addToCart, notAvailable)) {\n addToCart.disabled = bonusAccordionElements.length !== validProducts.length;\n }\n\n if (checked) {\n addClass(choiceOfBonusProduct, selectedProductClass);\n } else {\n removeClass(choiceOfBonusProduct, selectedProductClass);\n if (selectedProductElement) {\n selectedProductElement.click();\n }\n }\n if (selectedCount < maxCount) {\n $(accordionContainer).find('.choice-of-bonus-product').find('.select-bonus-product, .color-attribute, select').removeAttr('tabindex');\n } else {\n $(accordionContainer).find('.choice-of-bonus-product:not(.selected-product)').find('.select-bonus-product, .color-attribute, select').attr('tabindex', -1);\n }\n if (!checked) {\n return;\n }\n // LP customization changes end\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 '
      ' +\n $choiceOfBonusProduct.find('.product-name').html() +\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 const bonusDrawer = document.getElementById('chooseBonusProductModal');\n\n if (bonusDrawer) {\n bonusDrawer.addEventListener('click', e => {\n const { target } = e;\n if (hasClass(target, 'bonus-product-blocker') || hasClass(target, 'select-add') || hasClass(target, 'select-remove')) {\n e.preventDefault();\n const bonusTile = target.closest('.choice-of-bonus-product-tile');\n if (bonusTile) {\n const targetCheckbox = queryFirst('.select-bonus-product', bonusTile);\n\n if (!targetCheckbox.checked) {\n // unselect the checked checkbox as long as the user didn't click the already-checked option\n const accordion = bonusTile.closest('.bonus-acordion-container');\n const checkedBox = queryFirst('input:checked', accordion);\n if (checkedBox) {\n checkedBox.click();\n }\n }\n\n // toggle the checkbox for the clicked tile\n targetCheckbox.click();\n }\n }\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', !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 const bonusProductDialog = queryFirst('.choose-bonus-product-dialog');\n\n if (bonusProductDialog) {\n bonusProductDialog.addEventListener('click', e => {\n const target = e.target.closest('.select-bonus-product');\n\n if (!target) return;\n\n setControlsEnabled(target.closest('.row'), target.checked);\n });\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 = parseInt($(this).data('qty'), 10);\n const pid = $(this).data('pid');\n const uuid = $(this).data('uuid');\n const productId = $(`.choice-of-bonus-product.selected-product[data-pid=\"${pid}\"][data-uuid=\"${uuid}\"] .product-detail`).attr('data-pid');\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 = productId;\n option.selectedValueId = $(this).data('option-selected-value');\n }\n pidsObject.bonusProducts.push({\n uuid: uuid,\n pid: productId,\n qty: qtyOption,\n options: option ? [option] : []\n });\n pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n }\n });\n queryString += JSON.stringify(pidsObject);\n queryString = queryString + '&bonusItems=' + JSON.stringify($('.choose-bonus-product-dialog').data('bonusItems'));\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('
      ' + data.errorMessage + '
      ');\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 $('.minicart-quantity').html(data.totalQty);\n if ($('.cart-page').length) {\n location.reload();\n }\n }\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n revealRecommendations: function () {\n const { initSpecificCarousel } = require('../components/carousel');\n queryAll('.recommendations:not(.product-listing-header)').forEach(eachRecommendation => {\n const titleEl = queryFirst('.title', eachRecommendation);\n const productEl = queryFirst('.grid-tile', eachRecommendation);\n const scrollableContent = queryFirst('.scrollable-content', eachRecommendation);\n\n if (titleEl && !productEl) {\n eachRecommendation.outerHTML = '';\n } else if (titleEl && productEl) {\n eachRecommendation.style.display = 'block';\n if (scrollableContent) initSpecificCarousel(scrollableContent);\n }\n });\n },\n handleEarlyAccessPLPLockIcon: function () {\n const earlyAccessPLPContainer = queryAll('.early-access-plp-container');\n if (earlyAccessPLPContainer.length) {\n earlyAccessPLPContainer.forEach(earlyAccessPlpIcon => {\n const lockIconContainer = queryFirst('.loyalty-early-access-lock-container', earlyAccessPlpIcon);\n const earlyAccessWishlistIcon = queryFirst('.product-tile .add-to-wish-list-container', earlyAccessPlpIcon);\n const earlyAccessPLPBadge = queryFirst('.loyalty-product-tile-badge', earlyAccessPlpIcon);\n const { earlyAccessDate } = lockIconContainer.dataset;\n const isEarlyAccessItem = isEarlyAccessElement(earlyAccessDate);\n if (isLoyaltyProgramMember || !isEarlyAccessItem) {\n removeClass(earlyAccessWishlistIcon, HIDDEN_CLASS);\n addClass(lockIconContainer, HIDDEN_CLASS);\n if (!isEarlyAccessItem) {\n addClass(earlyAccessPLPBadge, HIDDEN_CLASS);\n }\n } else {\n addClass(earlyAccessWishlistIcon, HIDDEN_CLASS);\n removeClass([lockIconContainer, earlyAccessPLPBadge], HIDDEN_CLASS);\n }\n });\n }\n },\n\n getPidValue: getPidValue,\n getQuantitySelected: getQuantitySelected,\n handleEarlyAccessCta: handleEarlyAccessCta\n};\n","'use strict';\n\nconst { queryFirst } = require('../domUtil');\nconst { getNestedValue } = require('../util');\nconst { selectStyleMessageTmpl, ispuSelectStyleMessageTmpl } = require('../templates').productDetail;\nconst { EMPTY_STRING } = require('../constants');\n\n/**\n * Function to check if shipping preferences view is enabled or not\n * @returns { boolean } - returns isEnabled flag value\n */\nfunction isShippingPreferencesViewEnabled() {\n return getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.isEnabled') || false;\n}\n\n/**\n * Function to toggle select color or size info\n * @param {HTMLElement} productContainer - current product element\n */\nfunction toggleSelectSizeInfo(productContainer) {\n const selectedSizeEl = queryFirst('.size-btn.selected', productContainer);\n const availabilityMessageEl = queryFirst('.product-availability .availability-msg', productContainer);\n if (availabilityMessageEl) {\n if (!selectedSizeEl) {\n availabilityMessageEl.innerHTML = selectStyleMessageTmpl(availabilityMessageEl.dataset.selectStylesMessage);\n }\n }\n\n if (isShippingPreferencesViewEnabled()) {\n const ispuAvailabilityMessageEl = queryFirst('.ispu-preference-container .select-size-info-msg', productContainer);\n if (ispuAvailabilityMessageEl) {\n const messages = getNestedValue(window, 'lillyUtils.shippingPreferencesConfig.messages') || {};\n const { selectStylesMessage } = messages;\n if (!selectedSizeEl && selectStylesMessage) {\n ispuAvailabilityMessageEl.innerHTML = ispuSelectStyleMessageTmpl(selectStylesMessage);\n }\n }\n }\n}\n/**\n * Helper method to check if product is on early access or not\n * @param {Object|String} earlyAccess - product | early access date\n * @return {Boolean} true, if early access product or false for not\n */\nfunction isEarlyAccessElement(earlyAccess) {\n let isEarlyAccessItem = false;\n const earlyAccessDate = earlyAccess && earlyAccess.earlyAccessUntilDate || earlyAccess;\n if (earlyAccessDate && earlyAccessDate !== 'false') {\n if (new Date(earlyAccessDate).getTime() > new Date().getTime()) {\n isEarlyAccessItem = true;\n }\n }\n return isEarlyAccessItem;\n}\n\nmodule.exports = {\n toggleSelectSizeInfo: toggleSelectSizeInfo,\n isEarlyAccessElement: isEarlyAccessElement,\n isShippingPreferencesViewEnabled: isShippingPreferencesViewEnabled\n};\n\n","/**\n * HTML Templates for use in client-side rendering.\n *\n * @module dom.templates\n * @version 1.0.0\n */\n\n'use strict';\n\n/**\n * QuickView Templates\n */\nexports.quickView = {\n container: '
      ',\n quickViewModal: `\n
      \n \n
      \n
      \n
      \n
      \n
      \n
      \n `\n};\n\n/**\n * Get All Wishlist Collection Templates\n */\nexports.addToWishlist = {\n container: '
      ',\n addToWishlistModal: `\n
      \n \n
      \n
      \n
      \n \n
      \n
      \n
      \n
      \n
      \n \n\n `\n};\n\n/**\n * Cart error message template\n */\nexports.cart = {\n errorMessage: '

      {0}

      ',\n cartAvailabilityMessageOOS: (message, url) => (`\n
    5. ${message}\n Browse Similar Styles

      \n
    6. \n `),\n};\n\n/**\n * Cart & Checkout promo template\n */\nexports.promo = {\n shippingMethod: `\n
      \n
      \n

      \n {0}:{1}\n

      \n

      \n {3}\n

      \n
      \n
      \n

      \n {2}\n

      \n
      \n
      `,\n checkoutNormalShipping: '{0}',\n checkoutDiscountShipping: `\n {0}\n {1}\n `\n};\n\n/**\n * Checkout template\n */\nexports.checkout = {\n discountPrice: '{0}{1}'\n};\n\n/**\n * Selected swatch name template\n */\nexports.swatchNameTemplate = {\n swatchNameHtml: '

      Color: {0}

      '\n};\n\nexports.emptySwatchTemplate = '{0}';\n\n/*\n * Address Suggestions template\n */\nexports.addressSuggestions = {\n suggestionTextTemplate: '

      ',\n suggestionsTemplate: `\n
      \n
      \n \n \n
      \n
      `\n};\n\n/*\n * Approaching Discounts template\n */\nexports.approachingDiscounts = {\n discountContainerTemplate: '',\n singleDiscountTemplate: '
    7. {0}
    8. ',\n multipleDiscountsTemplate: `\n
    9. \n
      \n
      \n
        {0}
      \n
      \n
      \n
      \n \n
      \n
      \n
      \n
    10. `,\n nonCouponBasedAdjustmentTemplate: `
      \n
      \n

      {0}

      \n

      \n {1}\n

      \n
      \n

      {2}

      \n
      `\n};\n\n/**\n * Video Template\n * @param {Object} options video setting values\n * @return {html} video html template\n */\nexports.videoTemplate = (options = {}) => {\n // Note: I don't believe this template is used anywhere anymore\n const { loop = '', videoUrl = '', imgUrl = '', classNames = '', autoplay = false, muted = true, controls = false, icontitle = '', icondesc = '' } = options;\n\n return `\n
      \n \n \n
      \n `;\n};\n\n/**\n * Image Template\n * @param {string} imgUrl value\n * @param {string} altText value\n * @param {string} classNames value\n * @return {html} video html template\n */\nexports.imageTemplate = (imgUrl, altText, classNames) => {\n return `\n
      \n \"${altText}\"/\n
      \n `;\n};\n\n/**\n * Size option template\n * @param {string} url - Size variant url\n * @param {string} value - Size value\n * @return {html} size option html template\n */\nexports.sizeOptionTemplate = (url, value) => {\n return ``;\n};\n\n/**\n * Function to rerender size button element\n * @param {Object} variantData - variant details\n * @param {string} ariaLabel - aria label\n * @param {string} ariaDescribedby - aria described by\n * @param {string} selectedText - selected text\n * @param {string} oosMessage - out of the stock text\n * @return {html} size button html template\n */\nexports.sizeButtonTemplate = (variantData, ariaLabel, ariaDescribedby, selectedText, oosMessage) => {\n const { selected, forceOutOfStock, inStock, value, url } = variantData;\n return `
    11. \n \n ${selected ? selectedText : ''} ${!inStock || forceOutOfStock ? oosMessage : ''}\n
    12. `;\n};\n\n/**\n * Function to render empty wishlist markup for guest user\n * @param {string} emptyWishlistMessage - empty wishlist message\n * @return {html} wishlist html template\n */\nexports.guestEmptyWishlistTemplate = (emptyWishlistMessage, emptyWishlistContentAssetBody) => {\n return `
      \n
      \n

      ${emptyWishlistMessage}

      \n ${emptyWishlistContentAssetBody}\n
      \n
      `;\n};\n\n/**\n * Function to render empty wishlist markup for guest user\n * @param {string} emptySFLMessage - empty SFL message\n * @param {string} continueShopURL - continue shopping URL\n * @param {string} continueShopMsg - continue shopping message\n * @param {string} signInMsg - sign In message\n * @param {string} signInSFLURL - sign in URL\n * @return {html} SFL html template\n */\nexports.emptySFL = (emptySFLMessage, continueShopURL, continueShopMsg, signInMsg, signInSFLURL) => {\n return `
      \n
      \n
      \n
      \n

      ${emptySFLMessage}

      \n ${signInMsg}\n \n ${continueShopMsg}
      \n
      \n
      \n
      \n
      `;\n};\n\n/**\n * GWP Site Templates\n */\nexports.gwpSizeTemplate = {\n singleSize: '{0}',\n multiSize: `\n
      \n \n \n
      \n `,\n multiDefaultSizeOption: '',\n multiSizeOption: ''\n};\n\n/**\n * Address autocomplete templates\n */\nexports.autoComplete = {\n suggestionLink: (suggestion, addressLine, secondaryEntryAddressLine) => (`\n 1}\"\n data-secondary-entry-search-value=\"${secondaryEntryAddressLine}\"\n >${addressLine}\n `),\n suggestionContainer: containerClass => (`
      `)\n};\n\nexports.contactUsTemplate = {\n signupError: (msg) => (`
      ${msg}
      `),\n defaultSignupError: `
      We're sorry, an unexpected error occurred. Please try again.
      `// eslint-disable-line quotes\n};\n\nexports.browserWarningTemplate = `\n We're sorry, this browser is no longer supported.
      \n Please update your browser for a smoother, more secure shopping experience. We recommend downloading the latest version of\n Google Chrome,\n Microsoft Edge or\n Mozilla Firefox.\n`;\n\n/*\n * Shipping preference radio buttons\n */\nexports.shippingPreferenceTemplates = {\n shippingPreferences: (ispuRadioLabel, ispuRadioValue, shipToRadioLabel, shipToRadioValue, changeStoreLabel, preferISPU = false) => (`\n
      \n \n \n \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n
      \n \n \n
      \n
      \n
      \n
      \n
      \n `),\n storeDetail: (storeId, name, address1, city, stateCode, postalCode) => (`\n
      \n
      ${name}
      \n
      \n
      ${address1},\n ${city}, ${stateCode} ${postalCode}\n
      \n
      \n
      \n `)\n};\n\n/*\n * Product detail page - messaging templates\n */\nexports.productDetail = {\n selectStyleMessageTmpl: message => `
    13. ${message}

    14. `,\n availabilityMessageTmpl: message => `
    15. ${message}

    16. `,\n availabilityMessageOOS: (message, url) => (`\n
    17. ${message}\n Browse Similar Styles

      \n
    18. \n `),\n availabilityMessagePreorder: (message, url) => (`\n
    19. \n

      ${message}

      \n Shop for Similar Styles
      \n
    20. \n `),\n ispuSelectStyleMessageTmpl: message => `

      ${message}

      `,\n ispuAvailabilityMessageTmpl: message => `

      ${message}

      `,\n ispuLowStockMessageTmpl: message => `
    21. ${message}

    22. `,\n promotionMessageTmpl: (calloutMsg, details, index) => `
      \n
      \n
      \n ${calloutMsg}\n
      \n ` + ((details) ? `\n
      \n \n
      \n
      ${details}
      \n
      \n
      \n ` : '')\n + `
      \n
      `\n};\n\nexports.dialogTemplate = options => {\n const {\n buttons = [{ text: 'OK', primary: true, link: '' }],\n className = '',\n modalContentHeading = '',\n modalContentBody = '',\n id = 'dialog-' + Date.now(),\n slideOut = false\n } = options;\n\n const buttonSpace = Math.floor(12 / buttons.length);\n\n return `\n
      \n
      \n
      \n
      \n ${slideOut && modalContentHeading ? `

      ${modalContentHeading}

      ` : ''}\n \n
      \n ${!slideOut && modalContentHeading ? `

      ${modalContentHeading}

      ` : ''}\n
      ${modalContentBody}
      \n
      \n ${buttons.map(button => `\n
      \n ${button.link ?\n `${button.text}` :\n ``\n }\n
      `).join('')\n }\n
      \n
      \n
      \n
      \n `;\n};\n\nexports.errorTextTemplate = errorMessage => `

      ${errorMessage}

      `;\n\nexports.oneTrust = {\n privacyDialogCookieBanner: `\n \n `\n};\nexports.loyalty = {\n carouselBadge: '
      {0}
      '\n};\n\nexports.styliticsTemplates = {\n shopTheModelBadge: '

      As seen above

      '\n};\n\nexports.returnsPageTemplates = {\n defaultError: 'We're sorry, an unexpected error occurred. Please try again.',\n errorMessage: (message) => (`
      ${message}
      `)\n};\n\nexports.cyberSource = {\n secureAcceptanceTag: paymentType => `Secure Acceptance ${paymentType}`,\n boltPayPaymentTag: (paymentType, paymentLastFour, expMonth, expYear) => `\n
      ${paymentType}\n
      ${paymentLastFour}
      \n
      ${expMonth}/${expYear}
      `,\n paypalPaymentTag: (paypalMethod, paypalAmount) => `${paypalMethod}
      ${paypalAmount}
      `,\n creditCardPaymentTag: (cardType, creditCardType, maskedCardNumber, cardEndIn, cardExpMonth, cardExpYear) => `
      ${cardType} ${creditCardType}
      \n ${maskedCardNumber}
      ${cardEndIn} ${cardExpMonth}/${cardExpYear}
      `\n};\n\nexports.checkoutErrorTemplate = {\n checkoutErrorMsg: errorMsg => `
      \n ${errorMsg}\n
      `\n};\n","const { addClass, hasClass, queryFirst } = require('./domUtil');\n\n/**\n * Tokenize strings\n *\n * @param {string | Object} string Resource message that need to be tokenized\n * @param {string | Object} values Values that need to be replaced.\n * @param {string | Object} leftToken Left token type with default as {{\n * @param {string | Object} rightToken Right token type with defaulat as }}\n * @return {string} Updated string.\n */\nexports.tokenize = (string, values, leftToken = '{{', rightToken = '}}') => {\n if (typeof values !== 'object') return string;\n const operators = /([{}+.\\-!?[\\]])/g;\n return string.replace(new RegExp(leftToken.replace(operators, '\\\\$1') + '[\\\\r\\\\n\\\\s\\\\t]*([\\\\s\\\\S]+?)[\\\\r\\\\n\\\\s\\\\t]*' + rightToken.replace(operators, '\\\\$1'), 'igm'), (_, code) => {\n return values[code] || '';\n });\n};\n\n/**\n * Transforms all text to a kebab-case string.\n * @param {string} text - The text to transform\n * @returns {string} - The transformed string value\n * @example toKebabCase('.suggestions-related-products', ['.product-tile', '.link']) // suggestions-related-products-product-tile-link\n */\nconst toKebabCase = exports.toKebabCase = (...values) => values.map(value => {\n if (!Array.isArray(value)) value = [value];\n return value.map(text => typeof text === 'undefined' ? '' : String(text).toLowerCase().replace(/\\W/g, '-').trim()).join('-');\n}).join('-').replace(/-+/g, '-').replace(/^-+|-+$/g, '');\n\n/**\n * Transforms any input into a hash value.\n * @param {*} input - The input to transform\n * @returns {string} - The transformed string hash value\n * @example hashValue(function(a){ return a++; }) // 66756e6374696f6e2861297b2072657475726e20612b2b3b207d\n */\nexports.hashValue = input => {\n let value = JSON.stringify(String(input));\n\n if (value === '\"[object Object]\"') {\n // Sort the object first so hashes match despite key order\n value = JSON.stringify(Object.keys(input).sort().reduce((result, key) => {\n result[key] = input[key];\n return result;\n }, {}));\n }\n\n if (value.startsWith('\"') && value.endsWith('\"')) {\n value = value.substr(1, value.length - 2);\n }\n\n return value.split(\"\").map(digit => digit.charCodeAt(0).toString(16)).join('');\n};\n\n/**\n * Transforms all text to a valid dataset key.\n * @param {string} text - The text to transform\n * @returns {string} - The transformed string value\n * @example toDatasetKey('.suggestions-related-products', ['.product-tile', '.link']) // suggestionsRelatedProductsProductTileLink\n */\nexports.toDatasetKey = (...values) => toKebabCase(...values).split('-').map((text, index) => index === 0 ? text : text.charAt(0).toUpperCase() + text.substr(1)).join('');\n\n/**\n * Format dynamic resource messages.\n *\n * @param {string | Object} string Resource message that need to be tokenized\n * @param {string | Object} tokens Tokens that need to be replaced.\n * @return {string} Updated string.\n */\nexports.formatMessage = (string, ...tokens) => {\n return this.tokenize(\n string,\n tokens.reduce((result, item, index) => {\n result[index] = item;\n return result;\n }, {}),\n '{',\n '}'\n );\n};\n\n/**\n * Safely gets nested object properties. Returns the value if found, undefined if not found.\n * @param {*} obj The parent object in which the property exists\n * @param {*} keyString String denoting where in the parent object your target property should exist\n * @param {...any} replaceValues Values in the keyString to replace -- reference in the keyString with a number encapsulated in {} (e.g. {0}, {1}, etc)\n * @return {Object} returns nested object properties\n */\nexports.getNestedValue = function (obj, keyString, ...replaceValues) {\n const keys = keyString.split(/\\[|\\]|\\./).filter(el => el !== '');\n\n return keys.reduce((o, i) => (o || {})[/\\{\\d+\\}/.test(i) ? replaceValues[i.split(/\\{|\\}/)[1]] : i], obj);\n};\n\n/**\n * Ensures an event handler is only bound to an element once\n * @param {HTMLElement} element The element to bind the event to\n * @param {string} eventType The type of event\n * @param {function} handler The handler to execute when the event occurs, or the immediate callback if not defined\n * @param {string} initFlag The name of the flag to use for init\n */\nexports.initOnce = (element, eventType = '', handler, initFlag = '') => {\n const flag = 'init' + initFlag + eventType.toLowerCase();\n\n if (!element || element.dataset[flag]) return;\n\n element.dataset[flag] = true;\n if (eventType) {\n element.addEventListener(eventType, handler);\n } else {\n handler();\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 */\nexports.appendToUrl = (url, params) => {\n let newUrl = url;\n newUrl +=\n (newUrl.indexOf('?') !== -1 ? '&' : '?') +\n Object.keys(params)\n .map(key => key + '=' + encodeURIComponent(params[key]))\n .join('&');\n\n return newUrl;\n};\n\n/**\n * This method performs an ajax call\n * @param {string} url endpoint url\n * @param {string} type ajax method type\n * @param {Object} data data for an ajax call\n * @param {function} onSuccess success call back function\n * @param {function} onError error call back function\n * @return {function} returns ajax function\n */\nexports.getJSON = (url, type, data = {}, onSuccess = function () { }, onError = function () { }) => {\n return $.ajax({\n url,\n type,\n dataType: 'json',\n data,\n success: onSuccess,\n error: onError\n });\n};\n\n/**\n * This method renders geo location\n * @param {function} successCallback Success callback function\n * @param {Object} mixin additional parameters\n * @param {function} errorCallback Error callback function\n */\nexports.geolocate = (successCallback, mixin = {}, errorCallback) => {\n if (!navigator.geolocation) return;\n const data = Object.assign({}, mixin);\n const successHandler = response => {\n const { coords } = response;\n if (coords) {\n const { latitude, longitude } = coords;\n data.latitude = latitude;\n data.longitude = longitude;\n }\n\n if (successCallback) {\n successCallback(data);\n }\n };\n const errorHandler = error => {\n if (errorCallback) {\n errorCallback(data);\n }\n };\n navigator.geolocation.getCurrentPosition(\n successHandler,\n errorHandler,\n {\n maximumAge: 0\n }\n );\n};\n\n/**\n * This method stores data in key-value pair into browser's localStorage\n * @param {string} key Identifier to be stored\n * @param {string | Object} value Value to be stored\n */\nexports.setItemInLocalStorage = function (key, value) {\n if (!window.localStorage || !key) {\n return;\n }\n\n localStorage.setItem(key, JSON.stringify(value));\n};\n\n/**\n * This method stores data into browser's localStorage\n * @param {string} key Identifier for retrieving the value\n * @return {string | Object | boolean} returns parsed value\n */\nexports.getItemFromLocalStorage = function (key) {\n if (!window.localStorage || !key) {\n return false;\n }\n\n const value = localStorage.getItem(key);\n\n if (!value) {\n return false;\n }\n\n return JSON.parse(value);\n};\n\n/**\n * This method removes data from browser's localStorage\n * @param {string} key Identifier\n */\nexports.removeItemFromLocalStorage = function (key) {\n if (!window.localStorage || !key) {\n return;\n }\n\n localStorage.removeItem(key);\n};\n\n/**\n * This method formats phone number\n * @param {HTMLElement} element - current element for which formatting should be one\n */\nexports.formatPhoneNumber = function (element) {\n function formatValue(numbers) {\n const char = { 0: '(', 3: ') ', 6: '-' };\n element.value = '';\n for (let i = 0, l = numbers.length; i < l; i++) {\n element.value += (char[i] || '') + numbers[i];\n }\n }\n if (!element) {\n return;\n }\n element.addEventListener('keypress', function () {\n const numbers = element.value.replace(/\\D/g, '');\n formatValue(numbers);\n });\n element.addEventListener('paste', function (event) {\n event.preventDefault();\n addClass(this, 'is-invalid');\n if (hasClass(event.target, 'is-invalid')) {\n const errorMessageElmParent = event.target.parentNode;\n const errorMessageElm = queryFirst('.invalid-feedback', errorMessageElmParent);\n errorMessageElm.textContent = event.target.dataset.patternMismatch;\n }\n });\n element.addEventListener('input', function () {\n const numbers = element.value.replace(/\\D/g, '');\n formatValue(numbers);\n });\n};\n\n/**\n * @function\n * @desc Determines if the device that is being used is mobile\n * @returns {Boolean}\n */\nexports.isMobile = function () {\n const mobileAgentHash = ['mobile', 'tablet', 'phone', 'ipad', 'ipod', 'android', 'blackberry', 'windows ce', 'opera mini', 'palm'];\n let idx = 0;\n let isMobile = false;\n const userAgent = navigator.userAgent.toLowerCase();\n\n while (mobileAgentHash[idx] && !isMobile) {\n isMobile = userAgent.indexOf(mobileAgentHash[idx]) >= 0;\n idx++;\n }\n return isMobile;\n};\n\n/**\n * @function\n * @desc Fixes position sticky scrolling behavior for elements with greater height than widnow height. Ensures content is scrollable above the fold\n * @param {Array} items - items to set scroll height position\n */\nexports.stickyScrollPosition = items => {\n const $window = $(window);\n const handleStickyPositionOnScroll = item => {\n let ticking = false;\n const detailStickyScroll = () => {\n ticking = false;\n const itemHeight = item.getBoundingClientRect().height;\n const windowHeight = window.innerHeight;\n const newTop = itemHeight - windowHeight + 95;\n\n if (itemHeight > windowHeight - 95) {\n item.style.top = `${-newTop}px`;\n } else {\n item.style.top = '100px';\n }\n };\n const requestTick = () => {\n if (!ticking) {\n requestAnimationFrame(detailStickyScroll);\n }\n ticking = true;\n };\n const onScroll = () => {\n requestTick(item);\n };\n $window.scroll(onScroll);\n };\n\n items.forEach(item => {\n handleStickyPositionOnScroll(item);\n });\n};\n\n/**\n * Determines whether the user is browsing with an old/unsupported browser.\n * @returns {boolean} True if the browser is old/unsupported.\n */\nexports.isUnsupportedBrowser = () => {\n const { userAgent } = navigator;\n const sitePrefs = document.getElementById('site-prefs');\n\n if (!sitePrefs) return false;\n\n let unsupportedBrowserTypes;\n\n if (sitePrefs.dataset) {\n ({ unsupportedBrowserTypes } = sitePrefs.dataset);\n } else {\n // For old IE\n unsupportedBrowserTypes = sitePrefs.getAttribute('data-unsupported-browser-types');\n }\n\n return JSON.parse(unsupportedBrowserTypes).some(function (uaFragment) {\n return ~userAgent.indexOf(uaFragment);\n });\n};\n\n/**\n * Get remaining time object for given time string \n * @param {string} endtime - remaining time string comes as parameter\n * @return {Object} remainTimeObject - Date Object with day, hours, minutes, Sec\n */\nexports.getTimeRemaining = (endtime) => {\n const total = Date.parse(endtime) - Date.now();\n const seconds = Math.floor((total / 1000) % 60).toString();\n const minutes = Math.floor((total / 1000 / 60) % 60).toString();\n const hours = Math.floor((total / (1000 * 60 * 60)) % 24).toString();\n const days = Math.floor(total / (1000 * 60 * 60 * 24));\n\n return {\n total,\n days,\n hours,\n minutes,\n seconds\n };\n};\n\n/**\n * Checks if an email value is in the correct format for Bolt.\n * Note that this does not meet LP's standards for email validation\n * @param {string} email - email string to check if valid\n * @returns {boolean} Whether email is valid\n */\nexports.validateEmailBolt = email => /^[\\w.%+-]+@[\\w.-]+\\.[\\w]{2,6}$/.test(email);\n","'use strict';\nconst { HIDDEN_CLASS } = require('../constants');\nconst { removeClass, queryFirst, addClass } = require('../domUtil');\n\n/**\n * Show strike heart\n * @param {Element} productContainer product container with hearts\n */\nfunction showStrikeHearts(productContainer) {\n removeClass(queryFirst('.wishlist-strike', productContainer), HIDDEN_CLASS);\n addClass(queryFirst('.wishlist-add-update', productContainer), HIDDEN_CLASS);\n}\n\n/**\n * Hide strike heart\n * @param {Element} productContainer product container with hearts\n */\nfunction hideStrikeHearts(productContainer) {\n addClass(queryFirst('.wishlist-strike', productContainer), HIDDEN_CLASS);\n removeClass(queryFirst('.wishlist-add-update', productContainer), HIDDEN_CLASS);\n}\n\n/**\n * Update wishlists data attribute to theirs product ID\n * @param {string} id product ID string\n * @param {string | Object} container Parent element, if it not provided\n */\nfunction setWishlistProductId(id, container = document.body) {\n if (id) {\n const wishlistBtn = queryFirst('.wishlist-add-update button', container);\n const wishlistStrikeBtn = queryFirst('.wishlist-strike button', container);\n\n if (wishlistBtn) wishlistBtn.dataset.productId = id;\n if (wishlistStrikeBtn) wishlistStrikeBtn.dataset.productId = id;\n }\n}\nmodule.exports = {\n hideStrikeHearts: hideStrikeHearts,\n showStrikeHearts: showStrikeHearts,\n setWishlistProductId: setWishlistProductId\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/**\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 clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('
      '));\n } else {\n feedbackElement.html(payload.fields[key]);\n }\n feedbackElement.siblings('.form-control').addClass('is-invalid');\n }\n }\n });\n }\n if (payload && payload.error) {\n var form = $(formElement).prop('tagName') === 'FORM'\n ? $(formElement)\n : $(formElement).parents('form');\n\n form.prepend('
      '\n + payload.error.join('
      ') + '
      ');\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const processInclude = require('base/util');\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n processInclude(require('./components/pickUpInStore'));\n});\n"],"names":["_require","require","getProductData","queryFirst","queryAll","formatMessage","afterpayTimeout","Date","now","elementArray","items","scope","Array","isArray","document","reduce","results","item","forEach","parent","matches","push","concat","module","exports","afterpay","options","arguments","length","undefined","_options$alwaysShow","alwaysShow","anchors","observerTargets","price","priceTargets","renderMode","renderTarget","_options$showExcluded","showExcluded","_options$thresholds","thresholds","_options$logoPosition","logoPosition","window","presentAfterpay","setTimeout","args","apply","this","bind","afterpayPrefsEl","getElementById","value","afterpayPrefs","dataset","apConfig","afterpayLogoColor","currency","locale","exclusions","JSON","parse","apThresholds","minMaxThreshold","min","max","updateAmount","config","stringValue","String","isDecimalValue","indexOf","intValue","parseInt","replace","trim","amount","getPrice","observerTarget","element","innerText","renderAfterpay","instance","anchor","mode","_uData$action","_config$minMaxThresho","uData","utag_data","notWithinThreshold","excluded","hidden","excludedMessageKey","productElements","action","split","shift","toLowerCase","_getProductData","masterId","productName","afterpayNode","createElement","afterpayMessage","parentElement","insertBefore","firstChild","lastToken","pop","tokenText","join","excludedMultiSuffix","textContent","notWithinThresholdMessage","instanceNode","target","insertAdjacentElement","replaceChild","appendChild","slice","call","instanceConfig","Object","assign","anchorObserverTargets","priceValue","result","isNaN","apInstance","observer","MutationObserver","mutations","observe","childList","subtree","_typeof","o","Symbol","iterator","constructor","prototype","ownKeys","e","r","t","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","enumerable","_defineProperty","i","toPrimitive","TypeError","_toPrimitive","_toPropertyKey","defineProperty","configurable","writable","_slicedToArray","_arrayWithHoles","l","n","u","a","f","next","done","return","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","_arrayLikeToArray","toString","name","from","test","hasClass","_require2","toDatasetKey","hashValue","_require3","VIEW_PROMO","SELECT_PROMO","SELECT_ITEM","VIEW_ITEM_LIST","ADD_TO_CART","P_PRODUCT_LIST_KEY","P_PROMO_NAME_KEY","P_PROMO_CREATIVE_NAME","PERSISTED_DATA_NAME","STORAGE_EXP_TIME","gaInitKeyPrefix","gaRetriggerFlag","gaFieldPipe","customEventPattern","gaBindings","UDOProperties","UDOArrays","promoSensitiveEvents","productListSensitiveEvents","normalize","_len","fields","_key","map","field","values","text","smartNormalize","key","includes","normalizePayload","payload","entries","_ref","_ref2","getPageContext","srcElement","_window2$utag_data","sectionSrcElement","dialog","closest","$","data","jQuery","pageSection","pageSubsection","isCartPage","cartNav","removeDialog","selectedTab","uaAttributes","event_label","event_category","event_action","omitUADefaults","getOwnPropertyDescriptors","defineProperties","_objectSpread","page_section","page_subsection","caching_enabled","logged_in_status","user_loggedin_status","affiliation","loyalty_status","loyalty_program_member","page_name","title","page_type","page_category","page_subcategory","product_category","product_color","product_id","product_original_price","product_name","product_price","product_quantity","product_size","product_variant","product_badge","getStoredDataLayerInfo","localStorage","dataStr","getItem","console","error","removeItem","_data$key","timestamp","setItem","stringify","setStoredDataLayerInfo","storePersistentData","eventName","event_name","productList","category_id","promoName","promo_name","promoCreative","promo_creative","warn","sendEventGA","eventType","Promise","resolve","reject","utag","Error","bindGA","elements","_options$bindOptions","bindOptions","callback","_options$eventType","eventCondition","_options$isCustomEven","isCustomEvent","_options$normalize","usesNormalize","_options$retriggerEve","retriggerEvent","_options$usesContext","usesContext","_options$usesDataset","usesDataset","_options$updatesUDO","updatesUDO","_options$gaEventType","gaEventType","nodeList","NodeList","once","bindEngine","initFlag","targetSelectors","binding","isRebind","willRetrigger","ctrlKey","shiftKey","gaRetriggered","tagPayload","_target$dataset","eventCategory","eventAction","eventLabel","bindPayload","productListName","product_list","product_list_category","promoCreativeName","preventDefault","stopPropagation","pageContext","fromEntries","_ref3","preservedUDOProperties","substring","property","lazyUDOProperties","charAt","UDOUpdates","finally","trigger","productSetItem","productSetItems","productSetIndex","fill","sendEventGAWithContext","contextElem","normalizeData","delimiter","getText","elem","textNode","childNodes","_arrayWithoutHoles","_iterableToArray","_nonIterableSpread","find","child","nodeType","Node","TEXT_NODE","EXCLUSIVE_EXPERIENCES_TOOLTIP_CID","REWARDS_TOOLTIP_CID","OFFERS_TOOLTIP_CID","BENEFITS_TOOLTIP_CID","TELL_A_FRIEND_TOOLTIP_CID","STYLE_QUIZ_TOOLTIP_CID","MEMBERSHIP_FAQ_TOOLTIP_CID","TOOL_TIP_CONTENT","LOYALTY_TOOLTIP_ICON","ANALYTIC_EVENT_CLASS","BENEFIT_MODAL_CLOSE_ICON","BENEFIT_DETAIL_MODAL","BENEFIT_SWATCH_THUMBNAIL_MODAL","BENEFIT_SWATCH_TITLE","DOWNLOAD_SWATCH_CTA","GO_TO_ACCOUNT_CTA","BENEFIT_SWATCH_TAB","REFER_FRIEND_CTA","REFER_FRIEND_CTA_LINK","REFER_FRIEND_TEXT_FIELD","STYLE_QUIZ_PENDING_QUIZ","MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_CTA","MEMBERSHIP_LOYALTY_EXPAND_COLLAPSE_ALL_CTA","MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LINK","EXCLUSIVE_ARROW_RIGHT","EXCLUSIVE_ARROW_LEFT","EXCLUSIVE_PIP","ARROW_CLICKS","EXCLUSIVE_PIP_ACTION","MODULE_CHANGE","ARROW_NEXT","ARROW_PREVIOUS","EXCLUSIVE_VIEWALL","EXCLUSIVE_EXPERIENCE_CTA","EXCLUSIVE_RIGHT_SECTION","EXCLUSIVE_CONTENT_SLOTS_CLICK","EXCLUSIVE_SELECT_CONTENT","EXCLUSIVE_EXPERIENCE_NAME","EXCLUSIVE_CLICK_TO_VIEWALL","EXCLUSIVE_VIEWALL_EXCLUSIVE_EXPERIENCES","EXCLUSIVE_TOOLTIP","REFER_FRIEND_TOOLTIP","EXCLUSIVE_OPEN_TOOLTIP","HOW_TO_EARN_LINK","VIEW_POINT_ACTIVITY_CTA","REWARD_START_SHOPPING","REWARD_VIEW_CODE_CTA","VOUCHER_MODAL_CLOSE_CTA","OFFER_FLIP_CARD_CTA","VIEW_COPY_CODE_CTA","OFFER_DETAIL_CLOSE","BONUS_POINTS_DAY","EARLY_ACCESS","LOYALTY_PROGRAM_MODAL","LOYALTY_ACCOUNT_CARD","VIEW_LOYALTY_DASHBOARD","LOYALTY_DRAWER_LINK","LOYALTY_OPT_IN_CHECKBOX","ORDER_CONFIRM_REGISTER_MODAL","ORDER_CONFIRM_GUEST_ELEMENT","CREATE_ACCOUNT_ORDER_CONFIRM","LOYALTY_NEXT_BUTTON","CLOSE_WELCOME_MODAL","CLOSE_ENROLL_NOW_MODAL","ENROLL_LOYALTY_CTA","GUEST_LOYALTY_ENROLL","STYLE_QUIZ_START_CTA","STYLE_QUIZ_GO_TO_DASHBOARD","SWATCH_SELECTION_WRAPPER","NEXT_QUESTION_CTA","PREVIOUS_QUESTION_CTA","SUBMIT_QUIZ_CTA","SKIP_THIS_QUESTION_CTA","FINISH_LATER_CTA","START_SHOPPING_CTA","CONTENT_SLOT_SELECTORS","LOYALTY_BENEFIT_LABEL","LOYALTY_ANNUAL_GIFT_ID","ANNUAL_GIFT_LABEL","LOYALTY_BIRTHDAY_TREAT_LABEL","LOYALTY_DIGITAL_WALLPAPER_LABEL","MODAL_CLOSE_LABEL","MODAL_VOUCHER_CLOSE_LABEL","MODAL_SELECTED_LABEL","MODAL_DOWNLOAD_LABEL","CLICK_EVENT_ACTION","SHARE_EVENT_ACTION","LOYALTY_DASHBOARD_LABEL","LOYALTY_BENEFIT_TOOLTIP_LABEL","BENEFIT_LABEL","LOYALTY_EXCLUSIVE_EXPERIENCE_TOOLTIP_LABEL","LOYALTY_EXCLUSIVE_EXPERIENCE_LABEL","LOYALTY_MEMBERSHIP_FAQ_TOOLTIP_LABEL","TOOLTIP_LABEL","OPEN_TOOLTIP_LABEL","CLOSE_TOOLTIP_LABEL","STYLE_QUIZ_TOOLTIP_LABEL","STYLE_QUIZ_PAGE_SECTION","LOYALTY_REFER_A_FRIEND_SECTION","LOYALTY_MEMBERSHIP_FAQ_SECTION","LOYALTY_MODAL_PAGE_SUBSECTION","LOYALTY_REFER_A_FRIEND_LABEL_SECTION","LOYALTY_REFER_A_FRIEND_TOOLTIP","LOYALTY_EVENT_LABEL","MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ACTION","MEMBERSHIP_FAQ_EXPAND_COLLAPSE_ALL_ACTION","MEMBERSHIP_FAQ_TERMS_AND_CONDITION_LABEL","REWARDS_TOOLTIP_LABEL","REWARDS_PAGE_SECTION_LABEL","EVENT_CLICK_LINK_ACTION","REWARDS_HOW_TO_EARN_EVENT_LABEL","REWARDS_VIEW_POINT_ACTIVITY_LABEL","REWARDS_START_SHOPPING_LABEL","REWARDS_VIEW_CODE_ACTION","REWARDS_VIEW_CODE_LABEL","REWARDS_VOUCHER_MODAL","REWARDS_VOUCHER_LABEL","REWARDS_VOUCHER_PAGE_SECTION","OFFER_TOOLTIP_LABEL","OFFER_PAGE_SECTION","TAP_TO_REVEAL_ACTION","VIEW_AND_OFFER_CODE_CTA","OFFER_CLOSE_EVENT_LABEL","LOYALTY_PROGRAM_LABEL","LOYALTY_PROGRAM_ACTION","LOYALTY_PROGRAM_SUCCESS_ENROLL","ENROLL_LOYALTY","LOYALTY_DASHBOARD_ACTION","OPEN_LABEL","MY_ACCOUNT_NAME","ACCOUNT_PAGE_TYPE","MY_ACCOUNT_TAB","LOYALTY_PROGRAM_DETAILS","LOYALTY_OPT_IN_ACTION","LOYALTY_OPT_IN_CHECKBOX_SELECT_ACTION","LOYALTY_OPT_IN_CHECKBOX_DESELECT_ACTION","ACCOUNT_SIGN_IN_CATEGORY","CREATE_AN_ACCOUNT_ACTION","SUBMIT_LOYALTY_OPT_IN","SUBMIT_LOYALTY_NOT_OPT_IN","LOYALTY_PROGRAM_WELCOME","LOYALTY_PROGRAM_ENROLLMENT","LOYALTY_PROGRAM_ENROLL_SUCCESS","LOYALTY_STYLE_QUIZ_LABEL","LOYALTY_STYLE_QUIZ_GET_STARTED_ACTION","LOYALTY_STYLE_QUIZ_GO_TO_DASHBOARD","LOYALTY_STYLE_QUIZ_PAGE_NAME","LOYALTY_STYLE_QUIZ_QUESTION","OPTION_SELECTED","OPTION_DESELECTED","STYLE_QUIZ_NEXT_CTA","STYLE_QUIZ_PREVIOUS_CTA","STYLE_QUIZ_SUBMIT_CTA","STYLE_QUIZ_SKIP_THIS_QUESTION_CTA","STYLE_QUIZ_FINISH_LATER","START_SHOPPING","STYLE_QUIZ_THANK_YOU_PAGE","PDP_SELECTIONS","PDP_INTERACTION","CHANGE_STORE","VIEW_ITEM","SIGN_IN_OR_CREATE_ACCOUNT_ACTION","START_LABEL","PDP_PAGE_NAME","PRODUCT_PAGE_TYPE","CREATE_ACCOUNT_ACTION","SUBMIT_EVENT_LABEL","JOIN_CLUB_LILLY_EVENT","INITIATE_ACTION","LOYALTY_ENROLLMENT_CATEGORY","ACCOUNT_DASHBOARD_PAGE","GET_DIRECTIONS","STORE_INTERACTION","LOYALTY_VIEW_VOUCHER_CODE_LABEL","REWARDS_POINT_ACTIVITY_LABEL","REWARDS_SHOP_TAB_LABEL","SHARED_WISHLIST_CREATE_ACCOUNT_CATEGORY","SHARED_WISHLIST_CREATE_ACCOUNT_ACTION","SHARED_WISHLIST_CREATE_ACCOUNT_LABEL","SHARED_WISHLIST_PAGE_SUBSECTION","SHARED_WISHLIST_NON_LOYALTY_CATEGORY","SHARED_WISHLIST_NON_LOYALTY_ACTION","SHARED_WISHLIST_NON_LOYALTY_LABEL","LOYALTY_ENROLL_MODAL_INTERACTION_TYPE","SIGN_IN_OR_SIGN_UP_ENROLL_MODAL","LOYALTY_ENROLLMENT_EVENT_NAME","LOYALTY_VOUCHERS_EVENT_NAME","BOLT_INTERACTION","LOYALTY_DASHBOARD_REWARDS_EVENT_NAME","BOLT_MODAL_PROCEED","BOLT_MODAL_CLOSE","LOYALTY_REWARDS_EVENT_NAME","BOLT_SIGN_OUT","NEWSLETTER_SIGNUP_COMPLETE","NEWSLETTER_SIGNUP_FAILURE","isFitPredictorEnabled","noop","selector","querySelector","querySelectorAll","el","classList","c","contains","getPriceFromContainer","priceContainerId","container","parseFloat","getSalePrice","getSelectedColor","colorElement","getSelectedSize","sizeElement","getSizes","sizeArray","size","attrValue","startFP","ssp","getAvailableSizes","updateProductSetData","$container","context","sizes","availableSizes","each","attr","productId","first","val","salePrice","color","sizeType","productContext","$giftCardAmount","pid","masterid","useSale","prediction","event","productContainer","getAttribute","service","sizeOption","setAttribute","handleColor","attribute","handleSize","sauce","deviceWidth","channelValue","custID","email","screen","width","layout","language","market","shippingCountry","userId","emailHash","crumb","pt","bc","breadcrumb","type","html","setupTrigger","initializeDom","ssAddToCart","_container$dataset","variantId","quantity","startOM","startSF","updateProductData","newColor","setSelectedColor","newSize","setSelectedSize","newPrice","priceElement","setPrice","newSalePrice","salesPriceElement","setSalePrice","exported","alias","method","featureSwitch","addClass","removeClass","debounce","SCROLLABLE_CONTENT_SELECTOR","initSpecificCarousel","scrollableContainerEl","parentEl","leftArrowEl","addEventListener","scrollTo","left","Math","scrollLeft","offsetWidth","behavior","rightArrowEl","scrollWidth","initCarousel","hasEtmc","_etmc","trackCart","trackPageView","trackWishlist","setUserInfo","errorTextTemplate","cartTemplates","cart","approachingDiscountsTemplates","approachingDiscounts","promoTemplates","promo","displayFlex","emptySFL","lpRegisteredUserEmailEl","lpRegisteredUserEmail","boltCheckoutAccountExistEl","validateBasket","valid","message","errorHtml","errorMessage","empty","append","emptyCart","resources","emptyCartMsg","numItems","cartErrors","minicartCountOfItems","couponErrorMessage","checkoutButtonElement","expressCheckoutSection","gwpProductsLength","cartWithSFLElement","oosProduct","chooseGwpMessage","monogramRestrictionLength","numLowInventoryWarnings","removeAttribute","HIDDEN_CLASS","href","grandTotalVal","cartPage","zeroTotal","boltCheckoutCtaEl","_checkoutButtonElemen","isBoltEnable","isBoltUserLoggedIn","checkBoltAccountUrl","encodeURIComponent","ajax","url","success","has_bolt_account","enableOrDisableCheckoutButton","hiddenClass","toggleLocationIcon","isGeolocationAllowed","locationInactiveIcon","locationActiveIcon","$body","ispuContainer","ispuModalContainer","pickUpInStoreButton","isRecognizedUser","ispuClosestParent","isInCartPage","isInPdpPage","handleStoreResults","noStoresMessage","storeResults","productDetails","storesResultsHtml","innerHTML","preferredStore","setItemInLocalStorage","PREFERRED_STORE_ID","ID","noStoresErrorMessage","spinner","stop","handleConfirmStoreResults","storeConfirm","storeForm","errorCallBack","handleInStore","locationData","latitude","longitude","address","actionUrl","forceGeoLocation","ispuContainerDataset","products","editStore","inputSearchParameter","selectStoreView","storeId","getItemFromLocalStorage","storeID","start","getJSON","handlePreferredStore","on","googleKey","swatchName","mixinData","includeGoogleMaps","uuid","geolocate","modal","_event$target$dataset","getLatLong","isEditStore","storePickupInfo","ispuLineItems","ispuLineItemsData","productsInfo","ispuLineItem","_ispuLineItem$dataset","_ispuContainer$datase","lineItemErrorMessage","remove","cartProductsHtml","discountsHtml","totals","couponsEl","cookie","getTime","discounts","shippingMethod","promotionsListContainer","cartShippingMethodContainer","checkoutShippingMethodContainer","checkoutShippingMethodTitle","promotionsHtml","promoTemplate","cloneNode","promoContainer","promoText","promoTitle","promoValue","description","eachDiscount","applied","couponData","relationship","couponCode","totalPrice","isDiscounted","shippingLabel","displayName","shippingCost","estimatedArrivalTime","checkoutDiscountShipping","adjustedShippingCost","checkoutNormalShipping","updatePromoCodeDetails","selectedShippingMethod","giftWrapQuantity","giftWrapTotalPrice","giftWrapISPUTotalPrice","giftWrapISPUQuantity","giftWrapContainer","giftWrapISPUContainer","nonCouponContainer","freeprice","formattedPrice","cartWithSFLCountTotal","numberOfItems","subTotal","totalAmount","totalTax","orderLevelDiscountTotal","formatted","nonCouponPromotionsHTML","nonCouponBasedAdjustments","couponItem","nonCouponBasedAdjustmentTemplate","discountPrice","callOutMsg","renderedPromotions","UUID","priceTotal","renderedPrice","updateCartTotals","toggle","findStoreSubmit","disabled","confirmSection","geolocateError","SHIPPING_PREFERENCES_CONTAINER_SELECTOR","STORE_DETAIL_CONTAINER_SELECTOR","ISPU_PREFERENCE_CONTAINER_SELECTOR","ISPU_PREFERENCE_CONTENT_SELECTOR","ISPU_RADIO_SELECTOR","SHIP_TO_ADDRESS_RADIO_SELECTOR","STORE_DETAIL_SELECTOR","STORE_SERVICE_INFO_MESSAGE_SELECTOR","STORE_AVAILABILITY_MESSAGE_SELECTOR","ISPU_INFO_MESSAGE_SELECTOR","SHIP_TO_INFO_MESSAGE_SELECTOR","ISPU_SELECT_STYLE_MESSAGE_SELECTOR","DISABLED_CLASS","NOT_AVAILABLE_CLASS","ISPU_STORE_NAME_CLASS","PRE_ORDER_CLASS","SHIP_TO_LOW_INVENTORY_CLASS","ISPU_SERVICE_ERROR_ATTR_NAME","ISPU_SERVICE_BLOCKED","CHECKOUT_HIDDEN_CLASS","PRODUCT_DETAIL_CONTAINER_SELECTOR","PDP_CONTAINER_SELECTOR","PREFERENCE_SELECTOR","SHIP_TO_ADDRESS_CONTENT_SELECTOR","SHIPPING_PREFERENCE_RADIO_BUTTON_SELECTOR","RADIO_BUTTON_LABEL_SELECTOR","SHIPPING_PREFERENCE_KEY","ISPU_RADIO_VALUE","SHIP_TO_RADIO_VALUE","BOLT_PAY","CHANGE_STORE_LINK_SELECTOR","AVAILABILITY_MSG_SELECTOR","INVENTORY_MSG_SELECTOR","LOW_STOCK_ISPU_SELECTOR","WISHLIST_NAME_REGEX","TRACKER_FUNCTIONAL_COOKIE","LOYALTY_POSTAL_CODE_REGEX","MY_ACCOUNT","ORDER_CONFIRMATION","getNestedValue","getISPUradioButtonEl","productContainerEl","getShipToAddressContentEl","getShipToAddressradioButtonEl","getISPUPreferenceContentEl","addStoreNameClass","storeNameEl","removeStoreNameClass","getChangeStoreLinkEl","getSelectedPreferenceEl","getShippingPreferencesContainerEl","getSelectedSizeEl","selectISPURadioButton","ispuRadioButtonEl","enableISPUSection","checked","ispuContentEl","disableISPURadioButton","disableISPUSection","selectShipToRadioButton","shipToRadioButtonEl","enableShipToContent","shipToContentEl","disableShipToRadioButton","disableShipToContent","getPreferedShippingPreference","shippingPreferenceValue","activeStoreFilter","updateVisibilityOfLowInventoryMsg","ispuLowStockEl","availabilityElement","ispuLowInventory","ispuLowInventoryMsg","ispuProductInventory","breakpoints","xs","sm","md","lg","xl","EMPTY_STRING","INVALID_CLASS","INVISIBLE_CLASS","NO_SCROLL_CLASS","IS_STICKY_CLASS","SELECTED_CLASS","PREORDER_STATUS","IN_STOCK_STATUS","NOT_AVAILABLE_STATUS","KEYCODE_TAB","KEYCODE_ESCAPE","KEYCODE_UP","KEYCODE_DOWN","KEYCODE_ENTER","EVENT_KEY_ENTER","SEARCH_TYPE","SEARCH_SUBMIT","SEARCH_SUGGESTIONS","POPULAR_SEARCHES","loadScript","source","isAsync","script","src","async","onload","body","loadInput","referrerID","formElement","input","getStyles","styles","getComputedStyle","rules","rule","node","removeChild","_len2","_key2","_el$classList","_node$classList","add","_len3","_key3","_el$classList2","_node$classList2","toggleClass","_len4","_key4","_el$classList3","_node$classList3","_len5","classes","_key5","every","className","throttle","limit","waitCallback","isThrottling","_len6","_key6","returnValue","_this","timer","minimumDelay","condition","unrestrictedCallback","_len7","_key7","clearTimeout","toArray","_len8","_key8","arg","newTarget","array","makeArray","outerHeight","offsetHeight","marginTop","marginBottom","isInViewportCheck","scroll","scrollY","pageYOffset","boundsTop","getBoundingClientRect","top","numberOfViewportToCheck","nextViewportLazyLoad","viewport","innerHeight","bounds","clientHeight","isInViewport","rect","bottom","right","innerWidth","documentElement","clientWidth","cartElement","y","duration","getLastElementInRow","nextElementSibling","sibling","offsetTop","scrollHeight","previousElementSibling","updateUrlQueryParam","fragment","queryParamsElement","permaLink","history","pushState","path","newUrl","location","getCharacterCount","waitForElement","timeout","self","disconnect","eventTypes","_options$bindEngine","_options$once","useJQuery","_options$targetSelect","handler","extraData","Element","Event","targetElement","_targetElement","$element","off","removeEventListener","variationGroupId","originalPrice","productPrice","isPreorder","productData","containerData","monetatePid","isQuickview","_window","productInfo","productInventory","wishlistId","productSize","colorCode","productSet","productBadge","id","colorEl","swatchButton","attrDisplayvalue","tileEl","standardPrice","groupId","productNameEl","productSizeEl","valueId","originalPriceEl","productPriceEl","productColorEl","productColor","matchesBreakpoint","breakpoint","matchMedia","getCSRFToken","token","renderFragment","template","content","getCookieMap","keyValue","_keyValue$trim$split2","decodeURIComponent","setCookie","minutes","date","setTime","toGMTString","validateDate","monthSelector","dateSelector","m","d","mlength","labelOption","Option","option","selected","isVisible","HTMLElement","offsetParent","style","display","visibility","overflowY","height","maxHeight","toFormData","obj","includeUndefined","formData","FormData","googleMapScript","geocoder","head","callBack","mixin","google","maps","Geocoder","geocode","status","GeocoderStatus","OK","geometry","lat","lng","phInfoPopover","fpoInfoPopover","checkoutBenefitsInfoPopover","cvvInfoPopover","giftCardInfoPopover","birthdayInfoPopover","deliveryFeeInfoPopover","boltSignoutMessage","earlyAccessMessage","giftReturnNumberInfoPopover","keepUserSignedInPopover","keepUserSignedInContainer","earlyAccessLockedSelector","pdpChatWrapper","pdpChatPopover","pdpChatContainer","initPopover","popover","POPOVER_CLICK_BOTTOM","placement","initPopoverClose","one","clickEvent","clicked","initPopoverCloseSelector","tooltipSelector","initPopoverPromotions","button","popoverContent","initPopoverWishList","initPopoverEarlyAccessLocked","initPopoverAll","tooltipIcon","popContent","offset","toggleSelectSizeInfo","isEarlyAccessElement","loyaltyProfile","swatchNameTemplate","sizeOptionTemplate","sizeButtonTemplate","gwpSizeTemplate","dialogTemplate","loyalty","isLoyaltyProgramMember","isLoyaltyAuthenticated","isLoyaltyEnabled","_require$productDetai","selectStyleMessageTmpl","ispuSelectStyleMessageTmpl","isShippingPreferencesViewEnabled","selectedSizeEl","availabilityMessageEl","selectStylesMessage","ispuAvailabilityMessageEl","earlyAccess","isEarlyAccessItem","earlyAccessDate","earlyAccessUntilDate","quickView","quickViewModal","addToWishlist","addToWishlistModal","cartAvailabilityMessageOOS","checkout","swatchNameHtml","emptySwatchTemplate","addressSuggestions","suggestionTextTemplate","suggestionsTemplate","discountContainerTemplate","singleDiscountTemplate","multipleDiscountsTemplate","videoTemplate","_options$loop","loop","_options$videoUrl","videoUrl","_options$imgUrl","imgUrl","_options$classNames","classNames","_options$autoplay","autoplay","_options$muted","muted","_options$controls","controls","_options$icontitle","icontitle","_options$icondesc","icondesc","imageTemplate","altText","variantData","ariaLabel","ariaDescribedby","selectedText","oosMessage","forceOutOfStock","inStock","guestEmptyWishlistTemplate","emptyWishlistMessage","emptyWishlistContentAssetBody","emptySFLMessage","continueShopURL","continueShopMsg","signInMsg","signInSFLURL","singleSize","multiSize","multiDefaultSizeOption","multiSizeOption","autoComplete","suggestionLink","suggestion","addressLine","secondaryEntryAddressLine","street_line","secondary","state","city","zipcode","suggestionContainer","containerClass","contactUsTemplate","signupError","msg","defaultSignupError","browserWarningTemplate","shippingPreferenceTemplates","shippingPreferences","ispuRadioLabel","ispuRadioValue","shipToRadioLabel","shipToRadioValue","changeStoreLabel","preferISPU","storeDetail","address1","stateCode","postalCode","productDetail","availabilityMessageTmpl","availabilityMessageOOS","availabilityMessagePreorder","ispuAvailabilityMessageTmpl","ispuLowStockMessageTmpl","promotionMessageTmpl","calloutMsg","details","index","_options$buttons","buttons","primary","link","_options$className","_options$modalContent","modalContentHeading","_options$modalContent2","modalContentBody","_options$id","_options$slideOut","slideOut","buttonSpace","floor","oneTrust","privacyDialogCookieBanner","carouselBadge","styliticsTemplates","shopTheModelBadge","returnsPageTemplates","defaultError","cyberSource","secureAcceptanceTag","paymentType","boltPayPaymentTag","paymentLastFour","expMonth","expYear","paypalPaymentTag","paypalMethod","paypalAmount","creditCardPaymentTag","cardType","creditCardType","maskedCardNumber","cardEndIn","cardExpMonth","cardExpYear","checkoutErrorTemplate","checkoutErrorMsg","errorMsg","tokenize","string","leftToken","rightToken","operators","RegExp","_","code","toKebabCase","sort","startsWith","endsWith","substr","digit","charCodeAt","toUpperCase","tokens","keyString","replaceValues","initOnce","flag","appendToUrl","params","onSuccess","onError","dataType","successCallback","errorCallback","navigator","geolocation","getCurrentPosition","response","coords","maximumAge","removeItemFromLocalStorage","formatPhoneNumber","formatValue","numbers","char","errorMessageElmParent","parentNode","patternMismatch","isMobile","mobileAgentHash","idx","userAgent","stickyScrollPosition","$window","ticking","detailStickyScroll","itemHeight","windowHeight","newTop","requestAnimationFrame","handleStickyPositionOnScroll","isUnsupportedBrowser","unsupportedBrowserTypes","sitePrefs","some","uaFragment","getTimeRemaining","endtime","total","seconds","hours","days","validateEmailBolt","hideStrikeHearts","showStrikeHearts","setWishlistProductId","wishlistBtn","wishlistStrikeBtn","setTabNextFocus","focusParams","keyCode","firstFocusableEl","containerSelector","firstElementSelector","lastFocusableEl","lastElementSelector","is","nextToLastElementSelector","linkElements","focus","feedbackElement","children","siblings","prop","parents","prepend","include","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","getter","__esModule","definition","get","hasOwnProperty","toStringTag","processInclude"],"sourceRoot":""}