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,OAAS,GACnB,gBAAC,IAAS,CAAC,eAAc,KAAkB5C,UAAWyC,GAClD,gBAACvC,EAAA,CACGF,UAAU,mCACVG,MAAO,CAAEC,sBAET,gBAAC,IAAU,CAAC6C,eAAgB3D,EAAkB4D,MAAOP,KAKzE,GA9KStC,E,iIAAN,GAFN,OAAe,CAAC,2BACjB,YACaA,GAiLbA,EAAgBJ,YAAc,iB,+TC3O9B,MAAMkD,EAAqB,OAAU;;;;;;;;;;;;;;;;;;;EAqBxBC,GAAc,IAAAC,WAAS,SAAqBrF,GACrD,MAAMsF,GAAwB,OAAQ,wBAEtC,OACI,gBAACH,EAAA,CAAmB,eAAc,KAAsBnD,UAAWsD,GAC/D,gBAACC,EAAA,EAAc,CAACC,IAAKxF,EAAMwF,MAGvC,I,kfCpCYC,EAAL,CAAKA,IACRA,EAAA,QAAU,UACVA,EAAA,KAAO,OACPA,EAAA,iBAAmB,WAHXA,GAAL,CAAKA,GAAA,IAqBL,IAAMC,EAAN,cAA6B,YAGzB,QAAAC,GACH,MAAM3F,EAAQ,CACVK,OAAQ,OACAN,KAAKC,MAAMmE,mBACZpE,KAAKC,MAAMK,SAItB,OAAO,gBAACuF,EAAA,QAAY,KAAK5F,GAC7B,CAEA,MAAA4B,GACI,MAAM,eAAEsC,EAAc,GAAED,GAAOlE,KAAKC,MAEpC,OAAQkE,GACJ,IAAK,UACD,OAAOnE,KAAK4F,WAChB,IAAK,OACD,OAAO,gBAACP,EAAW,CAACI,IAAKvB,IAC7B,QACI,OAAO,KAEnB,GAzBSyB,E,iIAAN,GARN,OAAe,CACZ,+BACA,uBACA,sBACA,yBACA,0BAEJ,YACaA,GA4BbA,EAAezD,YAAc,gB","sources":["webpack://elc-service-prodcat/./src/exported/product-cross-sell/ProductCrossSell.tsx","webpack://elc-service-prodcat/./src/internal/views/product-carousel/ProductCarousel.tsx","webpack://elc-service-prodcat/./src/internal/views/product-tout/ProductTout.tsx","webpack://elc-service-prodcat/./src/internal/views/product-grid/CollectionItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { observer } from 'mobx-react';\nimport {\n ITranslationsCollection,\n addConfig,\n addContext,\n configConsumer,\n addTranslation,\n translationConsumer\n} from '@estee/elc-service';\nimport { Breakpoints } from '@estee/elc-base-theme';\nimport { Heading2 } from '@estee/elc-typography';\nimport { classes } from '../../internal/utils/Classes';\nimport { ProductCrossSellViewController } from '../../internal/controllers/ProductCrossSellViewController';\nimport { CartLimitReachedModal } from '../../internal/views/cart-limit-modal/CartLimitReachedModal';\nimport { ProductCarousel } from '../../internal/views/product-carousel/ProductCarousel';\nimport { mergeConfigs } from '../../internal/utils/ConfigUtils';\nimport { IOrderConfigCollection } from 'src/internal/interfaces/IOrderableComponents';\nimport { IFeatures } from '~constants/Features';\nimport { ICoreProduct } from '~api/interfaces/IProduct';\nimport { IItem } from '~api/interfaces/IItem';\nimport { IParamsById } from '~api/interfaces/IParamsById';\n\nexport interface IGridBreakpoints {\n numColumnsMobile: number;\n numColumnsDesktop: number;\n numColumnsLargeScreen: number;\n numColumnsExtraLargeScreen: number;\n}\n\nexport interface IProductCrossSellState {\n products: ICoreProduct[];\n}\n\nexport interface IProductCrossSellConfig {\n items?: IItem[];\n paramsById?: IParamsById;\n viewableInventoryStatuses?: string[];\n productGridBreakpoints: IGridBreakpoints;\n crossSellsCustomHeader: string;\n hideLoader?: boolean;\n componentElementsOrderConfig?: { [key: string]: IOrderConfigCollection };\n features: IFeatures;\n}\n\nexport interface IProductCrossSell {\n className?: string;\n translations?: ITranslationsCollection;\n config: IProductCrossSellConfig;\n viewController: ProductCrossSellViewController;\n state?: IProductCrossSellState;\n}\n\n@addContext()\n@addConfig(['prodcatConfig', 'features'], mergeConfigs)\n@configConsumer([\n 'crossSellsCustomHeader',\n 'productGridBreakpoints',\n 'hideLoader',\n 'paramsById',\n 'items',\n 'componentElementsOrderConfig',\n 'features'\n])\n@addTranslation(['crossSellsTitle'])\n@translationConsumer(['crossSellsTitle'])\n@observer\nclass ProductCrossSell extends React.Component {\n public static displayName: string;\n\n public async componentDidMount() {\n await this.props.viewController.loaded(this.props);\n }\n\n private get productCarouselProps() {\n const { productGridBreakpoints } = this.props.config;\n\n const {\n numColumnsMobile,\n numColumnsDesktop,\n numColumnsLargeScreen,\n numColumnsExtraLargeScreen\n } = productGridBreakpoints;\n\n const crossSellSettings = {\n dots: false,\n infinite: false,\n slidesToShow: numColumnsExtraLargeScreen,\n slidesToScroll: 1,\n responsive: [\n {\n breakpoint: Breakpoints.extraLargeScreen,\n settings: {\n slidesToShow: numColumnsLargeScreen,\n slidesToScroll: 1,\n infinite: false,\n dots: false,\n arrows: true\n }\n },\n {\n breakpoint: Breakpoints.largeScreen,\n settings: {\n slidesToShow: numColumnsDesktop,\n slidesToScroll: 1,\n infinite: false,\n dots: false,\n arrows: true\n }\n },\n {\n breakpoint: Breakpoints.desktop,\n settings: {\n slidesToShow: numColumnsMobile,\n slidesToScroll: 1,\n infinite: false,\n dots: false,\n arrows: true\n }\n }\n ]\n };\n\n return {\n products: this.props.viewController.data.crossSellProducts,\n carouselSettings: crossSellSettings\n };\n }\n\n private get crossSellHeader() {\n const { crossSellsCustomHeader } = this.props.config;\n const { crossSellsTitle: defaultHeader } = this.props\n .translations as ITranslationsCollection;\n\n return crossSellsCustomHeader || defaultHeader;\n }\n\n public render() {\n if (!this.props.viewController.isLoaded) {\n return null;\n }\n\n const productCrossSellHeaderClassNames = classes('product-cross-sell-header');\n const productCrossSellClassNames = classes('product-cross-sell', this.props.className);\n\n return (\n <>\n \n {this.crossSellHeader}\n \n \n \n \n );\n }\n}\n\nProductCrossSell.displayName = 'ProductCrossSell';\n\nexport default ProductCrossSell;\n","import * as React from 'react';\nimport { observer } from 'mobx-react';\nimport { configConsumer } from '@estee/elc-service';\nimport { SliderView, ISliderSettings, ISliderBreakpoints } from '@estee/elc-slider';\nimport { Container } from '@estee/elc-grid';\nimport styled from 'styled-components';\nimport { Breakpoints, ContentSpacing } from '@estee/elc-base-theme';\nimport { IContentItem } from '../../../exported/product-grid-wrapper/ProductGridWrapper';\nimport { Product } from '../../domain/entities/Product';\nimport { GridItem } from '../../domain/entities/GridItem';\nimport { DEFAULT_CAROUSEL_SETTINGS, gridItemType } from '../../constants/ProductGrid';\nimport { CollectionItem, CollectionItemType } from '../product-grid/CollectionItem';\nimport { ComponentTypes } from '../../constants/ComponentTypes';\nimport { classes } from '../../utils/Classes';\nimport { PRODUCT_CAROUSEL } from '~constants/DataTestIdAttributes';\nimport { getResponsiveConfig } from '~utils/ConfigUtils';\n\nexport interface IProductCarousel {\n config: {\n products?: Product[];\n gridItems?: GridItem[];\n content?: IContentItem[];\n carouselSettings?: ISliderSettings;\n defaultCarouselSettings?: ISliderSettings;\n toutWidth?: number;\n toutHeight?: number;\n loadCarouselFirstSlide?: boolean;\n };\n className?: string;\n disableFullHeight?: boolean;\n}\n\nconst SliderViewStyled = styled.div`\n margin-bottom: ${ContentSpacing.space20};\n\n .slick-track {\n margin-left: 0;\n padding: ${ContentSpacing.space4} 0;\n display: flex;\n }\n\n .slick-slide {\n & > div {\n height: ${(props) => (props.theme.disableFullHeight ? 'auto' : '100%')};\n }\n\n height: auto;\n float: none;\n margin: 0 ${ContentSpacing.space4};\n }\n\n [dir='rtl'] .slick-track {\n margin-right: 0;\n margin-left: auto;\n }\n\n .elc-slider-arrow-wrapper {\n &::before {\n content: none;\n }\n &.slick-prev {\n left: -15px;\n }\n\n [dir='rtl'] &.slick-prev {\n left: 0;\n right: -15px;\n }\n }\n`;\n@configConsumer(['loadCarouselFirstSlide'])\n@observer\nexport class ProductCarousel extends React.Component {\n public static displayName: string;\n\n public overrideCarouselSettings = () => {\n const { carouselSettings, defaultCarouselSettings, loadCarouselFirstSlide } =\n this.props.config;\n\n if (!carouselSettings) {\n return defaultCarouselSettings || DEFAULT_CAROUSEL_SETTINGS;\n }\n\n const { responsive: responsiveDefault, ...restDefaultProperties } =\n DEFAULT_CAROUSEL_SETTINGS;\n\n const { responsive: responsiveOverrideSettings, ...restOverrideProperties } =\n carouselSettings;\n\n const restSettings = {\n ...restDefaultProperties,\n ...restOverrideProperties\n };\n\n if (!responsiveOverrideSettings) {\n const settings = {\n ...restSettings,\n responsive: responsiveDefault\n };\n\n return { ...settings };\n }\n const responsiveSettings = responsiveDefault.map(function (responsive, index) {\n const responsiveOverrides =\n getResponsiveConfig(responsive.breakpoint, responsiveOverrideSettings) || {};\n\n return {\n ...responsive,\n settings: {\n ...responsive.settings,\n ...responsiveOverrides\n }\n };\n });\n\n const finalSettings = {\n ...restSettings,\n lazyLoad: loadCarouselFirstSlide ? 'ondemand' : null,\n responsive: responsiveSettings\n };\n\n return { ...finalSettings };\n };\n\n public mobileCarouselSettings = (carouselSettings: ISliderSettings): ISliderBreakpoints =>\n carouselSettings?.responsive?.find(\n (setting) => setting.breakpoint === Breakpoints.desktop\n ) as ISliderBreakpoints;\n\n private lazyLoadImage = (positionIndex: number, carouselSettings: ISliderSettings) => {\n const mobileSettings = this.mobileCarouselSettings(carouselSettings);\n const lazyLoadImageMobile = positionIndex >= Number(mobileSettings.settings.slidesToShow);\n const lazyLoadImageDesktop = positionIndex >= Number(carouselSettings.slidesToShow);\n\n return {\n lazyLoadImageMobile,\n lazyLoadImageDesktop\n };\n };\n\n private renderProductItem = (\n product: Product,\n carouselSettings: ISliderSettings,\n positionIndex: number\n ) => {\n const { lazyLoadImageMobile, lazyLoadImageDesktop } = this.lazyLoadImage(\n positionIndex,\n carouselSettings\n );\n\n return (\n product && (\n \n )\n );\n };\n\n private renderGridItems(\n item: GridItem,\n carouselSettings: ISliderSettings,\n positionIndex: number\n ) {\n const { lazyLoadImageMobile, lazyLoadImageDesktop } = this.lazyLoadImage(\n positionIndex,\n carouselSettings\n );\n switch (item.itemType) {\n case gridItemType.product:\n case gridItemType.featuredProduct:\n return item.product ? (\n \n ) : (\n <>\n );\n default:\n return (\n \n );\n }\n }\n\n public render() {\n const carouselContainerClassNames = classes('product-carousel-container');\n const carouselSettings = this.overrideCarouselSettings();\n const {\n disableFullHeight,\n config: { gridItems, products }\n } = this.props;\n\n let carouselItems: React.ReactElement[] = [];\n\n if (gridItems && gridItems.length > 0) {\n carouselItems = gridItems.reduce(\n (accumulator: React.ReactElement[], item, currentIndex) => {\n if (item.itemType !== gridItemType.featuredProduct) {\n accumulator.push(\n this.renderGridItems(item, carouselSettings, currentIndex)\n );\n }\n\n return accumulator;\n },\n []\n );\n } else if (products && products.length > 0) {\n carouselItems = products.map((product, index) =>\n this.renderProductItem(product, carouselSettings, index)\n );\n }\n\n return (\n carouselItems.length > 0 && (\n \n \n \n \n \n )\n );\n }\n}\n\nProductCarousel.displayName = 'ProductCarousel';\n","import * as React from 'react';\nimport { observer } from 'mobx-react';\nimport styled from 'styled-components';\nimport { classes } from '../../utils/Classes';\nimport { ProductContent } from '../product-content/ProductContent';\nimport { PRODUCT_TOUT_WRAPPER } from '~constants/DataTestIdAttributes';\n\nexport interface IProductToutProps {\n toutWidth?: number;\n toutHeight?: number;\n className?: string;\n nid: number;\n}\n\nconst ProductToutWrapper = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n\n /*\n Fallback for touts with no content displayed\n */\n .elc-service-view-renderer {\n width: 100%;\n height: 100%;\n\n & > div:empty {\n height: 100%;\n background-color: #eee;\n }\n }\n`;\n\nexport const ProductTout = observer(function ProductTout(props: IProductToutProps) {\n const productToutClassNames = classes('product-tout-wrapper');\n\n return (\n \n \n \n );\n});\n","import * as React from 'react';\nimport { observer } from 'mobx-react';\nimport { ProductTout } from '../product-tout/ProductTout';\nimport { configConsumer } from '@estee/elc-service';\nimport { IProductBriefConfig, IProductBriefProps } from '~interfaces/IProductBrief';\nimport ProductBrief from 'src/exported/product-brief/ProductBrief';\n\nexport enum CollectionItemType {\n PRODUCT = 'product',\n TOUT = 'tout',\n FEATURED_PRODUCT = 'featured'\n}\n\nexport interface ICollectionItemProps {\n collectionItem: CollectionItemType;\n productBriefProps?: IProductBriefProps;\n id: number | string;\n config?: IProductBriefConfig;\n}\n\n@configConsumer([\n 'componentElementsOrderConfig',\n 'enableClickableBrief',\n 'productBenefitTypes',\n 'translationsOverwrites',\n 'imageCarouselSettings'\n])\n@observer\nexport class CollectionItem extends React.Component {\n public static displayName: string;\n\n public getBrief() {\n const props = {\n config: {\n ...(this.props.productBriefProps as IProductBriefProps),\n ...this.props.config\n }\n };\n\n return ;\n }\n\n render() {\n const { collectionItem, id } = this.props;\n\n switch (collectionItem) {\n case CollectionItemType.PRODUCT:\n return this.getBrief();\n case CollectionItemType.TOUT:\n return ;\n default:\n return null;\n }\n }\n}\n\nCollectionItem.displayName = 'CollectionItem';\n"],"names":["ProductCrossSell","componentDidMount","this","props","viewController","loaded","productCarouselProps","productGridBreakpoints","config","numColumnsMobile","numColumnsDesktop","numColumnsLargeScreen","numColumnsExtraLargeScreen","crossSellSettings","dots","infinite","slidesToShow","slidesToScroll","responsive","breakpoint","settings","arrows","products","data","crossSellProducts","carouselSettings","crossSellHeader","crossSellsCustomHeader","crossSellsTitle","defaultHeader","translations","render","isLoaded","productCrossSellHeaderClassNames","productCrossSellClassNames","className","displayName","SliderViewStyled","theme","disableFullHeight","ProductCarousel","overrideCarouselSettings","defaultCarouselSettings","loadCarouselFirstSlide","responsiveDefault","restDefaultProperties","responsiveOverrideSettings","restOverrideProperties","restSettings","responsiveSettings","map","index","responsiveOverrides","finalSettings","lazyLoad","mobileCarouselSettings","find","setting","lazyLoadImage","positionIndex","mobileSettings","lazyLoadImageMobile","Number","lazyLoadImageDesktop","renderProductItem","product","key","productId","id","collectionItem","productBriefProps","componentType","renderGridItems","item","itemType","itemId","carouselContainerClassNames","gridItems","carouselItems","length","reduce","accumulator","currentIndex","push","sliderSettings","items","ProductToutWrapper","ProductTout","observer","productToutClassNames","ProductContent","nid","CollectionItemType","CollectionItem","getBrief","ProductBrief"],"sourceRoot":""}