{"version":3,"file":"index.es.min.js","sources":["../../../packages/components/src/nespressoElement/nespressoElement.js","../../../packages/components/src/constants.mjs","../../../packages/helpers/src/catalog.js","../../../packages/components/src/sku/services/index.js","../../../packages/helpers/src/dataLayer.js","../../../packages/helpers/src/cremaDataHelper.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/sku-main-info.dto.js","../../../packages/helpers/src/utils.ts","../../../packages/components/src/sku/constants.mjs","../../../packages/components/src/sku-coffee/services/index.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/product.coffee.dto.js","../../../services/plp/services.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/product.machine.dto.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/product.dto.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/product.accessory.dto.js","../../../packages/page-builder-sections/src/sku-main-info/dataTransform/product.giftCard.dto.js","../../../services/pdp-data/src/prod/index.js","../../../packages/helpers/src/refs.helpers.js","../../../packages/helpers/src/props.helpers.js","../../../packages/helpers/src/events.helpers.ts","../../../packages/helpers/src/gtmEvents.js","../../../packages/components/src/cta-3d/js/ar.service.js","../../../packages/components/src/cta-3d/cta-3d.js","../../../packages/helpers/src/assets/js/eventDispatch.js","../../../packages/page-builder-sections/src/sku-main-info/services/ldjson.js","../../../packages/helpers/src/rating.service.js","../../../packages/page-builder-sections/src/sku-main-info/sku-main-info.js","../../../packages/components/src/add-to-cart-bar/services/index.js","../../../packages/helpers/src/htmlElement.js"],"sourcesContent":["export class NespressoElement extends HTMLElement {\n constructor() {\n super()\n this.template = ''\n }\n\n connectedCallback() {\n this.props = this._createProps()\n this.onStart?.()\n this.loadTemplate()\n this.onReady?.()\n }\n\n /**\n * Load the attributes and create the props object\n * @returns {any}\n * @private\n */\n _createProps(forceAttributes = null) {\n const attributes = forceAttributes || this.attributes\n\n const getData = attr => attr.find(attribute => attribute.nodeName === 'data')\n\n let props\n try {\n props = [...attributes].reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n const data = getData([...attributes])\n\n if (data === undefined || data === null) {\n return props\n }\n\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log(this.nodeName, 'ERROR: No data', error)\n }\n }\n\n /**\n * Render by DOM diff\n */\n render(force = false) {\n if (force) {\n // todo review the performance of this\n this.innerHTML = ''\n }\n /**\n * Convert a template string into HTML DOM nodes\n * @param {String} str The template string\n * @return {Node} The template HTML\n */\n const _stringToHTML = str => {\n const parser = new DOMParser()\n const doc = parser.parseFromString(str, 'text/html')\n return doc.body\n }\n\n /**\n * Compare the template to the UI and make updates\n * @param {Node} template The template HTML\n * @param {Node} elem The UI HTML\n */\n const _diff = (template, elem) => {\n /**\n * Get the type for a node\n * @param {Node} node The node\n * @return {String} The type\n */\n const _getNodeType = node => {\n if (node.nodeType === 3) {\n return 'text'\n }\n if (node.nodeType === 8) {\n return 'comment'\n }\n return node.tagName.toLowerCase()\n }\n\n /**\n * Get the content from a node\n * @param {Node} node The node\n * @return {String} The type\n */\n const _getNodeContent = node => {\n if (node.childNodes && node.childNodes.length > 0) {\n return null\n }\n return node.textContent\n }\n\n // Get arrays of child nodes\n const domNodes = Array.prototype.slice.call(elem.childNodes)\n const templateNodes = Array.prototype.slice.call(template.childNodes)\n\n // If extra elements in DOM, remove them\n var count = domNodes.length - templateNodes.length\n if (count > 0) {\n for (; count > 0; count--) {\n domNodes[domNodes.length - count].parentNode.removeChild(\n domNodes[domNodes.length - count]\n )\n }\n }\n\n // Diff each item in the templateNodes\n templateNodes.forEach(function (node, index) {\n // If element doesn't exist, create it\n if (!domNodes[index]) {\n elem.appendChild(node.cloneNode(true))\n return\n }\n\n // If element is not the same type, replace it with new element\n if (_getNodeType(node) !== _getNodeType(domNodes[index])) {\n domNodes[index].parentNode.replaceChild(node.cloneNode(true), domNodes[index])\n return\n }\n\n // If content is different, update it\n const templateContent = _getNodeContent(node)\n if (templateContent && templateContent !== _getNodeContent(domNodes[index])) {\n domNodes[index].textContent = templateContent\n }\n\n // If target element should be empty, wipe it\n if (domNodes[index].childNodes.length > 0 && node.childNodes.length < 1) {\n domNodes[index].innerHTML = ''\n return\n }\n\n // If element is empty and shouldn't be, build it up\n // This uses a document fragment to minimize reflows\n if (domNodes[index].childNodes.length < 1 && node.childNodes.length > 0) {\n const fragment = document.createDocumentFragment()\n _diff(node, fragment)\n domNodes[index].appendChild(fragment)\n return\n }\n\n // If there are existing child elements that need to be modified, diff them\n if (node.childNodes.length > 0) {\n _diff(node, domNodes[index])\n }\n })\n }\n\n // todo - add support to reactivity\n // this.template(this.state)\n const templateHTML = _stringToHTML(this.template)\n _diff(templateHTML, this)\n }\n\n /**\n * Set the HTML to be used in the template\n * @param {String} html The HTML to use\n *\n * This function is overwritten by the extended class to set the HTML\n *\n */\n loadTemplate(template = '', force = false) {\n this.template = template === '' ? this.template : `${template}`\n this.render(force)\n }\n\n disconnectedCallback() {\n this.onDestroy?.()\n }\n}\n\ncustomElements.get('nb-nespresso-element') ||\n customElements.define('nb-nespresso-element', NespressoElement)\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","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","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 {\n getVertuoNext,\n getOrganicEu,\n getLabels,\n getProductHighlight,\n getFairTrade,\n getRainforest,\n getSustainability,\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} pdpData : original PDP data\n */\nexport async function getMergedPDPData(pdpData) {\n if (!pdpData) {\n console.error('PDP data is not available')\n return\n }\n const { configuration: { eCommerceData: { categories, product } = {} } = {} } = pdpData\n\n if (product.ranges && product.ranges.length > 0) {\n const rangeId = product.ranges[0]\n const category = categories.find(category => category.id === rangeId)\n if (category != null) {\n product.rangeData = category\n }\n }\n\n addLabels(categories, product)\n addFairTrade(categories, product)\n addProductHighlight(categories, product)\n addVertuoNext(categories, product)\n addOrganicEu(categories, product)\n addRainforest(categories, product)\n addSustainability(categories, product)\n addArabica(categories, product)\n\n return pdpData\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 {product} product\n */\nfunction addLabels(categories, product) {\n const labels = getLabels(categories).map(label => label.description)\n product.labels = labels\n}\n\nfunction addVertuoNext(categories, product) {\n const onlyVertuoNext = getVertuoNext(categories)\n if (!onlyVertuoNext) {\n return\n }\n product.onlyVertuoNext = true\n}\n\nfunction addOrganicEu(categories, product) {\n if (getOrganicEu(categories)) {\n product.organicEu = true\n }\n}\n\nfunction addRainforest(categories, product) {\n if (getRainforest(categories)) {\n product.rainforest = true\n }\n}\n\nfunction addSustainability(categories, product) {\n if (getSustainability(categories)) {\n product.sustainability = true\n }\n}\nfunction addArabica(categories, product) {\n if (getArabica(categories)) {\n product.arabica = true\n }\n}\n\n/**\n * adds highlighted property to products containing the product highlight category assigned to it\n * product highlight is a category recognized by ID\n * to apply a the product highlight on a given product, the product highlight productGroup has to contain the product\n * this function has to clean the productGroups as well by removing the product highlight one\n * @param {category[]} categories\n * @param {product} product\n */\nfunction addProductHighlight(categories, product) {\n const productHighlight = getProductHighlight(categories)\n if (!productHighlight) {\n return\n }\n product.highlighted = true\n}\n/**\n * adds fairTrade property to products containing the faire trade category assigned to it\n * Fair trade is a category recognized by ID\n * to apply a the fair trade on a given product, the faire trade productGroup has to contain the product\n * this function has to clean the productGroups as well by removing the fair trade one\n * @param {category[]} categories\n * @param {productGroup[]} productGroups\n * @param {product[]} products\n */\nfunction addFairTrade(categories, product) {\n const fairTrade = getFairTrade(categories)\n if (!fairTrade) {\n return\n }\n product.fairTrade = fairTrade.name\n}\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 '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\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, '"').replace(/'/g, ''')\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","export const VARIATION_PLP = 'plp'\nexport const VARIATION_PDP = 'pdp'\nexport const VARIATION_CROSS_SELL = 'cross-sell'\nexport const VARIATION_SMALL = 'small'\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 { VARIATION_PDP } from '@kissui/components/src/sku/constants'\nimport { getMaxIntensity } from '@kissui/components/src/sku-coffee/services'\n\nexport const getMergedProductCoffeeData = (pdpData, pageBuilderProps, priceFormatter, currency) => {\n const { variant } = pageBuilderProps.copywriting\n const { show_sleeve_price, show_sleeve } = variant\n const { product } = pdpData.configuration.eCommerceData\n\n const isBundledResult = isBundled(product)\n product.bundled = isBundledResult\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_label: pdpData.configuration.translations[\n 'productdetailsrespblock.capsule.a11y.intensity'\n ]\n .replace('{intensity}', '')\n .trim(),\n intensity: product.intensity,\n max_intensity: getMaxIntensity(product),\n variation: VARIATION_PDP,\n price_per_capsule: price_per_capsule\n ? priceFormatter.short(currency, price_per_capsule)\n : null,\n showCapsulePrice,\n show_capsule_price: showCapsulePrice,\n raw_price: final_price\n }\n\n if (show_sleeve_price || show_sleeve) {\n option.price = priceFormatter.short(currency, final_price)\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 = (pdpData, pageBuilderProps) => {\n const { variant } = pageBuilderProps.copywriting\n const { show_voltage, voltage_label, a11y_voltage_label, voltage_list } = variant\n const { colorVariants, product, ratingsAndReviews } = pdpData.configuration.eCommerceData\n\n // lists header props not coming from this.props\n let options = {\n activeSku: product.internationalId,\n max_colors: 99,\n ...ratingsAndReviews\n }\n\n options.colors = colorVariants.map(productColor => getColorModel(productColor))\n if (!options.colors || !options.colors.length) {\n const { colors = [] } = variant\n options.colors = colors\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 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 { sanitizeString } from '@kissui/helpers/src/utils'\nimport { getTechnologyName } from '@kissui/helpers/src/cremaDataHelper'\nimport { getMergedProductCoffeeData } from './product.coffee.dto'\nimport { getMergedProductMachineData } from './product.machine.dto'\nimport { getMergedProductAccessoryData } from './product.accessory.dto'\nimport { getMergedProductGiftCardData } from './product.giftCard.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'\nimport { VARIATION_PDP } from '@kissui/components/src/sku/constants'\n\nexport const getMergedProductData = (pdpData, pageBuilderProps, priceFormatter, currency) => {\n if (!pdpData) {\n console.error('PDP data is not available')\n return {}\n }\n const { variant } = pageBuilderProps.copywriting\n const { strikethrough_price, labels, additional_message, additional_message_icon } = variant\n\n const { product, categories } = pdpData.configuration.eCommerceData\n\n // lists header props not coming from this.props\n let options = {\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 raw_price: product.price,\n originalPrice: product.price,\n strikethrough_price: strikethrough_price || '',\n variation: VARIATION_PDP,\n image_alt_text: product.name,\n image: product.images?.icon,\n inStock: product.inStock,\n additional_message: additional_message || '',\n additional_message_icon: additional_message_icon || '',\n ...apiOverride(product, variant)\n }\n\n const labelTechnology = getTechnologyName(product, categories)\n if (labelTechnology) {\n options.label_technology = labelTechnology\n }\n\n if (product.highlightLabels?.length) {\n // Use native HMC highlight labels\n options.labels = product.highlightLabels.map(label => ({\n name: label.text,\n color: label.textColor,\n bgColor: label.backgroundColor\n }))\n } else {\n if (labels?.length) {\n // Use labels from Page Builder\n options.labels = labels\n }\n\n if (product?.labels.length) {\n // If labels are specificed in HMC data then use them\n options.labels = product.labels.map(label => JSON.parse(label))\n }\n }\n\n if (product.highlighted) {\n options.highlighted = product.highlighted\n }\n\n let dataTransformObjectProductType = {}\n if (product.type === ECAPI_TYPE_CAPSULE) {\n dataTransformObjectProductType = getMergedProductCoffeeData(\n pdpData,\n pageBuilderProps,\n priceFormatter,\n currency\n )\n } else if (product.type === ECAPI_TYPE_MACHINE) {\n dataTransformObjectProductType = getMergedProductMachineData(pdpData, pageBuilderProps)\n } else if (product.type === ECAPI_TYPE_ACCESSORY) {\n dataTransformObjectProductType = getMergedProductAccessoryData(pdpData, pageBuilderProps)\n } else if (product.type === ECAPI_TYPE_GIFT_CARD) {\n dataTransformObjectProductType = getMergedProductGiftCardData(pdpData, pageBuilderProps)\n }\n\n return {\n ...product,\n ...variant,\n ...options,\n ...dataTransformObjectProductType\n }\n}\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 { getDataLayer } from '@kissui/helpers/src/dataLayer'\n\nexport async function setPDPDataProvider() {\n window.getPDPData = window.getPDPData || getPDPData\n}\n\nexport async function getPDPData() {\n return await window.pdpData\n}\n\nexport async function market() {\n return napi.market().read() // eslint-disable-line\n}\n\nexport function getCurrency() {\n return getDataLayer().currency\n}\n\nexport async function getPriceFormatter() {\n return napi.priceFormat() // eslint-disable-line\n}\n","const createRefs = component => [...component.querySelectorAll('[data-ref]')].reduce(extract, {})\n\nconst extract = (refs, $ref) => {\n const { ref } = $ref.dataset\n\n // Check if ref is of type array\n const refArray = ref.match(/(\\w+)\\[(.+)\\]/)\n\n if (refArray !== null) {\n return getRefArray(refs, $ref, refArray)\n } else {\n return { ...refs, [$ref.dataset.ref]: $ref }\n }\n}\n\nconst getRefArray = (refs, $ref, [, name, index]) => {\n if (refs[name] === undefined) {\n refs[name] = []\n }\n refs[name][index] = $ref\n return refs\n}\n\nexport default createRefs\n","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 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 { customEvent, viewPromotion } from '@kissui/helpers/src/gtmEvents'\nimport { loadExternalScript } from '@kissui/helpers/src/utils'\nimport { getLangCode } from '@kissui/helpers/src/dataLayer'\n\n/**\n * AR 3D machine service\n *\n */\nconst service = element => {\n const QUERY_PARAMETER_SEEKQR = 'seekQR'\n const QUERY_PARAMETER_OCAVUQR = 'ocavuQR'\n const { key_3d: modelKey = '' } = element.props\n const { cta: $cta } = element.refs\n let launchOnReady = false\n\n const _onScriptLoaded = () => {\n $cta.addEventListener('mouseover', _preload, { once: true })\n if (launchOnReady) {\n launch()\n }\n }\n\n const _preload = () => {\n if (_isMobile() || !window.seek.state.availableFeatures.webgl) {\n return\n }\n const experienceTarget = createWrapper()\n window.seek.launchExperience(\n _getExperienceKey(),\n { modelKey, requestedEngine: 'webgl' },\n { experienceTarget }\n )\n }\n\n const _isMobile = () => ['iOS', 'Android'].includes(window.seek.state.platform.os)\n\n const _getExperienceKey = () => (_isMobile() ? 'seekview' : 'viewer-qr-showcase')\n\n const userScannedQRCode = () => {\n const { sku_data } = element.props\n const skuData = JSON.parse(sku_data)\n\n const urlParams = new URLSearchParams(window.location.search)\n const isUserScannedQRCode =\n urlParams.has(QUERY_PARAMETER_SEEKQR) || urlParams.has(QUERY_PARAMETER_OCAVUQR)\n if (!isUserScannedQRCode) {\n return\n }\n\n launch()\n\n customEvent({\n eventAction: 'Click CTA',\n eventLabel: 'AR Models - Run Experience - Seek View'\n })\n\n customEvent({\n event: 'page_builder_component_interaction',\n event_raised_by: 'page builder',\n component_name: skuData.component_name,\n action_type: 'ar run experience',\n item_id_event: skuData.item_id_event,\n item_name_event: skuData.item_name_event,\n item_category_event: skuData.item_category_event,\n item_technology_event: skuData.item_technology_event,\n item_range_event: skuData.item_range_event,\n item_price_event: skuData.item_price_event,\n event_GA4: true\n })\n }\n\n const onExperienceLaunched = () => {\n window.seek.removeEventListener('experienceLaunched', onExperienceLaunched)\n $cta.removeAttribute('disabled')\n\n viewPromotion()\n }\n\n const createWrapper = () => {\n const wrapper = document.createElement('div')\n wrapper.style.display = 'none'\n\n const bodyTag = document.getElementsByTagName('body')[0]\n bodyTag.parentNode.insertBefore(wrapper, bodyTag)\n\n return wrapper\n }\n\n const launch = () => {\n if (!window.seek) {\n launchOnReady = true\n return\n }\n\n launchOnReady = false\n window.seek.addEventListener('experienceLaunched', onExperienceLaunched)\n window.seek.config.defaultContext.selectedLanguageCode = getLangCode()\n window.seek.launchExperience(_getExperienceKey(), { modelKey })\n $cta.setAttribute('disabled', 'disabled')\n }\n\n if (!window.seek) {\n loadExternalScript({\n src: 'https://view.seekxr.com/nespresso/seek.min.js',\n defer: true,\n callback: _onScriptLoaded\n })\n }\n\n return { launch, userScannedQRCode }\n}\n\nexport default service\n","import createProps from '@kissui/helpers/src/props.helpers'\nimport createRefs from '@kissui/helpers/src/refs.helpers'\nimport eventsHelper from '@kissui/helpers/src/events.helpers'\nimport { customEvent } from '@kissui/helpers/src/gtmEvents'\nimport arService from './js/ar.service'\n\nclass Cta3D extends HTMLElement {\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.render()\n this.refs = createRefs(this)\n this.createEventListeners()\n\n this.arService = arService(this)\n this.arService.userScannedQRCode()\n }\n\n createEventListeners() {\n const listeners = [\n {\n element: this.refs.cta,\n type: 'click',\n listener: this.onClick.bind(this)\n }\n ]\n eventsHelper.add(listeners)\n this.eventListeners = listeners\n }\n\n render() {\n const {\n key_3d = '',\n label_button_3d = '',\n tracking_label,\n variation = 'secondary',\n sku_data\n } = this.props\n\n const skuData = JSON.parse(sku_data)\n\n customEvent({\n event: 'page_builder_component_interaction',\n event_raised_by: 'page builder',\n component_name: skuData.component_name,\n action_type: 'ar impression',\n item_id_event: skuData.item_id_event,\n item_name_event: skuData.item_name_event,\n item_category_event: skuData.item_category_event,\n item_technology_event: skuData.item_technology_event,\n item_range_event: skuData.item_range_event,\n item_price_event: skuData.item_price_event,\n event_GA4: true\n })\n\n this.innerHTML = `\n <nb-cta\n data-ref=\"cta\"\n class=\"cta__3d\"\n icon_right=\"24/symbol/360-view\"\n link=\"${key_3d}\"\n tracking_label=\"${tracking_label}\"\n variation=\"${variation}\"\n >${label_button_3d}</nb-cta>\n `\n }\n\n async onClick($event) {\n const { sku_data } = this.props\n const skuData = JSON.parse(sku_data)\n\n $event.preventDefault()\n this.arService.launch()\n\n customEvent({\n eventAction: 'Click CTA',\n eventLabel: 'AR Models - Popin - Click CTA'\n })\n\n customEvent({\n event: 'page_builder_component_interaction',\n event_raised_by: 'page builder',\n component_name: skuData.component_name,\n action_type: 'ar click',\n item_id_event: skuData.item_id_event,\n item_name_event: skuData.item_name_event,\n item_category_event: skuData.item_category_event,\n item_technology_event: skuData.item_technology_event,\n item_range_event: skuData.item_range_event,\n item_price_event: skuData.item_price_event,\n event_GA4: true\n })\n }\n}\n\ncustomElements.get('nb-cta-3d') || customElements.define('nb-cta-3d', Cta3D)\n\nexport default Cta3D\n","export const dispatchEvent = ({ eventName, args, element }) => {\n // Use the provided element or fallback to window if available\n if (!element) {\n if (typeof window !== 'undefined') {\n element = window\n } else {\n throw new Error(\n '`element` is not provided and `window` is unavailable. Provide a valid element to dispatch the event.'\n )\n }\n }\n\n let event\n if (args) {\n event = new CustomEvent(eventName, { detail: args, bubbles: true })\n } else {\n if (typeof Event === 'function') {\n event = new Event(eventName)\n } else {\n event = document.createEvent('Event')\n event.initEvent(eventName, true, true)\n }\n }\n element.dispatchEvent(event)\n}\n\nexport const readEvent = e => {\n if (!e.detail) {\n return\n }\n return e.detail\n}\n","import { isRated } from '@kissui/helpers/src/rating.service'\nimport { stripTags } from '@kissui/helpers/src/utils'\n\nconst buildSchemaRatings = product => {\n if (!isRated(product, 3)) {\n return {}\n }\n\n const { ratingAverage, reviewCount } = product\n\n return {\n aggregateRating: {\n '@type': 'AggregateRating',\n ratingValue: ratingAverage.toFixed(2),\n reviewCount: reviewCount\n }\n }\n}\n\nexport const buildSchema = product => {\n const {\n name,\n image,\n description,\n originalPrice,\n inStock,\n currency,\n legacyId,\n id,\n salesMultiple,\n url\n } = product\n\n if (!description) {\n return\n }\n\n const STRUCTURED_DATA_IN_STOCK = 'InStock'\n const STRUCTURED_DATA_OOS = 'OutOfStock'\n const availability = inStock ? STRUCTURED_DATA_IN_STOCK : STRUCTURED_DATA_OOS\n\n const data = {\n '@context': 'https://schema.org/',\n '@type': 'Product',\n name,\n image: convertToFullUrl(image.url),\n description: stripTags(description),\n sku: id,\n mpn: legacyId,\n offers: {\n '@type': 'Offer',\n price: originalPrice * salesMultiple,\n priceCurrency: currency,\n availability: `https://schema.org/${availability}`,\n url: convertToFullUrl(url)\n },\n ...buildSchemaRatings(product)\n }\n\n if (salesMultiple > 1) {\n data.offers.priceSpecification = {\n '@type': 'PriceSpecification',\n price: originalPrice,\n priceCurrency: currency,\n eligibleQuantity: salesMultiple\n }\n }\n return data\n}\n\nconst convertToFullUrl = url => {\n if (url.indexOf('nespresso.com') === -1) {\n url = `https://www.nespresso.com${url}`\n }\n\n return url\n}\n","// Caching mechanism for ratings\nconst API_RATING_CACHE_TTL = 86400000 // 24 hrs\nconst API_RATING_CACHE_PREFIX = 'n-ratings-'\n\nconst setWithExpiry = (key, value) => {\n const now = new Date()\n\n // 'item' is an object which contains the original value\n // as well as the time when it's supposed to expire\n const item = {\n value: value,\n expiry: now.getTime() + API_RATING_CACHE_TTL\n }\n localStorage.setItem(key, JSON.stringify(item))\n}\n\nconst getWithExpiry = key => {\n const itemStr = localStorage.getItem(key)\n if (!itemStr) return undefined\n\n const item = JSON.parse(itemStr)\n const now = new Date()\n\n // compare the expiry time of the item with the current time\n if (now.getTime() > item.expiry) {\n // If the item is expired, delete the item from storage and return null\n localStorage.removeItem(key)\n return undefined\n }\n\n return item.value\n}\n\nexport const getEncodedProductId = longSku => window.btoa(longSku)\n\nexport const getRatingDetails = async sku => {\n const key = `${API_RATING_CACHE_PREFIX}${sku}`\n let data = getWithExpiry(key)\n if (data === undefined) {\n // already expired or not cached\n data = await window.napi.ratings().summary(sku)\n setWithExpiry(key, data)\n }\n return data\n}\n\nexport const isRatingEnabled = product =>\n product.productRatings && product.productRatings.ratingEnabled\n\nexport const isRated = (productRatings, minimum_rating) =>\n productRatings.reviewCount > 0 &&\n productRatings.ratingAverage > 0 &&\n productRatings.ratingAverage >= minimum_rating\n\nexport const getRatingPercentage = ratingSpread => {\n const ratingAverageSum = ratingSpread.reduce((partialSum, value) => partialSum + value, 0)\n\n return ratingSpread.map(element => {\n return (element / ratingAverageSum) * 100\n })\n}\n\nexport const checkIfReviewsAvailable = ratingsResult => ratingsResult.reviewCount > 0\n\nexport const getProductReviews = async (\n market,\n language,\n encodedProductId,\n sort = 'highlightedFirst',\n page = 0\n) => {\n const url = `/ecapi/rating/v1/${market}/${language}/${encodedProductId}/read?platform=desktop&page=${page}&sort=${sort}`\n const response = await fetch(url)\n\n return response.json()\n}\n\nexport const postLike = async (market, language, encodedProductId, reviewId) => {\n const url = `/ecapi/rating/v1/${market}/${language}/${encodedProductId}/${reviewId}/like`\n\n const response = await fetch(url, {\n method: 'POST'\n })\n\n return response.json()\n}\n\nexport const getNapiProductReviews = async (sku, sort = 'highlightedFirst', page = 0) => {\n return window.napi.ratings().read(sku, sort, page)\n}\n\nexport const postNapiLike = async (sku, reviewId) => {\n return window.napi.ratings().like(sku, reviewId)\n}\n","import { NespressoElement } from '@kissui/components/src/nespressoElement'\nimport { getSkuComponentByType } from '@kissui/components/src/sku/services'\nimport { getAddToCartBarByType } from '@kissui/components/src/add-to-cart-bar/services'\nimport { getMergedPDPData, getMergedProductData } from './dataTransform'\nimport { getPriceFormatter, market, setPDPDataProvider } from '@kissui/pdp-data'\nimport { getMetaContent, stringifyForAttribute } from '@kissui/helpers/src/utils'\nimport createRefs from '@kissui/helpers/src/refs.helpers'\nimport '@kissui/components/src/cta-3d'\nimport {\n handlePromoClick,\n trackAddToCartImpression,\n trackDetailView\n} from '@kissui/helpers/src/gtmEvents'\nimport { dispatchEvent } from '@kissui/helpers/src/assets/js/eventDispatch'\nimport {\n B2B_CONTACT_FORM_POPIN_ID,\n EVENT_POPIN_OPEN,\n B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO\n} from '@kissui/components'\nimport { buildSchema } from './services/ldjson'\nimport { appendSchema } from '@kissui/helpers/src/htmlElement'\nimport { ASPECT_RATIO_16_9, ASPECT_RATIO_1_1 } from '@kissui/components/src/constants'\nimport { getTechnologyName } from '@kissui/helpers/src/catalog'\n\nconst SKU_MAIN_INFO_IMAGE_ID = 'SKU_MAIN_INFO_IMAGE_ID'\n\nclass SkuMainInfo extends NespressoElement {\n constructor(props) {\n super(props)\n this.boundOpenPopin = this.onOpenPopin.bind(this)\n this.boundOnIntersection = this.onIntersection.bind(this)\n }\n\n onStart() {\n setPDPDataProvider()\n this.setSkuTypeForBackgroundSize()\n const { campaign, layout } = this.props\n const { contrast, background } = layout\n const { variant } = this.props.copywriting\n\n // Sticky Add to Cart PDP is available only for Capsules PDPs,\n // currently unavailable for Machines and Accessories\n // docs: https://nestle.atlassian.net/wiki/spaces/WEBMASTERING/pages/126682112/Sticky+add+to+cart+PDP+-+Webmaster+Wikis+-+Product+Catalog\n this.useAddToCartBar = variant.is_capsule\n ? window.OVERWRITE_SKU_MAIN_INFO_STICKY_BAR_SHOW ||\n this.props.copywriting.add_to_cart_bar?.use_add_to_cart_bar\n : false\n\n this.useAddToCartBarTemplate = this.useAddToCartBar\n ? `<div data-ref=\"pdpAddToCartBar\"></div>`\n : ''\n\n this.template = `<nb-container\n class=\"sku-main-info__container\"\n contrast='${contrast}'\n campaign_id=\"${campaign.id}\"\n campaign_name=\"${campaign.name}\"\n campaign_creative=\"${campaign.creative}\"\n campaign_position=\"${campaign.position}\"\n background_mobile='${background.mobile}'\n background_desktop='${background.desktop}'\n background_retina='${background.retina}'\n lazy_load=\"false\">\n <div class=\"cb-col1\">\n ${this.renderLink()}\n ${this.renderImage()}\n <div data-ref=\"checkIn3D\"></div>\n ${this.renderDisclaimer()}\n </div>\n <article class=\"cb-col2\" data-ref=\"col2\">\n <div class=\"cb-card-placeholder\">\n <nb-loader></nb-loader>\n </div>\n </article>\n </nb-container>\n ${this.useAddToCartBarTemplate}\n `\n }\n\n setSkuTypeForBackgroundSize() {\n const { variant } = this.props.copywriting\n\n // For background size, only coffee needs a smaller one (because product image is 16/9 aspect ratio)\n // We cannot use the is-nb-sku-coffee class set by renderSku() method because it's set too late, only when API return product type\n if (variant.is_capsule) {\n this.classList.add('is-coffee')\n }\n }\n\n async onReady() {\n this.refs = createRefs(this)\n const payloads = await Promise.all([\n getMergedPDPData(await window.getPDPData()),\n market(),\n getPriceFormatter()\n ])\n\n const [pdpData, { currency }, priceFormatter] = payloads\n this.currency = currency\n this.pdpData = pdpData\n this.product = getMergedProductData(this.pdpData, this.props, priceFormatter, currency)\n\n this.replaceImageAltTxt()\n this.renderSku()\n this.renderCheck3D()\n this.addToBagContainer =\n this.querySelector('nb-add-to-cart') || document.getElementsByTagName('nb-cta')[0]\n this.footerBottom = document.querySelector('nb-footer-bottom')\n this.renderAddToCartBar()\n\n this.bindEvent()\n this.addSchema()\n\n await trackDetailView(this.product.id)\n trackAddToCartImpression(this.product, this.useAddToCartBar)\n }\n\n getColorFromContrast() {\n const { contrast } = this.props.layout\n return contrast === 'light' ? 'black' : 'white'\n }\n\n renderLink() {\n const { link, label, seo_label } = this.props.copywriting.link\n\n if (!label) {\n return ''\n }\n\n return `<nb-link\n link='${link}'\n seo_label='${seo_label}'\n color='${this.getColorFromContrast()}' size='large'\n >${label}</nb-link>`\n }\n\n renderImage() {\n const { image } = this.props.copywriting\n\n // 1. If aspect ratio is specified in Page Builder then use it\n if (image.aspect_ratio === ASPECT_RATIO_16_9 || image.aspect_ratio === ASPECT_RATIO_1_1) {\n return `<nb-img file=\"${image.retina}\" description=\"${image.alt_text}\" aspect_ratio=\"${image.aspect_ratio}\" fetchpriority=\"high\" object_fit=\"cover\"></nb-img>`\n }\n\n // 2. TODO: If aspect ratio is in the file path then use it\n\n // We need the PDP data to continue so insert a placeholder and insert later\n this.renderImageFromPdpData()\n return `<div id=\"${SKU_MAIN_INFO_IMAGE_ID}\"></div>`\n }\n\n async renderImageFromPdpData() {\n const { variant, image } = this.props.copywriting\n const pdpData = await window.getPDPData()\n const bundled = pdpData?.configuration?.eCommerceData?.product?.bundled ?? false\n\n // 3. If product is a bundle (based on PDP data) then it's 1/1\n if (bundled) {\n document.getElementById(\n SKU_MAIN_INFO_IMAGE_ID\n ).outerHTML = `<nb-img id=\"${SKU_MAIN_INFO_IMAGE_ID}\" file=\"${image.retina}\" description=\"${image.alt_text}\" aspect_ratio=\"${ASPECT_RATIO_1_1}\" fetchpriority=\"high\" object_fit=\"contain\"></nb-img>`\n return\n }\n\n // 4. If product is a capsule then 16/9, otherwise 1/1\n document.getElementById(\n SKU_MAIN_INFO_IMAGE_ID\n ).outerHTML = `<nb-img id=\"${SKU_MAIN_INFO_IMAGE_ID}\" file=\"${image.retina}\" description=\"${\n image.alt_text\n }\" aspect_ratio=\"${\n variant.is_capsule ? ASPECT_RATIO_16_9 : ASPECT_RATIO_1_1\n }\" fetchpriority=\"high\" object_fit=\"contain\"></nb-img>`\n }\n\n replaceImageAltTxt() {\n const imgWebElem = this.querySelector('nb-img')\n\n if (!imgWebElem || !imgWebElem.getAttribute('alt')) {\n return\n }\n imgWebElem.setAttribute('alt', this.product.name)\n\n const imgElem = imgWebElem.querySelector('img')\n if (imgElem) {\n imgElem.setAttribute('alt', this.product.name)\n }\n }\n\n renderDisclaimer() {\n const { disclaimer_text } = this.props.copywriting\n\n if (!disclaimer_text) {\n return ''\n }\n\n return `<small class=\"t-xs-500\">${disclaimer_text}</small>`\n }\n\n renderSku() {\n const { col2 } = this.refs\n const tag = getSkuComponentByType(this.product)\n\n this.classList.add(`is-${tag}`)\n const compatibilityData = this.props?.copywriting?.variant?.compatibility ?? {}\n col2.innerHTML = `<${tag}\n data=\"${stringifyForAttribute(this.product)}\"\n data-compatibility=\"${stringifyForAttribute(compatibilityData)}\"\n ></${tag}>`\n }\n\n renderAddToCartBar() {\n if (!this.useAddToCartBar) {\n return\n }\n\n const { pdpAddToCartBar } = this.refs\n\n const typeStickyBar = getAddToCartBarByType(this.product)\n const data = {\n ...this.product,\n pricePerCapsule: this.product.price_per_capsule,\n ...this.props.copywriting.add_to_cart_bar,\n currency: this.currency\n }\n\n pdpAddToCartBar.innerHTML = `<${typeStickyBar}\n data=\"${stringifyForAttribute(data)}\"\n ></${typeStickyBar}>`\n }\n\n addSchema() {\n if (!this.pdpData?.configuration?.eCommerceData?.product) {\n console.error('PDP data is not available')\n return\n }\n\n const { image } = this.pdpData.configuration.eCommerceData.product\n\n this.product.description =\n this.product?.api_override?.description || getMetaContent('description')\n\n const content = buildSchema({\n ...this.product,\n image,\n currency: this.currency\n })\n\n if (content) {\n appendSchema(content)\n }\n }\n\n renderCheck3D() {\n const { checkIn3D } = this.refs\n const { label_button_3d, key_3d } = this.product\n const { creative } = this.props ? this.props.campaign : ''\n const sku_technology = this.product.technologies ? getTechnologyName(this.product) : ''\n\n const sku_data = {\n item_id_event: this.product.internationalId,\n item_name_event: this.product.internationalName,\n component_name: creative,\n item_category_event: this.product.type,\n item_technology_event: sku_technology,\n item_range_event: this.product.category_name,\n item_price_event: this.product.raw_price\n }\n\n const sku_Data_str = JSON.stringify(sku_data)\n\n if (!key_3d) {\n checkIn3D.parentNode.removeChild(checkIn3D)\n return ''\n }\n\n const elem = document.createElement('nb-cta-3d')\n\n elem.setAttribute('class', 'link__3d')\n elem.setAttribute('key_3d', key_3d)\n elem.setAttribute('label_button_3d', label_button_3d)\n elem.setAttribute('sku_data', sku_Data_str)\n\n checkIn3D.replaceWith(elem)\n }\n\n onOpenPopin() {\n const {\n variant: {\n contact_cta: { contact_cta_text }\n }\n } = this.props.copywriting\n const { campaign } = this.props\n\n handlePromoClick({ campaign, cta_name: `CTA - ${contact_cta_text}` })\n\n const skuArgs = {\n id: B2B_CONTACT_FORM_POPIN_ID,\n srcComponent: B2B_CONTACT_FORM_POPIN_SRC_SKU_MAIN_INFO,\n productName: this.product.name\n }\n\n dispatchEvent({ eventName: EVENT_POPIN_OPEN, args: skuArgs })\n }\n\n isContactCtaFormPopin() {\n const { variant } = this.props.copywriting\n const { contact_cta = {} } = variant\n const { contact_url_anchor } = contact_cta\n return !contact_url_anchor\n }\n\n onIntersection(entries) {\n setTimeout(() => {\n this.addToCartBar = document.getElementsByClassName('c-add-to-cart-bar')[0]\n })\n if (!this.addToCartBar) {\n return\n }\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n this.addToCartBar.classList.remove('c-add-to-cart-bar--visible')\n } else {\n this.addToCartBar.classList.add('c-add-to-cart-bar--visible')\n }\n })\n }\n\n bindEvent() {\n this.contactBtn = this.querySelector(`.cb-content nb-cta`)\n\n this.headerWrapper = document.querySelector('.Header__top-wrapper')\n\n const bindIfHeaderExists = () => {\n if (this.contactBtn && this.isContactCtaFormPopin()) {\n this.contactBtn.addEventListener('click', this.boundOpenPopin)\n }\n\n if (!this.useAddToCartBar) {\n return\n }\n\n this.bindObserver()\n }\n\n // if header was not uploaded before,\n // interval tries to check whether header is uploaded\n // once it's done, interval cleares itself and bind Header\n if (!this.headerWrapper) {\n let intervalCleared = false\n\n const intervalId = setInterval(() => {\n this.headerWrapper = document.querySelector('.Header__top-wrapper')\n\n if (this.headerWrapper) {\n bindIfHeaderExists()\n\n if (intervalId && !intervalCleared) {\n clearInterval(intervalId)\n intervalCleared = true\n }\n }\n }, 1000)\n\n // if interval was not able to find\n // to dedicate moment when header is uploaded\n // setTimeout in 30s manually clear interval\n setTimeout(() => {\n if (intervalId && !intervalCleared) {\n clearInterval(intervalId)\n intervalCleared = true\n }\n }, 30000)\n } else {\n bindIfHeaderExists()\n }\n }\n\n bindObserver() {\n const observerOptions = {\n root: null, // Observe the element in the entire viewport\n threshold: 0, // Trigger the callback when any part of the element is visible or not visible\n rootMargin: this.headerWrapper\n ? `-${this.headerWrapper.offsetHeight}px 0px 0px 0px`\n : '0px'\n }\n\n this.observer = new IntersectionObserver(this.boundOnIntersection, observerOptions)\n this.observer.observe(this.addToBagContainer)\n\n // Ensure sticky add-to-cart-bar not visible when reaching nb-footer-bottom (to avoid covering content)\n this.footerBottom && this.observer.observe(this.footerBottom)\n }\n\n unbindEvent() {\n if (this.contactBtn && this.isContactCtaFormPopin()) {\n this.contactBtn.removeEventListener('click', this.boundOpenPopin)\n }\n\n if (this.observer) {\n this.observer.unobserve(this.addToBagContainer)\n this.footerBottom && this.observer.unobserve(this.footerBottom)\n }\n }\n\n disconnectedCallback() {\n this.unbindEvent()\n }\n}\n\ncustomElements.get('nb-sku-main-info') || customElements.define('nb-sku-main-info', SkuMainInfo)\n\nexport default SkuMainInfo\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 getAddToCartBarByType = ({ type }) => {\n let result = 'nb-add-to-cart-bar'\n\n if (type === ECAPI_TYPE_CAPSULE) {\n result = 'nb-add-to-cart-bar-coffee'\n } else if (type === ECAPI_TYPE_MACHINE) {\n result = 'nb-sku-machine'\n } else if (type === ECAPI_TYPE_ACCESSORY || type === ECAPI_TYPE_GIFT_CARD) {\n result = 'nb-add-to-cart-bar-accessory'\n }\n\n return result\n}\n","/**\n * Return real width for a DOM Node\n * @param {HTMLElement} el\n * @returns {number}\n */\nexport const outerWidth = el => {\n const style = getComputedStyle(el)\n const width = style.getPropertyValue('width') || 0\n const marginLeft = style.getPropertyValue('margin-left') || 0\n const marginRight = style.getPropertyValue('margin-right') || 0\n\n return parseInt(width) + parseInt(marginLeft) + parseInt(marginRight)\n}\n\n/**\n * Return real height for a DOM Node\n * @param {DOM Node} el\n * @returns {number}\n */\nexport const outerHeight = el => {\n const style = getComputedStyle(el)\n const height = style.getPropertyValue('height') || 0\n const marginTop = style.getPropertyValue('margin-top') || 0\n const marginBottom = style.getPropertyValue('margin-bottom') || 0\n\n return parseInt(height) + parseInt(marginTop) + parseInt(marginBottom)\n}\n\nexport const appendSchema = content => {\n const el = window.document.createElement('script')\n el.setAttribute('type', 'application/ld+json')\n el.innerHTML = JSON.stringify(content)\n window.document.head.appendChild(el)\n}\n"],"names":["NespressoElement","HTMLElement","constructor","this","template","connectedCallback","props","_createProps","onStart","loadTemplate","onReady","forceAttributes","attributes","reduce","all","attr","nodeName","nodeValue","data","find","attribute","getData","JSON","parse","error","console","log","render","force","innerHTML","_diff","elem","_getNodeType","node","nodeType","tagName","toLowerCase","_getNodeContent","childNodes","length","textContent","domNodes","Array","prototype","slice","call","templateNodes","count","parentNode","removeChild","forEach","index","appendChild","cloneNode","replaceChild","templateContent","fragment","document","createDocumentFragment","templateHTML","str","DOMParser","parseFromString","body","disconnectedCallback","onDestroy","customElements","get","define","ASPECT_RATIO_16_9","ASPECT_RATIO_1_1","ECAPI_TYPE_CAPSULE","ECAPI_TYPE_MACHINE","ECAPI_TYPE_ACCESSORY","ECAPI_TYPE_GIFT_CARD","TECHNOLOGY_CATEGORY_IDENTIFIER","isBundled","productData","sales_multiple","salesMultiple","isSalesMultipleGreaterThanOne","isUnitQuantityEqualToOne","unitQuantity","isSalesMultipleEqualToOne","isUnitQuantityGreaterThanOne","apiOverride","pageBuilderData","images","name","headline","description","api_override","image","icon","url","push","main","getDataLayer","window","padlNamespace","dataLayer","LABEL_CATEGORY_NAME","LABEL_CATEGORY_NAME_MACHINE","FAIR_TRADE_CATEGORY_NAME","VERTUO_NEXT_CATEGORY_NAME","ORGANIC_EU_CATEGORY_NAME","RAINFOREST_CATEGORY_NAME","SUSTAINABILITY_CATEGORY_NAME","ARABICA_CATEGORY_NAME","PRODUCT_HIGHLIGHT_CATEGORY_NAME","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","getVertuoNext","categories","category","getCategoryRegEx","test","id","isVertuoNext","getOrganicEu","isOrganicEu","getRainforest","isRainforest","getSustainability","isSustainability","getArabica","isArabica","getLabels","filter","isLabel","getProductHighlight","isProductHighlight","getFairTrade","isFairTrade","categoryIdTail","RegExp","replace","async","getMergedPDPData","pdpData","configuration","eCommerceData","product","ranges","rangeId","rangeData","addLabels","labels","map","label","fairTrade","addFairTrade","highlighted","addProductHighlight","onlyVertuoNext","addVertuoNext","organicEu","addOrganicEu","rainforest","addRainforest","sustainability","addSustainability","arabica","addArabica","removeEmptyValues","obj","findText","key","value","text","includes","organicLogoImg","getMarketCode","app","market","toLocaleLowerCase","getOrganicLogo","stringifyForAttribute","escapeHtml","stringify","m","sanitizeString","toString","stripTags","s","getMaxIntensity","technologies","INTENSITY_MAX_OL","indexOf","getMergedProductCoffeeData","pageBuilderProps","priceFormatter","currency","variant","copywriting","show_sleeve_price","show_sleeve","isBundledResult","bundled","showCapsulePrice","price_per_capsule","final_price","type","price","Math","round","getFinalPrice","option","intensity_label","translations","trim","intensity","max_intensity","variation","short","show_capsule_price","raw_price","getCurrentVoltage","VOLTAGE_110","getColorModel","colorCategories","colorShade","code","cssColorCode","sku","internationalId","link","getVoltageSwitcher","colorVariants","voltage_list","currentVoltage","oppositeVoltages","voltage","oppositeVoltage","pop","oppositeVoltageMachineName","oppositeVariation","machine","selected","getMergedProductData","strikethrough_price","additional_message","additional_message_icon","options","longSku","unit_quantity","category_name","label_range","originalPrice","image_alt_text","inStock","labelTechnology","techno","categoryNameAsSubstring","substring","cat","getTechnologyName","label_technology","highlightLabels","color","textColor","bgColor","backgroundColor","dataTransformObjectProductType","getMergedProductMachineData","show_voltage","voltage_label","a11y_voltage_label","ratingsAndReviews","activeSku","max_colors","colors","productColor","voltageData","getMergedProductGiftCardData","_","pageBuilderProductProps","default_image","getPDPData","napi","read","getPriceFormatter","priceFormat","createRefs","component","querySelectorAll","extract","refs","$ref","ref","dataset","refArray","match","getRefArray","undefined","isNil","emitCustomEvent","eventName","customEvent","CustomEvent","detail","bubbles","cancelable","composed","dispatchEvent","eventsHelper","add","eventListeners","eventListener","element","addEventListener","listener","raisedByPB","args","eventData","gtmDataObject","event_GA4","event","eventRaisedBy","event_raised_by","selectPromotion","cta_name","ecommerce","Object","keys","creative","position","ecommerceData","promotion_id","promotion_name","creative_slot","creative_name","getProductInfo","catalog","getProduct","trimSku","service","QUERY_PARAMETER_SEEKQR","key_3d","modelKey","cta","$cta","launchOnReady","_preload","_isMobile","seek","state","availableFeatures","webgl","experienceTarget","createWrapper","launchExperience","_getExperienceKey","requestedEngine","platform","os","onExperienceLaunched","removeEventListener","removeAttribute","viewPromotion","wrapper","createElement","style","display","bodyTag","getElementsByTagName","insertBefore","launch","config","defaultContext","selectedLanguageCode","page","pageInfo","language","setAttribute","loadExternalScript","src","callback","defer","module","script","onload","_onScriptLoaded","once","userScannedQRCode","sku_data","skuData","urlParams","URLSearchParams","location","search","has","eventAction","eventLabel","component_name","action_type","item_id_event","item_name_event","item_category_event","item_technology_event","item_range_event","item_price_event","Cta3D","createProps","createEventListeners","arService","listeners","onClick","bind","label_button_3d","tracking_label","$event","preventDefault","buildSchemaRatings","isRated","productRatings","minimum_rating","reviewCount","ratingAverage","aggregateRating","ratingValue","toFixed","convertToFullUrl","SKU_MAIN_INFO_IMAGE_ID","SkuMainInfo","super","boundOpenPopin","onOpenPopin","boundOnIntersection","onIntersection","setPDPDataProvider","setSkuTypeForBackgroundSize","campaign","layout","contrast","background","useAddToCartBar","is_capsule","OVERWRITE_SKU_MAIN_INFO_STICKY_BAR_SHOW","add_to_cart_bar","use_add_to_cart_bar","useAddToCartBarTemplate","mobile","desktop","retina","renderLink","renderImage","renderDisclaimer","classList","payloads","Promise","replaceImageAltTxt","renderSku","renderCheck3D","addToBagContainer","querySelector","footerBottom","renderAddToCartBar","bindEvent","addSchema","pbTrackDetailViewPDP","productInfo","productPayload","getProductPayload","actionField","internationalName","unitPrice","legacyId","technology","item","split","join","dimension44","dimension53","dimension54","dimension55","dimension56","dimension57","dimension192","brand","currencyCode","products","trackDetailView","trackAddToCartImpression","isStickyBar","item_market_id_event","item_market_name_event","item_type_event","getColorFromContrast","seo_label","aspect_ratio","alt_text","renderImageFromPdpData","getElementById","outerHTML","imgWebElem","getAttribute","imgElem","disclaimer_text","col2","tag","getSkuComponentByType","is_machine_b2b","result","compatibilityData","compatibility","pdpAddToCartBar","typeStickyBar","getAddToCartBarByType","pricePerCapsule","getMetaContent","metaName","metaTag","content","availability","mpn","offers","priceCurrency","priceSpecification","eligibleQuantity","buildSchema","el","head","appendSchema","checkIn3D","sku_technology","sku_Data_str","replaceWith","contact_cta","contact_cta_text","cleanedData","handlePromoClick","Error","Event","createEvent","initEvent","srcComponent","productName","isContactCtaFormPopin","contact_url_anchor","entries","setTimeout","addToCartBar","getElementsByClassName","entry","isIntersecting","remove","contactBtn","headerWrapper","bindIfHeaderExists","bindObserver","intervalCleared","intervalId","setInterval","clearInterval","observerOptions","root","threshold","rootMargin","offsetHeight","observer","IntersectionObserver","observe","unbindEvent","unobserve"],"mappings":"AAAO,MAAMA,UAAyBC,YAClCC,WAAAA,WAEIC,KAAKC,SAAW,EACpB,CAEAC,iBAAAA,GACSC,KAAAA,MAAQH,KAAKI,eAClBJ,KAAKK,YACLL,KAAKM,eACLN,KAAKO,WACT,CAOAH,YAAAA,CAAaI,EAAkB,MAC3B,MAAMC,EAAaD,GAAmBR,KAAKS,WAIvCN,IAAAA,EACA,IACAA,EAAQ,IAAIM,GAAYC,QAAO,CAACC,EAAKC,KAC1B,IAAKD,EAAK,CAACC,EAAKC,UAAWD,EAAKE,aACxC,CAAE,GAEL,MAAMC,EARMH,CAAAA,GAAQA,EAAKI,MAAKC,GAAoC,SAAvBA,EAAUJ,WAQxCK,CAAQ,IAAIT,IAECM,OAAS,MAATA,EACfZ,EAGJ,IAAKA,KAAUgB,KAAKC,MAAML,EAAKD,WACzC,OAAQO,GACLC,QAAQC,IAAIvB,KAAKa,SAAU,iBAAkBQ,EACjD,CACJ,CAKAG,MAAAA,CAAOC,GAAQ,GACPA,IAEAzB,KAAK0B,UAAY,IAOrB,MAWMC,EAAQA,CAAC1B,EAAU2B,KAMrB,MAAMC,EAAeC,GACK,IAAlBA,EAAKC,SACE,OAEW,IAAlBD,EAAKC,SACE,UAEJD,EAAKE,QAAQC,cAQlBC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