{"version":3,"file":"index.es.min.js","sources":["../../../packages/components/src/colors/components/color/constants.mjs","../../../packages/helpers/src/props.helpers.js","../../../packages/helpers/src/assets/js/eventDispatch.js","../../../packages/helpers/src/catalog.js","../../../packages/page-builder-sections/src/cross-sell/services/fetcher.service.js","../../../packages/components/src/colors/components/color/color.js","../../../packages/components/src/colors/colors.js","../../../packages/components/src/colors/constants.mjs"],"sourcesContent":["export const EVENT_COLOR_CLICKED = 'EVENT_COLOR_CLICKED'\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 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 { 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 getProduct,\n getProductCategories,\n ECAPI_TYPE_CAPSULE,\n ECAPI_TYPE_GIFT_CARD\n} from '@kissui/helpers/src/catalog'\n\n/**\n * Api fetcher service\n *\n * @returns {object}\n */\nconst fetcher = () => {\n const apiRatings = window.napi && window.napi.ratings\n const apiPriceFormat = window.napi && window.napi.priceFormat\n let priceFormatter = null\n\n const loadPriceFormat = async () => {\n priceFormatter = await apiPriceFormat()\n }\n\n const getApiProduct = async sku => await getProduct(sku)\n\n /**\n * Get all products merged with data coming from API\n *\n * @returns {Promise<array>}list of products\n * @param productList\n * @param withRating\n */\n const getAll = (productList, withRating) =>\n Promise.all(\n productList.map(async product => {\n try {\n const fetchedProduct = await getOne(product, withRating)\n productList.splice(productList.indexOf(product), 1, fetchedProduct)\n } catch (error) {\n productList.splice(productList.indexOf(product), 1)\n }\n })\n )\n\n /**\n * Get product merged with data coming from API\n *\n * @returns {Promise} product\n * @param product\n * @param withRating\n */\n const getOne = async (product, withRating) => {\n try {\n return await fetchOne(product, withRating)\n } catch (error) {\n console.error(`Fetch for product ${product.sku} failed: ${error}`)\n throw error\n }\n }\n\n /**\n * Fetch and merge product with data coming from API\n *\n * @param {object} product - base product from static data\n * @param apiProduct\n * @param withRating\n * @param list\n * @returns {Promise<object>} Product\n */\n const fetchOne = async (product, withRating) => {\n const { api_override: { name = '', headline = '', description = '' } = {} } = product\n\n const apiProduct = await getApiProduct(product.sku)\n const productCategories = await getProductCategories(product.sku)\n\n const overrides = {\n name: name !== '' ? name : apiProduct.name,\n headline: headline !== '' ? headline : apiProduct.headline,\n description: description !== '' ? description : apiProduct.description,\n longSku: apiProduct ? apiProduct.id : null,\n price: apiProduct ? apiProduct.price : null,\n pdp_urls: getValueObject(apiProduct, 'pdpURLs'),\n images: apiProduct.images,\n slides: apiProduct.slides,\n technologies: apiProduct.technologies,\n type: apiProduct.type,\n productCategories\n }\n\n if (withRating && product.productRatings?.ratingEnabled) {\n overrides.rating = await getRating(product, apiProduct)\n }\n\n if (apiProduct.type === ECAPI_TYPE_CAPSULE) {\n overrides.bundled = apiProduct.bundled\n overrides.intensity = apiProduct.capsuleProperties?.intensity || 0\n overrides.unit_quantity = getValueNumber(apiProduct, 'unitQuantity', 1)\n overrides.sales_multiple = getValueNumber(apiProduct, 'salesMultiple', 10)\n }\n\n if (apiProduct.type === ECAPI_TYPE_GIFT_CARD) {\n if (!product.variant.giftcard_price) {\n throw new Error('Gift Card amount price is not defined')\n }\n\n overrides.price = product.variant.giftcard_price\n overrides.images = { icon: product.variant.default_image }\n }\n\n return { ...merge(product, apiProduct), ...overrides }\n }\n\n /**\n * Merge products based on static product existing keys\n * A shallow copy is made to prevent original object mutation\n *\n * @param {object} product\n * @param {object} apiProduct\n * @param {boolean} force Force property override\n * @returns {object} Product\n */\n const merge = (product, apiProduct, force = false) => {\n const mergedProduct = { ...product }\n\n if (!apiProduct) {\n return mergedProduct\n }\n\n for (const key of Object.keys(mergedProduct)) {\n const empty = mergedProduct[key] === '' || mergedProduct[key] === '0'\n if (key in apiProduct && (empty || force)) {\n mergedProduct[key] = apiProduct[key]\n }\n }\n\n return mergedProduct\n }\n\n /**\n * @param {object} apiProduct\n * @returns {number}\n */\n const getValueNumber = (apiProduct, key, defaultValue) =>\n parseInt((apiProduct && apiProduct[key]) || defaultValue)\n\n /**\n * @param {object} apiProduct\n * @returns {object}\n */\n const getValueObject = (apiProduct, key) => {\n return apiProduct && Object.keys(apiProduct[key]).length > 0 ? apiProduct[key] : {}\n }\n\n /**\n * @param {string} sku\n * @returns {Promise<number>} Rating value\n */\n const getRating = async ({ sku }, apiProduct) => {\n if (\n !apiRatings ||\n (apiProduct && apiProduct.productRatings && !apiProduct.productRatings.ratingEnabled)\n ) {\n return toFloat(0, 1)\n }\n\n try {\n const { ratingAverage = 0 } = await apiRatings().summary(sku)\n return toFloat(ratingAverage !== 0 ? ratingAverage : 0, 1)\n } catch (error) {\n console.error(`Product rating fetch failed on sku ${sku}`, error)\n return toFloat(0, 1)\n }\n }\n\n /**\n * Get currency from datalayer\n * @returns {string}\n */\n const _getCurrency = () => {\n const { dataLayer = {} } = window[window.config.padl.namespace]\n return dataLayer.app?.app?.currency\n }\n\n /**\n * @returns {string}\n * @param price\n */\n const formatPrice = price => {\n const { short } = priceFormatter\n return short(_getCurrency(), price)\n }\n\n /**\n * @param {number} value\n * @param {number} decimal\n * @returns {number}\n */\n const toFloat = (value, decimal = 2) => parseFloat(value).toFixed(decimal)\n\n return {\n loadPriceFormat,\n getApiProduct,\n getAll,\n getOne,\n fetchOne,\n merge,\n formatPrice\n }\n}\n\nexport default fetcher()\n","import { EVENT_COLOR_CLICKED } from './constants.mjs'\nimport createProps from '@kissui/helpers/src/props.helpers'\n\nimport { dispatchEvent } from '@kissui/helpers/src/assets/js/eventDispatch'\n\nclass color extends HTMLElement {\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.render()\n this.createEventListeners()\n }\n\n createEventListeners() {\n this.addEventListener('click', this.handleClick)\n }\n\n render() {\n const { link, label, code, a11y_label = 'color', selected, size = 'large' } = this.props\n\n const element = document.createElement(link ? 'a' : 'button')\n\n if (link) {\n element.setAttribute('href', link)\n }\n if (label) {\n element.setAttribute('title', label)\n element.setAttribute('aria-label', `${label} ${a11y_label}`)\n }\n if (selected === 'true') {\n element.setAttribute('class', 'selected')\n }\n\n this.classList.add(size)\n\n element.innerHTML = `\n <div><span style=\"background-color: ${code}\"></span></div>\n `\n this.innerHTML = element.outerHTML\n }\n\n handleClick() {\n const { sku } = this.props\n dispatchEvent({\n element: this,\n eventName: EVENT_COLOR_CLICKED,\n args: { sku }\n })\n }\n}\n\ncustomElements.get('nb-color') || customElements.define('nb-color', color)\n\nexport default color\n","import { EVENT_COLOR_CLICKED } from './components/color/constants.mjs'\nimport { DEFAULT_MAX_COLOR_COUNT, EVENT_COLOR_CHANGE } from './constants.mjs'\n\nimport createProps from '@kissui/helpers/src/props.helpers'\nimport { dispatchEvent, readEvent } from '@kissui/helpers/src/assets/js/eventDispatch'\n\nimport fetcherService from '@kissui/page-builder-sections/src/cross-sell/services/fetcher.service'\nimport './components/color'\n\nclass Colors extends HTMLElement {\n constructor() {\n super()\n this._apiProducts = {}\n this._colors = []\n this._maxColors = DEFAULT_MAX_COLOR_COUNT\n }\n\n async connectedCallback() {\n this.props = createProps(this.attributes)\n this.updateMaxColors()\n\n await this.fetchColors()\n\n this.render()\n this.createEventListeners()\n }\n\n hasColorData() {\n return this.props.colors && this.props.colors.every(this.hasAllProps)\n }\n\n hasAllProps(color) {\n return color.sku != null && color.name != null && color.code != null\n }\n\n createEventListeners() {\n this.addEventListener(EVENT_COLOR_CLICKED, this.onColorChange)\n }\n\n render() {\n const { heading = '' } = this.props\n\n this.innerHTML = `\n ${heading ? `<p class=\"t-sm-400-sl\">${heading}</p>` : ``}\n ${this.renderColors()}${this.renderExtraColors()}\n `\n }\n\n renderColors() {\n return this._colors.map(this.renderColor.bind(this)).join('')\n }\n\n renderColor(color) {\n const { a11y_label = '', activeSku, size = 'large' } = this.props\n const { code = '', name = '', link = '', sku = '' } = color\n this.classList.add(size)\n\n return `\n <nb-color\n code=\"${code}\"\n label=\"${name}\"\n link=\"${link}\"\n sku=\"${sku}\"\n selected=\"${sku === activeSku}\"\n ${a11y_label ? `a11y_label=\"${a11y_label}\"` : ''}\n size=\"${size}\"\n ></nb-color>\n `\n }\n\n renderExtraColors() {\n const { colors = [], extra_url, extra_title } = this.props\n const extraColorsLength = Math.max(0, colors.length - this._maxColors)\n if (extraColorsLength <= 0 || !extra_url) {\n return ''\n }\n\n return `\n <nb-link\n size=\"small\"\n color=\"black\"\n seo_label=\"${extra_title}\"\n aria-label=\"${extra_title}\"\n link=\"${extra_url}\"\n >+${extraColorsLength}</nb-link>`\n }\n\n async fetchColors() {\n if (this.hasColorData()) {\n this._colors = this.clampColor(this.props.colors)\n return\n }\n try {\n const preparedColors = this.prepareColors(this._maxColors)\n await Promise.all(preparedColors.map(this.fetchColor.bind(this)))\n } catch (error) {\n console.error(`Fetch for colors failed: ${error}`)\n }\n }\n\n async fetchColor(color) {\n const { prevent } = this.props\n const apiProduct = await fetcherService.getApiProduct(color.sku)\n const apiColor = {\n code: apiProduct.colorShade.cssCode,\n name: apiProduct.colorShade.name,\n link: prevent === undefined ? apiProduct.pdpURLs.desktop : ''\n }\n this._apiProducts[color.sku] = apiProduct\n this._colors.push({ ...color, ...apiColor })\n }\n\n prepareColors() {\n const { colors = [] } = this.props\n return this.clampColor(colors).filter(this.hasSKU)\n }\n\n clampColor(colors) {\n return colors.slice(0, this._maxColors)\n }\n\n hasSKU(colorItem) {\n return colorItem.sku != null && colorItem.sku !== ''\n }\n\n updateMaxColors() {\n const { max_colors } = this.props\n if (max_colors) {\n this._maxColors = parseInt(max_colors)\n }\n }\n\n onColorChange($event) {\n const { sku } = readEvent($event)\n const productData = { ...this._apiProducts[sku], sku }\n if (productData) {\n dispatchEvent({\n element: this,\n eventName: EVENT_COLOR_CHANGE,\n args: { productData }\n })\n }\n }\n}\n\n// Registers custom element\ncustomElements.get('nb-colors') || customElements.define('nb-colors', Colors)\n\nexport default Colors\n","export const DEFAULT_MAX_COLOR_COUNT = 4\nexport const EVENT_COLOR_CHANGE = 'EVENT_COLOR_CHANGE'\n"],"names":["EVENT_COLOR_CLICKED","createProps","attributes","data","find","attribute","nodeName","getData","props","filter","reduce","all","attr","nodeValue","isNil","JSON","parse","error","console","log","obj","dispatchEvent","eventName","args","element","window","Error","event","CustomEvent","detail","bubbles","Event","document","createEvent","initEvent","getProduct","sku","napi","catalog","replace","trimSku","fetcherService","fetcher","apiRatings","ratings","apiPriceFormat","priceFormat","priceFormatter","getApiProduct","async","getOne","product","withRating","fetchOne","api_override","name","headline","description","apiProduct","productCategories","productDetails","supercategories","Promise","map","categoryEncoded","getCategory","getProductCategories","overrides","longSku","id","price","pdp_urls","getValueObject","images","slides","technologies","type","productRatings","ratingEnabled","rating","getRating","bundled","intensity","capsuleProperties","unit_quantity","getValueNumber","sales_multiple","variant","giftcard_price","icon","default_image","merge","force","mergedProduct","key","Object","keys","empty","defaultValue","parseInt","length","toFloat","ratingAverage","summary","value","decimal","parseFloat","toFixed","loadPriceFormat","getAll","productList","fetchedProduct","splice","indexOf","formatPrice","short","_getCurrency","dataLayer","config","padl","namespace","app","currency","color","HTMLElement","connectedCallback","this","render","createEventListeners","addEventListener","handleClick","link","label","code","a11y_label","selected","size","createElement","setAttribute","classList","add","innerHTML","outerHTML","customElements","get","define","Colors","constructor","_apiProducts","_colors","_maxColors","DEFAULT_MAX_COLOR_COUNT","updateMaxColors","fetchColors","hasColorData","colors","every","hasAllProps","onColorChange","heading","renderColors","renderExtraColors","renderColor","bind","join","activeSku","extra_url","extra_title","extraColorsLength","Math","max","clampColor","preparedColors","prepareColors","fetchColor","prevent","apiColor","colorShade","cssCode","undefined","pdpURLs","desktop","push","hasSKU","slice","colorItem","max_colors","$event","e","readEvent","productData"],"mappings":"AAAO,MAAMA,EAAsB,sBCE7BC,EAAcC,IACVC,MAAAA,EAHMD,CAAAA,GAAcA,EAAWE,MAAKC,GAAoC,SAAvBA,EAAUC,WAGpDC,CAAQ,IAAIL,IACnBM,EAAQ,IAAIN,GACbO,QAAOJ,GAAoC,SAAvBA,EAAUC,WAC9BI,QAAO,CAACC,EAAKC,KACH,IAAKD,EAAK,CAACC,EAAKN,UAAWM,EAAKC,aACxC,CAAE,GAET,GAAIC,EAAMX,GACCK,OAAAA,EAGP,IACO,MAAA,IAAKA,KAAUO,KAAKC,MAAMb,EAAKU,WACzC,OAAQI,GACLC,QAAQC,IAAI,iBAAkBF,EAAOd,GAAMU,UAC/C,GAGEC,EAAQM,GAAoC,MAARA,ECrB7BC,EAAgBA,EAAGC,UAAAA,EAAWC,KAAAA,EAAMC,QAAAA,MAE7C,IAAKA,EACD,aAAWC,OAAW,KAGZ,MAAA,IAAIC,MACN,yGAHJF,EAAUC,MAIV,CAIJE,IAAAA,EACAJ,EACAI,EAAQ,IAAIC,YAAYN,EAAW,CAAEO,OAAQN,EAAMO,SAAS,IAEvC,mBAAVC,MACPJ,EAAQ,IAAII,MAAMT,IAElBK,EAAQK,SAASC,YAAY,SAC7BN,EAAMO,UAAUZ,GAAW,GAAM,IAGzCE,EAAQH,cAAcM,EAAK,ECJlBQ,EAAaC,GAAOX,OAAOY,KAAKC,UAAUH,W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