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uC,EAAEjD,UACZhJ,OAAOgJ,UAAUC,KAAKgD,EAAEjD,UAAUU,GAE1C,IAECwC,OAAOC,IACRrF,QAAQN,MAAM2F,EAAI,IAEjBC,SAAQ,KACLL,GACAA,GACJ,GAER,GAEJ,K,2EChNA,MAAMM,EAAqB,4FACdtK,EAAqBC,GAAWA,EAAOwD,cAAc6G,GACrDC,EAA2BtK,GAAWA,EAAOwG,iBAAiB6D,E","sources":["webpack:///./assets/src/scripts/utilities/freeze.ts","webpack:///./assets/src/scripts/constants/customMessages.ts","webpack:///./assets/src/scripts/constants/whatInput.ts","webpack:///./assets/src/scripts/utilities/whatInput.ts","webpack:///./assets/src/scripts/base/commonInterface.ts","webpack:///./assets/src/scripts/base/baseComponent.ts","webpack:///./assets/src/scripts/components/addToWishlist.ts","webpack:///./assets/src/scripts/utilities/analyticsUtils.ts","webpack:///./assets/src/scripts/utilities/focusableElementUtils.ts"],"sourcesContent":["export default function deepFreeze(o) {\n Object.freeze(o);\n Object.getOwnPropertyNames(o).forEach(function (prop) {\n if (Object.hasOwnProperty.call(o, prop) && o[prop] !== null && (typeof o[prop] === 'object' || typeof o[prop] === 'function') && !Object.isFrozen(o[prop])) {\n deepFreeze(o[prop]);\n }\n });\n return o;\n}\n","import deepFreeze from '../utilities/freeze';\nexport default deepFreeze({\n WINDOW: {\n CLICK_EVENT: 'body:click:event',\n },\n BODY: {\n TOGGLE_OVERLAY: 'toggle:overlay',\n ON_OVERLAY: 'on:overlay',\n OFF_OVERLAY: 'off:overlay',\n },\n HEADER: {\n UPDATE_TRAP: 'header:trap:update',\n IN_PDP: 'header:inPdp',\n },\n BURGER: {\n TOGGLE_MENU: 'menu:toggle',\n },\n BREAKPOINTER: {\n BREAKPOINT_CHANGE: 'breakpoint:change',\n },\n DROP_DOWN: {\n OPEN: 'dropdown:open',\n CLOSE: 'dropdown:close',\n },\n PRODUCT_CAROUSEL: {\n UPDATE_IMAGES: 'product:carousel:update_images',\n UPDATE_ZOOM_IMAGES: 'product:carousel:update_zoom_images',\n },\n BRANDS: {\n UPDATE_GRID: 'brands:update:grid',\n UPDATE_STORES: 'brands:update:stores',\n SEARCH_BY_STORE: 'brands:search:bystore',\n },\n MODAL_EVENTS: {\n show: 'modal:show',\n close: 'modal:close',\n },\n});\n","import deepFreeze from '../utilities/freeze';\nexport default deepFreeze({\n INPUT: {\n KEYBOARD: 'keyboard',\n MOUSE: 'mouse'\n }\n});\n","import whatInput from 'what-input';\nexport const ask = (strategy = 'input') => {\n return whatInput.ask(strategy);\n};\n","import { getAllFocusableElements, getFirstFocusable } from '../utilities/focusableElementUtils';\nimport CustomMessages from '../constants/customMessages';\nimport EventBus from '../libs/eventBus';\nimport WHAT_INPUT from '../constants/whatInput';\nimport { ask } from '../utilities/whatInput';\nimport config from 'gia/config';\nexport default class CommonInterface {\n constructor() {\n config.set('log', true);\n window.EventBus = EventBus;\n window.CUSTOM_MESSAGES = this.CUSTOM_MESSAGES;\n this._grabMessages();\n }\n get CUSTOM_MESSAGES() {\n return CustomMessages;\n }\n get Messages() {\n return {};\n }\n get isKeyboard() {\n return this._isKeyboard();\n }\n get isMouse() {\n return this._isMouse();\n }\n get whatInput() {\n return this._whatInput();\n }\n _checkMessages() {\n for (const message in this.Messages) {\n if (window.eventQueue.get(message)) {\n const ref = this.Messages[message].bind(this);\n window.eventQueue.get(message).map((payload) => {\n ref(payload);\n });\n window.eventQueue.delete(message);\n }\n }\n }\n _grabMessages() {\n this._messages = {};\n for (const message in this.Messages) {\n if (this.Messages[message]) {\n const __ref__ = this.Messages[message].bind(this);\n this._messages[message] = __ref__;\n this.GRAB(message, __ref__);\n }\n }\n }\n _ungrabMessages() {\n for (const message in this._messages) {\n this.UNGRAB(message, this._messages[message]);\n }\n }\n objectIsEmpty(object) {\n for (let key in object) {\n if (object.hasOwnProperty(key))\n return false;\n }\n return true;\n }\n /**\n *\n * EMIT\n *\n * @param {string} message\n * @param {Object} payload\n */\n EMIT(message, payload) {\n return EventBus.emit(message, payload);\n }\n /**\n *\n * GRAB\n *\n * @param {string} message\n * @param {Function} callBack\n */\n GRAB(message, callBack) {\n if (!callBack)\n return;\n EventBus.on(message, callBack);\n }\n /**\n *\n * UNGRAB\n *\n * @param {string} message\n * @param {Function} callBack\n */\n UNGRAB(message, callBack) {\n if (!callBack)\n return;\n EventBus.off(message, callBack);\n }\n getFirstFocusable(parent) {\n return getFirstFocusable(parent);\n }\n getFocusableElements(parent) {\n return getAllFocusableElements(parent);\n }\n _isMouse() {\n return ask() === WHAT_INPUT.INPUT.MOUSE;\n }\n _isKeyboard() {\n return ask() === WHAT_INPUT.INPUT.KEYBOARD;\n }\n _whatInput() {\n return ask();\n }\n _destroy() {\n this._ungrabMessages();\n }\n}\n","import Bean from 'bean';\nimport CommonInterface from './commonInterface';\nimport deepFreeze from '../utilities/freeze';\nexport default class BaseComponent extends CommonInterface {\n /**\n *\n * constructor\n *\n * @param {Element} element\n */\n constructor(element) {\n super();\n this._componentElement = element;\n this._componentElement.setAttribute('data-component-init', 'true');\n this._checkMessages();\n //console.log(`%c[${this.COMPONENT_NAME}]%c initialized`, 'color:orange;', 'color:white;');\n }\n /**\n * @returns {ComponentElement}\n */\n get _el() {\n return this._componentElement;\n }\n get _options() {\n const compOptions = {};\n const options = Object.assign({}, this._el.dataset);\n const optionsEntires = Object.keys(options).filter((entry) => entry.includes('option'));\n optionsEntires.forEach((entry) => {\n const cleanEntry = BaseComponent.cleanOptionKey(entry);\n let optionValue;\n if (options[entry].includes('{') && options[entry].includes('}')) {\n optionValue = JSON.parse(options[entry].replace(/'/g, '\"'));\n }\n else {\n optionValue = BaseComponent.convertType(options[entry]);\n }\n compOptions[cleanEntry] = optionValue;\n });\n return deepFreeze(compOptions);\n }\n get COMPONENT_NAME() {\n return this._el.getAttribute('data-component');\n }\n static convertType(option) {\n let optionReturn;\n switch (option) {\n case 'false':\n optionReturn = false;\n break;\n case 'true':\n optionReturn = true;\n break;\n case 'null':\n optionReturn = null;\n break;\n default:\n optionReturn = option;\n break;\n }\n return optionReturn;\n }\n static cleanOptionKey(key) {\n const str = key.replace('option', '');\n return `${str.charAt(0).toLocaleLowerCase()}${str.slice(1)}`;\n }\n /**\n *\n * $on\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this._el]\n * @param {Array|String|Element} [elements = null]\n */\n $on(events, cb, element = this._el, elements = null) {\n if (!element || !events || !cb)\n return;\n if (!elements) {\n Bean.on(element, events, (e) => {\n if (e)\n e.stopPropagation();\n cb(e);\n });\n }\n else {\n Bean.on(element, events, elements, (e) => {\n if (e)\n e.stopPropagation();\n cb(e);\n });\n }\n }\n /**\n *\n * $one\n *\n * @param {String} events\n * @param {Function} cb\n * @param {Element} [element = this._el]\n */\n $one(events, cb, element = this._el) {\n Bean.one(element, events, cb);\n }\n /**\n *\n * $off\n *\n * @param {String} events\n * @param {Element} [element = this._el]\n */\n $off(events, element = this._el) {\n Bean.off(element, events);\n }\n /**\n *\n * $fire\n *\n * @param {String} events\n * @param {Element} [element = this._el]\n */\n $fire(events, element = this._el) {\n Bean.fire(element, events);\n }\n updateAriaAttributes(element) {\n const attributes = [...element.attributes]\n .filter((attr) => {\n return attr.nodeName.indexOf('has') === -1;\n })\n .filter((attr) => {\n return attr.nodeName.indexOf('aria') > -1 && (attr.nodeValue === 'true' || attr.nodeValue === 'false');\n })\n .map((attr) => {\n return attr.nodeName;\n });\n attributes.forEach((attr) => {\n element.setAttribute(attr, element.getAttribute(attr) === 'true' ? 'false' : 'true');\n });\n }\n}\n","//import spinner from './spinner';\nimport BaseComponent from '../base/baseComponent';\nimport customEventBus from '../libs/eventBus';\nimport micromodalInstance from '../libs/micromodalInstance';\nimport analyticsUtils from '../utilities/analyticsUtils';\nexport default class AddToWishlist extends BaseComponent {\n constructor(element) {\n super(element);\n this.isinwishlist = null;\n this.waiting = false;\n this.pid = this._options.vgid;\n this.pageType = document.querySelector('.page').getAttribute('data-action') || '';\n this.handleClick();\n // if (this.pageType === 'Wishlist-Show') {\n // this.listenForCartAdded();\n // }\n }\n get SELECTORS() {\n return {\n label: '.btn-addtowishlist-label',\n feedback: '.btn-actions-feedback',\n listItem: '.product-tile',\n counter: 'data-wishlistcounter',\n };\n }\n handleClick() {\n this._el.addEventListener('click', (_e) => {\n this.count = document.body.querySelector(`[${this.SELECTORS.counter}]`)\n ? parseInt(document.body.querySelector(`[${this.SELECTORS.counter}]`).getAttribute(this.SELECTORS.counter))\n : 0;\n this.isinwishlist = JSON.parse(this._el.getAttribute('data-isinwishlist')) || false;\n this.wishlistFlow();\n });\n }\n async wishlistFlow() {\n if (this.waiting === false) {\n this.waiting = true;\n //spinner.set();\n try {\n const data = await this.toggleWishlist();\n const { error, msg } = data;\n if (data.nonAuthenticated) {\n window.location.href = data.redirectUrl;\n return;\n }\n if (error) {\n console.error('wishlistFlow error', msg, error);\n }\n else if (data.listIsFull) {\n console.warn('Wishlist is full');\n //@ts-ignore\n micromodalInstance.forceShow('modal-wishlistfull');\n }\n else {\n analyticsUtils.updateDataLayer(this._el, data);\n if (document.querySelector('.page').getAttribute('data-action') === 'Wishlist-Show') {\n this.isinwishlist = false;\n if (this.count > 0)\n this.removeLisItemCard();\n if (this.count < 1) {\n location.reload();\n }\n }\n else {\n this.isinwishlist = !this.isinwishlist;\n this.updateCta();\n }\n this.updateCounter(data.listLength);\n }\n }\n catch (error) {\n console.error('wishlistFlow error catch', error);\n }\n finally {\n //spinner.unset();\n this.waiting = false;\n }\n }\n }\n async toggleWishlist() {\n let endpointUrl, fetchData;\n // const formData = new FormData();\n // formData.append('pid', this.pid);\n let obj = { pid: this.pid };\n endpointUrl = this._options.endpointAdd;\n fetchData = {\n method: 'POST',\n body: JSON.stringify(obj),\n //body: formData,\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n },\n };\n return fetch(endpointUrl, fetchData).then(function (response) {\n // if (!this.isinwishlist && this.pageType === 'Product-Show') {\n // customEventBus.emit(this.CUSTOM_MESSAGES.DATALAYER.WISHLIST.add, { trackUrl: location.href });\n // }\n return response.json();\n });\n }\n /****/\n updateCta() {\n this._el.setAttribute('data-isinwishlist', this.isinwishlist.toString());\n const copy = this.isinwishlist ? this._options.labelAdded : this._options.labelDefault;\n this._el.setAttribute('aria-label', copy);\n }\n removeLisItemCard() {\n this._el.closest(this.SELECTORS.listItem).remove();\n }\n updateCounter(num) {\n this.count = num || 0;\n const counters = document.querySelectorAll(`[${this.SELECTORS.counter}]`);\n counters.forEach((counter) => {\n let htmlcounter = counter;\n if (this.count === 0) {\n htmlcounter.innerText = '0';\n //htmlcounter.style.display = 'none';\n location.reload();\n }\n else {\n //htmlcounter.removeAttribute('style');\n htmlcounter.innerText = this.count.toString();\n }\n counter.setAttribute(this.SELECTORS.counter, this.count.toString());\n });\n }\n listenForCartAdded() {\n console.log('LISTEN');\n // workaround to remove product from wishlist in wishlist-show page\n //customEventBus.on('minicart:update', (data: any) => {\n customEventBus.on('cartCookie:update', (data) => {\n //const listitem = document.querySelector(this.SELECTORS.listItem + '[data-option-pid=\"' + data.pid + '\"]');\n let listitem = document.querySelector(`.product-tile[data-option-pid=\"${data.pid}\"]`);\n console.log('BUS', `.product-tile[data-option-pid=\"${data.pid}\"]`, data.pid);\n if (listitem) {\n this.wishlistFlow();\n // const removeBtn = listitem.querySelector('[data-component=\"addToWishlist\"][data-isinwishlist=\"true\"]') as HTMLElement;\n // removeBtn.click();\n }\n });\n }\n}\n","import customEventBus from '../libs/eventBus';\nconst analyticsUtils = {\n listenForPush: () => {\n customEventBus.on('datalayer:push', (data) => {\n window.dataLayer.push(data);\n });\n },\n pushCheckoutStepDatalayer: async (step) => {\n let forcedPipeline = '';\n switch (step) {\n case 'shipping':\n forcedPipeline = 'CheckoutStepShipping';\n break;\n case 'payment':\n forcedPipeline = 'CheckoutStepPayment';\n break;\n default:\n }\n let formData = new FormData();\n formData.append('forcedPipeline', forcedPipeline);\n await fetch(window.asyncServiceUrl, {\n method: 'POST',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n },\n body: formData,\n }).then(r => r.json()).then((data) => {\n if (data.dataLayer) {\n for (let i in data.dataLayer) {\n window.dataLayer.push(data.dataLayer[i]);\n }\n }\n });\n },\n pushCheckoutSelectDatalayer: async (step, option) => {\n let stepNumber = '0';\n switch (step) {\n case 'shipping':\n stepNumber = '1';\n break;\n case 'payment':\n stepNumber = '2';\n break;\n default:\n }\n if (step === 'payment') {\n switch (option) {\n case 'scheme':\n option = 'credit_card';\n break;\n default:\n }\n }\n let formData = new FormData();\n formData.append('forcedPipeline', 'CheckoutSelectOption');\n formData.append('step', stepNumber);\n formData.append('option', option);\n await fetch(window.asyncServiceUrl, {\n method: 'POST',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n },\n body: formData,\n }).then(r => r.json()).then((data) => {\n if (data.dataLayer) {\n for (let i in data.dataLayer) {\n window.dataLayer.push(data.dataLayer[i]);\n }\n }\n });\n },\n getItemListId(tile) {\n let itemListId = 'card_prodotti';\n let carouselWrapper = tile.closest('.productcarouseleinstein.editorialcaroousel');\n if (carouselWrapper) {\n itemListId = 'carousel_1';\n }\n else if (tile.closest('.product-detail')) {\n itemListId = 'banner';\n }\n return itemListId;\n },\n getItemListName(tile) {\n let itemListName = 'Listing Page';\n let carouselWrapper = tile.closest('.productcarouseleinstein.editorialcaroousel');\n if (carouselWrapper) {\n let titleElement = carouselWrapper.querySelector('.productcarouseleinstein-header .title');\n if (titleElement) {\n itemListName = titleElement.textContent;\n }\n }\n else if (tile.closest('.wishlist-content')) {\n let wishlistContent = tile.closest('.wishlist-content');\n if (wishlistContent) {\n itemListName = \"Wishlist\";\n }\n }\n else if (tile.closest('.product-detail')) {\n itemListName = 'PDP';\n }\n return itemListName;\n },\n updateDataLayer(el, data) {\n if (data.dataLayer) {\n const page = document.querySelector('.page');\n let tileIndex = 0;\n const itemListId = this.getItemListId(el);\n const itemListName = this.getItemListName(el);\n if (itemListName === 'Listing Page' || itemListName === 'Wishlist') {\n tileIndex = this.getTileIndex(el.closest('.product-tile'));\n }\n else if (itemListId === 'carousel_1') {\n const productTile = el.closest('.experience-component.experience-molecules-productTile.swiper-slide');\n tileIndex = this.getTileIndexFromCarousel(productTile);\n }\n for (let i in data.dataLayer) {\n // @ts-ignore\n if (page && data.dataLayer[i].ecommerce && data.dataLayer[i].ecommerce.items && data.dataLayer[i].ecommerce.items.length > 0) {\n data.dataLayer[i].ecommerce.items[0].item_list_name = itemListName;\n data.dataLayer[i].ecommerce.items[0].item_list_id = itemListId;\n data.dataLayer[i].ecommerce.items[0].index = tileIndex;\n data.dataLayer[i].ecommerce.item_list_name = itemListName;\n data.dataLayer[i].ecommerce.item_list_id = itemListId;\n }\n window.dataLayer.push(data.dataLayer[i]);\n }\n }\n },\n /* Get tiles info in listing */\n getTileListName(tile) {\n // name types: category, search, recommended, featured\n let listName = '';\n if (tile.closest('.editorial-component') !== null) {\n listName = 'featured';\n }\n else if (document.body.querySelector('[data-listingtype]') && document.body.querySelector('[data-listingtype]').getAttribute('data-listingtype') !== '') {\n listName = document.body.querySelector('[data-listingtype]').getAttribute('data-listingtype');\n }\n else if ('RECOMMENDED_TBD' === listName) {\n // TODO: definizione recommended\n listName = 'recommended';\n }\n return listName;\n },\n getTileListId(tile) {\n let listId = '';\n if (tile.closest('.editorial-component') !== null) {\n listId = tile.closest('.editorial-component').classList[1] || 'editorial-component';\n }\n else if (document.body.querySelector('[data-listingid]') && document.body.querySelector('[data-listingid]').getAttribute('data-listingid') !== '') {\n listId = document.body.querySelector('[data-listingid]').getAttribute('data-listingid');\n }\n else if ('RECOMMENDED_ID_TBD' === listId) {\n // TODO: definizione recommended\n listId = 'recommended';\n }\n return listId;\n },\n getTileIndex(tile) {\n let i = 0;\n let context = tile.parentNode;\n i = [...context.querySelectorAll('.product-tile')].indexOf(tile);\n return i;\n },\n getTileIndexFromCarousel(productTile) {\n let carouselWrapper = productTile.closest('.productcarouseleinstein.editorialcaroousel');\n var allProductTiles = carouselWrapper.querySelectorAll('.experience-component.experience-molecules-productTile.swiper-slide');\n return Array.prototype.indexOf.call(allProductTiles, productTile);\n },\n getListPids(context) {\n let productIds = [];\n if (context.querySelectorAll('.product-tile').length > 0) {\n context.querySelectorAll('.product-tile').forEach((item) => {\n productIds.push(item.getAttribute('data-productid'));\n });\n }\n return productIds;\n },\n async passThroughProcessor(data, _callback = null) {\n let formData = new FormData();\n for (let k in data) {\n formData.append(k, data[k]);\n }\n await fetch(window.asyncServiceUrl, {\n method: 'POST',\n headers: {\n 'X-Requested-With': 'XMLHttpRequest',\n },\n body: formData,\n })\n .then((r) => r.json())\n .then((d) => {\n if (d.dataLayer && window.dataLayer) {\n for (let i in d.dataLayer) {\n window.dataLayer.push(d.dataLayer[i]);\n }\n }\n })\n .catch((err) => {\n console.error(err);\n })\n .finally(() => {\n if (_callback) {\n _callback();\n }\n });\n }\n};\nexport default analyticsUtils;\n","const focusableSelectors = 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"]), [role=\"button\"]';\nexport const getFirstFocusable = (parent) => parent.querySelector(focusableSelectors);\nexport const getAllFocusableElements = (parent) => parent.querySelectorAll(focusableSelectors);\n"],"names":["deepFreeze","o","Object","freeze","getOwnPropertyNames","forEach","prop","hasOwnProperty","call","isFrozen","WINDOW","CLICK_EVENT","BODY","TOGGLE_OVERLAY","ON_OVERLAY","OFF_OVERLAY","HEADER","UPDATE_TRAP","IN_PDP","BURGER","TOGGLE_MENU","BREAKPOINTER","BREAKPOINT_CHANGE","DROP_DOWN","OPEN","CLOSE","PRODUCT_CAROUSEL","UPDATE_IMAGES","UPDATE_ZOOM_IMAGES","BRANDS","UPDATE_GRID","UPDATE_STORES","SEARCH_BY_STORE","MODAL_EVENTS","show","close","INPUT","KEYBOARD","MOUSE","ask","strategy","CommonInterface","constructor","config","window","EventBus","CUSTOM_MESSAGES","this","_grabMessages","Messages","isKeyboard","_isKeyboard","isMouse","_isMouse","whatInput","_whatInput","_checkMessages","message","eventQueue","get","ref","bind","map","payload","delete","_messages","__ref__","GRAB","_ungrabMessages","UNGRAB","objectIsEmpty","object","key","EMIT","callBack","getFirstFocusable","parent","getFocusableElements","_destroy","BaseComponent","element","super","_componentElement","setAttribute","_el","_options","compOptions","options","assign","dataset","keys","filter","entry","includes","cleanEntry","cleanOptionKey","optionValue","JSON","parse","replace","convertType","COMPONENT_NAME","getAttribute","static","option","optionReturn","str","charAt","toLocaleLowerCase","slice","$on","events","cb","elements","e","stopPropagation","$one","$off","$fire","updateAriaAttributes","attributes","attr","nodeName","indexOf","nodeValue","AddToWishlist","isinwishlist","waiting","pid","vgid","pageType","document","querySelector","handleClick","SELECTORS","label","feedback","listItem","counter","addEventListener","_e","count","body","parseInt","wishlistFlow","async","data","toggleWishlist","error","msg","nonAuthenticated","location","href","redirectUrl","console","listIsFull","warn","removeLisItemCard","reload","updateCta","updateCounter","listLength","endpointUrl","fetchData","obj","endpointAdd","method","stringify","headers","fetch","then","response","json","toString","copy","labelAdded","labelDefault","closest","remove","num","querySelectorAll","htmlcounter","innerText","listenForCartAdded","log","listitem","analyticsUtils","listenForPush","dataLayer","push","pushCheckoutStepDatalayer","step","forcedPipeline","formData","FormData","append","asyncServiceUrl","r","i","pushCheckoutSelectDatalayer","stepNumber","getItemListId","tile","itemListId","getItemListName","itemListName","carouselWrapper","titleElement","textContent","updateDataLayer","el","page","tileIndex","getTileIndex","productTile","getTileIndexFromCarousel","ecommerce","items","length","item_list_name","item_list_id","index","getTileListName","listName","getTileListId","listId","classList","parentNode","allProductTiles","Array","prototype","getListPids","context","productIds","item","_callback","k","d","catch","err","finally","focusableSelectors","getAllFocusableElements"],"sourceRoot":""}