{"version":3,"file":"index.es.min.js","sources":["../../../packages/components/src/nespressoElement/nespressoElement.js","../../../packages/helpers/src/props.helpers.js","../../../packages/helpers/src/utils.ts","../../../packages/helpers/src/refs.helpers.js","../../../packages/helpers/src/cupsizes.helpers.js","../../../packages/page-builder-sections/src/cup-sizes/components/cup-size/cupSize.js","../../../packages/page-builder-sections/src/cup-sizes/cupSizes.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","const getData = attributes => attributes.find(attribute => attribute.nodeName === 'data')\n\nconst createProps = attributes => {\n const data = getData([...attributes])\n const props = [...attributes]\n .filter(attribute => attribute.nodeName !== 'data')\n .reduce((all, attr) => {\n return { ...all, [attr.nodeName]: attr.nodeValue }\n }, {})\n\n if (isNil(data)) {\n return props\n }\n\n try {\n return { ...props, ...JSON.parse(data.nodeValue) }\n } catch (error) {\n console.log('ERROR: No data', error, data?.nodeValue)\n }\n}\n\nconst isNil = obj => obj === undefined || obj === null\n\nexport const parseBool = value => (!value || value === 'false' ? false : true)\n\nexport default createProps\n","export { waitForSelector } from './waitForSelector'\n\nexport const constants = {\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n ESC: 27,\n SPACE: 32,\n ENTER: 13,\n TAB: 9\n}\n\nexport function capitalize(s = '') {\n return s[0].toUpperCase() + s.slice(1)\n}\n\nexport const convertToCamelCase = (str: string): string => {\n const arr = str.match(/[a-z]+|\\d+/gi)\n if (!arr) { return str }\n return arr.map((m, i) => {\n let low = m.toLowerCase()\n if (i !== 0) {\n low = low.split('').map((s, k) => (k === 0 ? s.toUpperCase() : s)).join(\"\")\n }\n return low\n }).join(\"\")\n}\n\nexport function slug(s = '') {\n return s\n .toLowerCase()\n .trim()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .replace(/[^\\w-]+/g, '') // Remove all non-word chars\n .replace(/--+/g, '-') // Replace multiple - with single -\n}\n\nexport function pxToEm(target: number, stripedInnerFontSize = 1) {\n return target / 14 / stripedInnerFontSize + 'em'\n}\n\nexport function percent(target: number) {\n return target + '%'\n}\n\nexport function parseHTML(str: string) {\n const tmp = document.implementation.createHTMLDocument('')\n tmp.body.innerHTML = str\n return tmp.body.childNodes\n}\n\nexport function stripHTML(str: string) {\n const tmp = document.implementation.createHTMLDocument('')\n tmp.body.innerHTML = str\n return (tmp.body.textContent ?? \"\").replace(RegExp('[\\\\s|\\'|\"]', 'g'), '')\n}\n\nexport function makeId(length: number) {\n var result = ''\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n var charactersLength = characters.length\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\n }\n return result\n}\n\nexport function removeEmptyValues(obj: { [key: string]: any }): { [key: string]: any } {\n for (let key in obj) {\n if (obj[key] === null || obj[key] === undefined || obj[key] === '') {\n delete obj[key]\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","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 volumes = {\n carafe: { ml: 535, oz: 18.09 },\n 'carafe-vertuo': { ml: 535, oz: 18.09 },\n alto: { ml: 335, oz: 11.33 },\n mug: { ml: 230, oz: 7.77 },\n gran_lungo: { ml: 150, oz: 5.07 },\n lungo: { ml: 110, oz: 3.7 },\n double_espresso: { ml: 80, oz: 2.7 },\n 'double-espresso-vertuo': { ml: 80, oz: 2.7 },\n espresso: { ml: 40, oz: 1.35 },\n 'espresso-vertuo': { ml: 40, oz: 1.35 },\n ristretto: { ml: 25, oz: 0.84 }\n}\n\nexport const getCupSize = (size, isOz) => {\n const unit = isOz ? 'oz' : 'ml'\n const volume = volumes[size]\n\n if (!volume) {\n return ''\n }\n\n return `${volume[unit]} ${unit}`\n}\n","import createProps from '@kissui/helpers/src/props.helpers'\nimport { lazyLoad } from '@kissui/helpers/src/utils'\nimport createRefs from '@kissui/helpers/src/refs.helpers'\nimport { getCupSize } from '@kissui/helpers/src/cupsizes.helpers'\n\nclass CupSize extends HTMLElement {\n constructor() {\n super()\n }\n\n connectedCallback() {\n this.props = createProps(this.attributes)\n this.render()\n this.refs = createRefs(this)\n this.initLazyLoad()\n }\n\n initLazyLoad() {\n const { image } = this.props\n const path = '/shared_res/agility/next-components/assets/cup-size/'\n const { visual } = this.refs\n let src = ''\n\n if (image.custom !== '') {\n src = image.custom\n } else {\n src = path + image.predefined + '.png'\n }\n\n if (visual && image) {\n lazyLoad(visual, 'src', `${src}`, src)\n }\n }\n\n render() {\n const { label, a11y_label } = this.props\n\n this.innerHTML = `\n <img src='' data-ref=\"visual\" aria-hidden='true' alt=\"\" />\n <h3 class='t-sm-700' aria-description='${a11y_label}'>${label}</h3>\n ${this.renderVolume()}\n `\n }\n\n renderVolume() {\n const { volume } = this.props\n\n let volumeRender = ''\n\n if (volume.automatic || volume.automatic === 'true') {\n volumeRender = '(' + getCupSize(volume.size, volume.unit === 'oz') + ')'\n } else {\n volumeRender = volume.override\n }\n\n return `<p class='t-sm-400'>${volumeRender}</p>`\n }\n}\n\ncustomElements.get('nb-cup-size') || customElements.define('nb-cup-size', CupSize)\nexport default CupSize\n","import { CONTRAST_LIGHT } from '@kissui/components'\nimport { NespressoElement } from '@kissui/components/src/nespressoElement'\nimport './components/cup-size'\n\nclass CupSizes extends NespressoElement {\n loadTemplate() {\n const { layout, campaign, copywriting } = this.props\n const { padding_top, padding_bottom, background_color } = layout\n const { heading, description, items } = copywriting\n\n if (!items) {\n return null\n }\n\n this.template = `<nb-container\n background_color='${background_color}'\n contrast='${CONTRAST_LIGHT}'\n classname='${padding_top} ${padding_bottom}'\n campaign_id='${campaign.id}'\n campaign_name='${campaign.name}'\n campaign_position='${campaign.position}'\n campaign_creative='${campaign.creative}'>\n <h2 class='h-3xl-300'>${heading}</h2>\n <p class='cb-description t-sm-400'>${description}</p>\n <div class='cb-items'>\n ${items\n .map(data => `<nb-cup-size data='${JSON.stringify(data)}'></nb-cup-size>`)\n .join('')}\n </div>\n </nb-container>`\n\n this.render()\n }\n}\n\ncustomElements.get('nb-cup-sizes') || customElements.define('nb-cup-sizes', CupSizes)\n\nexport default CupSizes\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","isNil","obj","extract","refs","$ref","ref","dataset","refArray","match","getRefArray","name","undefined","volumes","carafe","ml","oz","alto","mug","gran_lungo","lungo","double_espresso","espresso","ristretto","CupSize","filter","createProps","querySelectorAll","initLazyLoad","image","visual","src","custom","predefined","value","url","inViewPort","setAttribute","cb","classList","add","img","Image","onload","onerror","Error","test","window","navigator","userAgent","agent","start","indexOf","Number","substr","replace","lazyBackgroundObserver","IntersectionObserver","entries","entry","isIntersecting","unobserve","target","observe","isOldIOS","lazyLoad","label","a11y_label","renderVolume","volume","volumeRender","automatic","getCupSize","size","isOz","unit","override","CupSizes","layout","campaign","copywriting","padding_top","padding_bottom","background_color","heading","description","items","id","position","creative","map","stringify","join"],"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,EAAkBJ,GAChBA,EAAKK,YAAcL,EAAKK,WAAWC,OAAS,EACrC,KAEJN,EAAKO,YAIVC,EAAWC,MAAMC,UAAUC,MAAMC,KAAKd,EAAKO,YAC3CQ,EAAgBJ,MAAMC,UAAUC,MAAMC,KAAKzC,EAASkC,YAGtDS,IAAAA,EAAQN,EAASF,OAASO,EAAcP,OAC5C,GAAIQ,EAAQ,EACR,KAAOA,EAAQ,EAAGA,IACdN,EAASA,EAASF,OAASQ,GAAOC,WAAWC,YACzCR,EAASA,EAASF,OAASQ,IAMvCD,EAAcI,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