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EAAE,yCACfwF,GAAQmC,KAER,gBAAoB,WAAgB,KACxC,gBAAoB,SAAU,CAAE5I,UAAW,IAAW,wBAAyB,CAAE9B,UAAWd,EAAMmM,YAAc3H,QAAUa,IAClHA,EAAEG,iBACFjF,GAAQ,EAAK,EACd,gBAAiB,UACpB,gBAAoB,OAAQ,CAAEqC,UAAW,+BAAiCiB,EAAE,wBAC5E,gBAAoB,OAAQ,CAAEjB,UAAW,kCAAoCzB,OAAOiJ,cACxFf,GAAQmC,KACPxL,EAAMoM,UAAY,gBAAoB,EAAuB,CAAE/B,uBAAwB9J,IAAY,C","sources":["webpack:///./assets/common/src/ui/accordion/Accordion.tsx","webpack:///./assets/common/src/ui/accordion/AccordionItem.tsx","webpack:///./assets/common/src/ui/button/Button.tsx","webpack:///./assets/common/src/utils/ui.ts","webpack:///./assets/common/src/utils/useQueryStringBoolean.ts","webpack:///./assets/moncler/src/components/countryselector/SuggestedCountryModal.tsx","webpack:///./assets/moncler/src/components/countryselector/CountryModal.tsx"],"sourcesContent":["import React, { cloneElement, useEffect, useMemo, useState, createElement } from 'react';\nimport { isInViewport, scrollToPx } from '../../utils/ui';\nimport classNames from 'classnames';\nlet timeoutId;\nconst Accordion = (props) => {\n const [expandedCard, setExpandedCard] = useState();\n const [height, setHeight] = useState(0);\n const groupRef = React.createRef();\n const setOpen = (i) => {\n setExpandedCard(i);\n };\n const isOpen = (i) => {\n return expandedCard === i;\n };\n const onChildSelect = (i) => {\n setOpen(isOpen(i) ? null : i);\n };\n // OE-14667 set the accordion close if there is a new result in the search input\n useEffect(() => {\n if (props.results && props.results.length > 0) {\n setOpen(-1);\n }\n }, [props.results]);\n const scrollToElement = (container, opener) => {\n clearTimeout(timeoutId);\n timeoutId = setTimeout(() => {\n if (!isInViewport(opener)) {\n const scrollPosition = window.scrollY;\n const containerScrollPosition = container.getBoundingClientRect().top;\n let header = document.querySelector('header');\n const headerHeight = header && header.offsetHeight;\n const gap = 100;\n const scrollPositionFinal = scrollPosition + containerScrollPosition - headerHeight - gap;\n scrollToPx(scrollPositionFinal);\n }\n }, 500);\n };\n useEffect(() => {\n let defaultOpen;\n React.Children.forEach(props.children, (c, i) => {\n if (!!c) {\n if (React.isValidElement(c)) {\n if (c.props.isInitialOpen) {\n defaultOpen = c.key || i;\n }\n }\n else {\n console.warn('Element is not an accordion item.', c);\n }\n }\n });\n setOpen(defaultOpen);\n }, []);\n useEffect(() => {\n console.log('set accordion height');\n setHeight(groupRef.current.clientHeight);\n }, []);\n const childrenLength = useMemo(() => {\n let counter = 0;\n React.Children.map(props.children, () => {\n counter += 1;\n });\n return counter;\n }, []);\n // causava sfarfallamenti\n // const disableScroll = () => {\n // if (timeout) {\n // clearTimeout(timeout);\n // }\n // document.documentElement.classList.add('initial-scroll');\n // const scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n // const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;\n // window.onscroll = () => {\n // window.scrollTo(scrollLeft, scrollTop);\n // };\n // };\n // const enableScroll = () => {\n // document.documentElement.classList.remove('initial-scroll');\n // window.onscroll = () => {};\n // };\n return createElement(props.type, {\n className: classNames('accordion__group', { 'accordion__group--flex': props.flex, 'accordion__group--list': props.type === 'ul' }),\n ref: groupRef,\n style: { gap: props.gap || 0 },\n }, React.Children.map(props.children, (child, i) => {\n if (React.isValidElement(child)) {\n return cloneElement(child, Object.assign({ onSelect: () => onChildSelect(child.key || i), expanded: isOpen(child.key || i), loading: isOpen(child.key || i) && child.props.initiallyClosed, scrollToElement: scrollToElement, flex: props.flex, gap: props.gap, parentHeight: height, childrenLength: childrenLength, type: (props.type === 'ul' && 'li') || 'div' }, child.props));\n }\n }));\n};\nAccordion.defaultProps = {\n type: 'div',\n};\nexport default Accordion;\n","import classNames from 'classnames';\nimport React, { useEffect, useRef } from 'react';\nimport { useTranslation } from 'react-i18next';\nconst AccordionItem = (props) => {\n const { t } = useTranslation();\n const accordionPanel = useRef();\n const container = useRef();\n const opener = useRef();\n // const firstChildMargin = window.getComputedStyle(props?.parentRef?.firstChild as Element).getPropertyValue('margin-bottom');\n // useEffect(() => {\n // let heightForFlex;\n // if (props.flex && props.gap && props.parentHeight) {\n // heightForFlex =\n // console.log('children total height', heightForFlex);\n // }\n // }, [props.parentHeight]);\n useEffect(() => {\n console.log('Update Height: ', props.accordionId, props.updateHeight);\n // actual animation\n if (props.flex && props.gap && props.parentHeight) {\n accordionPanel.current.style.height = props.expanded\n ? props.autoHeight\n ? 'auto'\n : `${(props === null || props === void 0 ? void 0 : props.parentHeight) - (container.current.clientHeight * props.childrenLength + props.gap * (props.childrenLength - 1))}px`\n : '0px';\n }\n else {\n accordionPanel.current.style.height = props.expanded ? (props.autoHeight ? 'auto' : `${accordionPanel.current.firstElementChild.scrollHeight}px`) : '0px';\n }\n }, [props.expanded, props.children, props.updateHeight, props.parentHeight]);\n return (React.createElement(\"div\", { ref: container, className: (!props.miniAccordion ? 'accordion__item' : '') + (props.itemClass ? ' ' + props.itemClass : '') },\n React.createElement(\"button\", { ref: opener, type: \"button\", id: props.accordionId, onClick: () => {\n props.onClick && props.onClick();\n props.onSelect();\n if (props.callbackOnOpen && !props.expanded) {\n props.callbackOnOpen();\n }\n if (props.scrollToElement) {\n props.scrollToElement(container.current, opener.current);\n }\n }, className: classNames(props.miniAccordion ? 'accordion__header--mini' : 'accordion__header', { accordion__panel_open: props.expanded, 'header--selected': props.elementActive }, props.headerClass ? props.headerClass : ''), \"aria-expanded\": props.expanded, \"aria-controls\": props.accordionId + '-panel', tabIndex: props.tabIndex || null },\n props.isTitleMarkup ? props.title : React.createElement(\"span\", { className: \"primary-s\" + (props.miniAccordion ? ' accordion__header--underline' : '') }, props.title),\n !props.hideToggleButtons && !props.miniAccordion && (React.createElement(React.Fragment, null,\n React.createElement(\"i\", { className: \"header__open\" },\n React.createElement(\"span\", { className: \"text\" }, t('button.show'))),\n React.createElement(\"i\", { className: \"header__close\" },\n React.createElement(\"span\", { className: \"text\" }, t('button.hide'))))),\n props.miniAccordion &&\n React.createElement(React.Fragment, null,\n !props.expanded && React.createElement(\"div\", { className: \"accordion__header--arrow-down\" }),\n props.expanded && React.createElement(\"div\", { className: \"accordion__header--arrow-up\" }))),\n React.createElement(\"div\", { ref: accordionPanel, className: classNames(`accordion__panel${!!props.contentClass ? ' ' + props.contentClass : ''}`, { accordion__panel_open: props.expanded }), role: \"region\", id: props.accordionId + '-panel', \"aria-labelledby\": props.accordionId },\n React.createElement(\"div\", null,\n React.createElement(React.Fragment, null,\n props.loading && React.createElement(\"p\", { className: \"pb-12\" }, t('label.loading')),\n props.children)))));\n};\nAccordionItem.defaultProps = {\n isTitleMarkup: false,\n type: 'div',\n};\nexport default AccordionItem;\n","import classNames from 'classnames';\nimport React from 'react';\nconst Button = (props) => {\n const handleClick = (e) => {\n if (props.usesDefault != undefined && !props.usesDefault && props.onClick) {\n e.preventDefault();\n }\n props.onClick && props.onClick.call(this, e);\n };\n const handleKeyDown = (e) => {\n if (props.usesDefault != undefined && !props.usesDefault && props.onKeyDown) {\n e.preventDefault();\n }\n props.onKeyDown && props.onKeyDown.call(this, e);\n };\n return (React.createElement(\"button\", Object.assign({ ref: props.reference, onClick: handleClick, onKeyDown: handleKeyDown, disabled: props.disabled, className: classNames('button', props.cls, props.className, { loading: props.isLoading }), type: props.type, \"aria-label\": props.ariaLabel, \"aria-current\": props.ariaCurrent, \"aria-expanded\": props.ariaExpanded, \"aria-haspopup\": props.ariaHaspopup, \"aria-controls\": props.ariaControls }, (props.tabIndex ? { tabIndex: props.tabIndex } : {})), props.isLoading ? (React.createElement(React.Fragment, null,\n React.createElement(\"div\", null))) : (React.createElement(\"span\", null, props.children))));\n};\nButton.defaultProps = {\n cls: ['button--primary'],\n className: '',\n};\nexport default Button;\n","/**\n *\n * check if given element is in viewpot\n * @param elem - element to check\n *\n * @returns return true if is in viewport\n */\nexport const isInViewport = (elem) => {\n const bounding = elem.getBoundingClientRect();\n return (bounding.top >= 0 &&\n bounding.left >= 0 &&\n bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n bounding.right <= (window.innerWidth || document.documentElement.clientWidth));\n};\nexport const scrollToPx = (endPosition) => {\n if ('scrollBehavior' in document.documentElement.style) {\n window.scrollTo({\n top: endPosition,\n left: 0,\n behavior: 'smooth',\n });\n }\n else {\n let gap = window.scrollY;\n const direction = gap > endPosition ? 'up' : 'down';\n const int = setInterval(function () {\n if (direction === 'up') {\n gap -= 10;\n if (gap <= endPosition)\n clearInterval(int);\n }\n else {\n gap += 10;\n if (gap >= endPosition)\n clearInterval(int);\n }\n window.scrollTo(0, gap);\n }, 10);\n }\n};\n// for PLP tiles check\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst findDuplicates = () => {\n const tiles = new Map();\n document.querySelectorAll('[data-id]').forEach((tile) => {\n // @ts-ignore\n let currentId = tile.dataset.id;\n if (tiles.has(currentId)) {\n tiles.set(currentId, Number(tiles.get(currentId)) + 1);\n }\n else {\n tiles.set(currentId, 1);\n }\n });\n let duplicateCounter = 0;\n for (const [key, value] of tiles) {\n if (value > 1) {\n duplicateCounter++;\n console.info(`found ${value} duplicates for ${key}`);\n }\n }\n console.info(`%cfound a total of ${duplicateCounter} duplicates!`, 'color:purple;background-color:white;font-weight:bold;');\n};\n","import qs from 'query-string';\nimport { useCallback, useState } from 'react';\nfunction useQueryStringBoolean(key, initialValue) {\n const setQueryStringWithoutPageReload = (qsValue) => {\n const newurl = window.location.protocol + '//' + window.location.host + window.location.pathname + (qsValue ? '?' + qsValue : '');\n window.history.pushState({ path: newurl }, '', newurl);\n };\n const getQueryStringValue = (key) => {\n const values = qs.parse(window.location.search);\n let value = values[key];\n return !!value;\n };\n function setQueryStringValue(key, value) {\n const values = qs.parse(window.location.search);\n const newvalues = Object.assign(Object.assign({}, values), { [key]: value });\n if (!value) {\n delete newvalues[key];\n }\n const newQsValue = qs.stringify(newvalues);\n setQueryStringWithoutPageReload(newQsValue);\n }\n const onSetValue = useCallback((newValue) => {\n setValue(newValue);\n setQueryStringValue(key, newValue);\n }, [key]);\n const [value, setValue] = useState(getQueryStringValue(key) || initialValue);\n return [value, onSetValue];\n}\nexport default useQueryStringBoolean;\n","import ModalDialog from '@ui/modal/ModalDialog';\nimport Button from '@ui/button/Button';\nimport api from '@utils/api';\nimport React, { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport customEventBus from '@common/scripts/libs/eventBus';\nconst SuggestedCountryModal = (props) => {\n const { t } = useTranslation();\n const [open, setOpen] = useState(false);\n const [modalData, setModalData] = useState();\n useEffect(() => {\n if (sessionStorage.getItem('suggested-country') != 'closed' && !window.disableGeolocation) {\n api.checkGeolocationCountryMatch(window.country.toLowerCase()).then((data) => {\n if (data.error) {\n customEventBus.emit('suggestedCountry:close', {});\n return;\n }\n if (data.success && !data.countryMatch) {\n setOpen(true);\n setModalData(data);\n }\n else {\n customEventBus.emit('suggestedCountry:close', {});\n }\n });\n }\n else {\n customEventBus.emit('suggestedCountry:close', {});\n }\n }, []);\n const onCloseModal = () => {\n sessionStorage.setItem('suggested-country', 'closed');\n // Manage newsletter popup Show\n customEventBus.emit('suggestedCountry:close', {});\n };\n if (!modalData) {\n return React.createElement(React.Fragment, null);\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(ModalDialog, { isOpen: open, onRequestClose: () => {\n setOpen(false);\n onCloseModal();\n }, overlayClassName: \"mobile-visible\", contentLabel: t('modal.suggestedcountry.title'), className: \"suggested-country-modal\" },\n React.createElement(React.Fragment, null,\n React.createElement(\"p\", null, t('modal.suggestedcountry.description1', { 0: modalData.IPCountryName })),\n React.createElement(\"p\", { className: \"mb-24\" }, t('modal.suggestedcountry.description2')),\n React.createElement(Button, { type: \"button\", cls: ['button--primary'], onClick: () => {\n onCloseModal();\n window.location.href = `${window.location.origin}/${modalData.defaultLanguage}-${modalData.IPCountryCode.toLowerCase()}`;\n } }, t('modal.suggestedcountry.changelocation')),\n React.createElement(\"div\", { className: \"text-center\" },\n React.createElement(Button, { type: \"button\", cls: ['button--secondary'], onClick: () => {\n onCloseModal();\n setOpen(false);\n } }, t('modal.suggestedcountry.remaininthe', { 0: window.countryname })),\n React.createElement(Button, { type: \"button\", cls: ['button--tertiary', 'button--arrow-right'], onClick: () => {\n setOpen(false);\n onCloseModal();\n props.setCountrySelectorOpen(true);\n } }, t('modal.suggestedcountry.chose')))))));\n};\nexport default SuggestedCountryModal;\n","import Accordion from '@ui/accordion/Accordion';\nimport AccordionItem from '@ui/accordion/AccordionItem';\nimport Button from '@ui/button/Button';\nimport ModalDialog from '@ui/modal/ModalDialog';\nimport analytics from '@utils/analytics';\nimport api from '@utils/api';\nimport useBreakpoint from '@utils/useBreakpoint';\nimport useQueryStringBoolean from '@utils/useQueryStringBoolean';\nimport React, { useEffect, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport SuggestedCountryModal from './SuggestedCountryModal';\nimport classNames from 'classnames';\nconst CountryModal = (props) => {\n const { t } = useTranslation();\n const [open, setOpen] = useQueryStringBoolean('countryselector');\n const [data, setData] = useState();\n const [confirmed, setConfirmed] = useState();\n const [requireconfirm, setRequireconfirm] = useState();\n const currentBreakpoint = useBreakpoint();\n useEffect(() => {\n if (open) {\n api.getMiniCart().then((cart) => {\n setRequireconfirm(cart.isExchange || false);\n api.countrySelectorJson().then((data) => {\n setData(data);\n });\n });\n }\n }, [open]);\n const countries = (countries, region) => countries === null || countries === void 0 ? void 0 : countries.map((country) => (React.createElement(\"li\", { key: country.link },\n React.createElement(\"a\", { href: country.link, \"data-analytics-country\": country.countryCode, onClick: () => {\n analytics.countryselectorClick(region, country.name.toLowerCase());\n } },\n React.createElement(\"span\", { className: \"countryname\" }, country.name),\n country.shoppable && React.createElement(\"span\", { className: \"icon--bag\", \"aria-label\": t('changecountry.shoppable.aria') }),\n window.country === country.countryCode && React.createElement(\"span\", { className: \"icon--checkmark\", \"aria-label\": t('changecountry.current.aria') })))));\n const desktopLayput = () => (React.createElement(\"div\", { className: \"countryselector-wrapper mt-32\" },\n React.createElement(\"div\", { className: \"row\" },\n data.EUROPE && (React.createElement(\"div\", { className: \"col-md-6\" },\n React.createElement(\"div\", { className: \"continent\" },\n React.createElement(\"h5\", { className: \"card-header\" }, \"EUROPE\"),\n React.createElement(\"div\", { className: \"accordion__panel\" },\n React.createElement(\"ol\", null, countries(data.EUROPE, 'europe')))))),\n data.AMERICAS && (React.createElement(\"div\", { className: \"col-md-3\" },\n React.createElement(\"div\", { className: \"continent\" },\n React.createElement(\"h5\", { className: \"card-header\" }, \"AMERICAS\"),\n React.createElement(\"div\", { className: \"accordion__panel\" },\n React.createElement(\"ol\", null, countries(data.AMERICAS, 'americas')))))),\n React.createElement(\"div\", { className: \"col-md-3\" },\n data.ASIA && (React.createElement(\"div\", { className: \"continent\" },\n React.createElement(\"h5\", { className: \"card-header\" }, \"ASIA\"),\n React.createElement(\"div\", { className: \"accordion__panel\" },\n React.createElement(\"ol\", null, countries(data.ASIA, 'asia'))))),\n data.OCEANIA && (React.createElement(\"div\", { className: \"continent mt-32\" },\n React.createElement(\"h5\", { className: \"card-header\" }, \"OCEANIA\"),\n React.createElement(\"div\", { className: \"accordion__panel\" },\n React.createElement(\"ol\", null, countries(data.OCEANIA, 'oceania')))))))));\n const confirmationDialog = () => (React.createElement(React.Fragment, null,\n React.createElement(\"div\", { className: \"row countryselector-modal\" },\n React.createElement(\"div\", { className: \"col-12\" },\n React.createElement(\"div\", { className: \"countryselector-modal__description\" }, t('exchange.changecountrywarning')),\n React.createElement(\"div\", { className: \"countryselector-modal__description\" }, t('checkout.shipping.changecountryproceed')))),\n React.createElement(\"div\", { className: \"row\" },\n React.createElement(\"div\", { className: \"col-6 col-md-3\" },\n React.createElement(Button, { type: \"button\", cls: ['button--secondary'], onClick: () => {\n setOpen(false);\n } }, t('label.no'))),\n React.createElement(\"div\", { className: \"col-6 col-md-3\" },\n React.createElement(Button, { type: \"button\", cls: ['button--primary'], onClick: () => {\n setConfirmed(true);\n } }, t('label.yes'))))));\n const mobileLayout = () => (React.createElement(Accordion, null,\n data.EUROPE && (React.createElement(AccordionItem, { title: \"EUROPE\", accordionId: \"region_europe\" },\n React.createElement(\"ol\", null, countries(data.EUROPE, 'europe')))),\n data.AMERICAS && (React.createElement(AccordionItem, { title: \"AMERICAS\", accordionId: \"region_americas\" },\n React.createElement(\"ol\", null, countries(data.AMERICAS, 'americas')))),\n data.ASIA && (React.createElement(AccordionItem, { title: \"ASIA\", accordionId: \"region_asia\" },\n React.createElement(\"ol\", null, countries(data.ASIA, 'asia')))),\n data.OCEANIA && (React.createElement(AccordionItem, { title: \"OCEANIA\", accordionId: \"region_oceania\" },\n React.createElement(\"ol\", null, countries(data.OCEANIA, 'oceania'))))));\n const modal = () => (React.createElement(ModalDialog, { isOpen: open, onRequestClose: () => {\n setOpen(false);\n analytics.countryselectorClose();\n }, hasDivisor: !requireconfirm || confirmed, contentLabel: t('modal.country.title'), subtitle: requireconfirm && !confirmed ? '' : t('modal.country.description'), className: \"country-modal\" }, requireconfirm && !confirmed ? React.createElement(React.Fragment, null, confirmationDialog()) : React.createElement(React.Fragment, null, currentBreakpoint >= window.mqObj['md'] ? desktopLayput() : mobileLayout())));\n if (props.children) {\n return (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"countryselector\" },\n React.createElement(\"button\", { type: \"button\", onClick: () => {\n setOpen(true);\n }, dangerouslySetInnerHTML: { __html: props.children } })),\n data && modal()));\n }\n if (props.fromBookAnAppointment) {\n return (React.createElement(React.Fragment, null,\n React.createElement(\"p\", { className: \"countryselector\" },\n t('bookanappointment.currentlocation', { country: window.countryname }),\n ' ',\n React.createElement(\"button\", { className: \"link-button\", type: \"button\", onClick: () => {\n setOpen(true);\n } }, t('bookanappointment.differentlocation'))),\n data && modal()));\n }\n return (React.createElement(React.Fragment, null,\n React.createElement(\"button\", { className: classNames('footer-menu__menuitem', { container: props.contained }), onClick: (e) => {\n e.preventDefault();\n setOpen(true);\n }, \"aria-haspopup\": \"dialog\" },\n React.createElement(\"span\", { className: \"footer-menu__menuitem__item\" }, t('footer.item.country')),\n React.createElement(\"span\", { className: \"footer-menu__menuitem__current\" }, window.countryname)),\n data && modal(),\n !props.editMode && React.createElement(SuggestedCountryModal, { setCountrySelectorOpen: setOpen })));\n};\nexport default CountryModal;\n"],"names":["timeoutId","Accordion","props","expandedCard","setExpandedCard","useState","height","setHeight","groupRef","setOpen","i","isOpen","useEffect","results","length","scrollToElement","container","opener","clearTimeout","setTimeout","scrollPosition","window","scrollY","containerScrollPosition","getBoundingClientRect","top","header","document","querySelector","scrollPositionFinal","offsetHeight","defaultOpen","children","c","isInitialOpen","key","console","warn","log","current","clientHeight","childrenLength","useMemo","counter","createElement","type","className","flex","ref","style","gap","child","cloneElement","Object","assign","onSelect","onChildSelect","expanded","loading","initiallyClosed","parentHeight","defaultProps","AccordionItem","t","accordionPanel","useRef","accordionId","updateHeight","autoHeight","firstElementChild","scrollHeight","miniAccordion","itemClass","id","onClick","callbackOnOpen","accordion__panel_open","elementActive","headerClass","tabIndex","isTitleMarkup","title","hideToggleButtons","contentClass","role","Button","reference","e","undefined","usesDefault","preventDefault","call","onKeyDown","disabled","cls","isLoading","ariaLabel","ariaCurrent","ariaExpanded","ariaHaspopup","ariaControls","isInViewport","elem","bounding","left","bottom","innerHeight","documentElement","right","innerWidth","clientWidth","scrollToPx","endPosition","scrollTo","behavior","direction","int","setInterval","clearInterval","initialValue","setQueryStringValue","value","values","location","search","newvalues","qsValue","newurl","protocol","host","pathname","history","pushState","path","setQueryStringWithoutPageReload","onSetValue","useCallback","newValue","setValue","getQueryStringValue","useTranslation","open","modalData","setModalData","sessionStorage","getItem","disableGeolocation","api","country","toLowerCase","then","data","error","success","countryMatch","onCloseModal","setItem","ModalDialog","onRequestClose","overlayClassName","contentLabel","IPCountryName","href","origin","defaultLanguage","IPCountryCode","countryname","setCountrySelectorOpen","useQueryStringBoolean","setData","confirmed","setConfirmed","requireconfirm","setRequireconfirm","currentBreakpoint","useBreakpoint","cart","isExchange","countries","region","map","link","countryCode","analytics","name","shoppable","modal","hasDivisor","subtitle","mqObj","EUROPE","AMERICAS","ASIA","OCEANIA","dangerouslySetInnerHTML","__html","fromBookAnAppointment","contained","editMode"],"sourceRoot":""}