{"version":3,"file":"index.es.min.js","sources":["../../../packages/helpers/src/props.helpers.js","../../../packages/helpers/src/utils.ts","../../../packages/page-builder-sections/src/hotspots/subcomponents/grid/grid.js","../../../packages/components/src/constants.mjs","../../../packages/helpers/src/catalog.js","../../../packages/helpers/src/events.helpers.ts","../../../packages/helpers/src/gtmEvents.js","../../../packages/helpers/src/assets/js/viewportTracking.js","../../../packages/helpers/src/assets/js/zoneTracking.js","../../../packages/helpers/src/viewport.helpers.ts","../../../packages/page-builder-sections/src/hotspots/subcomponents/hotspot/hotspot.js","../../../packages/helpers/src/dataLayer.js","../../../packages/helpers/src/cremaDataHelper.js","../../../packages/components/src/sku-coffee/services/index.js","../../../packages/page-builder-sections/src/product-grid/dataTransform/product.coffee.dto.js","../../../services/plp/services.js","../../../packages/page-builder-sections/src/product-grid/dataTransform/product.machine.dto.js","../../../packages/components/src/sku/services/index.js","../../../packages/page-builder-sections/src/product-grid/dataTransform/product.dto.js","../../../packages/components/src/sku/constants.mjs","../../../packages/page-builder-sections/src/product-grid/dataTransform/product.accessory.dto.js","../../../packages/page-builder-sections/src/product-grid/dataTransform/product.giftCard.dto.js","../../../packages/page-builder-sections/src/hotspots/subcomponents/hotspot-tooltip/hotspot-tooltip.js","../../../packages/helpers/src/getCurrency.js","../../../packages/page-builder-sections/src/hotspots/hotspots.js"],"sourcesContent":["const getData = attributes => attributes.find(attribute => attribute.nodeName === 'data')\n\nconst createProps = attributes => {\n    const data = getData([...attributes])\n    const props = [...attributes]\n        .filter(attribute => attribute.nodeName !== 'data')\n        .reduce((all, attr) => {\n            return { ...all, [attr.nodeName]: attr.nodeValue }\n        }, {})\n\n    if (isNil(data)) {\n        return props\n    }\n\n    try {\n        return { ...props, ...JSON.parse(data.nodeValue) }\n    } catch (error) {\n        console.log('ERROR: No data', error, data?.nodeValue)\n    }\n}\n\nconst isNil = obj => obj === undefined || obj === null\n\nexport const parseBool = value => (!value || value === 'false' ? false : true)\n\nexport default createProps\n","export { waitForSelector } from './waitForSelector'\n\nexport const constants = {\n    LEFT: 37,\n    UP: 38,\n    RIGHT: 39,\n    DOWN: 40,\n    ESC: 27,\n    SPACE: 32,\n    ENTER: 13,\n    TAB: 9\n}\n\nexport function capitalize(s = '') {\n    return s[0].toUpperCase() + s.slice(1)\n}\n\nexport const convertToCamelCase = (str: string): string => {\n    const arr = str.match(/[a-z]+|\\d+/gi)\n    if (!arr) { return str }\n    return arr.map((m, i) => {\n        let low = m.toLowerCase()\n        if (i !== 0) {\n            low = low.split('').map((s, k) => (k === 0 ? s.toUpperCase() : s)).join(\"\")\n        }\n        return low\n    }).join(\"\")\n}\n\nexport function slug(s = '') {\n    return s\n        .toLowerCase()\n        .trim()\n        .replace(/\\s+/g, '-') // Replace spaces with -\n        .replace(/[^\\w-]+/g, '') // Remove all non-word chars\n        .replace(/--+/g, '-') // Replace multiple - with single -\n}\n\nexport function pxToEm(target: number, stripedInnerFontSize = 1) {\n    return target / 14 / stripedInnerFontSize + 'em'\n}\n\nexport function percent(target: number) {\n    return target + '%'\n}\n\nexport function parseHTML(str: string) {\n    const tmp = document.implementation.createHTMLDocument('')\n    tmp.body.innerHTML = str\n    return tmp.body.childNodes\n}\n\nexport function stripHTML(str: string) {\n    const tmp = document.implementation.createHTMLDocument('')\n    tmp.body.innerHTML = str\n    return (tmp.body.textContent ?? \"\").replace(RegExp('[\\\\s|\\'|\"]', 'g'), '')\n}\n\nexport function makeId(length: number) {\n    var result = ''\n    var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n    var charactersLength = characters.length\n    for (var i = 0; i < length; i++) {\n        result += characters.charAt(Math.floor(Math.random() * charactersLength))\n    }\n    return result\n}\n\nexport function removeEmptyValues(obj: { [key: string]: any }): { [key: string]: any } {\n    const findText = [\n        'Default campaign ID (tracking missing in Page Builder export)',\n        'Default campaign name (tracking missing in Page Builder export)',\n        'promoname', \n        'promoid', \n        'promocreative', \n        'undefined'\n    ];\n    \n    for (let key in obj) {\n        const value = obj[key];\n        \n        if (value === null || value === undefined || value === '') {\n            delete obj[key];\n            continue;\n        }\n        \n        if (typeof value === 'string') {\n            for (const text of findText) {\n                if (value.includes(text)) {\n                    delete obj[key];\n                    break;\n                }\n            }\n        }\n    }\n    \n    return obj;\n}\n\nexport function makeHash(str: string) {\n    var hash = 0,\n        i,\n        chr\n    if (!str) {\n        return hash\n    }\n    for (i = 0; i < str.length; i++) {\n        chr = str.charCodeAt(i)\n        hash = (hash << 5) - hash + chr\n        hash |= 0 // Convert to 32bit integer\n    }\n    return 'id-' + hash\n}\n\nexport function getHashLink(link: string) {\n    let linkHash = link\n    let linkNoHash = link\n    if (link.indexOf('#') !== -1) {\n        linkNoHash = link.replace('#', '')\n    } else {\n        linkHash = '#' + link\n    }\n\n    return { linkNoHash, linkHash }\n}\n\nexport function lazyLoad(node: Element, attribute: string, value: any, url: string) {\n    const CLASSNAME_OUT_OF_SCREEN = 'lazy-load'\n    const CLASSNAME_IN_SCREEN = 'lazy-loaded'\n    const CLASSNAME_ON_ERROR = 'lazy-loaded-error'\n\n    const isOldIOS = () => {\n        var agent = window.navigator.userAgent,\n            start = agent.indexOf('OS ')\n        if ((agent.indexOf('iPhone') > -1 || agent.indexOf('iPad') > -1) && start > -1) {\n            return window.Number(agent.substr(start + 3, 3).replace('_', '.')) < 14\n        }\n        return false\n    }\n\n    const inViewPort = (attribute: string, value: any) => {\n        node.setAttribute(attribute, value)\n\n        const cb = () => node.classList.add(CLASSNAME_IN_SCREEN)\n\n        if (url) {\n            const img = new Image()\n            img.src = url\n            img.onload = cb\n            img.onerror = () => {\n                cb()\n                node.classList.add(CLASSNAME_ON_ERROR)\n                throw new Error(`Image ${url} cannot be loaded`)\n            }\n\n            return\n        }\n\n        cb()\n    }\n\n    if (/Trident\\/|MSIE/.test(window.navigator.userAgent) || isOldIOS()) {\n        inViewPort(attribute, value)\n    } else {\n        if ('IntersectionObserver' in window) {\n            node.classList.add(CLASSNAME_OUT_OF_SCREEN)\n            let lazyBackgroundObserver = new IntersectionObserver(function (entries) {\n                entries.forEach(function (entry) {\n                    if (entry.isIntersecting) {\n                        inViewPort(attribute, value)\n                        lazyBackgroundObserver.unobserve(entry.target)\n                    }\n                })\n            })\n            lazyBackgroundObserver.observe(node)\n        } else {\n            inViewPort(attribute, value)\n        }\n    }\n}\n\nexport function lazyLoadCallback(node: Element, cb: () => void) {\n    const isOldIOS = () => {\n        var agent = window.navigator.userAgent,\n            start = agent.indexOf('OS ')\n        if ((agent.indexOf('iPhone') > -1 || agent.indexOf('iPad') > -1) && start > -1) {\n            return window.Number(agent.substr(start + 3, 3).replace('_', '.')) < 14\n        }\n        return false\n    }\n\n    if (/Trident\\/|MSIE/.test(window.navigator.userAgent) || isOldIOS()) {\n        cb()\n    } else {\n        if ('IntersectionObserver' in window) {\n            let lazyBackgroundObserver = new IntersectionObserver(\n                function (entries) {\n                    entries.forEach(function (entry) {\n                        if (entry.isIntersecting) {\n                            cb()\n                            lazyBackgroundObserver.unobserve(entry.target)\n                        }\n                    })\n                },\n                { rootMargin: '150% 0px' }\n            )\n            lazyBackgroundObserver.observe(node)\n        }\n    }\n}\n\n// Debounce\nexport function debounce<T>(func: (v: T) => void, time = 100) {\n    let timer: number\n    return function (event: T) {\n        if (timer) {\n            window.clearTimeout(timer)\n        }\n        timer = window.setTimeout(func, time, event)\n    }\n}\n\n// isIE - to check for internet explorer\nexport function isIE() {\n    let ua = window.navigator.userAgent,\n        isIE = /MSIE|Trident/.test(ua)\n\n    return isIE\n}\n\n// Load external script\nexport const loadExternalScript = ({\n    src,\n    callback = null,\n    async = false,\n    defer = false,\n    module = false,\n    id = ''\n}: {\n    src: string;\n    callback: null | GlobalEventHandlers[\"onload\"]\n    module: boolean,\n    defer: boolean,\n    async: boolean,\n    id: string\n}) => {\n    const script = document.createElement('script')\n    script.type = module ? 'module' : 'text/javascript'\n    script.src = src\n    id ? (script.id = id) : false // add id attribute only if passed\n    if (typeof callback === 'function') {\n        script.onload = callback\n    }\n    script.async = async\n    script.defer = defer\n    document.body.appendChild(script)\n}\n\n// Load external css\nexport const loadExternalCss = ({ src }: { src: string }) => {\n    const script = document.createElement('link')\n    script.rel = 'stylesheet'\n    script.href = src\n    document.body.appendChild(script)\n}\n// Lazy load vendor script\nexport const lazyLoadVendorScript = (handler, el) => {\n    const observer = new IntersectionObserver(handler)\n    observer.observe(el)\n}\n\n/**\n * Replaces variable inside a given string\n * Each variable have to be enclosed between stChr and enChr\n * The values have to be contained in the vars object, they key must match\n * example :\n * txt : 'See {resultsLength} Results'\n * vars : {resultsLength:'30'}\n * stChr : '{'\n * enChr : '}'\n *\n * will return : 'See 30 Results'\n *\n * @param {string} txt\n * @param {object} vars\n * @param {string} stChr\n * @param {string} enChr\n */\nexport function interpolate(txt: string, vars: Record<string, null | undefined | string>, stChr: string, enChr: string) {\n    let curIdx = 0\n\n    while (txt) {\n        const stIdx = txt.indexOf(stChr, curIdx)\n        if (stIdx === -1) {\n            break\n        }\n        const enIdx = txt.indexOf(enChr, stIdx + 1)\n        if (enIdx === -1) {\n            break\n        }\n        const hashId = txt.substring(stIdx + stChr.length, enIdx)\n        if (vars[hashId] != null) {\n            txt = txt.substr(0, stIdx) + vars[hashId] + txt.substr(enIdx + enChr.length)\n            curIdx = stIdx\n        } else {\n            curIdx = enIdx\n        }\n    }\n    return txt\n}\n\n/**\n * Find in container element, add height to equal size of element\n * @param container css path where my element is contain e.g. `.c-container`\n * @param el css path of elements to equalized\n */\nexport const equalHeight = (containerSelector: string, el: string, elementScope: HTMLElement) => {\n    const container = elementScope.querySelector<HTMLElement>(containerSelector)\n    if (!container) {\n        return\n    }\n\n    const items = container.querySelectorAll<HTMLElement>(el)\n    let max = -1\n\n    for (let i = 0; i < [...items].length; i++) {\n        const item = [...items][i]\n        let h = item.offsetHeight\n        max = h > max ? h : max\n    }\n\n    if (max <= 0) {\n        return\n    }\n\n    for (let i = 0; i < [...items].length; i++) {\n        const item = [...items][i]\n        item.style.height = `${max}px`\n    }\n}\n\nexport const stringifyCurlyQuote = (data: {}) => JSON.stringify(data).replace(\"'\", '’')\n\nexport const stringifyForAttribute = (data = {}) => {\n    return escapeHtml(JSON.stringify(data))\n}\n\n/**\n * This function is included instead of sanitizeString because for\n * inserting HTML into innerHTML we need to make sure all HTML\n * entities are escaped.\n */\nexport const escapeHtml = (text: string) => {\n    const map = {\n        '&': '&amp;',\n        '<': '&lt;',\n        '>': '&gt;',\n        '\"': '&quot;',\n        \"'\": '&#039;'\n    } as { [s: string]: string }\n\n    return text.replace(/[&<>\"']/g, (m) => map[m])\n}\n\n/**\n * Because setting attributes escapes more than the characters above and then preact also\n * escapes text we need a more complete way of unescaping all html entities (not just the ones\n * above)\n */\nconst domParser = new DOMParser()\nexport const unescapeHtml = (text: string) => {\n    return domParser.parseFromString(text, \"text/html\").body.textContent\n}\n\nexport const sanitizeString = (data: {}) => {\n    if (!data) {\n        return ''\n    }\n\n    return data.toString().replace(/\"/g, '&quot;').replace(/'/g, '&apos;')\n}\n\nexport const stripTags = (s: string) => {\n    return (s || '').replace(/(<([^>]+)>)/gi, '')\n}\n\nexport const setAttributes = (element: Element, attrs: Record<string, any>) => {\n    for (let key in attrs) {\n        element.setAttribute(key, attrs[key])\n    }\n    return element\n}\n\nexport const getMetaContent = (metaName: string) => {\n    const metaTag = document.querySelector(`meta[name=${metaName}]`)\n    if (!metaTag) {\n        return ''\n    }\n    return metaTag.getAttribute('content')\n}\n\nexport const isObjectEmpty = (obj: {}) => {\n    return Object.keys(obj).length === 0\n}\n","import './grid.scss'\nimport createProps from '@kissui/helpers/src/props.helpers'\nimport { stringifyForAttribute } from '@kissui/helpers/src/utils'\n\nclass Grid extends HTMLElement {\n    constructor() {\n        super()\n    }\n\n    connectedCallback() {\n        this.props = createProps(this.attributes)\n        this.render()\n    }\n    render() {\n        const { grid_type } = this.props\n\n        if (grid_type === 'three-items') {\n            this.innerHTML = this.renderThreeItems()\n        }\n    }\n    renderThreeItems() {\n        const { grid_elements } = this.props\n\n        return `\n            <div class=\"hotspots__main-grid\">\n                <div class=\"item-big\" data-bg-size=\"768\">\n                    ${this.renderItemByType(grid_elements[0])}\n                </div>\n                <div class=\"item-small\" data-bg-size=\"368\">\n                    ${this.renderItemByType(grid_elements[1])}\n                    ${this.renderItemByType(grid_elements[2])}\n                </div>\n            </div>\n        `\n    }\n    renderItemByType(item) {\n        const { details } = item\n\n        return details?.type === 'hotspot'\n            ? `<nb-hotspot data=\"${stringifyForAttribute(details)}\"></nb-hotspot>`\n            : ''\n    }\n}\n\ncustomElements.get('nb-hotspots-grid') || customElements.define('nb-hotspots-grid', Grid)\n\nexport default Grid\n","export const MAX_WIDTH_CONTAINER = 1160\n\nexport const BREAKPOINT_XL = 1920\nexport const BREAKPOINT_TABLET = 1024\nexport const BREAKPOINT_L = 996\nexport const BREAKPOINT_M = 768\nexport const BREAKPOINT_S = 750\nexport const BREAKPOINT_XS = 375\n\nexport const CTA_PRIMARY = 'primary'\nexport const CTA_PRIMARY_TRANSPARENT = 'primary_transparent'\nexport const CTA_SUBTLE = 'subtle'\nexport const CTA_LINK = 'link'\nexport const CTA_LINK_UNDERLINE = 'link-underline'\nexport const CTA_LINK_GOLD = 'link-gold'\nexport const CTA_LINK_ADD_TO_CART_SMALL = 'AddToCart_small'\nexport const CTA_LINK_ADD_TO_CART_LARGE = 'AddToCart_large'\n\nexport const EVENT_TAB_CHANGE = 'EVENT_TAB_CHANGE'\n\nexport const EVENT_VIDEO = 'WEB_COMPONENT_VIDEO'\nexport const EVENT_POPIN_OPEN = 'WEB_COMPONENT_POPIN_OPEN'\nexport const EVENT_POPIN_OPENED = 'WEB_COMPONENT_POPIN_OPENED'\nexport const EVENT_POPIN_CLOSE = 'WEB_COMPONENT_POPIN_CLOSE'\nexport const EVENT_POPIN_CLOSED = 'WEB_COMPONENT_POPIN_CLOSED'\nexport const EVENT_POPIN_CLOSE_CLICK = 'WEB_COMPONENT_POPIN_CLOSE_CLICK'\nexport const EVENT_POPIN_KEY_DOWN = 'keydown'\nexport const EVENT_POPIN_FORM_TOGGLE_TITLE = 'WEB_COMPONENT_POPIN_FORM_TOGGLE_TITLE'\nexport const EVENT_CTA_CLICK = 'WEB_COMPONENT_CTA_CLICK'\nexport const EVENT_HERO_REORDER_OPEN = 'WEB_COMPONENT_HERO_REORDER_OPEN'\nexport const EVENT_HERO_REORDER_CLOSE = 'WEB_COMPONENT_HERO_REORDER_CLOSE'\nexport const EVENT_QUICKVIEW_OPEN = 'WEB_COMPONENT_QUICKVIEW_OPEN'\nexport const EVENT_QS_OPEN = 'WEB_COMPONENT_QS_OPEN'\nexport const EVENT_QS_OPENED = 'WEB_COMPONENT_QS_OPENED'\nexport const EVENT_QS_CLOSE = 'WEB_COMPONENT_QS_CLOSE'\nexport const EVENT_QS_CLOSED = 'WEB_COMPONENT_QS_CLOSED'\nexport const EVENT_QS_CLOSE_CLICK = 'WEB_COMPONENT_QS_CLOSE_CLICK'\nexport const EVENT_QS_KEY_DOWN = 'keydown'\nexport const EVENT_ADD_TO_CART = 'WEB_COMPONENT_ADD_TO_CART'\nexport const EVENT_CART_UPDATED = 'WEB_COMPONENT_CART_UPDATED'\nexport const EVENT_VIDEO_TOGGLE = 'WEB_COMPONENT_VIDEO_TOGGLE'\nexport const VIDEO_ON_HOVER = 'VIDEO_ON_HOVER'\nexport const VIDEO_ON_OUT = 'VIDEO_ON_OUT'\nexport const EVENT_DETAIL_OPEN = 'WEB_COMPONENT_DETAIL_OPEN'\nexport const EVENT_SLIDER_READY = 'WEB_COMPONENT_SLIDER_READY'\nexport const EVENT_SLIDE_CHANGE = 'WEB_COMPONENT_SLIDE_CHANGE'\nexport const EVENT_OVERLAY_OPEN = 'WEB_COMPONENT_OVERLAY_OPEN'\nexport const EVENT_OVERLAY_CLOSE = 'WEB_COMPONENT_OVERLAY_CLOSE'\nexport const EVENT_OVERLAY_CLICKED = 'WEB_COMPONENT_OVERLAY_CLICKED'\nexport const EVENT_OPEN_PRODUCT_AR_CLICKED = 'OPEN_PRODUCT_AR_CLICKED'\nexport const EVENT_SORT_BY_CHANGE = 'WEB_COMPONENT_SORT_BY_CHANGE'\n\nexport const EVENT_BUBBLE_SELECTED = 'EVENT_BUBBLE_SELECTED'\nexport const EVENT_RECO_TOOL_OPTION_CLICKED = 'EVENT_RECO_TOOL_OPTION_CLICKED'\nexport const WEB_COMPONENT_PROJECTS_LOADED = 'WEB_COMPONENT_PROJECTS_LOADED'\nexport const WEB_COMPONENT_ANCHOR_LOADED = 'WEB_COMPONENT_ANCHOR_LOADED'\n\nexport const EVENT_SWIPED_UP = 'swiped-up'\nexport const EVENT_SWIPED_DOWN = 'swiped-down'\nexport const EVENT_SWIPED_LEFT = 'swiped-left'\nexport const EVENT_SWIPED_RIGHT = 'swiped-right'\n\nexport const EVENT_HEADER_POSITION_CHANGED = 'EVENT_HEADER_POSITION_CHANGED'\n\nexport const keys = { ESC: 'Escape' }\n\nexport const ADD_TO_CART_MODIFIER_MINI = 'mini'\nexport const ADD_TO_CART_MODIFIER_DEFAULT = ADD_TO_CART_MODIFIER_MINI\n\nexport const COFFEE_ORIGINAL = 'original'\nexport const COFFEE_VERTUO = 'vertuo'\nexport const COFFEE_PRO = 'pro'\nexport const COFFEE_OL = 'OL'\nexport const COFFEE_VL = 'VL'\nexport const INTENSITY_MAX_OL = 14\nexport const INTENSITY_MAX_VL = 12\nexport const DEFAULT_BUBBLE_ICON = ''\n\nexport const NUMBER_PRODUCTS_SLIDER = 8\nexport const NUMBER_FEATURES_PDP = 8\n\nexport const ALIGNMENT = ['center', 'left', 'right']\nexport const POSITION = ['top', 'right', 'bottom', 'left']\nexport const TRANSLATION_ADD_TO_CART = 'Add to cart'\nexport const TRANSLATION_UPDATE_BASKET = 'Update basket'\n\nexport const TIME_INSTANT = 1\nexport const TIME_FAST = 300\nexport const TIME_MEDIUM = 600\nexport const TIME_SLOW = 1200\n\nexport const APP_APPLE_LINK = {\n    default: 'https://apps.apple.com/us/app/nespresso/id342879434',\n    us: 'https://apps.apple.com/us/app/nespresso-new/id1609639566',\n    uk: 'https://apps.apple.com/gb/app/nespresso-new/id1609639566',\n    kr: 'https://apps.apple.com/kr/app/%EB%84%A4%EC%8A%A4%ED%94%84%EB%A0%88%EC%86%8C-%EB%B6%80%ED%8B%B0%ED%81%AC/id1609639566'\n}\nexport const APP_ANDROID_LINK =\n    'https://play.google.com/store/apps/details?id=com.nespresso.activities'\nexport const APP_HUAWEI_LINK = 'https://appgallery.huawei.com/app/C102571517'\n\nexport const SRC_PAGE_PLP = 'plp'\nexport const SRC_PAGE_PDP = 'pdp'\n\nexport const PLP_TYPE_COFFEE = 'coffee'\nexport const PLP_TYPE_MACHINE = 'machine'\nexport const PLP_TYPE_ACCESSORY = 'accessory'\nexport const CALLEO_API_DOMAIN = 'https://www.contact.nespresso.com/'\n\n// SCSS RELATED\n// Todo : should be shared by JS and SCSS\nexport const BROWSER_CONTEXT = 16 // 1rem = 16px\nexport const COLOR_WHITE_1000 = '#FFFFFF' // Do not change for #FFF shortcut, it will break slider-natural gradients !\n\nexport const CONTRAST_DARK = 'dark'\nexport const CONTRAST_LIGHT = 'light'\n\nexport const B2B_CONTACT_FORM_POPIN_ID = 'b2b-contact-form-popin-id'\nexport const B2B_CONTACT_FORM_POPIN_SRC_SEARCH = 'coveo-search'\n\nexport const B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO = 'sku-main-info'\n\nexport const B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO_AUTO = 'sku-main-info-auto'\n\nexport const ASPECT_RATIO_16_9 = '16/9'\nexport const ASPECT_RATIO_1_1 = '1/1'\n\nexport const NESPRESSO_PRODUCTION_DOMAIN = 'https://www.nespresso.com'\nexport const NESPRESSO_ROLLOUT_DOMAIN = 'https://nc2-env-rollout.nespresso.com'\n\nexport const EVENT_QUIZ_ON_GO_BACK = 'WEB_COMPONENT_EVENT_QUIZ_ON_GO_BACK'\nexport const EVENT_QUIZ_SUBMIT = 'WEB_COMPONENT_EVENT_QUIZ_SUBMIT'\n","import { COFFEE_VERTUO } from '@kissui/components/src/constants.mjs'\nimport { getCurrency } from './getCurrency'\nexport { getCurrency } from './getCurrency'\n\nexport const ECAPI_TYPE_CAPSULE = 'capsule'\nexport const ECAPI_TYPE_MACHINE = 'machine'\nexport const ECAPI_TYPE_ACCESSORY = 'accessory'\nexport const ECAPI_TYPE_GIFT_CARD = 'giftcard'\n\nconst TECHNOLOGY_CATEGORY_IDENTIFIER = '/machineTechno/'\nconst SLEEVE_OF_10 = 10\nconst SLEEVE_OF_7 = 7\n\nconst trimSku = sku => sku.replace(/[^a-z0-9- +./]/gi, '')\n\nexport const getLegacySKU = productId => productId.split('prod/').pop()\n\nexport const getPriceFormatter = async () => await window.napi.priceFormat()\n\nexport const getProduct = sku => window.napi.catalog().getProduct(trimSku(sku))\n\nexport function getTechnologyName(productData) {\n    const techno = productData.technologies[0]\n    return techno.substring(\n        techno.indexOf(TECHNOLOGY_CATEGORY_IDENTIFIER) + TECHNOLOGY_CATEGORY_IDENTIFIER.length\n    )\n}\n\nfunction isMultipleOf(quantity, multiple) {\n    return quantity % multiple === 0\n}\n\nexport function getSleeveNumber(product, getTechnologyNameFn = getTechnologyName) {\n    if (product.sales_multiple !== 1 && isMultipleOf(product.sales_multiple, SLEEVE_OF_10)) {\n        // Sleeve of original or vertuo\n        return product.sales_multiple / SLEEVE_OF_10\n    }\n\n    if (\n        product.sales_multiple !== 1 &&\n        getTechnologyNameFn(product) === COFFEE_VERTUO &&\n        isMultipleOf(product.sales_multiple, SLEEVE_OF_7)\n    ) {\n        // Sleeve of vertuo\n        return product.sales_multiple / SLEEVE_OF_7\n    }\n\n    if (product.sales_multiple === 1 && isMultipleOf(product.unitQuantity, SLEEVE_OF_10)) {\n        // Bundle of original or vertuo\n        return product.unitQuantity / SLEEVE_OF_10\n    }\n\n    if (\n        product.sales_multiple === 1 &&\n        getTechnologyNameFn(product) === COFFEE_VERTUO &&\n        isMultipleOf(product.unitQuantity, SLEEVE_OF_7)\n    ) {\n        // Bundle of vertuo\n        return product.unitQuantity / SLEEVE_OF_7\n    }\n\n    return NaN\n}\n\n/**\n * Guess if the product is part of a bundle.\n * This is determined by checking the 'sales_multiple' and 'unitQuantity' properties.\n */\nexport function isBundled(productData) {\n    // TODO: this function should not change the productData, but some components still need it\n    productData.sales_multiple = productData.sales_multiple || productData.salesMultiple\n\n    const isSalesMultipleGreaterThanOne = productData.sales_multiple > 1\n    const isUnitQuantityEqualToOne = productData.unitQuantity === 1\n    const isSalesMultipleEqualToOne = productData.sales_multiple === 1\n    const isUnitQuantityGreaterThanOne = productData.unitQuantity > 1\n\n    // The product is not bundled if sales_multiple > 1 and unitQuantity = 1\n    if (isSalesMultipleGreaterThanOne && isUnitQuantityEqualToOne) {\n        return false\n    }\n\n    // The product is bundled if sales_multiple = 1 and unitQuantity > 1\n    return isSalesMultipleEqualToOne && isUnitQuantityGreaterThanOne\n}\n\n/**\n * Replace an array of SKU with product data\n * Remove the element inside the list if sku fail. It prevents to get an empty item.\n * @param {Array.<String>} skus\n * @param getProductFn\n * @returns {Promise<Awaited<unknown>[]>}\n */\nexport function getProductAndClean(skus, getProductFn = getProduct, napi = window.napi) {\n    const promises = []\n\n    if (!napi) {\n        return Promise.reject()\n    }\n\n    if (!Array.isArray(skus)) {\n        skus = [skus]\n    }\n\n    // Load manually the product to delete SKU fail\n    for (const sku of skus) {\n        promises.push(\n            getProductFn(sku)\n                .then(data => skus.splice(skus.indexOf(sku), 1, data))\n                .catch(() => {\n                    skus.splice(skus.indexOf(sku), 1)\n                    console.error(`getProduct fail on sku ${sku}`)\n                })\n        )\n    }\n\n    return Promise.all(promises)\n}\n\nexport const getFormattedPrice = async price => {\n    const priceFormatter = await getPriceFormatter()\n    const currency = getCurrency()\n\n    return priceFormatter.html\n        ? priceFormatter.html(currency, price)\n        : priceFormatter.short(currency, price) || ''\n}\n\nexport const getProductCategories = async sku => {\n    const productDetails = await getProduct(sku)\n    const productCategories = productDetails ? productDetails.supercategories : []\n    const productCategoriesNew = await Promise.all(\n        productCategories.map(async categoryEncoded => {\n            const productCategoryData = await window.napi.catalog().getCategory(categoryEncoded)\n            return productCategoryData\n        })\n    )\n    return productCategoriesNew\n}\n","export type EventListener = {\n    element: HTMLElement\n    type: string\n    listener: (e: Event) => void\n    options?: boolean | AddEventListenerOptions\n}\n\nconst add = (eventListeners: EventListener[] = []) => {\n    eventListeners.forEach(eventListener => {\n        if (!eventListener || !eventListener.element) {\n            return\n        }\n        return eventListener.element.addEventListener(\n            eventListener.type,\n            eventListener.listener,\n            eventListener.options\n        )\n    })\n}\n\nconst remove = (eventListeners: EventListener[] = []) => {\n    eventListeners.forEach(eventListener => {\n        if (!eventListener || !eventListener.element) {\n            return\n        }\n        eventListener.element.removeEventListener(eventListener.type, eventListener.listener)\n    })\n}\n\nconst busNamespace = 'pageBuilder'\n\nexport const emitCustomEvent = (eventName: string, data: unknown) => {\n    const customEvent = new CustomEvent(`${busNamespace}.${eventName}`, {\n        detail: data,\n        bubbles: true,\n        cancelable: true,\n        composed: false\n    })\n\n    window.dispatchEvent(customEvent)\n}\n\nexport default { add, emitCustomEvent, remove }\n","import { getProduct } from '@kissui/helpers/src/catalog'\nimport { emitCustomEvent } from './events.helpers'\nimport { removeEmptyValues } from '@kissui/helpers/src/utils'\n\nconst raisedByPB = 'page builder'\nconst raisedByWC = 'Web component'\n\n/**\n * helper method for 'itemDisplay' GTM event\n * @param {*} event : 'itemDisplay' - Mandatory as is\n * @param {*} eventRaisedBy : 'Web component' - Mandatory as is\n * @param {*} eventAction : 'Click' - Action that led to the item display. For example, click\n * @param {*} itemTypes : ['products'] - Mandatory as is\n * @param {*} rootElement : ['nb-slider'] - Root DOM element for item detection. Closest common ancestor element of the inserted/displayed promotions and products. It will help the detection to reduce its performance consumption. Set to 0 (zero) in order to request detection through the entire document.\n */\nexport const itemDisplay = args => {\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'itemDisplay',\n        eventRaisedBy: raisedByWC,\n        eventAction: 'Click',\n        itemTypes: ['products'],\n        ...args\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('itemDisplay', eventData)\n}\n\n/**\n *\n * helper method for 'customEvent' GTM event\n * @param {*} args (event, eventRaisedBy, eventCategory, eventAction, eventLabel, nonInteraction)\n */\n\nexport const customEvent = args => {\n    window.gtmDataObject = window.gtmDataObject || []\n    var eventData\n    if (args.event_GA4 === undefined || args.event_GA4 === false) {\n        eventData = {\n            event: 'customEvent',\n            eventRaisedBy: raisedByWC,\n            ...args\n        }\n    } else {\n        eventData = {\n            event_raised_by: raisedByPB,\n            ...args\n        }\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('customEvent', eventData)\n}\n\n/**\n * Helper method for tracking component interactions, compatible with GA4.\n *\n * @param {String} creative : component raising the event, e.g. 'before_coffees_list', 'before_machines_list', 'before_accessories_list'\n * @param {String} actionType : description of the interaction, e.g 'pdp quick view'\n * @param {String} internationalId : long SKU, e.g. 'erp.pt.b2c/prod/7243.30'\n * @param {String} internationalName : international name of the product, e.g. 'Vertuo Carafe Pour-Over Style Mild'\n * @param {String} productType : type of product, i.e. 'capsule', 'machine', 'accessory'\n * @param {String} range : product range, e.g. 'ispirazione italiana'\n * @param {String} technology : technology, i.e. 'original', 'vertuo'\n * @param {Number} price : price, e.g. .51\n * @param {String} eventAction : description of the action, e.g. 'PDP Quick View'\n *\n * Initally created for PDP Quick View tracking:\n * https://dsu-confluence.nestle.biz/display/DIANA/BEFORE+-+PDP+Quick+View\n * Will probably be rolled out across all components, update this comment accordingly.\n */\nexport const trackComponentInteraction = ({\n    creative = '',\n    actionType = '',\n    internationalId = '',\n    internationalName = '',\n    productType = '',\n    technology = '',\n    category = '',\n    rawPrice = '',\n    eventAction = ''\n}) => {\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'page_builder_component_interaction',\n        event_raised_by: raisedByPB,\n        component_name: creative,\n        action_type: actionType,\n        item_id_event: internationalId,\n        item_name_event: internationalName,\n        item_category_event: productType,\n        item_technology_event: technology,\n        item_range_event: category,\n        item_price_event: rawPrice,\n        eventCategory: 'User Engagement',\n        eventAction: eventAction,\n        eventLabel: `${productType} - ${technology} - ${internationalName}`\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\n/**\n *\n * Push 'view_promotion' event for GA 4\n * @param {*} args (event, event_raised_by, ecommerce: {promotion_id, promotion_name, creative_slot, creative_name})\n */\nexport const viewPromotion = args => {\n    const event = 'view_promotion'\n    const eventData = {\n        event,\n        event_raised_by: raisedByPB,\n        ecommerce: {}\n    }\n    if (Object.keys(args).length) {\n        const { id = '', creative = '', name = '', position = '' } = args\n        let ecommerceData = {\n            promotion_id: id,\n            promotion_name: name,\n            creative_slot: position,\n            creative_name: creative\n        }\n        ecommerceData = removeEmptyValues(ecommerceData)\n        eventData.ecommerce = ecommerceData\n    }\n    window.gtmDataObject ??= []\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent(event, eventData)\n}\n\nexport const handlePromoClick = args => {\n    const { campaign, cta_name } = args\n\n    const cleanedData = removeEmptyValues(campaign)\n    selectPromotion({ cta_name, ...cleanedData })\n}\n\n/**\n *\n * Push 'select_promotion' event for GA 4\n * @param {*} args (event, event_raised_by, cta_name, ecommerce: {promotion_id, promotion_name, creative_slot, creative_name})\n */\nexport const selectPromotion = args => {\n    const event = 'select_promotion'\n    const eventData = {\n        event: 'select_promotion',\n        cta_name: args?.cta_name ?? '(not set)',\n        event_raised_by: raisedByPB,\n        ecommerce: {}\n    }\n    if (Object.keys(args).length) {\n        const { id = '', creative = '', name = '', position = '' } = args\n        let ecommerceData = {\n            promotion_id: id,\n            promotion_name: name,\n            creative_slot: position,\n            creative_name: creative\n        }\n        ecommerceData = removeEmptyValues(ecommerceData)\n        eventData.ecommerce = ecommerceData\n    }\n\n    window.gtmDataObject ??= []\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent(event, eventData)\n}\n\nexport const interactionClick = (nameComponent, ctaName) => {\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'page_builder_component_interaction',\n        event_raised_by: raisedByPB,\n        eventCategory: 'User Engagement',\n        eventAction: 'Click CTA',\n        eventLabel: `Page Builder - ${nameComponent} - ${ctaName}`,\n        component_name: nameComponent,\n        action_type: 'web component click',\n        cta_name: ctaName\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\nexport const getProductInfo = async (sku, data) => {\n    let product = data\n    if (!product) {\n        product = await getProduct(sku)\n    }\n    return product\n}\n\nexport const getProductPayload = (data, actionField = {}) => {\n    const {\n        internationalName,\n        internationalId,\n        category,\n        unitPrice,\n        legacyId,\n        name,\n        technologies,\n        bundled,\n        inStock,\n        type\n    } = data\n\n    const technology = technologies.map(item => item.split('/').pop()).join('|')\n    const isDiscovery = category.toLowerCase().includes('discovery')\n\n    return [\n        // Array consists of one product details for PDP Product Detail View\n        {\n            ...actionField,\n            name: internationalName, // '[[International Product Name]]' NIE, Contract\n            id: internationalId, // '[[International Product ID]]'\n            price: unitPrice, // '[[Product Price]'\n            // dimension43: '[[true/false]]', // '[[true/false]]' // Signifies if this product is part of a standing order or not\n            dimension44: isDiscovery.toString(), // '[[true/false]]', // Signifies if this product is part of a discovery offer\n            dimension53: legacyId, // '[[Product Local market ID]]', // Local market id for product\n            dimension54: name, // '[[Product Local market Name]]', // Local market name for product\n            dimension55: category, // '[[Product Range]]', // Range of the product, eg: Barista Creations for Ice (Nessoft Category)\n            dimension56: technology, // '[[Product Technology]]', //Product technology according to Nespresso categorization (original, vertuo, pro)\n            dimension57: bundled ? 'bundle' : 'single', // '[[Product Type]]', //If the product is single or bundle\n            dimension192: inStock ? 'in stock' : 'out of stock', // '[in stock]', // \"in stock\" or \"out of stock\"\n            category: type, // '[[Product Category]]', //Product category according to Nespresso categorization (Nessoft type): capsule, accessory, machine\n            brand: 'Nespresso' // Static value set to Nespresso\n        }\n    ]\n}\n\nexport const trackDetailView = async (sku, data) => {\n    // https://dsu-confluence.nestle.biz/display/DIANA/HQ+PB+Tracking+-+Product+Detail+View\n    if (window.pbTrackDetailViewPDP || !sku || !window.napi) {\n        return\n    }\n\n    const productInfo = await getProductInfo(sku, data)\n    const productPayload = getProductPayload(productInfo)\n    const currency = productInfo.currency\n\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'detailView',\n        currencyCode: currency,\n        eventRaisedBy: raisedByPB,\n        ecommerce: {\n            detail: {\n                actionField: {},\n                products: productPayload\n            }\n        }\n    }\n    window.gtmDataObject.push(eventData)\n    // Track only once per page\n    window.pbTrackDetailViewPDP = true\n    emitCustomEvent('detailView', eventData)\n}\n\nexport const trackAddToCartImpression = (product, isStickyBar) => {\n    // https://dsu-confluence.nestle.biz/pages/viewpage.action?spaceKey=DIANA&title=PDP+-+Sticky+Add+To+Cart+Custom+Event\n\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'page_builder_component_interaction',\n        event_raised_by: raisedByPB,\n        component_name: 'before_sku_main_info',\n        action_type: isStickyBar\n            ? 'sticky add to cart impression'\n            : 'standard add to cart impression',\n        //product info\n        item_id_event: product.internationalId,\n        item_name_event: product.internationalName,\n        item_category_event: product.type,\n        item_price_event: product.price_per_capsule?.split(' ')[0],\n        item_market_id_event: product.legacyId,\n        item_market_name_event: product.name,\n        item_range_event: product.category_name,\n        item_technology_event: product.technology?.[0]?.split('/').slice(-1) ?? '',\n        item_type_event: product.bundled ? 'bundle' : 'single'\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('page_builder_component_interaction', eventData)\n}\n\nexport const productImpression = async (position, list, sku, data) => {\n    // https://dsu-confluence.nestle.biz/pages/viewpage.action?pageId=225612781\n    // don't track already tracked products\n    window.gtmDataObject = window.gtmDataObject || []\n    const hasDetailView = window.gtmDataObject.find(item => item.event === 'detailView')\n    const alreadyTracked = !!hasDetailView?.ecommerce?.detail?.products.find(p =>\n        sku.includes(p.id)\n    )\n    if (alreadyTracked) {\n        return\n    }\n\n    const productInfo = await getProductInfo(sku, data)\n    const productPayload = getProductPayload(productInfo, { list: list, position: position })\n    const currency = productInfo.currency\n    const eventData = {\n        event: 'impression',\n        eventAction: 'Product Impression',\n        currencyCode: currency,\n        eventRaisedBy: raisedByPB,\n        ecommerce: {\n            impressions: productPayload\n        }\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('impression', eventData)\n}\n\nexport const productClick = async (position, list, sku, data) => {\n    // https://dsu-confluence.nestle.biz/pages/viewpage.action?pageId=225612781\n\n    if (typeof list !== 'string') return\n\n    const productInfo = await getProductInfo(sku, data)\n    const productPayload = getProductPayload(productInfo, { position: position })\n    const currency = productInfo.currency\n\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = {\n        event: 'productClick',\n        eventAction: 'Product Click',\n        currencyCode: currency,\n        eventRaisedBy: raisedByPB,\n        ecommerce: {\n            click: {\n                actionField: {\n                    list: list\n                },\n                products: productPayload\n            }\n        }\n    }\n    window.gtmDataObject.push(eventData)\n    emitCustomEvent('productClick', eventData)\n}\n\nexport function filterTrackingFromPlpFilters(filtersSelected) {\n    const grouped = groupSelectedFilters(filtersSelected)\n    const groupKeys = Object.keys(grouped)\n    const typesFiltersSelected = groupKeys.join('|').substring(0, 99)\n    const valuesFiltersSelected = groupKeys\n        .map(key => grouped[key].values.map(value => value.split('/').at(-1)).join(','))\n        .join('|')\n        .substring(0, 99)\n\n    return [typesFiltersSelected, valuesFiltersSelected]\n}\n\nexport const filterActionEvent = (\n    actionType,\n    filterType,\n    filterValues,\n    clickLocation,\n    dataType\n) => {\n    // https://dsu-confluence.nestle.biz/display/DIANA/PLP+-+Filter+Revamp\n    window.gtmDataObject = window.gtmDataObject || []\n    const eventData = getExplicitFilterEventData(\n        actionType,\n        filterType,\n        filterValues,\n        clickLocation\n    )\n\n    window.gtmDataObject.push(eventData)\n    if (window.NEXT_V1_PLP_EXPLICIT_FILTER_TRACKING && dataType) {\n        window.gtmDataObject.push({\n            ...window.NEXT_V1_PLP_EXPLICIT_FILTER_TRACKING,\n            experiment_action: `${actionType} - ${dataType}`,\n            cta_name: 'All filters'\n        })\n    }\n\n    emitCustomEvent('plp_filter', eventData)\n}\n\nconst getExplicitFilterEventData = (actionType, filterType, filterValues, clickLocation) => {\n    return {\n        event: 'plp_filter',\n        event_raised_by: raisedByPB,\n        action_type: actionType,\n        filter_type: filterType,\n        ...(filterValues ? { filter_values: filterValues } : {}),\n        ...(clickLocation ? { click_location: clickLocation } : {})\n    }\n}\n\nfunction groupSelectedFilters(filtersSelected = []) {\n    return filtersSelected.reduce((grouped, { key, value }) => {\n        if (!grouped[key]) grouped[key] = { key, values: [] }\n        grouped[key].values.push(value.replaceAll(',', '-'))\n        return grouped\n    }, {})\n}\n\nfunction arrTolastURLElementMapper(arr) {\n    if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n    return arr.map(item => item.split('/').pop()?.trim() || '')\n}\n\nfunction arrToJoinedString(arr, joiner = '|') {\n    if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n    return arr.map(item => item.trim()).join(joiner)\n}\n\nfunction findTechnogiesText(arr) {\n    if (typeof arr === 'undefined' || arr.length === 0) return undefined\n\n    if (arr.length === 1) return cleanText(arrTolastURLElementMapper(arr)?.[0])\n    else return 'multiple'\n}\n\nfunction cleanText(str) {\n    if (typeof str === 'undefined') return undefined\n\n    return str.toString().trim()\n}\n\nconst generateEcommerceObject = async (productIds, options) => {\n    const productRequests = productIds.map(SKU => getProduct(SKU))\n    const productData = await Promise.all(productRequests)\n\n    return {\n        ecommerce: {\n            currency: window[window.config.padl.namespace].dataLayer.app.app.currency,\n            value: productData.reduce((ac, product) => {\n                return ac + product.price\n            }, 0),\n            items: productData.map((product, index) => {\n                if (product.type === 'bundle' || product.type === 'giftcard') {\n                    return {\n                        item_id: cleanText(product.internationalId),\n                        item_name: cleanText(product.internationalName),\n                        item_brand: 'nespresso',\n                        item_category: cleanText(product.type),\n                        index: index + 1\n                    }\n                }\n\n                let output = {\n                    item_id: cleanText(product.internationalId),\n                    item_name: cleanText(product.internationalName),\n                    item_brand: 'nespresso',\n                    item_category: cleanText(product.type),\n                    item_category2: arrToJoinedString(\n                        arrTolastURLElementMapper(product.technologies)\n                    ),\n                    item_category3: cleanText(product.category),\n                    price: product.price,\n                    quantity: product.salesMultiple,\n                    affiliation: 'nespresso online store',\n                    coupon: undefined,\n                    discount: undefined,\n                    location_id: undefined,\n                    item_list_name: cleanText(options?.listName),\n                    item_list_id: cleanText(options?.listId),\n                    index: index + 1,\n                    item_market_id: cleanText(product.legacyId),\n                    item_market_name: cleanText(product.name),\n                    item_technology: findTechnogiesText(product.technologies),\n                    item_range: cleanText(product.category),\n                    item_discovery_offer: product.category.includes('discovery').toString(),\n                    item_added_by_user: undefined,\n                    item_ecotax_applicable: product?.displayEcoTax\n                        ? cleanText(product?.displayEcoTax.toString())\n                        : undefined,\n                    item_selection_list: cleanText(arrToJoinedString(product.productSelections)),\n                    item_in_stock: product?.inStock\n                        ? cleanText(product?.inStock.toString())\n                        : undefined,\n                    item_subscription_name: undefined,\n                    item_subscription_category: undefined,\n                    item_subscription_price: undefined,\n                    item_subscription_duration: undefined,\n                    item_subscription_fee: undefined\n                }\n\n                switch (product.type) {\n                    case 'capsule': {\n                        const capsuleProduct = product\n\n                        output.item_category4 = capsuleProduct.bundled ? 'bundle' : 'single'\n\n                        output.item_type = capsuleProduct.bundled ? 'bundle' : 'single'\n\n                        output.item_coffee_aromatic_profile = cleanText(\n                            arrToJoinedString(capsuleProduct.capsuleProductAromatics)?.toLowerCase()\n                        )\n\n                        output.item_coffee_intensity =\n                            cleanText(capsuleProduct.capsuleProperties.intensity) ?? undefined\n\n                        output.item_coffee_cup_size = cleanText(\n                            arrToJoinedString(capsuleProduct.capsuleCupSizes)\n                        )?.toLowerCase()\n\n                        break\n                    }\n                    case 'machine': {\n                        const machineProduct = product\n\n                        output.item_machine_shade = cleanText(machineProduct.colorShade?.name)\n\n                        break\n                    }\n                }\n\n                if (product.type === 'machine' || product.type === 'accessory') {\n                    output.item_avg_rating = product.ratingCode\n                    output.item_number_of_reviews = product.ratingCode\n                }\n\n                return output\n            })\n        }\n    }\n}\n\nexport const selectItems = async (productIds, options) => {\n    const ecommerceObject = await generateEcommerceObject(productIds, options)\n\n    const output = {\n        event: 'select_item',\n        event_raised_by: options?.eventRaisedBy ?? 'before_cross_sell_v3',\n        click_location: options?.clickLocation ?? 'page builder cross sell quick view',\n        item_list_id: options?.listId ?? 'before_cross_sell_v3',\n        subscription_product_included: 'false',\n        discovery_offer_included: 'false',\n        ...ecommerceObject\n    }\n\n    window.gtmDataObject.push({ ecommerce: null })\n    window.gtmDataObject.push(output)\n}\n\nexport const viewItemList = async (productIds, options) => {\n    const ecommerceObject = await generateEcommerceObject(productIds, options)\n\n    const output = {\n        event: 'view_item_list',\n        event_raised_by: options?.eventRaisedBy,\n        subscription_product_included: 'false',\n        discovery_offer_included: 'false',\n        ...ecommerceObject\n    }\n\n    if (options?.eventRaisedBy === undefined) delete output.event_raised_by\n\n    window.gtmDataObject.push({ ecommerce: null })\n    window.gtmDataObject.push(output)\n}\n\nexport const isGtmTrackingExists = trackingData => {\n    window.gtmDataObject = window.gtmDataObject || []\n\n    return window.gtmDataObject.some(\n        event =>\n            event.event === trackingData.event &&\n            event.ecommerce?.creative_slot === trackingData.campaign.position &&\n            event.ecommerce?.promotion_id === trackingData.campaign.id &&\n            event.ecommerce?.promotion_name === trackingData.campaign.name &&\n            event.ecommerce?.creative_name === trackingData.campaign.creative\n    )\n}\n","import { viewPromotion } from '@kissui/helpers/src/gtmEvents'\n\nexport default class {\n    constructor(node, data) {\n        this.observer = new IntersectionObserver(\n            IntersectionObserverEntry => this.onChange(IntersectionObserverEntry),\n            { threshold: [0], rootMargin: '0% 0%' }\n        )\n\n        this.el = node\n        this.data = data\n\n        if (!(this.el instanceof Element)) {\n            return\n        }\n\n        this.observer.observe(this.el)\n    }\n\n    /**\n     * Check if element are in the viewport\n     * @param {Array} observables\n     * @param {HTMLElement} observables.target\n     * @param {Boolean} observables.isIntersecting\n     */\n    onChange(observables) {\n        observables.forEach(observable => {\n            if (!observable.isIntersecting) {\n                return\n            }\n\n            this.track(observable)\n            this.observer.unobserve(observable.target)\n        })\n    }\n\n    track() {\n        // This line is needed to make the code compatible with Safari <=13\n        if ('requestIdleCallback' in window) {\n            window.requestIdleCallback(() => this.runTrack())\n        } else {\n            window.setTimeout(() => this.runTrack(), 1)\n        }\n    }\n\n    runTrack() {\n        if (!this.data['id'] || this.data['id'] === null || this.data['id'] === '') {\n            return\n        }\n        viewPromotion({ ...this.data })\n    }\n}\n","import Viewport from './viewportTracking'\nimport { viewPromotion } from '@kissui/helpers/src/gtmEvents'\nimport { isObjectEmpty, removeEmptyValues } from '@kissui/helpers/src/utils'\n\nexport default function (node, campaign) {\n    const tracking = new ZoneTracking(node, campaign)\n\n    return {\n        destroy: () => {\n            if (!tracking.getIom().hasIntersectionObserver()) {\n                tracking.destroy()\n            }\n        }\n    }\n}\n\nclass ZoneTracking extends Viewport {\n    constructor(node, data) {\n        super(node)\n        this.data = data\n    }\n\n    runTrack() {\n        const cleanedData = removeEmptyValues(this.data)\n        if (cleanedData && !isObjectEmpty(cleanedData)) {\n            viewPromotion({ ...cleanedData })\n        }\n    }\n}\n","import { BREAKPOINT_M, BREAKPOINT_TABLET } from '@kissui/components'\n\nconst viewport = () => {\n    const lt = (ref: number) => {\n        return window.innerWidth < ref\n    }\n\n    return {\n        get is() {\n            const { innerWidth: vw, devicePixelRatio } = window\n            return {\n                mobile: vw < BREAKPOINT_M,\n                mobile_tablet: vw < BREAKPOINT_TABLET,\n                tablet: vw >= BREAKPOINT_M && vw < BREAKPOINT_TABLET,\n                desktop: vw >= BREAKPOINT_TABLET && devicePixelRatio <= 1,\n                retina: vw >= BREAKPOINT_TABLET && devicePixelRatio > 1\n            }\n        },\n        lt\n    }\n}\n\nconst helper = viewport()\n\nexport default helper\n","import './hotspot.scss'\nimport { stringifyForAttribute } from '@kissui/helpers/src/utils'\nimport createProps from '@kissui/helpers/src/props.helpers'\nimport zoneTracking from '@kissui/helpers/src/assets/js/zoneTracking'\nimport viewportHelper from '@kissui/helpers/src/viewport.helpers'\n\nclass Hotspot extends HTMLElement {\n    constructor() {\n        super()\n    }\n\n    connectedCallback() {\n        this.props = createProps(this.attributes)\n        const { campaign } = this.props\n\n        this.parentProps = createProps(this.closest('nb-hotspots').attributes)\n        this.render()\n\n        zoneTracking(this, { ...campaign })\n    }\n\n    render() {\n        const { media, headline, subhead } = this.props\n        const { accessibility } = this.parentProps.copywriting\n        const { retina, desktop, mobile } = media\n\n        let selectedMedia = desktop\n\n        if (viewportHelper.is.retina) {\n            selectedMedia = retina\n        } else if (viewportHelper.is.mobile) {\n            selectedMedia = mobile\n        }\n\n        const { src, alt } = selectedMedia\n\n        this.innerHTML = `\n            <div class=\"hotspot\" role=\"tooltip\" aria-label=\"${accessibility.productsInPic}\">\n                <nb-img class=\"nb-card__visual\"\n                    file=\"${src}\"\n                    description=\"${alt}\"\n                    aspect_ratio=\"1/1\"\n                ></nb-img>\n                <div class=\"hotspot-description\">\n                    <div class=\"hotspot-description__inner\">\n                        ${headline && `<h4 class=\"t-sm-500-sl\">${headline}</h4>`}\n                        ${subhead && `<h5 class=\"h-lg-500\">${subhead}</h5>`}\n                    </div>\n                </div>\n                ${this.renderHotspotTooltip()}\n            </div>\n        `\n    }\n\n    renderHotspotTooltip() {\n        const { markers, campaign } = this.props\n\n        return markers\n            .map((marker, idx) => {\n                return `\n                    <nb-hotspot-tooltip data-idx=\"${idx}\" data=\"${stringifyForAttribute({\n                    ...marker,\n                    campaign\n                })}\"></nb-hotspot-tooltip>\n                `\n            })\n            .join('')\n    }\n}\n\ncustomElements.get('nb-hotspot') || customElements.define('nb-hotspot', Hotspot)\nexport default Hotspot\n","export const getDataLayer = () => {\n    return window[window?.padlNamespace]?.dataLayer\n}\n\nexport const getMarketCode = () => {\n    const dataLayer = getDataLayer()\n    if (!dataLayer) {\n        return 'ch'\n    }\n\n    return dataLayer.app.app.market.toLocaleLowerCase()\n}\n\nexport const getLangCode = () => {\n    const dataLayer = getDataLayer()\n    if (!dataLayer) {\n        return 'en'\n    }\n\n    return getDataLayer().page.page.pageInfo.language.toLocaleLowerCase()\n}\n\nexport const getSegmentCode = () => {\n    const dataLayer = getDataLayer()\n    if (!dataLayer) {\n        return 'B2C'\n    }\n\n    return getDataLayer().page.page.pageInfo.segmentBusiness\n}\n\nexport const isLoggedIn = () => {\n    const dataLayer = getDataLayer()\n    if (!dataLayer || !dataLayer.user) {\n        return false\n    }\n\n    return dataLayer.user.isLoggedIn\n}\n\nexport const interpolateMarketLang = (string, market, lang) => {\n    return string.replace('{market}', market).replace('{lang}', lang)\n}\n","import { getMarketCode } from './dataLayer'\n\nconst LABEL_CATEGORY_NAME = 'cat/capsule-range-label'\nconst LABEL_CATEGORY_NAME_MACHINE = 'cat/machine-range-label'\nexport const RANGE_CATEGORY_NAME = 'cat/capsule-range'\nconst FAIR_TRADE_CATEGORY_NAME = 'cat/capsule-range-fair-trade'\nconst VERTUO_NEXT_CATEGORY_NAME = 'cat/capsule-attribute-only-vertuo-next'\nconst ORGANIC_EU_CATEGORY_NAME = 'capsule-attribute-organic-eu'\nconst RAINFOREST_CATEGORY_NAME = 'capsule-attribute-rainforest'\nconst SUSTAINABILITY_CATEGORY_NAME = 'capsule-attribute-sustainability'\nconst ARABICA_CATEGORY_NAME = 'capsule-attribute-arabica'\nconst PRODUCT_HIGHLIGHT_CATEGORY_NAME = 'cat/capsule-attribute-highlight'\nconst TECHNOLOGY_CATEGORY_IDENTIFIER = '/machineTechno/'\n\nconst COMMON_URL = 'https://www.nespresso.com/shared_res/agility/commons/img/icons/'\n\nexport const FAIR_TRADE_IMG = COMMON_URL + 'fairTrade.svg'\nexport const ORGANIC_LOGO_IMG_EU = COMMON_URL + 'logo-organic-eu.svg'\nexport const ORGANIC_LOGO_IMG_US = COMMON_URL + 'logo-organic-us.svg'\nexport const ORGANIC_LOGO_IMG_CA = COMMON_URL + 'logo-organic-ca.svg'\nexport const ORGANIC_LOGO_IMG_BR = COMMON_URL + 'logo-organic-br.svg'\nexport const ORGANIC_LOGO_IMG_JP = COMMON_URL + 'logo-organic-jp.svg'\nexport const ORGANIC_LOGO_IMG_BE = COMMON_URL + 'logo-organic-be.png'\n\nexport const VERTUONEXT_LOGO_IMG = COMMON_URL + 'logo-only-vertuo-next.svg'\nexport const RAINFOREST_LOGO_IMG = COMMON_URL + 'logo-rainforest.svg'\nexport const SUSTAINABILITY_LOGO_IMG = COMMON_URL + 'logo-sustainability.svg'\nexport const Q_CERTIFICATION_ARABICA_LOGO_IMG = COMMON_URL + 'q_grade_certification_arabica.svg'\nexport const DESIGN_AWARD_2021_IMG = COMMON_URL + 'design_award_2021.svg'\n\nexport const LOGO_IMG_MAP = {\n    fair_trade: FAIR_TRADE_IMG,\n    is_organic: getOrganicLogo(),\n    only_vertuo_next: VERTUONEXT_LOGO_IMG,\n    is_q_certified_arabica: Q_CERTIFICATION_ARABICA_LOGO_IMG,\n    is_rainforest: RAINFOREST_LOGO_IMG,\n    is_sustainable: SUSTAINABILITY_LOGO_IMG,\n    is_design_award_2021: DESIGN_AWARD_2021_IMG\n}\n\nexport function getOrganicLogo() {\n    let organicLogoImg = ORGANIC_LOGO_IMG_EU\n\n    switch (getMarketCode()) {\n        case 'us':\n            organicLogoImg = ORGANIC_LOGO_IMG_US\n            break\n        case 'ca':\n            organicLogoImg = ORGANIC_LOGO_IMG_CA\n            break\n        case 'br':\n            organicLogoImg = ORGANIC_LOGO_IMG_BR\n            break\n        case 'jp':\n            organicLogoImg = ORGANIC_LOGO_IMG_JP\n            break\n        case 'be':\n            organicLogoImg = ORGANIC_LOGO_IMG_BE\n            break\n    }\n\n    return organicLogoImg\n}\n\n/**\n * retrieves the list of categories of type Vertuo Next\n * @param {category[]} categories\n */\nexport function getVertuoNext(categories) {\n    return categories.find(category => isVertuoNext(category))\n}\n\n/**\n * returns true when the category is product vertuo next\n * @param {category} category\n */\nfunction isVertuoNext(category) {\n    return getCategoryRegEx(VERTUO_NEXT_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * retrieves the list of categories of type organic EU\n * @param {category[]} categories\n */\nexport function getOrganicEu(categories) {\n    return categories.find(category => isOrganicEu(category))\n}\n\n/**\n * returns true when the category is product organic EU\n * @param {category} category\n */\nfunction isOrganicEu(category) {\n    return getCategoryRegEx(ORGANIC_EU_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * retrieves the list of categories of type rainforest\n * @param {category[]} categories\n */\nexport function getRainforest(categories) {\n    return categories.find(category => isRainforest(category))\n}\n\n/**\n * returns true when the category is rainforest\n * @param {category} category\n */\nfunction isRainforest(category) {\n    return getCategoryRegEx(RAINFOREST_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * retrieves the list of categories of type sustainability\n * @param {category[]} categories\n */\nexport function getSustainability(categories) {\n    return categories.find(category => isSustainability(category))\n}\n\n/**\n * retrieves the list of categories of type arabica\n * @param {category[]} categories\n */\nexport function getArabica(categories) {\n    return categories.find(category => isArabica(category))\n}\n\n/**\n * returns true when the category is arabica\n * @param {category} category\n */\nfunction isArabica(category) {\n    return getCategoryRegEx(ARABICA_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * returns true when the category is sustainability\n * @param {category} category\n */\nfunction isSustainability(category) {\n    return getCategoryRegEx(SUSTAINABILITY_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * retrieves the list of categories of type label\n * @param {category[]} categories\n */\nexport function getLabels(categories) {\n    return categories.filter(category => isLabel(category))\n}\n\n/**\n * retrieves the list of categories of type label\n * @param {category[]} categories\n */\nexport function getProductHighlight(categories) {\n    return categories.find(category => isProductHighlight(category))\n}\n/**\n * retrieves the list of categories of type label\n * @param {category[]} categories\n */\nexport function getFairTrade(categories) {\n    return categories.find(category => isFairTrade(category))\n}\n\n/**\n * returns a regex to match the tail (global) of a given local category ID\n * @param {string} categoryIdTail : should contain the end of the category ID\n */\nexport function getCategoryRegEx(categoryIdTail) {\n    return new RegExp(categoryIdTail.replace(/\\//g, '\\\\/'))\n}\n\n/**\n * returns true when the category is child of the label category (is type label)\n * @param {category} category\n */\nfunction isLabel(category) {\n    return (\n        getCategoryRegEx(LABEL_CATEGORY_NAME).test(category.id) ||\n        getCategoryRegEx(LABEL_CATEGORY_NAME_MACHINE).test(category.id)\n    )\n}\n\n/**\n * returns true when the category is product highlight\n * @param {category} category\n */\nfunction isProductHighlight(category) {\n    return getCategoryRegEx(PRODUCT_HIGHLIGHT_CATEGORY_NAME).test(category.id)\n}\n/**\n * returns true when the category is fair trade\n * @param {category} category\n */\nfunction isFairTrade(category) {\n    return getCategoryRegEx(FAIR_TRADE_CATEGORY_NAME).test(category.id)\n}\n\n/**\n * returns true when the category is child of the range category (is type range)\n * @param {category} category\n */\nexport function isRange(category) {\n    return category.superCategories.some(superCategory =>\n        getCategoryRegEx(RANGE_CATEGORY_NAME).test(superCategory)\n    )\n}\n\nexport function getTechnologyName(productData, categories) {\n    if (!productData || !productData.technologies || !productData.technologies.length) {\n        return null\n    }\n\n    const techno = productData.technologies[0]\n    const categoryNameAsSubstring = techno.substring(\n        techno.indexOf(TECHNOLOGY_CATEGORY_IDENTIFIER) + TECHNOLOGY_CATEGORY_IDENTIFIER.length\n    )\n    const category = categories?.find(cat => cat.id === techno)\n\n    // Backward compatibility, return name as substring if the list of categories are not available\n    return category?.name || categoryNameAsSubstring\n}\n\nexport function isCategoryHidden(categoryId) {\n    let hideCategory = false\n    // To enable AB testing: exclude categories which are to be hidden\n    if (\n        window.PLP_HIDE_CATEGORIES?.length &&\n        window.PLP_HIDE_CATEGORIES.findIndex(c => categoryId.indexOf(c) >= 0) >= 0\n    ) {\n        hideCategory = true\n    }\n\n    // To enable AB testing: exclude categories except those which are to be shown\n    if (window.PLP_ONLY_SHOW_CATEGORIES?.length) {\n        // Default to hide\n        hideCategory = true\n        if (window.PLP_ONLY_SHOW_CATEGORIES.findIndex(c => categoryId.indexOf(c) >= 0) >= 0) {\n            hideCategory = false\n        }\n    }\n    return hideCategory\n}\n","import { INTENSITY_MAX_OL, INTENSITY_MAX_VL } from '@kissui/components'\n\nexport const getMaxIntensity = ({ technologies }) =>\n    technologies.indexOf('original') !== -1 ? INTENSITY_MAX_OL : INTENSITY_MAX_VL\n","import { getFinalPrice } from '@kissui/plp/services'\nimport { isBundled } from '@kissui/helpers/src/catalog'\nimport { getMaxIntensity } from '@kissui/components/src/sku-coffee/services'\n\nexport const getMergedProductCoffeeData = (\n    product,\n    pageBuilderProductProps,\n    pageBuilderProps,\n    priceFormatter,\n    currency\n) => {\n    const { bundle_details } = pageBuilderProductProps\n    const { options } = pageBuilderProps\n    const { show_sleeve_price } = options\n\n    const isBundledResult = isBundled(product)\n\n    const { showCapsulePrice, price_per_capsule, final_price } = getFinalPrice(\n        show_sleeve_price,\n        product,\n        isBundled\n    )\n\n    const option = {\n        bundled: isBundledResult,\n        intensity: product.capsuleProperties?.intensity || product.intensity || null,\n        max_intensity: getMaxIntensity(product),\n        price_per_capsule: price_per_capsule\n            ? priceFormatter.short(currency, price_per_capsule)\n            : null,\n        show_capsule_price: showCapsulePrice\n    }\n\n    if (show_sleeve_price) {\n        option.price = priceFormatter.short(currency, final_price)\n    }\n\n    if (bundle_details) {\n        option.bundle_details = bundle_details\n    }\n\n    return option\n}\n","import {\n    getVertuoNext,\n    getOrganicEu,\n    getRainforest,\n    getLabels,\n    getProductHighlight,\n    getFairTrade,\n    getSustainability,\n    isRange,\n    getCategoryRegEx,\n    RANGE_CATEGORY_NAME,\n    getArabica\n} from '@kissui/helpers/src/cremaDataHelper'\n\n/**\n * Modifies the structure to make it easier to use in components\n * Applies all the data customization mixing Page builder with HMC data\n * @param {object} plpData : original PLP data\n */\nexport async function getMergedPLPData(plpData) {\n    const { data } = plpData\n    if (!data) {\n        return []\n    }\n\n    const eCommerceData = data.configuration.eCommerceData\n\n    addLabels(eCommerceData)\n\n    addProductAttribute(\n        eCommerceData,\n        getFairTrade,\n        (prod, category) => (prod.fairTrade = category.name)\n    )\n    addProductAttribute(eCommerceData, getProductHighlight, prod => (prod.highlighted = true))\n    addProductAttribute(eCommerceData, getVertuoNext, prod => (prod.onlyVertuoNext = true))\n    addProductAttribute(eCommerceData, getOrganicEu, prod => (prod.organicEu = true))\n    addProductAttribute(eCommerceData, getRainforest, prod => (prod.rainforest = true))\n    addProductAttribute(eCommerceData, getSustainability, prod => (prod.sustainability = true))\n    addProductAttribute(eCommerceData, getArabica, prod => (prod.arabica = true))\n\n    addSubSegments(eCommerceData)\n\n    return eCommerceData.categories\n}\n\nfunction addSubSegments(eCommerceData) {\n    const { categories, productGroups, products } = eCommerceData\n    // should be forEach if nothing returned/assigned\n    categories.forEach(category => {\n        const hasSegment = category.subCategories.length > 0 && isRange(category)\n        if (hasSegment) {\n            category.segments = category.subCategories.map(categoryId => {\n                const segment = categories.find(subCategory => subCategory.id === categoryId)\n                if (segment && isSubsegment(categories, segment)) {\n                    segment.products = getProductsData(productGroups, segment.id, products)\n                    segment.isSegment = true\n                }\n                return segment\n            })\n        }\n\n        category.products = getProductsData(productGroups, category.id, products)\n    })\n}\n\nexport function getProductsData(productGroups, categoryId, products) {\n    let result = []\n    try {\n        const currentCategory = productGroups.find(category => category.categoryId === categoryId)\n\n        if (!currentCategory) {\n            return result\n        }\n\n        const { productIds } = currentCategory\n        return productIds.map(productId => {\n            const product = products.find(product => product.id === productId)\n            return product\n        })\n    } catch (e) {\n        //generally an anti pattern to only log the error, with no try catch the result would be the same\n        console.log(e)\n    }\n\n    return result\n}\n\n/**\n * adds labels property to products containing each label's category data (JSON parsed description property) assigned to it\n * labels are categories that have the label base category as parent\n * to apply a label on a given product, the label has to contain the product\n * this function has to clean the productGroups as well by removing the label ones\n * @param {category[]} categories\n * @param {productGroup[]} productGroups\n * @param {product[]} products\n */\nfunction addLabels(eCommerceData) {\n    const { categories, productGroups, products } = eCommerceData\n    const labels = getLabels(categories)\n    const labelGroups = getLabelGroups(productGroups, labels)\n    labelGroups.forEach(group => {\n        const label = labels.find(label => label.id === group.categoryId)\n        group.productIds.forEach(productId => {\n            const prod = products.find(product => product.id === productId)\n            prod.labels = prod.labels || []\n            prod.labels.push(label.description)\n        })\n    })\n    //removing label categories from productGroups\n    labelGroups.forEach(labelGroup => {\n        const indexToRemove = productGroups.findIndex(\n            productGroup => productGroup.categoryId === labelGroup.categoryId\n        )\n        productGroups.splice(indexToRemove, 1)\n    })\n}\n\n/**\n * adds a property to products containing the given category assigned to it\n * The category is recognized by ID\n * to apply a the category on a given product, the category's productGroup has to contain the product\n * this function has to clean the productGroups as well by removing the given's one to not let it display as a range in the PLP\n * @param {category[]} categories\n * @param {productGroup[]} productGroups\n * @param {product[]} products\n */\nfunction addProductAttribute(eCommerceData, categoryFetcher, assignHandler) {\n    const { categories, productGroups, products } = eCommerceData\n    const category = categoryFetcher(categories)\n    if (!category) {\n        return\n    }\n    const categoryGroup = getCategoryGroup(productGroups, category)\n    if (!categoryGroup) {\n        return\n    }\n    categoryGroup.productIds.forEach(productId => {\n        const prod = products.find(product => product.id === productId)\n        if (categoryFetcher === getArabica) {\n            console.log('addProductAttribute', prod)\n        }\n        assignHandler(prod, category)\n    })\n    const indexToRemove = productGroups.findIndex(\n        productGroup => productGroup.categoryId === categoryGroup.categoryId\n    )\n    productGroups.splice(indexToRemove, 1)\n}\n\n/**\n * retrieve all the productGroup that are labels\n * @param {productGroup[]} productGroups\n * @param {category[]} labels\n */\nfunction getLabelGroups(productGroups, labels) {\n    return productGroups.filter(group => labels.some(label => label.id === group.categoryId))\n}\n\n/**\n * retrieve the productGroup which correspond to a category\n * @param {productGroup[]} productGroups\n * @param {category} fairTrade\n */\nfunction getCategoryGroup(productGroups, category) {\n    return productGroups.find(group => category.id === group.categoryId)\n}\n\n/**\n * returns true when the category is child of the range category (is type range)\n * @param {category} category\n */\nexport function isSubsegment(categories, category) {\n    /*category.superCategories.some(superCategoryId => {\n        const superCategoryData = categories.find(categoryToFind => categoryToFind.id === superCategoryId)\n    })*/\n    const result = category.superCategories.some(superCategory =>\n        getCategoryRegEx(RANGE_CATEGORY_NAME).test(superCategory)\n    )\n    return result\n}\nexport function getFinalPrice(show_sleeve_price, product, isBundled) {\n    let showCapsulePrice = show_sleeve_price\n    let final_price\n    let price_per_capsule\n\n    const bundled = isBundled(product)\n\n    if (product.type === 'capsule' && !bundled) {\n        final_price = product.price * product.salesMultiple\n        // this isn't necessary in prod but the mock price formatter needs it\n        final_price = Math.round(final_price * 100) / 100\n        price_per_capsule = product.price\n    } else {\n        showCapsulePrice = false\n        final_price = product.price\n    }\n\n    return { showCapsulePrice, final_price, price_per_capsule }\n}\n","const VOLTAGE_110 = '110'\nconst VOLTAGE_220 = '220'\n\nexport const getMergedProductMachineData = (product, pageBuilderProductProps, pageBuilderProps) => {\n    const { strikethrough_price, variant } = pageBuilderProductProps\n    const { show_voltage, voltage_label, a11y_voltage_label, voltage_list } = variant\n    const { colorVariants, ratingsAndReviews } = product\n\n    // lists header props not coming from this.props\n    let options = {\n        ratings: ratingsAndReviews\n    }\n\n    if (show_voltage) {\n        const currentVoltage = getCurrentVoltage(product)\n        const voltageData = getVoltageSwitcher(colorVariants, voltage_list, product)\n\n        const colors = colorVariants\n            .filter(productColor => productColor.name.indexOf(currentVoltage) > -1)\n            .map(productColor => getColorModel(productColor))\n\n        options = {\n            ...options,\n            colors,\n            show_voltage,\n            voltage_label,\n            a11y_voltage_label,\n            voltage_list: voltageData\n        }\n    }\n\n    if (options.colors) {\n        options.activeSku = product.internationalId\n        options.colors = !options.colors\n            ? colorVariants.map(productColor => getColorModel(productColor))\n            : options.colors\n        options.max_colors = 99\n    }\n\n    options.strikethrough_price = strikethrough_price || ''\n    options.show_ratings = (pageBuilderProps && pageBuilderProps.options.show_ratings) || false\n    options.minimum_rating = (pageBuilderProps && pageBuilderProps.options.minimum_rating) || 0\n\n    return options\n}\n\nconst getCurrentVoltage = product =>\n    product.name.indexOf(VOLTAGE_110) > -1 ? VOLTAGE_110 : VOLTAGE_220\n\nconst getColorModel = product => {\n    return {\n        category:\n            product.colorCategories && product.colorCategories[0]\n                ? product.colorCategories[0]\n                : null,\n        name: product.colorShade ? product.colorShade.name : null,\n        code: product.colorShade ? product.colorShade.cssColorCode : null,\n        sku: product.internationalId,\n        link: product.url\n    }\n}\n\n/**\n * Return an array with the url of the opposite voltage for the machine\n * https://dsu-confluence.nestle.biz/x/fKgaCQ\n * @param colorVariants - HMC Crema UI PDP Data\n * @param voltage_list - Page Builder\n * @param product - HMC Crema UI PDP Data Current product display\n * @returns {Array} voltages\n * @returns {String} voltages[].label - Label of voltage\n * @returns {String} voltages[].link - Empty if current voltage, or fill with the machine url of the opposite voltage\n */\nconst getVoltageSwitcher = (colorVariants, voltage_list, product) => {\n    // From current voltage, get the same color for the opposite voltage\n    const currentVoltage = getCurrentVoltage(product)\n    const oppositeVoltages = voltage_list.filter(voltage => voltage.label !== currentVoltage)\n\n    if (!oppositeVoltages || !oppositeVoltages.length) {\n        return voltage_list\n    }\n\n    const oppositeVoltage = oppositeVoltages.pop().label\n\n    // Find in machines same name with new voltage\n    const oppositeVoltageMachineName = product.name.replace(currentVoltage, oppositeVoltage)\n    const oppositeVariation = colorVariants.find(\n        machine =>\n            machine.name === oppositeVoltageMachineName &&\n            product.colorShade.cssColorCode === machine.colorShade.cssColorCode\n    )\n\n    if (!oppositeVariation) {\n        return voltage_list\n    }\n\n    const { url = '' } = oppositeVariation\n\n    // Build final array, current voltage without link and opposite voltage with link\n    return voltage_list.map(voltage => {\n        if (voltage.label !== currentVoltage) {\n            voltage.url = url\n            voltage.selected = false\n        } else {\n            voltage.selected = true\n        }\n\n        return voltage\n    })\n}\n","import {\n    ECAPI_TYPE_ACCESSORY,\n    ECAPI_TYPE_CAPSULE,\n    ECAPI_TYPE_GIFT_CARD,\n    ECAPI_TYPE_MACHINE\n} from '@kissui/helpers/src/catalog'\n\nexport const getSkuComponentByType = ({ type, is_machine_b2b }) => {\n    let result = 'nb-sku'\n\n    if (type === ECAPI_TYPE_CAPSULE) {\n        result = 'nb-sku-coffee'\n    } else if (type === ECAPI_TYPE_MACHINE && is_machine_b2b) {\n        result = 'nb-sku-machine-b2b'\n    } else if (type === ECAPI_TYPE_MACHINE) {\n        result = 'nb-sku-machine'\n    } else if (type === ECAPI_TYPE_ACCESSORY) {\n        result = 'nb-sku-accessory'\n    } else if (type === ECAPI_TYPE_GIFT_CARD) {\n        result = 'nb-sku-gift-card'\n    }\n\n    return result\n}\n\nexport const apiOverride = (productData, pageBuilderData) => {\n    if (!productData || !pageBuilderData) {\n        return {}\n    }\n\n    const { images, name, headline, description } = productData\n    const { api_override } = pageBuilderData\n\n    if (!api_override) {\n        return {}\n    }\n\n    return {\n        image: api_override.image || images?.icon || images?.url || images?.push || images?.main,\n        name: api_override.name || name,\n        headline: api_override.headline || headline,\n        description: api_override.description || description\n    }\n}\n","import { sanitizeString } from '@kissui/helpers/src/utils'\nimport { getMergedProductCoffeeData } from './product.coffee.dto'\nimport { getMergedProductMachineData } from './product.machine.dto'\nimport { VARIATION_PLP } from '@kissui/components/src/sku/constants'\nimport { getMergedProductGiftCardData } from './product.giftCard.dto'\nimport { getMergedProductAccessoryData } from './product.accessory.dto'\nimport { apiOverride } from '@kissui/components/src/sku/services'\nimport {\n    ECAPI_TYPE_ACCESSORY,\n    ECAPI_TYPE_CAPSULE,\n    ECAPI_TYPE_GIFT_CARD,\n    ECAPI_TYPE_MACHINE\n} from '@kissui/helpers/src/catalog'\n\nexport const getMergedProductData = (\n    product,\n    pageBuilderProductProps,\n    pageBuilderProps,\n    priceFormatter,\n    currency\n) => {\n    const { options } = pageBuilderProps\n    const {\n        variant,\n        labels,\n        strikethrough_price,\n        additional_message,\n        additional_message_icon,\n        additional_message_link\n    } = pageBuilderProductProps\n\n    // lists header props not coming from this.props\n    let data = {\n        sku: product.internationalId,\n        technologies: product.technologies,\n        longSku: product.id,\n        name: product.name,\n        headline: sanitizeString(product.headline),\n        sales_multiple: product.salesMultiple,\n        unit_quantity: product.unitQuantity,\n        type: product.type,\n        category_name: product.rangeData?.name || '',\n        label_range: product.rangeData?.name || '',\n        price: product.price ? priceFormatter.short(currency, product.price) : null,\n        strikethrough_price: strikethrough_price || '',\n        variation: VARIATION_PLP,\n        image_alt_text: product.name,\n        image: product.images?.icon,\n        url: product.pdpURLs?.desktop || '',\n        additional_message: additional_message || '',\n        additional_message_icon: additional_message_icon || '',\n        additional_message_link: additional_message_link || {},\n        ...apiOverride(product, pageBuilderProductProps)\n    }\n\n    if (labels && labels.length) {\n        data.labels = labels\n    }\n\n    if (product.highlighted) {\n        data.highlighted = product.highlighted\n    }\n\n    let dataTransformObjectProductType = {}\n    if (product.type === ECAPI_TYPE_CAPSULE) {\n        dataTransformObjectProductType = getMergedProductCoffeeData(\n            product,\n            pageBuilderProductProps,\n            pageBuilderProps,\n            priceFormatter,\n            currency\n        )\n    } else if (product.type === ECAPI_TYPE_MACHINE) {\n        dataTransformObjectProductType = getMergedProductMachineData(\n            product,\n            pageBuilderProductProps,\n            pageBuilderProps\n        )\n    } else if (product.type === ECAPI_TYPE_ACCESSORY) {\n        dataTransformObjectProductType = getMergedProductAccessoryData(\n            product,\n            pageBuilderProductProps,\n            pageBuilderProps\n        )\n    } else if (product.type === ECAPI_TYPE_GIFT_CARD) {\n        dataTransformObjectProductType = getMergedProductGiftCardData(\n            product,\n            pageBuilderProductProps,\n            pageBuilderProps\n        )\n    }\n\n    return {\n        ...product,\n        ...options,\n        ...variant,\n        ...data,\n        ...dataTransformObjectProductType\n    }\n}\n","export const VARIATION_PLP = 'plp'\nexport const VARIATION_PDP = 'pdp'\nexport const VARIATION_CROSS_SELL = 'cross-sell'\nexport const VARIATION_SMALL = 'small'\n","export const getMergedProductAccessoryData = () => ({})\n","export const getMergedProductGiftCardData = (_, pageBuilderProductProps) => {\n    const { variant } = pageBuilderProductProps\n\n    return {\n        image: variant && variant.default_image\n    }\n}\n","import './hotspot-tooltip.scss'\nimport { makeId } from '@kissui/helpers/src/utils'\nimport createProps from '@kissui/helpers/src/props.helpers'\nimport { getCurrency, getPriceFormatter, getProduct } from '@kissui/helpers/src/catalog'\nimport viewportHelper from '@kissui/helpers/src/viewport.helpers'\nimport { getMergedProductData } from '@kissui/page-builder-sections/src/product-grid/dataTransform'\nimport { getSkuComponentByType } from '@kissui/components/src/sku/services'\nimport { selectPromotion } from '@kissui/helpers/src/gtmEvents'\nimport { VARIATION_SMALL } from '@kissui/components/src/sku/constants.mjs'\n\nclass HotspotTooltip extends HTMLElement {\n    constructor() {\n        super()\n        this.currency = null\n        this.priceFormatter = null\n        this.isActive = false\n        this.classes = {\n            tooltip: 'hotspot-tooltip',\n            preview: 'hotspot-preview',\n            previewIsActive: 'hotspot-preview--is-active'\n        }\n\n        this.parentProps = createProps(this.closest('nb-hotspots').attributes)\n        this.tooltipId = `hotspot-tooltip-${makeId(5)}`\n    }\n    async connectedCallback() {\n        this.props = createProps(this.attributes)\n        this.adjustTooltipsPosition = this.adjustTooltipsPosition.bind(this)\n\n        await this.onReady().then()\n        await this.render()\n    }\n\n    async onReady() {\n        this.priceFormatter = await getPriceFormatter()\n        this.currency = getCurrency()\n    }\n\n    async render() {\n        const { yCord, xCord } = this.props\n\n        this.innerHTML = `\n        <div class=\"${this.classes.tooltip}\" id=\"${this.tooltipId}\" data-initial-x=\"${xCord}\" data-initial-y=\"${yCord}\" tabindex=\"0\" role=\"button\" aria-pressed=\"false\"></div>\n    `\n\n        this.adjustTooltipsPosition()\n        const tooltipElement = this.querySelector(`.${this.classes.tooltip}`)\n\n        // If has SKU, load product variant\n        if (this.props.sku) {\n            const preview = await this.renderPreview()\n            tooltipElement.innerHTML = preview\n            const productInfo = await getProduct(this.props.sku)\n            const productName = productInfo.name\n            tooltipElement.setAttribute('aria-label', productName)\n        } else {\n            // No SKU provided, load content variant\n            const { title, description } = this.props\n\n            tooltipElement.innerHTML = `\n                <div class=\"${this.classes.preview}\">\n                    <p class=\"${this.classes.preview}__title\">${title}</p>\n                    <p class=\"${this.classes.preview}__description\">${description}</p>\n                </div>\n            `\n            tooltipElement.setAttribute('aria-label', title)\n        }\n\n        this.adjustTooltipsPreviewPosition()\n        this.bindEvents()\n    }\n\n    async renderPreview() {\n        const { sku } = this.props\n\n        const productInfo = await getProduct(sku)\n        const mergedProductData = getMergedProductData(\n            productInfo,\n            this.props,\n            this.parentProps,\n            this.priceFormatter,\n            this.currency\n        )\n\n        const tag = getSkuComponentByType(mergedProductData)\n        const elementProduct = document.createElement(tag)\n        elementProduct.setAttribute(\n            'data',\n            JSON.stringify({ ...mergedProductData, variation: VARIATION_SMALL })\n        )\n\n        return `\n            <div class=\"${this.classes.preview}\">\n                ${elementProduct.outerHTML}\n            </div>\n        `\n    }\n\n    closeCurrentPreview() {\n        if (document.querySelector(`.${this.classes.previewIsActive}`)) {\n            this.isActive = false\n\n            document\n                .querySelector(`.${this.classes.previewIsActive}`)\n                .classList.remove(this.classes.previewIsActive)\n\n            document\n                .querySelector(`.${this.classes.tooltip}[aria-pressed=\"true\"]`)\n                .setAttribute('aria-pressed', 'false')\n        }\n    }\n\n    boundOnTooltipMouseoverClick() {\n        if (this.isActive) {\n            return\n        }\n\n        this.closeCurrentPreview()\n        this.isActive = true\n        this.classList.add(this.classes.previewIsActive)\n        this.querySelector(`.${this.classes.tooltip}`).setAttribute('aria-pressed', true)\n\n        const spotIdx = this.getAttribute('data-idx')\n        const { campaign, tracking_label } = this.props\n        const cta_name = `hot spot - ${parseInt(spotIdx) + 1} - ${\n            tracking_label || this.props.sku || this.props.title\n        }`\n\n        selectPromotion({ ...campaign, cta_name: cta_name })\n\n        setTimeout(() => {\n            this.isActive = false\n        }, 2000)\n    }\n    boundOnTooltipMouseleave() {\n        this.isActive = false\n        this.classList.remove(this.classes.previewIsActive)\n        this.querySelector(`.${this.classes.tooltip}`).setAttribute('aria-pressed', false)\n    }\n\n    bindEvents() {\n        this.addEventListener('mouseover', this.boundOnTooltipMouseoverClick.bind(this))\n        this.addEventListener('mouseleave', this.boundOnTooltipMouseleave.bind(this))\n        this.addEventListener('click', this.boundOnTooltipMouseoverClick.bind(this))\n        this.addEventListener('keydown', this.boundOnTooltipMouseoverClick.bind(this))\n\n        window.addEventListener('resize', this.adjustTooltipsPosition)\n        window.addEventListener('click', event => {\n            if (viewportHelper.is.mobile) {\n                if (\n                    !event.target.classList.contains(this.classes.tooltip) &&\n                    !event.target.classList.contains(this.classes.preview)\n                ) {\n                    this.closeCurrentPreview()\n                }\n            }\n        })\n\n        this.replaceClasses('.nb-sku .cb-heading', 't-md-700-sl', 't-xs-700-sl')\n        this.replaceClasses('.nb-sku .cb-text', 't-sm-400-sl', 't-xs-500-sl')\n\n        if (this.querySelector('.nb-sku .cb-price-current')) {\n            this.querySelector('.nb-sku .cb-price-current').classList.add('t-xs-700-sl')\n        }\n    }\n\n    replaceClasses(el, oldClass, newClass) {\n        if (this.querySelector(el)) {\n            this.querySelector(el).classList.remove(oldClass)\n            this.querySelector(el).classList.add(newClass)\n        }\n    }\n\n    disconnectedCallback() {\n        this.removeEventListener('mouseover', this.boundOnTooltipMouseoverClick)\n        this.removeEventListener('mouseleave', this.boundOnTooltipMouseleave)\n        this.removeEventListener('click', this.boundOnTooltipMouseoverClick)\n\n        window.removeEventListener('resize', this.adjustTooltipsPosition)\n    }\n\n    adjustTooltipsPosition() {\n        const { yCord, xCord } = this.props\n        const imgRect = this.parentElement.getBoundingClientRect()\n        const bgSize = this.parentElement.closest('[data-bg-size]').getAttribute('data-bg-size')\n\n        if (!bgSize || !imgRect) {\n            return false\n        }\n\n        this.querySelector(`.${this.classes.tooltip}`).style.left = `${\n            (xCord / bgSize) * imgRect.width\n        }px`\n        this.querySelector(`.${this.classes.tooltip}`).style.top = `${\n            (yCord / bgSize) * imgRect.height\n        }px`\n    }\n\n    adjustTooltipsPreviewPosition() {\n        const hotspot = this.parentElement.parentElement.parentElement\n        const preview = this.querySelector(`.${this.classes.preview}`)\n        const tooltip = this.querySelector(`.${this.classes.tooltip}`)\n        const { spaceAbove, spaceBelow, spaceLeft, spaceRight } = this.calculateSpaces(\n            hotspot,\n            tooltip\n        )\n\n        this.setPreviewVisibility(preview, 'hidden', 'block')\n\n        const { previewWidth, previewHeight } = this.getPreviewDimensions(preview)\n\n        this.setPreviewVisibility(preview, '', '')\n\n        const horizontalPosition = this.getHorizontalPosition(spaceLeft, spaceRight, previewWidth)\n        const verticalPosition = this.getVerticalPosition(spaceAbove, spaceBelow, previewHeight)\n\n        this.applyPreviewPosition(preview, verticalPosition, horizontalPosition)\n    }\n\n    calculateSpaces(hotspot, tooltip) {\n        const hotspotRect = hotspot.getBoundingClientRect()\n        const tooltipRect = tooltip.getBoundingClientRect()\n\n        return {\n            spaceAbove: tooltipRect.top - hotspotRect.top,\n            spaceBelow: hotspotRect.bottom - tooltipRect.bottom,\n            spaceLeft: tooltipRect.left - hotspotRect.left,\n            spaceRight: hotspotRect.right - tooltipRect.right\n        }\n    }\n\n    setPreviewVisibility(preview, visibility, display) {\n        preview.style.visibility = visibility\n        preview.style.display = display\n    }\n\n    getPreviewDimensions(preview) {\n        return {\n            previewWidth: preview.offsetWidth,\n            previewHeight: preview.offsetHeight\n        }\n    }\n\n    getHorizontalPosition(spaceLeft, spaceRight, previewWidth) {\n        if (spaceRight < previewWidth && spaceLeft >= previewWidth) {\n            return 'left'\n        } else if (spaceLeft < previewWidth && spaceRight >= previewWidth) {\n            return 'right'\n        }\n\n        return spaceRight >= previewWidth ? 'right' : 'left'\n    }\n\n    getVerticalPosition(spaceAbove, spaceBelow, previewHeight) {\n        if (spaceAbove < previewHeight && spaceBelow >= previewHeight) {\n            return 'bottom'\n        } else if (spaceBelow < previewHeight && spaceAbove >= previewHeight) {\n            return 'top'\n        }\n\n        return spaceBelow >= previewHeight ? 'bottom' : 'top'\n    }\n\n    applyPreviewPosition(preview, verticalPosition, horizontalPosition) {\n        preview.classList.remove(\n            'position-top-left',\n            'position-top-right',\n            'position-bottom-left',\n            'position-bottom-right'\n        )\n\n        preview.classList.add(`position-${verticalPosition}-${horizontalPosition}`)\n    }\n}\n\ncustomElements.get('nb-hotspot-tooltip') ||\n    customElements.define('nb-hotspot-tooltip', HotspotTooltip)\nexport default HotspotTooltip\n","export const getCurrency = () => window[window.config.padl.namespace].dataLayer.app.app.currency\n","import createProps from '@kissui/helpers/src/props.helpers'\nimport { stringifyForAttribute } from '@kissui/helpers/src/utils'\n\nimport './subcomponents/grid/grid'\nimport './subcomponents/hotspot/hotspot'\nimport './subcomponents/hotspot-tooltip/hotspot-tooltip'\nimport { selectPromotion } from '@kissui/helpers/src/gtmEvents'\n\nclass Hotspots extends HTMLElement {\n    connectedCallback() {\n        this.props = createProps(this.attributes)\n        this.activeCategory = 0\n        this.render()\n    }\n\n    render() {\n        const {\n            copywriting: { title, subtitle, description },\n            layout: { padding_top, padding_bottom },\n            campaign\n        } = this.props\n\n        this.innerHTML = `\n            <nb-container\n                background_color=\"white_1000\"\n                contrast=\"light\"\n                campaign_id='${campaign.id}'\n                campaign_name='${campaign.name}'\n                campaign_position='${campaign.position}'\n                campaign_creative='${campaign.creative}'\n                classname='hotspots-container ${padding_top} ${padding_bottom}'\n            >\n                <div class=\"hotspots\">\n                    <div class=\"hotspots-header\">\n                        ${subtitle && `<h2 class=\"t-xs-500-sl\">${subtitle}</h2>`}\n                        ${title && `<h3 class=\"h-2xl-300\">${title}</h3>`}\n                        ${description && `<h4 class=\"t-sm-400-sl\">${description}</h4>`}\n                    </div>\n                    ${this.renderCategories()}\n                    <div class=\"hotspots-grid\" id=\"hotspots-grid\"></div>\n                </div>\n            </nb-container>\n        `\n\n        this.renderItems()\n        this.bindEvents()\n    }\n\n    renderItems() {\n        const { categories } = this.props.copywriting\n\n        this.querySelector('#hotspots-grid').innerHTML = `\n            <nb-hotspots-grid data=\"${stringifyForAttribute(\n                categories[this.activeCategory]\n            )}\"></nb-hotspots-grid>\n        `\n    }\n\n    renderCategories() {\n        const { categories } = this.props.copywriting\n\n        if (categories.length > 1) {\n            return (\n                '<div class=\"hotspots-categories\">' +\n                categories\n                    .map(\n                        (element, index) => `\n                    <a class=\"toggle-category\" data-category-id=\"${index}\">\n                        <nb-chip id=\"category-${index}\" icon=\"\" type=\"radio\" checked=\"${\n                            index === 0\n                        }\">\n                            ${element.category_title}\n                        </nb-chip>\n                    </a>\n                `\n                    )\n                    .join('') +\n                '</div>'\n            )\n        }\n\n        return ''\n    }\n\n    toggleCategoryClickHandler(categoryElement) {\n        const categoryId = parseInt(categoryElement.getAttribute('data-category-id'))\n\n        if (this.activeCategory === categoryId) {\n            return false\n        }\n\n        this.activeCategory = categoryId\n\n        const { categories } = this.props.copywriting\n        const category = categories[this.activeCategory]\n\n        if (category) {\n            this.renderItems()\n            selectPromotion({\n                cta_name: `menu chip - ${this.activeCategory + 1} - ${category.category_title}`\n            })\n        }\n    }\n\n    bindEvents() {\n        this.querySelectorAll('.toggle-category').forEach(category => {\n            category.addEventListener('click', () => {\n                this.toggleCategoryClickHandler(category)\n            })\n        })\n    }\n\n    unbindEvents() {\n        this.querySelectorAll('.toggle-category').forEach(category => {\n            category.removeEventListener('click', () => {\n                this.toggleCategoryClickHandler(category)\n            })\n        })\n    }\n\n    disconnectedCallback() {\n        this.unbindEvents()\n    }\n}\n\ncustomElements.get('nb-hotspots') || customElements.define('nb-hotspots', Hotspots)\n\nexport default Hotspots\n"],"names":["createProps","attributes","data","find","attribute","nodeName","getData","props","filter","reduce","all","attr","nodeValue","isNil","JSON","parse","error","console","log","obj","removeEmptyValues","findText","key","value","text","includes","stringifyForAttribute","escapeHtml","stringify","map","replace","m","DOMParser","sanitizeString","toString","Grid","HTMLElement","constructor","connectedCallback","this","render","grid_type","innerHTML","renderThreeItems","grid_elements","renderItemByType","item","details","type","customElements","get","define","BREAKPOINT_TABLET","ECAPI_TYPE_CAPSULE","ECAPI_TYPE_MACHINE","ECAPI_TYPE_ACCESSORY","ECAPI_TYPE_GIFT_CARD","getProduct","sku","window","napi","catalog","trimSku","isBundled","productData","sales_multiple","salesMultiple","isSalesMultipleGreaterThanOne","isUnitQuantityEqualToOne","unitQuantity","isSalesMultipleEqualToOne","isUnitQuantityGreaterThanOne","emitCustomEvent","eventName","customEvent","CustomEvent","detail","bubbles","cancelable","composed","dispatchEvent","raisedByPB","viewPromotion","args","event","eventData","event_raised_by","ecommerce","Object","keys","length","id","creative","name","position","ecommerceData","promotion_id","promotion_name","creative_slot","creative_name","gtmDataObject","push","selectPromotion","cta_name","Viewport","node","observer","IntersectionObserver","IntersectionObserverEntry","onChange","threshold","rootMargin","el","Element","observe","observables","forEach","observable","isIntersecting","track","unobserve","target","requestIdleCallback","runTrack","setTimeout","ZoneTracking","cleanedData","isObjectEmpty","helper","is","innerWidth","vw","devicePixelRatio","mobile","mobile_tablet","tablet","desktop","retina","lt","ref","Hotspot","campaign","parentProps","closest","tracking","zoneTracking","media","headline","subhead","accessibility","copywriting","selectedMedia","viewportHelper","src","alt","productsInPic","renderHotspotTooltip","markers","marker","idx","join","getMarketCode","dataLayer","padlNamespace","app","market","toLocaleLowerCase","COMMON_URL","ORGANIC_LOGO_IMG_EU","ORGANIC_LOGO_IMG_US","ORGANIC_LOGO_IMG_CA","ORGANIC_LOGO_IMG_BR","ORGANIC_LOGO_IMG_JP","ORGANIC_LOGO_IMG_BE","organicLogoImg","getOrganicLogo","getMaxIntensity","technologies","INTENSITY_MAX_OL","indexOf","getMergedProductCoffeeData","product","pageBuilderProductProps","pageBuilderProps","priceFormatter","currency","bundle_details","options","show_sleeve_price","isBundledResult","showCapsulePrice","price_per_capsule","final_price","bundled","price","Math","round","getFinalPrice","option","intensity","capsuleProperties","max_intensity","short","show_capsule_price","getCurrentVoltage","VOLTAGE_110","getColorModel","category","colorCategories","colorShade","code","cssColorCode","internationalId","link","url","getVoltageSwitcher","colorVariants","voltage_list","currentVoltage","oppositeVoltages","voltage","label","oppositeVoltage","pop","oppositeVoltageMachineName","oppositeVariation","machine","selected","apiOverride","pageBuilderData","images","description","api_override","image","icon","main","getMergedProductData","variant","labels","strikethrough_price","additional_message","additional_message_icon","additional_message_link","longSku","unit_quantity","category_name","rangeData","label_range","variation","image_alt_text","pdpURLs","highlighted","dataTransformObjectProductType","getMergedProductMachineData","show_voltage","voltage_label","a11y_voltage_label","ratingsAndReviews","ratings","voltageData","colors","productColor","activeSku","max_colors","show_ratings","minimum_rating","getMergedProductAccessoryData","getMergedProductGiftCardData","_","default_image","HotspotTooltip","isActive","classes","tooltip","preview","previewIsActive","tooltipId","result","characters","i","charAt","floor","random","makeId","adjustTooltipsPosition","bind","onReady","then","async","priceFormat","getPriceFormatter","config","padl","namespace","yCord","xCord","tooltipElement","querySelector","renderPreview","productName","setAttribute","title","adjustTooltipsPreviewPosition","bindEvents","productInfo","mergedProductData","tag","getSkuComponentByType","is_machine_b2b","elementProduct","document","createElement","outerHTML","closeCurrentPreview","classList","remove","boundOnTooltipMouseoverClick","add","spotIdx","getAttribute","tracking_label","parseInt","boundOnTooltipMouseleave","addEventListener","contains","replaceClasses","oldClass","newClass","disconnectedCallback","removeEventListener","imgRect","parentElement","getBoundingClientRect","bgSize","style","left","width","top","height","hotspot","spaceAbove","spaceBelow","spaceLeft","spaceRight","calculateSpaces","setPreviewVisibility","previewWidth","previewHeight","getPreviewDimensions","horizontalPosition","getHorizontalPosition","verticalPosition","getVerticalPosition","applyPreviewPosition","hotspotRect","tooltipRect","bottom","right","visibility","display","offsetWidth","offsetHeight","Hotspots","activeCategory","subtitle","layout","padding_top","padding_bottom","renderCategories","renderItems","categories","element","index","category_title","toggleCategoryClickHandler","categoryElement","categoryId","querySelectorAll","unbindEvents"],"mappings":"AAAA,MAEMA,EAAcC,IACVC,MAAAA,EAHMD,CAAAA,GAAcA,EAAWE,MAAKC,GAAoC,SAAvBA,EAAUC,WAGpDC,CAAQ,IAAIL,IACnBM,EAAQ,IAAIN,GACbO,QAAOJ,GAAoC,SAAvBA,EAAUC,WAC9BI,QAAO,CAACC,EAAKC,KACH,IAAKD,EAAK,CAACC,EAAKN,UAAWM,EAA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