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AAMiL,aAAae,KAAInL,GAAQA,IAC9DP,KAAKN,MAAMsJ,YACXhJ,KAAKN,MAAMgJ,mBACX1I,KAAKN,MAAM2K,WACXrK,KAAKN,MAAM6K,gBAOxC,CAsCQ8jD,oBAAiB,IAAAC,EACrB,MAAM,OAAEhuD,EAAM,QAAE4F,EAAO,SAAEiB,GAAanH,KAAKN,MAC3C,OACIF,EAAAA,cAACD,EAAAA,GAAImB,OAAAC,OAAA,GACG,CACAJ,KAAMD,EAAOkH,SACbtF,MAA6B,QAAxBosD,EAAEhuD,EAAOiuD,uBAAe,IAAAD,EAAAA,EAAI,CAAC,EAClCluD,UAAW,yBACX+B,aAAc+D,EAAQC,QAAQhE,aAC9BK,eAAgB0D,EAAQC,QACxBgB,aAIhB,EA0EJ","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/aquaglide-header/components/logo.tsx?adf0","webpack://Msdyn365.Commerce.Online/./src/modules/aquaglide-header/components/nav-icon.tsx?f523","webpack://Msdyn365.Commerce.Online/./src/modules/aquaglide-header/components/aquaglide-header-preferred-store.tsx?a19d","webpack://Msdyn365.Commerce.Online/./src/modules/aquaglide-header/aquaglide-header.tsx?dfbc","webpack://Msdyn365.Commerce.Online/./src/modules/aquaglide-header/aquaglide-header.view.tsx?db78","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/components/logo.tsx?d024","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/components/nav-icon.tsx?036d","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/components/connellyb2b-header-preferred-store.tsx?4dc3","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/connellyb2b-header.tsx?f159","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/collapse/Collapse.tsx?4835","webpack://Msdyn365.Commerce.Online/./public/connelly/img/ConnellyWebWhite.svg?136b","webpack://Msdyn365.Commerce.Online/./src/modules/connellyb2b-header/connellyb2b-header.view.tsx?74c7","webpack://Msdyn365.Commerce.Online/./src/modules/kent-header/components/logo.tsx?9879","webpack://Msdyn365.Commerce.Online/./src/modules/kent-header/components/nav-icon.tsx?e52b","webpack://Msdyn365.Commerce.Online/./src/modules/kent-header/kent-header.tsx?6404","webpack://Msdyn365.Commerce.Online/./src/modules/kent-header/kent-header.view.tsx?2eb1","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/utilities.ts?a27b","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/choice-summary.tsx?9be8","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/error-message.tsx?ef33","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/feature-search-result-item.tsx?8030","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/link.tsx?e3df","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/modal.tsx?cfe1","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/product-search-result-items.tsx?56d6","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/range-refine-item.tsx?c023","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/refine-item.tsx?ae76","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/refine-submenu.tsx?c591","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/separator.tsx?daed","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/components/title.tsx?8310","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/liquid23-search-result-container.props.autogenerated.ts?9bb7","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/liquid23-search-result-container.tsx?41e9","webpack://Msdyn365.Commerce.Online/./src/modules/liquid23-search-result-container/liquid23-search-result-container.view.tsx?0865","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/components/logo.tsx?7e1d","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/components/nav-icon.tsx?259e","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/components/obrienb2b-header-preferred-store.tsx?7ea5","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/obrienb2b-header.tsx?c0d6","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/collapse/Collapse.tsx?aa93","webpack://Msdyn365.Commerce.Online/./public/obrien/img/Obrien-Logo-Web.svg?e342","webpack://Msdyn365.Commerce.Online/./src/modules/obrienb2b-header/obrienb2b-header.view.tsx?f06a","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/components/logo.tsx?8fd8","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/components/nav-icon.tsx?26a7","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/components/watersportdiscounts-header-preferred-store.tsx?6a6e","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/components/links-left.tsx?620d","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/components/links-right.tsx?e0aa","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/watersportdiscounts-header.tsx?1e9d","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/collapse/Collapse.tsx?71ba","webpack://Msdyn365.Commerce.Online/./public/watersportdiscounts/img/WatersportDiscountsLogo.svg?e67d","webpack://Msdyn365.Commerce.Online/./src/modules/watersportdiscounts-header/watersportdiscounts-header.view.tsx?a435","webpack://Msdyn365.Commerce.Online/./src/nickComponents/price.components.tsx?e06a","webpack://Msdyn365.Commerce.Online/./src/nickComponents/product-dimension/swatch/swatch-item.tsx?30cf","webpack://Msdyn365.Commerce.Online/./src/nickComponents/product-dimension/swatch/swatch.tsx?c760","webpack://Msdyn365.Commerce.Online/./src/nickComponents/product-component-swatch.tsx?a4cd","webpack://Msdyn365.Commerce.Online/./src/nickComponents/product-dimension/dropdown/dropdown.tsx?2783","webpack://Msdyn365.Commerce.Online/./src/nickComponents/product-dimension/product-dimension.component.tsx?10d0","webpack://Msdyn365.Commerce.Online/./src/nickComponents/rating.component.tsx?f999","webpack://Msdyn365.Commerce.Online/./src/themes/connellyb2b/views/components/product.component.tsx?028e","webpack://Msdyn365.Commerce.Online/./src/themes/hosports-b2b/views/components/product.component.tsx?e808","webpack://Msdyn365.Commerce.Online/./src/themes/obrien23/views/components/product.component.tsx?9c13","webpack://Msdyn365.Commerce.Online/./src/themes/obrienb2b/views/components/product.component.tsx?d1fa","webpack://Msdyn365.Commerce.Online/./src/themes/watersportdiscounts/views/components/product.component.tsx?9735","webpack://Msdyn365.Commerce.Online/./src/modules/fabrikam/views/components/cartlineitem.component.tsx?eb8c","webpack://Msdyn365.Commerce.Online/./src/modules/header/components/header-preferred-store.tsx?ee9c","webpack://Msdyn365.Commerce.Online/./src/modules/header/components/logo.tsx?f27e","webpack://Msdyn365.Commerce.Online/./src/modules/header/components/nav-icon.tsx?2475","webpack://Msdyn365.Commerce.Online/./src/modules/header/header.tsx?e91a","webpack://Msdyn365.Commerce.Online/./src/modules/header/header.view.tsx?cf0f","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-preview/product-comparison-preview.tsx?39f6","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison-preview/product-comparison-preview.view.tsx?28cb","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison/base/product-specification.tsx?75ed","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison/base/remove-from-comparison-button.tsx?1d8c","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison/product-comparison.tsx?4f74","webpack://Msdyn365.Commerce.Online/./src/modules/product-comparison/product-comparison.view.tsx?a0a9","webpack://Msdyn365.Commerce.Online/./src/modules/header/utilities/mock-utilities.ts?d017","webpack://Msdyn365.Commerce.Online/./src/modules/adventureworks/views/header.view.tsx?9bd3"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport interface ILogoProps {\r\n image: Msdyn365.IImageData;\r\n gridSettings?: Msdyn365.IGridSettings;\r\n link?: ILinkData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n requestContext: Msdyn365.IRequestContext;\r\n}\r\n\r\nexport interface ILinkData {\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Logo component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Logo extends React.PureComponent {\r\n private attributes?: Msdyn365.IDictionary;\r\n\r\n constructor(props: ILogoProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Logo);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n public render(): JSX.Element {\r\n return
{this._renderLogo(this.props)}
;\r\n }\r\n\r\n private _renderLogo(config: ILogoProps): JSX.Element {\r\n if (config.link && config.link.linkUrl.destinationUrl) {\r\n return (\r\n // eslint-disable-next-line react/jsx-no-target-blank\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n return this._renderImage(config);\r\n }\r\n\r\n private _renderImage(config: ILogoProps): JSX.Element {\r\n const defaultImageSettings: Msdyn365.IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=132&h=28&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=160&h=48&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default Logo;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n ITelemetryContent,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IAquaglideHeaderResources } from '../aquaglide-header.props.autogenerated';\r\n\r\nexport interface INavIconProps {\r\n resources: IAquaglideHeaderResources;\r\n isExpanded: boolean;\r\n targetId: string;\r\n telemetryContent?: ITelemetryContent;\r\n toggleNavBar(): void;\r\n}\r\n\r\n/**\r\n *\r\n * NavIcon component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\n@observer\r\nexport class NavIcon extends React.Component {\r\n private attributes?: Msdyn365.IDictionary;\r\n\r\n constructor(props: INavIconProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.NavIcon);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","import { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IAquaglideHeaderData } from '../aquaglide-header.data';\r\nimport { IAquaglideHeaderProps } from '../aquaglide-header.props.autogenerated';\r\n\r\n/**\r\n * The header preferred store component\r\n */\r\n@observer\r\nexport class HeaderPreferredStore extends React.PureComponent> {\r\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\r\n public handleClick = () => {\r\n return this._findPreferreStoreOnClick(this.props);\r\n };\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n slots,\r\n resources\r\n } = this.props;\r\n if (slots && slots.storeSelector && slots.storeSelector.length) {\r\n const storeName = storeSelectorStateManager!.preferredStore && storeSelectorStateManager!.preferredStore.StoreName;\r\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\r\n //@ts-ignore\r\n storeSelectorStateManager?.preferredStore.StoreName;\r\n resources.headerPreferredStoreText;\r\n\r\n return (\r\n
\r\n \r\n {storeName}\r\n \r\n {slots.storeSelector}\r\n
\r\n );\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private async _findPreferreStoreOnClick(props: IAquaglideHeaderProps): Promise {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n modules\r\n } = props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n storeSelectorStateManager\r\n .openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: orgUnitLocation => {\r\n return Promise.resolve();\r\n }\r\n })\r\n .catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n }\r\n}\r\n\r\nexport default HeaderPreferredStore;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n Button,\r\n getPayloadObject,\r\n getTelemetryAttributes,\r\n getTelemetryObject,\r\n IModuleProps,\r\n INodeProps,\r\n ITelemetryContent,\r\n KeyCodes,\r\n Modal,\r\n ModalBody,\r\n ModalHeader,\r\n onTelemetryClick,\r\n Popover,\r\n TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport * as React from 'react';\r\nimport { HeaderPreferredStore, Logo, NavIcon } from './components';\r\nimport { IAquaglideHeaderData } from './aquaglide-header.data';\r\nimport { IAquaglideHeaderProps, IAquaglideHeaderResources, IMyAccountLinksData } from './aquaglide-header.props.autogenerated';\r\n\r\nexport interface IHeaderState {\r\n mobileMenuCollapsed: boolean;\r\n signinPopoverOpen: boolean;\r\n}\r\n\r\nexport interface IHeaderViewProps extends IAquaglideHeaderProps, IHeaderState {\r\n logo: React.ReactNode;\r\n wishListIconDesktop: React.ReactNode;\r\n wishListIconMobile: React.ReactNode;\r\n cartIcon: React.ReactNode;\r\n navIcon: React.ReactNode;\r\n className: string;\r\n menuBar: React.ReactNode[];\r\n search: React.ReactNode[];\r\n siteOptions: React.ReactNode[];\r\n HeaderTag: IModuleProps;\r\n HeaderContainer: INodeProps;\r\n MobileMenuContainer: INodeProps;\r\n MobileMenuHeader: React.ReactNode;\r\n MobileMenuBodyContainer: INodeProps;\r\n MobileMenuLinksContainer: INodeProps;\r\n HeaderTopBarContainer: INodeProps;\r\n Divider: INodeProps;\r\n\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n preferredStore?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * Header component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass Header extends React.PureComponent, IHeaderState> {\r\n private popOverRef: React.RefObject;\r\n private telemetryContent: ITelemetryContent;\r\n @computed public get displayName(): Readonly {\r\n const customer = this.props.data.accountInformation?.result;\r\n return customer ? customer.FirstName || customer.Name : undefined;\r\n }\r\n\r\n constructor(props: IAquaglideHeaderProps) {\r\n super(props);\r\n this.popOverRef = React.createRef();\r\n this._toggleNavbar = this._toggleNavbar.bind(this);\r\n this._togglePopover = this._togglePopover.bind(this);\r\n this._keydown = this._keydown.bind(this);\r\n this.state = {\r\n mobileMenuCollapsed: true,\r\n signinPopoverOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.addEventListener('keydown', this._keydown);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.removeEventListener('keydown', this._keydown, false);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n data: {\r\n accountInformation,\r\n cart: { result: cart },\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n context: {\r\n request: { user }\r\n },\r\n context,\r\n resources: { cartLabel, cartQtyLabel }\r\n } = this.props;\r\n const { logoLink, logoImage } = this.props.config;\r\n const headerClassName = classnames('ms-header', this.props.config.className);\r\n const navbarKey = 'header-nav-mobile';\r\n const customer = accountInformation && accountInformation.result;\r\n const cartIconSlot = this._getSlot('cartIcon');\r\n const menuBarSlot = this._getSlot('aquaglideMenuBar');\r\n const searchSlot = this._getSlot('search');\r\n const siteOptionsSlot = this._getSlot('siteOptions');\r\n const preferredStoreSlot = this._getSlot('storeSelector');\r\n const viewProps: IHeaderViewProps = {\r\n ...(this.props as IAquaglideHeaderProps),\r\n ...this.state,\r\n logo: (\r\n \r\n ),\r\n wishListIconDesktop: (\r\n \r\n ),\r\n wishListIconMobile: (\r\n \r\n ),\r\n cartIcon:\r\n cartIconSlot && cartIconSlot.length > 0\r\n ? cartIconSlot[0]\r\n : cart && (\r\n \r\n ),\r\n navIcon: (\r\n \r\n ),\r\n menuBar: (menuBarSlot && menuBarSlot.length && menuBarSlot) || [],\r\n search: (searchSlot && searchSlot.length && searchSlot) || [],\r\n siteOptions: (siteOptionsSlot && siteOptionsSlot.length && siteOptionsSlot) || [],\r\n className: headerClassName,\r\n HeaderTag: {\r\n moduleProps: this.props,\r\n className: classnames(headerClassName),\r\n tag: 'header'\r\n },\r\n HeaderContainer: {\r\n className: classnames('ms-header__container')\r\n },\r\n HeaderTopBarContainer: {\r\n className: classnames('ms-header__topbar aquaglide justify')\r\n },\r\n Divider: {\r\n className: classnames('ms-header__divider')\r\n },\r\n MobileMenuContainer: {\r\n tag: Modal,\r\n id: navbarKey,\r\n className: 'ms-header__mobile-hamburger',\r\n isOpen: !this.state.mobileMenuCollapsed,\r\n wrapClassName: 'ms-header__modal'\r\n },\r\n MobileMenuHeader: ,\r\n MobileMenuBodyContainer: {\r\n tag: ModalBody,\r\n className: 'ms-header__mobile-hamburger-menu-body'\r\n },\r\n MobileMenuLinksContainer: {\r\n className: 'ms-header__mobile-hamburger-menu-links'\r\n },\r\n AccountInfoDropdownParentContainer: {\r\n className: 'ms-header__account-info'\r\n },\r\n AccountInfoDropdownPopoverConentContainer:\r\n (customer &&\r\n this.displayName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: this.state.signinPopoverOpen,\r\n target: this.popOverRef,\r\n toggle: this._togglePopover\r\n }) ||\r\n undefined,\r\n\r\n signInLink: this._getSigninButton(customer, user, this.props.resources),\r\n signOutLink: this._getSignOutButton(customer, user, this.props.resources),\r\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(customer),\r\n accountLinks: this._getAccountLinks(customer),\r\n preferredStore: preferredStoreSlot && preferredStoreSlot.length && storeSelectorStateManager && (\r\n \r\n )\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /* Handle link text change*/\r\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent) => {\r\n if (this.props.config.myAccountLinks && this.props.config.myAccountLinks[linkIndex]) {\r\n this.props.config.myAccountLinks[linkIndex].linkText = event.target.value;\r\n }\r\n };\r\n\r\n private _getSlot(slotName: string): React.ReactNode[] | null {\r\n const { slots } = this.props;\r\n return (slots && slots[slotName] && slots[slotName].length && slots[slotName]) || null;\r\n }\r\n\r\n private _getSigninButton(\r\n customer: Customer | undefined,\r\n user: MsDyn365.IRequestContextUser | undefined,\r\n resources: IAquaglideHeaderResources\r\n ): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignIn);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return (\r\n !customer && (\r\n \r\n \r\n {resources.signInLinkText}\r\n \r\n \r\n )\r\n );\r\n }\r\n\r\n private _getSignOutButton(\r\n customer: Customer | undefined,\r\n user: MsDyn365.IRequestContextUser | undefined,\r\n resources: IAquaglideHeaderResources\r\n ): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignOut);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return (\r\n customer &&\r\n this.displayName && (\r\n \r\n \r\n {resources.signOutLinkText}\r\n \r\n \r\n )\r\n );\r\n }\r\n\r\n private _getAccountInfoDropdownButton(customer: Customer | undefined): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.MyProfile);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return (\r\n customer &&\r\n this.displayName && (\r\n \r\n {this.displayName}\r\n \r\n )\r\n );\r\n }\r\n\r\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\r\n const { myAccountLinks } = this.props.config;\r\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n if (!customer || !this.displayName || !myAccountLinks || !myAccountLinks.length) {\r\n return undefined;\r\n }\r\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\r\n payLoad.contentAction.etext = cta.linkText;\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n const editableLink: MsDyn365.ILinksData = {\r\n ariaLabel: cta.ariaLabel,\r\n className: 'ms-signin-info__account-link-button',\r\n linkText: cta.linkText,\r\n linkUrl: cta.linkUrl.destinationUrl,\r\n openInNewTab: cta.openInNewTab,\r\n role: 'button',\r\n additionalProperties: attributes\r\n };\r\n\r\n return (\r\n \r\n );\r\n });\r\n }\r\n\r\n private _toggleNavbar(): void {\r\n this.setState({\r\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\r\n });\r\n }\r\n\r\n private _togglePopover(): void {\r\n this.setState({\r\n signinPopoverOpen: !this.state.signinPopoverOpen\r\n });\r\n }\r\n\r\n private _keydown(e: KeyboardEvent): void {\r\n if (e.keyCode === KeyCodes.Escape) {\r\n this.setState({ mobileMenuCollapsed: true });\r\n }\r\n }\r\n}\r\n\r\nexport default Header;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Collapse, Drawer, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport { AsyncResult } from '@msdyn365-commerce/core';\r\nimport { IHeaderViewProps } from './aquaglide-header';\r\n\r\nconst headerView: React.FC = props => {\r\n const { HeaderTag, HeaderContainer, HeaderTopBarContainer, Divider } = props;\r\n return (\r\n \r\n \r\n \r\n {/* This is the area that is majorly revamped. Subtract components as needed. */}\r\n\r\n
\r\n {props.logo}\r\n {props.navIcon}\r\n
\r\n\r\n
{_renderReactFragment(props.menuBar)}
\r\n\r\n
\r\n {_renderReactFragment(props.search)}\r\n {_renderDesktopAccountBlock(props)}\r\n {props.wishListIconDesktop}\r\n \r\n {props.cartIcon}\r\n {_renderReactFragment(props.siteOptions)}\r\n
\r\n
\r\n {_renderCollapseMenu(props)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nfunction _renderCollapseMenu(props: IHeaderViewProps): JSX.Element | null {\r\n const { MobileMenuLinksContainer, mobileMenuCollapsed } = props;\r\n return (\r\n \r\n \r\n {_renderReactFragment(props.menuBar)}\r\n {_renderReactFragment(props.search)}\r\n {_renderMobileAccountBlock(props, true)}\r\n {props.wishListIconMobile}\r\n \r\n \r\n );\r\n}\r\n\r\nconst renderCustomerName = (accountInformation: AsyncResult): React.ReactChild => {\r\n const customer = accountInformation && accountInformation.result;\r\n return <>{customer && customer.FirstName};\r\n};\r\n\r\nfunction _renderMobileAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n const { AccountInfoDropdownParentContainer, signOutLink, signInLink, data, accountLinks } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n const accountClassName = classnames(\r\n 'ms-header__drawer',\r\n AccountInfoDropdownParentContainer.className,\r\n renderForMobile ? 'account-mobile' : 'account-desktop'\r\n );\r\n\r\n if (accountLinks) {\r\n return (\r\n \r\n
\r\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n {signOutLink}\r\n
\r\n \r\n );\r\n } else if (signInLink) {\r\n return (\r\n \r\n {signInLink}\r\n \r\n );\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nfunction _renderDesktopAccountBlock(props: IHeaderViewProps): JSX.Element | null {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n AccountInfoDropdownPopoverConentContainer,\r\n accountInfoDropdownButton,\r\n signOutLink,\r\n signInLink,\r\n accountLinks\r\n } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n if (AccountInfoDropdownPopoverConentContainer) {\r\n return (\r\n \r\n {accountInfoDropdownButton}\r\n \r\n {accountLinks ? accountLinks.map(link => link) : false}\r\n {signOutLink}\r\n \r\n \r\n );\r\n } else if (signInLink) {\r\n return {signInLink};\r\n }\r\n }\r\n props.context.telemetry.error('Header content is empty, module wont render.');\r\n return null;\r\n}\r\n\r\nfunction _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\r\n return (\r\n \r\n {items && items.length\r\n ? items.map((slot: React.ReactNode, index: number) => {\r\n return {slot};\r\n })\r\n : null}\r\n \r\n );\r\n}\r\n\r\nexport default headerView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport interface ILogoProps {\r\n image: Msdyn365.IImageData;\r\n gridSettings?: Msdyn365.IGridSettings;\r\n link?: ILinkData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n requestContext: Msdyn365.IRequestContext;\r\n}\r\n\r\nexport interface ILinkData {\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Logo component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Logo extends React.PureComponent {\r\n\r\n private attributes?: Msdyn365.IDictionary;\r\n\r\n constructor(props: ILogoProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Logo);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n public render():JSX.Element {\r\n return(\r\n
\r\n {this._renderLogo(this.props)}\r\n
\r\n );\r\n }\r\n\r\n private _renderLogo(config: ILogoProps):JSX.Element {\r\n if(config.link && config.link.linkUrl.destinationUrl) {\r\n return(\r\n \r\n {this._renderImage(config)}\r\n \r\n );\r\n }\r\n return(\r\n this._renderImage(config)\r\n );\r\n }\r\n\r\n private _renderImage(config: ILogoProps): JSX.Element {\r\n const defaultImageSettings: Msdyn365.IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=132&h=28&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=160&h=48&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default Logo;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IConnellyb2bHeaderResources } from '../connellyb2b-header.props.autogenerated';\r\n\r\nexport interface INavIconProps {\r\n resources: IConnellyb2bHeaderResources;\r\n isExpanded: boolean;\r\n targetId: string;\r\n telemetryContent?: ITelemetryContent;\r\n toggleNavBar(): void;\r\n}\r\n\r\n/**\r\n *\r\n * NavIcon component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\n@observer\r\nexport class NavIcon extends React.Component {\r\n\r\n private attributes?: Msdyn365.IDictionary;\r\n\r\n constructor(props: INavIconProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.NavIcon);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n\r\n public render():JSX.Element {\r\n return (\r\n Menu\r\n );\r\n }\r\n}","import { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IConnellyb2BHeaderData } from '../connellyb2b-header.data';\r\nimport { IConnellyb2bHeaderProps } from '../connellyb2b-header.props.autogenerated';\r\n\r\n/**\r\n * The header preferred store component\r\n */\r\n@observer\r\nexport class HeaderPreferredStore extends React.PureComponent> {\r\n\r\n public handleClick = () => { return this._findPreferreStoreOnClick(this.props); };\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n slots,\r\n resources\r\n } = this.props;\r\n if (slots && slots.storeSelector && slots.storeSelector.length) {\r\n const storeName = storeSelectorStateManager!.preferredStore && storeSelectorStateManager!.preferredStore.StoreName ?\r\n storeSelectorStateManager!.preferredStore.StoreName :\r\n resources.headerPreferredStoreText;\r\n\r\n return (\r\n
\r\n \r\n {slots.storeSelector}\r\n
\r\n );\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private async _findPreferreStoreOnClick(props: IConnellyb2bHeaderProps): Promise {\r\n const { data: { storeSelectorStateManager: { result: storeSelectorStateManager } }, modules } = props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n storeSelectorStateManager.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: orgUnitLocation => {\r\n return Promise.resolve();\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n }\r\n}\r\n\r\nexport default HeaderPreferredStore;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes, Modal,\r\n ModalBody, ModalHeader, onTelemetryClick, Popover, TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport * as React from 'react';\r\nimport { HeaderPreferredStore, Logo, NavIcon } from './components';\r\nimport { IConnellyb2BHeaderData } from './connellyb2b-header.data';\r\nimport { IConnellyb2bHeaderProps, IConnellyb2bHeaderResources, IMyAccountLinksData } from './connellyb2b-header.props.autogenerated';\r\n\r\nexport interface IHeaderState {\r\n mobileMenuCollapsed: boolean;\r\n signinPopoverOpen: boolean;\r\n}\r\n\r\nexport interface IHeaderViewProps extends IConnellyb2bHeaderProps, IHeaderState {\r\n logo: React.ReactNode;\r\n wishListIconDesktop: React.ReactNode;\r\n wishListIconMobile: React.ReactNode;\r\n cartIcon: React.ReactNode;\r\n navIcon: React.ReactNode;\r\n className: string;\r\n menuBar: React.ReactNode[];\r\n search: React.ReactNode[];\r\n siteOptions: React.ReactNode[];\r\n HeaderTag: IModuleProps;\r\n HeaderContainer: INodeProps;\r\n MobileMenuContainer: INodeProps;\r\n MobileMenuHeader: React.ReactNode;\r\n MobileMenuBodyContainer: INodeProps;\r\n MobileMenuLinksContainer: INodeProps;\r\n HeaderTopBarContainer: INodeProps;\r\n Divider: INodeProps;\r\n\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n preferredStore?: React.ReactNode;\r\n\r\n logoLinkSvg: string;\r\n}\r\n\r\n/**\r\n *\r\n * Header component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass Header extends React.PureComponent, IHeaderState> {\r\n private popOverRef: React.RefObject;\r\n private telemetryContent: ITelemetryContent;\r\n @computed public get displayName(): Readonly {\r\n const customer = this.props.data.accountInformation?.result;\r\n return customer ? customer.FirstName || customer.Name : undefined;\r\n }\r\n\r\n constructor(props: IConnellyb2bHeaderProps) {\r\n super(props);\r\n this.popOverRef = React.createRef();\r\n this._toggleNavbar = this._toggleNavbar.bind(this);\r\n this._togglePopover = this._togglePopover.bind(this);\r\n this._keydown = this._keydown.bind(this);\r\n this.state = {\r\n mobileMenuCollapsed: true,\r\n signinPopoverOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.addEventListener('keydown', this._keydown);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.removeEventListener('keydown', this._keydown, false);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n data: { accountInformation,\r\n cart: { result: cart },\r\n storeSelectorStateManager: {result: storeSelectorStateManager}\r\n },\r\n context: {\r\n request: {\r\n user\r\n }\r\n },\r\n context,\r\n resources: {\r\n cartLabel,\r\n cartQtyLabel\r\n }\r\n } = this.props;\r\n const { logoLink, logoImage, logoLinkSvg } = this.props.config;\r\n const headerClassName = classnames('ms-header', this.props.config.className);\r\n const navbarKey = 'header-nav-mobile';\r\n const customer = accountInformation && accountInformation.result;\r\n const cartIconSlot = this._getSlot('cartIcon');\r\n const menuBarSlot = this._getSlot('connellyb2bMenuBar');\r\n const searchSlot = this._getSlot('search');\r\n const siteOptionsSlot = this._getSlot('siteOptions');\r\n const preferredStoreSlot = this._getSlot('storeSelector');\r\n\r\n const LogoLinkSvg = logoLinkSvg ? logoLinkSvg : 'No Link';\r\n\r\n const viewProps: IHeaderViewProps = {\r\n ...(this.props as IConnellyb2bHeaderProps),\r\n ...(this.state),\r\n logo: ,\r\n wishListIconDesktop: (\r\n \r\n ),\r\n wishListIconMobile: (\r\n \r\n ),\r\n cartIcon: (cartIconSlot && cartIconSlot.length > 0)\r\n ? cartIconSlot[0]\r\n : cart && ,\r\n navIcon: ,\r\n menuBar: menuBarSlot && menuBarSlot.length && menuBarSlot || [],\r\n search: searchSlot && searchSlot.length && searchSlot || [],\r\n siteOptions: siteOptionsSlot && siteOptionsSlot.length && siteOptionsSlot || [],\r\n className: headerClassName,\r\n logoLinkSvg: LogoLinkSvg,\r\n HeaderTag: {\r\n moduleProps: this.props,\r\n className: classnames(headerClassName),\r\n tag: 'header'\r\n },\r\n HeaderContainer: {\r\n className: classnames('ms-header__container')\r\n },\r\n HeaderTopBarContainer: {\r\n className: classnames('inside-xxl always-flex justify')\r\n },\r\n Divider: {\r\n className: classnames('ms-header__divider')\r\n },\r\n MobileMenuContainer: {\r\n tag: Modal,\r\n id: navbarKey,\r\n className: 'ms-header__mobile-hamburger',\r\n isOpen: !this.state.mobileMenuCollapsed,\r\n wrapClassName: 'ms-header__modal'\r\n },\r\n MobileMenuHeader: (\r\n \r\n ),\r\n MobileMenuBodyContainer: {\r\n tag: ModalBody,\r\n className: 'ms-header__mobile-hamburger-menu-body',\r\n },\r\n MobileMenuLinksContainer: {\r\n className: 'ms-header__mobile-hamburger-menu-links',\r\n },\r\n AccountInfoDropdownParentContainer: {\r\n className: 'ms-header__account-info'\r\n },\r\n AccountInfoDropdownPopoverConentContainer: customer && this.displayName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: this.state.signinPopoverOpen,\r\n target: this.popOverRef,\r\n toggle: this._togglePopover,\r\n } || undefined,\r\n signInLink: this._getSigninButton(customer, user, this.props.resources),\r\n signOutLink: this._getSignOutButton(customer, user, this.props.resources),\r\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(customer),\r\n accountLinks: this._getAccountLinks(customer),\r\n preferredStore: preferredStoreSlot\r\n && preferredStoreSlot.length\r\n && storeSelectorStateManager\r\n && ()\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /* Handle link text change*/\r\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent) => {\r\n if (this.props.config.myAccountLinks && this.props.config.myAccountLinks[linkIndex]) {\r\n this.props.config.myAccountLinks[linkIndex].linkText = event.target.value;\r\n }\r\n }\r\n\r\n private _getSlot(slotName: string): React.ReactNode[] | null {\r\n const { slots } = this.props;\r\n return (slots && slots[slotName] && slots[slotName].length && slots[slotName]) || null;\r\n }\r\n\r\n private _getSigninButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IConnellyb2bHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignIn);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return !customer && (\r\n \r\n {resources.signInLinkText}\r\n \r\n );\r\n }\r\n\r\n private _getSignOutButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IConnellyb2bHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignOut);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n \r\n {resources.signOutLinkText}\r\n \r\n );\r\n }\r\n\r\n private _getAccountInfoDropdownButton(customer: Customer | undefined): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.MyProfile);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n \r\n {this.displayName}\r\n \r\n );\r\n }\r\n\r\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\r\n const { myAccountLinks } = this.props.config;\r\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n if(!customer || ! this.displayName || !myAccountLinks || !myAccountLinks.length) {\r\n return undefined;\r\n }\r\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\r\n payLoad.contentAction.etext = cta.linkText;\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n const editableLink: MsDyn365.ILinksData = {\r\n ariaLabel: cta.ariaLabel,\r\n className: 'ms-signin-info__account-link-button',\r\n linkText: cta.linkText,\r\n linkUrl: cta.linkUrl.destinationUrl,\r\n openInNewTab: cta.openInNewTab,\r\n role: 'button',\r\n additionalProperties: attributes\r\n };\r\n\r\n return (\r\n \r\n );\r\n });\r\n }\r\n\r\n private _toggleNavbar(): void {\r\n this.setState({\r\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\r\n });\r\n }\r\n\r\n private _togglePopover(): void {\r\n this.setState({\r\n signinPopoverOpen: !this.state.signinPopoverOpen\r\n });\r\n }\r\n\r\n private _keydown(e: KeyboardEvent): void {\r\n if (e.keyCode === KeyCodes.Escape) {\r\n this.setState({ mobileMenuCollapsed: true });\r\n }\r\n }\r\n}\r\n\r\nexport default Header;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport Transition from 'react-transition-group/Transition';\r\n\r\nimport { mapToCssModules, TransitionStatuses } from '@msdyn365-commerce-modules/utilities';\r\nimport { ICollapseProps } from './Collapse.props';\r\n\r\nexport interface ICollapseState {\r\n height: number | null;\r\n}\r\n\r\ntype IHash = {\r\n [key in TransitionStatuses]: string;\r\n};\r\n\r\n/**\r\n * This is the controlled version of a Collapse component, and as such the toggle behavior is expected to be handled in a parent component.\r\n * @see See [Uncontrolled Components - React](https://reactjs.org/docs/uncontrolled-components.html) to learn more.\r\n * @visibleName Collapse (controlled)\r\n */\r\nexport default class Collapse extends React.Component {\r\n public static defaultProps: Partial = {\r\n isOpen: false,\r\n tag: 'div',\r\n timeout: 0\r\n };\r\n\r\n public props: ICollapseProps;\r\n\r\n public state: ICollapseState;\r\n\r\n private readonly _transitionStatusToClassHash: IHash = {\r\n entering: 'collapse',\r\n entered: 'collapse show',\r\n exiting: 'collapse',\r\n exited: 'collapse'\r\n };\r\n\r\n private readonly _tagRef: React.RefObject = React.createRef();\r\n\r\n constructor(props: ICollapseProps) {\r\n super(props);\r\n this.props = props;\r\n\r\n this.state = {\r\n height: 0\r\n };\r\n\r\n this._onEntering = this._onEntering.bind(this);\r\n this._onExit = this._onExit.bind(this);\r\n this._onExited = this._onExited.bind(this);\r\n this._onExiting = this._onExiting.bind(this);\r\n this._reevaluateHeight = this._reevaluateHeight.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n window && window.addEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public componentDidUpdate(nextProps: ICollapseProps): void {\r\n if (nextProps.children !== this.props.children) {\r\n this._reevaluateHeight();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window && window.removeEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICollapseProps,\r\n nextState: ICollapseState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n tag,\r\n isOpen,\r\n className,\r\n children,\r\n navbar,\r\n cssModule,\r\n\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n timeout,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited,\r\n\r\n ...otherProps\r\n } = this.props;\r\n\r\n const Tag = tag || 'div';\r\n const transitionProps = {\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited\r\n };\r\n\r\n //const { height } = this.state;\r\n //const style = height === null || height === 0 ? null : { minHeight: height };\r\n\r\n return (\r\n \r\n {(status: TransitionStatuses) => {\r\n const collapseClass = this._getTransitionClass(status);\r\n const classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);\r\n\r\n return (\r\n \r\n {children}\r\n \r\n );\r\n }}\r\n \r\n );\r\n }\r\n\r\n private _reevaluateHeight(): void {\r\n const node = this._tagRef.current;\r\n if (node !== null && node.firstElementChild && node.firstElementChild.scrollHeight > 0) {\r\n this.setState({ height: node.firstElementChild.scrollHeight });\r\n }\r\n }\r\n\r\n private _getTransitionClass(status: TransitionStatuses): string {\r\n return this._transitionStatusToClassHash[status] || 'collapse';\r\n }\r\n\r\n private _onEntering(node: HTMLElement, isAppearing: boolean): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n //if (this.props.onEntering) {\r\n // this.props.onEntering(node, isAppearing);\r\n //}\r\n }\r\n\r\n private _onExit(node: HTMLElement): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n if (this.props.onExit) {\r\n this.props.onExit(node);\r\n }\r\n }\r\n\r\n private _onExiting(node: HTMLElement): void {\r\n this.setState({ height: 0 });\r\n\r\n if (this.props.onExiting) {\r\n this.props.onExiting(node);\r\n }\r\n }\r\n\r\n private _onExited(node: HTMLElement): void {\r\n this.setState({ height: null });\r\n\r\n if (this.props.onExited) {\r\n this.props.onExited(node);\r\n }\r\n }\r\n}\r\n","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from \"react\";\nexport default (({\n styles = {},\n ...props\n}) => /*#__PURE__*/React.createElement(\"svg\", _extends({\n version: \"1.1\",\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n x: \"0\",\n y: \"0\",\n viewBox: \"0 0 630.97 117.83\",\n xmlSpace: \"preserve\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st0\"] || \"st0\",\n d: \"M157.17 2.87c-31 0-56.69 25.4-56.69 56.4 0 32.15 25.4 56.4 56.69 56.4s56.69-24.25 56.69-56.4c0-31-25.69-56.4-56.69-56.4zm0 100.18c-23.39 0-43.2-19.09-43.2-43.78 0-23.83 17.8-43.77 43.2-43.77 25.4 0 43.2 19.95 43.2 43.77 0 24.69-19.8 43.78-43.2 43.78zM429 103.05c-23.39 0-43.2-19.09-43.2-43.78h99.89c0-31-25.69-56.4-56.69-56.4-31 0-56.69 25.4-56.69 56.4 0 32.15 25.4 56.4 56.69 56.4 26.77 0 49.23-17.76 55.16-43.02h-14c-5.62 17.88-22.21 30.4-41.16 30.4zm0-87.55c20.38 0 35.87 12.84 41.19 30.22h-82.37C393.15 28.34 408.63 15.5 429 15.5zM56.69 103.05c-23.39 0-43.2-19.09-43.2-43.78 0-23.83 17.8-43.77 43.2-43.77 13.24 0 24.42 5.42 32.08 13.98l6.88-11.02C85.44 8.82 71.69 2.87 56.69 2.87 25.69 2.87 0 28.27 0 59.27c0 32.15 25.4 56.4 56.69 56.4 15.08 0 28.8-5.64 38.96-15.07l-7.17-11.66c-7.97 8.73-19.37 14.11-31.79 14.11zM347.06 5.17v79.94l-26.71-27.99V5.17h-13.49v37.82L265.83 0v42.12L225.62 0v113.38h13.49V32.72l26.71 27.99v52.67h13.49V74.85l41.03 42.99V75.71l40.2 42.12V5.17h-13.48zm-40.21 79.94l-27.54-28.85V32.72l27.54 28.85v23.54zM510.96 5.17h-13.48v108.21h56.49v-12.34h-43.01z\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st0\"] || \"st0\",\n d: \"M531.2 5.16h-13.49v89.16h36.26V82.85H531.2zM615.47 5.17l-26.56 46.21-26.55-46.21h-15.5l35.31 61.14v47.07h13.49V66.31l35.31-61.14zM170.13 33.47c9.32 0 17.38 5.25 21.13 12.95-5.21-13.91-18.5-23.58-34.1-23.58-20.12 0-36.43 16.31-36.43 36.43s16.31 36.43 36.43 36.43 36.43-16.31 36.43-36.43h-10.22c0 15.35-12.28 27.8-27.34 27.8-15.38 0-27.7-12.43-27.7-27.83 0-14.04 8.02-24.55 19.5-29.82-10.52 4.9-17.88 16.7-17.88 28.27 0 14.61 11.3 26.39 25.41 26.39 13.82 0 25.08-11.08 25.08-24.75l-10.05-.02c0 9.07-7.34 16.42-16.24 16.42-9.54 0-16.95-7.92-16.95-17.85 0-10.39 6.01-19.51 14.86-24.37-7.52 4.55-12.51 13.95-12.51 22.63 0 9.23 6.31 16.58 14.27 16.58 7.43 0 13.56-5.99 13.56-13.39l-10.21-.03c0 2.62-2.21 4.75-4.71 4.75-3.4 0-5.73-3.4-5.73-7.84 0-12.52 10.48-22.74 23.4-22.74z\"\n})));","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport Collapse from './collapse/Collapse';\r\nimport * as React from 'react';\r\n//import classnames from 'classnames';\r\n// import { Customer } from '@msdyn365-commerce/retail-proxy';\r\n// import { AsyncResult } from '@msdyn365-commerce/core';\r\nimport { IHeaderViewProps } from './connellyb2b-header';\r\n//@ts-ignore\r\nimport Logosvg from '../../../public/connelly/img/ConnellyWebWhite.svg';\r\n\r\nconst headerView: React.FC = props => {\r\n const {\r\n HeaderTag,\r\n HeaderContainer,\r\n HeaderTopBarContainer,\r\n Divider,\r\n logoLinkSvg\r\n } = props;\r\n return (\r\n \r\n \r\n \r\n\r\n {/* This is the area that is majorly revamped. Subtract components as needed. */}\r\n\r\n
\r\n {props.navIcon}\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n {_renderReactFragment(props.search)}\r\n {_renderDesktopAccountBlock(props)}\r\n {props.cartIcon}\r\n {_renderReactFragment(props.siteOptions)}\r\n
\r\n\r\n
\r\n {_renderCollapseMenu(props)}\r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nfunction _renderCollapseMenu(props: IHeaderViewProps): JSX.Element | null {\r\n const { MobileMenuLinksContainer, mobileMenuCollapsed } = props;\r\n return (\r\n \r\n \r\n
\r\n {_renderReactFragment(props.menuBar)}\r\n {/* {_renderMobileAccountBlock(props, true)}\r\n {props.wishListIconMobile} */}\r\n
\r\n
\r\n
\r\n );\r\n}\r\n\r\n// const renderCustomerName = (accountInformation: AsyncResult): React.ReactChild => {\r\n// const customer = accountInformation && accountInformation.result;\r\n// return (\r\n// <>{customer && customer.FirstName}\r\n// );\r\n// };\r\n\r\n// function _renderMobileAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n// const {\r\n// AccountInfoDropdownParentContainer,\r\n// signOutLink,\r\n// signInLink,\r\n// data,\r\n// accountLinks } = props;\r\n\r\n// if (AccountInfoDropdownParentContainer) {\r\n// const accountClassName = classnames('ms-header__drawer', AccountInfoDropdownParentContainer.className, renderForMobile ? 'account-mobile' : 'account-desktop');\r\n\r\n// if (accountLinks) {\r\n// return (\r\n// \r\n//
\r\n// {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n// {signOutLink}\r\n//
\r\n//
\r\n// );\r\n// } else if (signInLink) {\r\n// return (\r\n// \r\n// {signInLink}\r\n// \r\n// );\r\n// }\r\n// }\r\n// return null;\r\n// }\r\n\r\nfunction _renderDesktopAccountBlock(props: IHeaderViewProps): JSX.Element | null {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n AccountInfoDropdownPopoverConentContainer,\r\n accountInfoDropdownButton,\r\n signOutLink,\r\n signInLink,\r\n accountLinks,\r\n } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n if (AccountInfoDropdownPopoverConentContainer) {\r\n return (\r\n \r\n {accountInfoDropdownButton}\r\n \r\n { accountLinks ? accountLinks.map(link => link) : false }\r\n {signOutLink}\r\n \r\n \r\n );\r\n } else if (signInLink) {\r\n return (\r\n \r\n {signInLink}\r\n \r\n );\r\n }\r\n }\r\n props.context.telemetry.error('Header content is empty, module wont render.');\r\n return null;\r\n}\r\n\r\nfunction _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\r\n return (\r\n \r\n {items && items.length\r\n ? items.map((slot: React.ReactNode, index: number) => {\r\n return {slot};\r\n })\r\n : null}\r\n \r\n );\r\n}\r\n\r\nexport default headerView;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport interface ILogoProps {\r\n image: Msdyn365.IImageData;\r\n gridSettings?: Msdyn365.IGridSettings;\r\n link?: ILinkData;\r\n className?: string;\r\n}\r\n\r\nexport interface ILinkData {\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Logo component\r\n * @extends {React.PureComponent}\r\n */\r\nexport class Logo extends React.PureComponent {\r\n public render():JSX.Element {\r\n return(\r\n
\r\n {this._renderLogo(this.props)}\r\n
\r\n );\r\n }\r\n\r\n private _renderLogo(config: ILogoProps):JSX.Element {\r\n if(config.link && config.link.linkUrl.destinationUrl) {\r\n return(\r\n \r\n {this._renderImage(config)}\r\n \r\n );\r\n }\r\n return(\r\n this._renderImage(config)\r\n );\r\n }\r\n\r\n private _renderImage(config: ILogoProps): JSX.Element {\r\n const defaultImageSettings: Msdyn365.IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=132&h=28&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=160&h=48&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n}\r\n\r\nexport default Logo;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { Button } from '@msdyn365-commerce-modules/utilities';\r\nimport { observer } from 'mobx-react';\r\nimport { IKentHeaderResources } from '../kent-header.props.autogenerated';\r\n\r\nexport interface INavIconProps {\r\n resources: IKentHeaderResources;\r\n isExpanded: boolean;\r\n targetId: string;\r\n toggleNavBar(): void;\r\n}\r\n\r\n/**\r\n *\r\n * NavIcon component\r\n * @extends {React.PureComponent}\r\n */\r\n\r\n@observer\r\nexport class NavIcon extends React.Component {\r\n public render():JSX.Element {\r\n return (\r\n \r\n );\r\n }\r\n}\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Button, IModuleProps, INodeProps, KeyCodes, Modal, ModalBody, ModalHeader, Popover } from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components'\r\nimport { IRequestContextUser } from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { Logo, NavIcon } from './components';\r\nimport { IKentHeaderData } from './kent-header.data';\r\nimport { IKentHeaderProps, IKentHeaderResources, IMyAccountLinksData } from './kent-header.props.autogenerated';\r\n\r\nexport interface IHeaderState {\r\n mobileMenuCollapsed: boolean;\r\n signinPopoverOpen: boolean;\r\n}\r\n\r\nexport interface IHeaderViewProps extends IKentHeaderProps, IHeaderState {\r\n logo: React.ReactNode;\r\n wishListIconDesktop: React.ReactNode;\r\n wishListIconMobile: React.ReactNode;\r\n cartIcon: React.ReactNode;\r\n navIcon: React.ReactNode;\r\n className: string;\r\n menuBar: React.ReactNode[];\r\n search: React.ReactNode[];\r\n HeaderTag: IModuleProps;\r\n HeaderContainer: INodeProps;\r\n MobileMenuContainer: INodeProps;\r\n MobileMenuHeader: React.ReactNode;\r\n MobileMenuBodyContainer: INodeProps;\r\n MobileMenuLinksContainer: INodeProps;\r\n HeaderTopBarContainer: INodeProps;\r\n Divider: INodeProps;\r\n\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n}\r\n\r\n/**\r\n *\r\n * Header component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass Header extends React.PureComponent, IHeaderState> {\r\n private popOverRef: React.RefObject;\r\n\r\n constructor(props: IKentHeaderProps) {\r\n super(props);\r\n this.popOverRef = React.createRef();\r\n this._toggleNavbar = this._toggleNavbar.bind(this);\r\n this._togglePopover = this._togglePopover.bind(this);\r\n this._keydown = this._keydown.bind(this);\r\n this.state = {\r\n mobileMenuCollapsed: true,\r\n signinPopoverOpen: false\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n window && window.addEventListener('keydown', this._keydown);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window && window.removeEventListener('keydown', this._keydown, false);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n slots,\r\n typeName,\r\n data: { accountInformation,\r\n cart: { result: cart }\r\n },\r\n context: {\r\n request: {\r\n user\r\n }\r\n },\r\n context,\r\n resources: {\r\n cartLabel,\r\n cartQtyLabel\r\n }\r\n } = this.props;\r\n const { logoLink, logoImage } = this.props.config;\r\n const headerClassName = classnames('ms-header', this.props.config.className);\r\n const navbarKey = 'header-nav-mobile';\r\n\r\n const customer = accountInformation && accountInformation.result;\r\n\r\n const viewProps: IHeaderViewProps = {\r\n ...(this.props as IKentHeaderProps),\r\n ...(this.state),\r\n logo: ,\r\n wishListIconDesktop: ,\r\n wishListIconMobile: ,\r\n cartIcon: cart && ,\r\n navIcon: ,\r\n menuBar: slots && slots.kentMenuBar && slots.kentMenuBar.length && slots.kentMenuBar || [],\r\n search: slots && slots.search && slots.search.length && slots.search || [],\r\n className: headerClassName,\r\n HeaderTag: {\r\n moduleProps: this.props,\r\n className: classnames(headerClassName),\r\n tag: 'header'\r\n },\r\n HeaderContainer: {\r\n className: classnames('ms-header__container')\r\n },\r\n HeaderTopBarContainer: {\r\n className: classnames('ms-header__topbar')\r\n },\r\n Divider: {\r\n className: classnames('ms-header__divider')\r\n },\r\n MobileMenuContainer: {\r\n tag: Modal,\r\n id: navbarKey,\r\n className: 'ms-header__mobile-hamburger',\r\n isOpen: !this.state.mobileMenuCollapsed,\r\n wrapClassName: 'ms-header__modal'\r\n },\r\n MobileMenuHeader: (\r\n \r\n ),\r\n MobileMenuBodyContainer: {\r\n tag: ModalBody,\r\n className: 'ms-header__mobile-hamburger-menu-body',\r\n },\r\n MobileMenuLinksContainer: {\r\n className: 'ms-header__mobile-hamburger-menu-links',\r\n },\r\n AccountInfoDropdownParentContainer: customer && {\r\n className: 'ms-header__account-info'\r\n } || undefined,\r\n AccountInfoDropdownPopoverConentContainer: customer && customer.FirstName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: this.state.signinPopoverOpen,\r\n target: this.popOverRef,\r\n toggle: this._togglePopover,\r\n } || undefined,\r\n signInLink: this._getSigninButton(customer, user, this.props.resources),\r\n signOutLink: this._getSignOutButton(customer, user, this.props.resources),\r\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(customer),\r\n accountLinks: this._getAccountLinks(customer)\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _getSigninButton(customer: Customer | undefined, user: IRequestContextUser | undefined, resources: IKentHeaderResources): React.ReactNode | undefined {\r\n return customer && !customer.FirstName && (\r\n \r\n {resources.signInLinkText}\r\n \r\n );\r\n }\r\n\r\n private _getSignOutButton(customer: Customer | undefined, user: IRequestContextUser | undefined, resources: IKentHeaderResources): React.ReactNode | undefined {\r\n return customer && customer.FirstName && (\r\n \r\n {resources.signOutLinkText}\r\n \r\n );\r\n }\r\n\r\n private _getAccountInfoDropdownButton(customer: Customer | undefined): React.ReactNode | undefined {\r\n return customer && customer.FirstName && (\r\n \r\n {customer.FirstName}\r\n \r\n );\r\n }\r\n\r\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\r\n const { myAccountLinks } = this.props.config;\r\n\r\n return customer && customer.FirstName && myAccountLinks && myAccountLinks.length ?\r\n myAccountLinks.map((cta: IMyAccountLinksData, index: number) => (\r\n \r\n {cta.linkText || ''}\r\n \r\n ))\r\n : undefined;\r\n }\r\n\r\n private _toggleNavbar(): void {\r\n this.setState({\r\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\r\n });\r\n }\r\n\r\n private _togglePopover(): void {\r\n this.setState({\r\n signinPopoverOpen: !this.state.signinPopoverOpen\r\n });\r\n }\r\n\r\n private _keydown(e: KeyboardEvent): void {\r\n if (e.keyCode === KeyCodes.Escape) {\r\n this.setState({ mobileMenuCollapsed: true });\r\n }\r\n }\r\n}\r\n\r\nexport default Header;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { IHeaderViewProps } from './kent-header';\r\nimport { Collapse, Drawer, Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { AsyncResult } from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nconst headerView: React.FC = props => {\r\n const {\r\n HeaderTag,\r\n HeaderContainer,\r\n HeaderTopBarContainer,\r\n //Divider,\r\n } = props;\r\n return (\r\n \r\n \r\n \r\n \r\n\r\n
\r\n
\r\n {props.logo}\r\n {props.navIcon}\r\n {_renderReactFragment(props.menuBar)}\r\n
\r\n
\r\n
\r\n {_renderCollapseMenu(props)}\r\n\r\n
\r\n
\r\n );\r\n};\r\n\r\nfunction _renderCollapseMenu(props: IHeaderViewProps): JSX.Element | null {\r\n const { MobileMenuLinksContainer, mobileMenuCollapsed } = props;\r\n return (\r\n \r\n \r\n {_renderReactFragment(props.menuBar)}\r\n {_renderReactFragment(props.search)}\r\n {_renderMobileAccountBlock(props, true)}\r\n {props.wishListIconMobile}\r\n \r\n\r\n\r\n \r\n );\r\n}\r\nconst renderCustomerName = (accountInformation: AsyncResult): React.ReactChild => {\r\n const customer = accountInformation && accountInformation.result;\r\n return (\r\n <>{customer && customer.FirstName}\r\n );\r\n};\r\n\r\nfunction _renderMobileAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n signOutLink,\r\n signInLink,\r\n data,\r\n accountLinks } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n const accountClassName = classnames('ms-header__drawer', AccountInfoDropdownParentContainer.className, renderForMobile ? 'account-mobile' : 'account-desktop');\r\n\r\n if (accountLinks) {\r\n return (\r\n \r\n
\r\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n {signOutLink}\r\n
\r\n
\r\n );\r\n } else if (signInLink) {\r\n return (\r\n \r\n {signInLink}\r\n \r\n );\r\n }\r\n }\r\n return null;\r\n}\r\n\r\nfunction _renderAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n AccountInfoDropdownPopoverConentContainer,\r\n accountInfoDropdownButton,\r\n signOutLink,\r\n signInLink,\r\n accountLinks,\r\n } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n const accountClassName = classnames(AccountInfoDropdownParentContainer.className, renderForMobile ? 'account-mobile' : 'account-desktop');\r\n if (AccountInfoDropdownPopoverConentContainer) {\r\n return (\r\n \r\n {accountInfoDropdownButton}\r\n \r\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n {signOutLink}\r\n \r\n \r\n );\r\n } else if (signInLink) {\r\n return (\r\n \r\n {signInLink}\r\n \r\n );\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nfunction _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\r\n return (\r\n \r\n {items && items.length\r\n ? items.map((slot: React.ReactNode, index: number) => {\r\n return {slot};\r\n })\r\n : null}\r\n \r\n );\r\n}\r\n\r\nexport default headerView;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ITelemetry } from '@msdyn365-commerce/core';\r\nimport { AttributeDataType, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * Types of product refiner values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerValueDataTypeValue {\r\n /**\r\n * Range slider is used for selections like price.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Range = 1,\r\n\r\n /**\r\n * Range input is a different way to specify ranges and can be expressed with input boxes\r\n * as well as a set of discrete single-select type values.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n RangeInput = 4,\r\n\r\n /**\r\n * This is a discrete list item, either multi-select or single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n List = 5,\r\n\r\n /**\r\n * Boolean types allows only single-select.\r\n * @deprecated This will be removed soon. Please, use `AttributeDataType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { AttributeDataType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Boolean = 6\r\n}\r\n\r\n/**\r\n * Types of product refiners.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerTypeValue {\r\n /**\r\n * Refiner values are single-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Single = 0,\r\n\r\n /**\r\n * Refiner values are multi-select.\r\n * @deprecated This will be removed soon. Please, use `RefinerType` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { RefinerType } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Multi = 1\r\n}\r\n\r\n/**\r\n * ProductRefinerSource enum type.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\nexport enum ProductRefinerSource {\r\n /**\r\n * The None member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n None = 0,\r\n\r\n /**\r\n * The Attribute member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Attribute = 1,\r\n\r\n /**\r\n * The Category member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Category = 2,\r\n\r\n /**\r\n * The Price member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Price = 3,\r\n\r\n /**\r\n * The Rating member.\r\n * @deprecated This will be removed soon. Please, use `ProductRefinerSource` from `@msdyn365-commerce/retail-proxy` instead.\r\n * @example\r\n * ```\r\n * import { ProductRefinerSource } from `@msdyn365-commerce/retail-proxy`;\r\n * ```\r\n */\r\n Rating = 4\r\n}\r\n\r\n/**\r\n * Checks if the data type value corresponds to a slider.\r\n * @param dataTypeValue\r\n */\r\nexport function isRangeType(dataTypeValue: number | undefined): boolean {\r\n return (\r\n dataTypeValue === AttributeDataType.Currency ||\r\n dataTypeValue === AttributeDataType.Decimal ||\r\n dataTypeValue === AttributeDataType.Integer\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n */\r\nexport function findMatchingRefinementCriterion(\r\n productRefinerValue: ProductRefinerValue,\r\n refinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue | undefined {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return refinementCriteria.find((refinementCriterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(productRefinerValue, refinementCriterion)\r\n );\r\n}\r\n\r\n/**\r\n * Find the refinement criterion associated with this product refiner value.\r\n * @param productRefinerValue Product refiner value to match.\r\n * @param refinementCriteria Selected refinement criteria.\r\n * @param refinementCriterion\r\n */\r\nexport function isMatchingRefinementCriterion(productRefinerValue: ProductRefinerValue, refinementCriterion: ProductRefinerValue): boolean {\r\n // If the value is a range, then match only on data type value; otherwise match on item string\r\n return (\r\n refinementCriterion.RefinerRecordId === productRefinerValue.RefinerRecordId &&\r\n refinementCriterion.RefinerSourceValue === productRefinerValue.RefinerSourceValue &&\r\n refinementCriterion.DataTypeValue === productRefinerValue.DataTypeValue &&\r\n (isRangeType(refinementCriterion.DataTypeValue) ||\r\n refinementCriterion.LeftValueBoundString === productRefinerValue.LeftValueBoundString)\r\n );\r\n}\r\n\r\nexport function getUpdatedRefinementCriteria(\r\n itemToggleNotification: IRefineItemToggleNotification,\r\n currentRefinementCriteria: ProductRefinerValue[]\r\n): ProductRefinerValue[] {\r\n const updatedRefinementCriteria: ProductRefinerValue[] = [];\r\n let toggledItemFound = false;\r\n currentRefinementCriteria.forEach((selectedCriterion: ProductRefinerValue) => {\r\n if (isMatchingRefinementCriterion(itemToggleNotification.productRefinerValue, selectedCriterion)) {\r\n toggledItemFound = true;\r\n if (itemToggleNotification.isSelecting) {\r\n const next = {\r\n ...selectedCriterion,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n selectedCriterion.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n selectedCriterion.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n } // Else the item is being de-selected, so omit it from the refinement criteria\r\n } else {\r\n // Keep existing criterion because it is not in the item toggle notification\r\n updatedRefinementCriteria.push(selectedCriterion);\r\n }\r\n });\r\n\r\n if (!toggledItemFound) {\r\n const next = {\r\n ...itemToggleNotification.productRefinerValue,\r\n LeftValueBoundString:\r\n (itemToggleNotification.rangeStart !== undefined && `${itemToggleNotification.rangeStart}`) ||\r\n itemToggleNotification.productRefinerValue.LeftValueBoundString,\r\n RightValueBoundString:\r\n (itemToggleNotification.rangeEnd !== undefined && `${itemToggleNotification.rangeEnd}`) ||\r\n itemToggleNotification.productRefinerValue.RightValueBoundString\r\n };\r\n updatedRefinementCriteria.push(next);\r\n\r\n // If single select, then deselect any others in the parent refiner group\r\n if (\r\n (itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.Text ||\r\n itemToggleNotification.productRefinerValue.DataTypeValue === AttributeDataType.TrueFalse) &&\r\n itemToggleNotification.parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect\r\n ) {\r\n itemToggleNotification.parentProductRefinerHierarchy.Values.forEach((child: ProductRefinerValue) => {\r\n if (child.RefinerRecordId === next.RefinerRecordId && child.LeftValueBoundString === next.LeftValueBoundString) {\r\n // Do nothing\r\n } else {\r\n const matchingIndex = updatedRefinementCriteria.findIndex((criterion: ProductRefinerValue) =>\r\n isMatchingRefinementCriterion(child, criterion)\r\n );\r\n if (matchingIndex > -1) {\r\n updatedRefinementCriteria.splice(matchingIndex, 1);\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n return updatedRefinementCriteria;\r\n}\r\n\r\nexport function formatPrice(\r\n amount: string | undefined,\r\n currency: string | undefined,\r\n locale: string | undefined,\r\n telemetry: ITelemetry\r\n): string {\r\n if (!amount || !currency) {\r\n telemetry.trace(`[refine-menu.utilities.formatPrice] could not format price for ${amount} ${currency}`);\r\n return amount || '';\r\n }\r\n const priceAmount = (amount && Number(amount)) || 0;\r\n let result: string;\r\n\r\n try {\r\n result = new Intl.NumberFormat(locale, {\r\n style: 'currency',\r\n currencyDisplay: 'symbol',\r\n currency,\r\n minimumFractionDigits: 0\r\n }).format(priceAmount);\r\n } catch (error) {\r\n result = `${priceAmount} ${currency}`;\r\n telemetry.warning(`[refine-menu.utilities.formatPrice] Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { ProductListInventoryFilteringOptions } from '../actions';\r\nimport { IChoiceSummaryProps } from './choice-summary.props';\r\nimport { isMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\ninterface IRefinerMap {\r\n key: string;\r\n value: ProductRefinerValue;\r\n}\r\n\r\n/**\r\n * ChoiceSummary component.\r\n */\r\n@observer\r\nexport default class ChoiceSummary extends React.PureComponent {\r\n private readonly closeButtonGlyph: string = 'msi-close-btn';\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n @computed get selectedRefinersMap(): IRefinerMap[] {\r\n let { selectedChoices } = this.props;\r\n const { channelInventoryConfigurationId, refinerHierarchy } = this.props;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n if (this.props.context?.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS) {\r\n selectedChoices = selectedChoices.filter(choice => {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, choice))\r\n );\r\n return parent && parent.RecordId !== channelInventoryConfigurationId;\r\n });\r\n }\r\n return selectedChoices.map((selectedRefiner: ProductRefinerValue) => {\r\n return {\r\n key: this._getKeyForRefinerValue(selectedRefiner),\r\n value: selectedRefiner\r\n } as IRefinerMap;\r\n });\r\n }\r\n\r\n constructor(props: Readonly) {\r\n super(props);\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { clearAllText, label, classNames, choiceAriaLabel, closeAriaLabel } = this.props;\r\n const items = this.selectedRefinersMap;\r\n this.payLoad.contentAction.etext = clearAllText;\r\n const clearAllAttributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n
\r\n );\r\n }\r\n\r\n private _getKeyForRefinerValue(productRefinerValue: ProductRefinerValue): string {\r\n const { choiceFormat, choiceRangeValueFormat, refinerHierarchy, telemetry, refinerValues } = this.props;\r\n const overallFormat = choiceFormat || '{1}';\r\n const rangeFormat = choiceRangeValueFormat;\r\n let refinerName = '';\r\n if (refinerHierarchy && refinerHierarchy.find) {\r\n const parent = refinerHierarchy.find(\r\n (hierarchy: IProductRefinerHierarchy) =>\r\n !!hierarchy.Values.find((value: ProductRefinerValue) => isMatchingRefinementCriterion(value, productRefinerValue))\r\n );\r\n\r\n if (!parent) {\r\n telemetry.warning('[choice-summary] could not find parent of selected refiner value');\r\n } else {\r\n refinerName = parent.KeyName || '';\r\n }\r\n }\r\n\r\n let refinerValueName: string;\r\n if (isRangeType(productRefinerValue.DataTypeValue)) {\r\n refinerValueName = rangeFormat\r\n .replace('{0}', this._formatPrice(productRefinerValue.LeftValueBoundString, productRefinerValue.UnitText))\r\n .replace('{1}', this._formatPrice(productRefinerValue.RightValueBoundString, productRefinerValue.UnitText));\r\n } else if (productRefinerValue.RefinerRecordId === 0) {\r\n const filterValue = refinerValues?.Values.find(r => r.LeftValueBoundString === productRefinerValue.LeftValueBoundString);\r\n refinerValueName = (filterValue ? filterValue.LeftValueBoundLocalizedString : productRefinerValue.LeftValueBoundString) || '';\r\n } else {\r\n refinerValueName = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n }\r\n\r\n if (refinerName === 'Rating' || refinerName === 'Price') {\r\n return overallFormat.replace('{0}', refinerName).replace('{1}', `${refinerValueName}`);\r\n }\r\n return overallFormat.replace('{0}', refinerName).replace('{1}', `${refinerValueName}_${refinerName}`);\r\n }\r\n\r\n private _formatPrice(amount: string | undefined, currency: string | undefined): string {\r\n if (!amount || !currency) {\r\n this.props.telemetry.trace('[choice-summary] could not format price');\r\n return amount || '';\r\n }\r\n let result = amount;\r\n\r\n try {\r\n result = this.props.context!.cultureFormatter.formatCurrency(Number(amount), currency);\r\n } catch (error) {\r\n this.props.telemetry.warning(`Failed to format price for ${result}: ${error}`);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n const target = e.currentTarget as HTMLElement;\r\n const clearAll = target.getAttribute('class')!.includes('choice-summary__clear-all');\r\n const selectedRefiner = clearAll ? undefined : this._getSelectedRefinerChoice(target);\r\n\r\n if (this.props.onChoiceClicked) {\r\n this.props.onChoiceClicked({\r\n clearAll,\r\n itemClicked: target,\r\n choiceClicked: selectedRefiner,\r\n nextItemToFocus: target.nextSibling as HTMLElement\r\n });\r\n }\r\n };\r\n\r\n private _getSelectedRefinerChoice(itemClicked: HTMLElement): ProductRefinerValue | undefined {\r\n const result = this.selectedRefinersMap.find(selected => itemClicked.id === selected.key);\r\n return (result && result.value) || undefined;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface IErrorMessage {\r\n text?: string;\r\n}\r\n\r\nexport const ErrorMessage: React.FC = ({ text }) => {\r\n return (\r\n \r\n
\r\n {` `}\r\n {text}\r\n {` `}\r\n
\r\n
\r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICoreContext, IGridSettings, IImageData, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { getFallbackImageUrl, getProductPageUrlSync } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ILiquid23SearchResultContainerResources } from '../liquid23-search-result-container.props.autogenerated';\r\n\r\n// Import { IComponent, IComponentProps, ICoreContext, IGridSettings, IImageData, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\n\r\ninterface IFeatureSearchResultItem {\r\n product: SimpleProduct | null;\r\n context: ICoreContext;\r\n resources: ILiquid23SearchResultContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n telemetryContent?: ITelemetryContent;\r\n recommendation?: string;\r\n}\r\n\r\nexport const FeatureSearchResultItem: React.FC = ({\r\n product,\r\n context,\r\n imageSettings,\r\n resources,\r\n telemetryContent,\r\n recommendation\r\n}) => {\r\n if (product === null) {\r\n return null;\r\n }\r\n\r\n const productName = product.Name;\r\n const productRecordId = product && product.RecordId ? product.RecordId : 0;\r\n const productUrl = getProductPageUrlSync(product.Name || '', productRecordId, context && context.actionContext, undefined);\r\n const fallbackImage = getFallbackImageUrl(product.ItemId, context.actionContext.requestContext.apiSettings);\r\n const heading =\r\n recommendation && recommendation === 'descriptions' ? resources.featureSimilarDescriptionTitle : resources.featureSimilarLooksTitle;\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, productName!, productRecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n return (\r\n
\r\n \r\n
\r\n {renderProductPlacementImage(\r\n imageSettings,\r\n context.request.gridSettings,\r\n product.PrimaryImageUrl,\r\n product.Name,\r\n fallbackImage,\r\n context.actionContext.requestContext\r\n )}\r\n
\r\n \r\n
\r\n

{heading}

\r\n {renderProductTitle(product?.Name)}\r\n
\r\n
\r\n );\r\n};\r\n\r\nfunction renderProductPlacementImage(\r\n imageSettings?: IImageSettings,\r\n gridSettings?: IGridSettings,\r\n imageUrl?: string,\r\n altText?: string,\r\n fallbackImage?: string,\r\n context?: IRequestContext\r\n): JSX.Element | null {\r\n if (!imageUrl || !gridSettings || !imageSettings) {\r\n return null;\r\n }\r\n const img: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : ''\r\n };\r\n const imageProps = {\r\n gridSettings,\r\n imageSettings,\r\n fallBackSrc: fallbackImage\r\n };\r\n return ;\r\n}\r\n\r\nfunction renderProductTitle(title?: string): JSX.Element | null {\r\n return

{title}

;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ILink {\r\n className?: string;\r\n text?: string;\r\n href?: string;\r\n ariaLabel?: string;\r\n}\r\n\r\nexport const Link: React.FC = ({ text, className, href, ariaLabel }) => (\r\n \r\n {' '}\r\n {text}{' '}\r\n \r\n);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport React from 'react';\r\n\r\nexport interface ISearchResultModalViewProps {\r\n modal: React.ReactElement;\r\n modalHeader: React.ReactElement;\r\n modalFooter: React.ReactElement;\r\n modalBody: React.ReactElement;\r\n}\r\n\r\ninterface IModalToggleProps {\r\n innerRef: React.RefObject | undefined;\r\n id: string;\r\n text: string;\r\n ariaLabel: string;\r\n onClick(): void;\r\n}\r\n\r\nexport interface ISearchResultModalResources {\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n}\r\n\r\nexport interface ISearchResultModalProps {\r\n resources: ISearchResultModalResources;\r\n isOpen: boolean;\r\n returnRef: React.RefObject | undefined;\r\n onModalToggle(): void;\r\n}\r\n\r\nexport const ModalToggle: React.FC = (props: IModalToggleProps) => {\r\n const { text, onClick, ariaLabel, innerRef, id } = props;\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport const SearchResultModal = (props: ISearchResultModalProps): ISearchResultModalViewProps => {\r\n return {\r\n modal: modalNode(props),\r\n modalHeader: modalHeaderNode(props),\r\n modalFooter: modalFooterNode(props),\r\n modalBody: \r\n };\r\n};\r\n\r\nconst modalNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst modalHeaderNode = (props: ISearchResultModalProps) => {\r\n return {props.resources.modalTitle};\r\n};\r\n\r\nconst modalFooterNode = (props: ISearchResultModalProps) => {\r\n return (\r\n \r\n \r\n \r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport { IPriceComponentResources, ProductComponent } from '@msdyn365-commerce/components';\r\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ILiquid23SearchResultContainerResources } from '../liquid23-search-result-container.props.autogenerated';\r\n\r\ninterface IProductSearchResultItems {\r\n products: ProductSearchResult[];\r\n context: ICoreContext;\r\n resources: ILiquid23SearchResultContainerResources;\r\n imageSettings?: IImageSettings;\r\n moduleType: string;\r\n moduleId: string;\r\n allowBackNavigation?: boolean;\r\n telemetryContent: ITelemetryContent;\r\n quickviewSlot?: {} | null | undefined;\r\n productComparisonButton?: {} | null | undefined;\r\n channelInventoryConfigurationId?: number;\r\n isPriceMinMaxEnabled?: boolean;\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\n/**\r\n * Returns the product inventory label.\r\n * @param channelInventoryConfigurationId - The channel configuration Id.\r\n * @param product - The product.\r\n * @returns The inventory label.\r\n */\r\nexport function getInventoryLabel(channelInventoryConfigurationId: number | undefined, product: ProductSearchResult): string | undefined {\r\n if (!channelInventoryConfigurationId || !ArrayExtensions.hasElements(product.AttributeValues)) {\r\n return undefined;\r\n }\r\n const inventoryAttribute = product.AttributeValues.find(attribute => attribute.RecordId === channelInventoryConfigurationId);\r\n if (inventoryAttribute) {\r\n return inventoryAttribute.TextValue;\r\n }\r\n return undefined;\r\n}\r\n\r\nexport const ProductSearchResultItems: React.FC = ({\r\n products,\r\n context,\r\n imageSettings,\r\n resources,\r\n moduleType,\r\n moduleId,\r\n allowBackNavigation,\r\n telemetryContent,\r\n quickviewSlot,\r\n productComparisonButton,\r\n channelInventoryConfigurationId,\r\n isPriceMinMaxEnabled,\r\n productsDimensionAvailabilities\r\n}) => {\r\n const priceResources: IPriceComponentResources = {\r\n priceRangeSeparator: resources.priceRangeSeparator\r\n };\r\n return (\r\n
    \r\n {products.map((product: ProductSearchResult, index: number) => (\r\n
  • \r\n \r\n ArrayExtensions.hasElements(dimensionAvailability) &&\r\n dimensionAvailability[0].masterProductId === product.MasterProductId\r\n )}\r\n />\r\n
  • \r\n ))}\r\n
\r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ISliderLabel, ISliderThumbProps, Slider } from '@msdyn365-commerce-modules/utilities';\r\nimport debounce from 'lodash/debounce';\r\nimport { computed } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemProps, IRefineItemState } from './refine-item';\r\n\r\ntype InputType = 'Min' | 'Max';\r\n\r\nexport type RangeRefineItemType = 'slider' | 'input';\r\n\r\n/**\r\n * Range refine item properties.\r\n */\r\nexport interface IRangeRefineItemProps extends IRefineItemProps {\r\n rangeType: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n sliderKey?: string;\r\n}\r\n\r\n/**\r\n * Range refine item state.\r\n */\r\nexport interface IRangeRefineItemState extends IRefineItemState {\r\n validationErrorMin: string | undefined;\r\n validationErrorMax: string | undefined;\r\n selectedMin: string | undefined;\r\n selectedMax: string | undefined;\r\n touchedMin: boolean;\r\n touchedMax: boolean;\r\n sliderId: string;\r\n minValue: string | undefined;\r\n maxValue: string | undefined;\r\n labels: ISliderLabel[];\r\n sliderThumbs: ISliderThumbProps[];\r\n}\r\n\r\n/**\r\n * RangeRefineItem component (controlled by RefineSubmenu).\r\n */\r\n@observer\r\nexport default class RangeRefineItem extends React.Component {\r\n private readonly _formattedPriceReverseLookup: Map = new Map();\r\n\r\n private readonly minInput: React.RefObject;\r\n\r\n private readonly maxInput: React.RefObject;\r\n\r\n @computed get currencyCode(): string {\r\n return this.props.productRefinerValue.UnitText || '';\r\n }\r\n\r\n public constructor(props: IRangeRefineItemProps) {\r\n super(props);\r\n this._onRangeUpdate = this._onRangeUpdate.bind(this);\r\n this._onRangeUpdateEnd = this._onRangeUpdateEnd.bind(this);\r\n this._handleRangeTooltipText = this._handleRangeTooltipText.bind(this);\r\n this._changeMin = this._changeMin.bind(this);\r\n this._changeMax = this._changeMax.bind(this);\r\n this._finishChangeMin = this._finishChangeMin.bind(this);\r\n this._finishChangeMax = this._finishChangeMax.bind(this);\r\n\r\n this.minInput = React.createRef();\r\n this.maxInput = React.createRef();\r\n\r\n const { selectedRefinementCriterion } = this.props;\r\n const initialMin = selectedRefinementCriterion?.LeftValueBoundString ?? '0';\r\n const initialMax = selectedRefinementCriterion?.RightValueBoundString;\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.state = {\r\n isChecked: false,\r\n validationErrorMin: undefined,\r\n validationErrorMax: undefined,\r\n selectedMin: initialMin,\r\n selectedMax: initialMax,\r\n touchedMin: false,\r\n touchedMax: false,\r\n sliderId,\r\n minValue,\r\n maxValue,\r\n labels,\r\n sliderThumbs\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRangeRefineItemProps, nextState: IRangeRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public componentDidUpdate(previousProps: IRangeRefineItemProps): void {\r\n if (previousProps !== this.props) {\r\n this.updateSliderProps();\r\n }\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const { productRefinerValue, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerValue || !parentProductRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error(\r\n 'Cannot render refine value range without productRefinerValue and parentProductRefinerHierarchy'\r\n );\r\n return undefined;\r\n }\r\n\r\n if (this.props.rangeType === 'input') {\r\n return this._renderInputFields();\r\n }\r\n\r\n return this._renderSlider();\r\n }\r\n\r\n /**\r\n * Function to update slider props.\r\n */\r\n private updateSliderProps(): void {\r\n const sliderId = `slider_${String(this.props.parentProductRefinerHierarchy.RecordId)}_${String(\r\n this.props.productRefinerValue.RefinerRecordId\r\n )}`;\r\n const minValue = this.props.productRefinerValue.LeftValueBoundString;\r\n const maxValue = this.props.productRefinerValue.RightValueBoundString;\r\n const minPrice = this._formatPrice(minValue);\r\n const maxPrice = this._formatPrice(maxValue);\r\n const labels: ISliderLabel[] = this.getLabels(sliderId, minPrice, maxPrice);\r\n const selectedMin =\r\n this.props.selectedRefinementCriterion?.LeftValueBoundString ?? this.props.productRefinerValue.LeftValueBoundString ?? '0';\r\n const selectedMax =\r\n this.props.selectedRefinementCriterion?.RightValueBoundString ??\r\n this.props.productRefinerValue.RightValueBoundString ??\r\n maxValue;\r\n const selectedMinPrice = this._formatPrice(selectedMin);\r\n const selectedMaxPrice = this._formatPrice(selectedMax);\r\n const sliderKeyString = this.props.sliderKey ? `_${String(this.props.sliderKey)}` : '';\r\n const sliderThumbs: ISliderThumbProps[] = this.getSliderThumbs(\r\n sliderId,\r\n sliderKeyString,\r\n selectedMin,\r\n selectedMinPrice,\r\n selectedMax,\r\n selectedMaxPrice,\r\n maxPrice\r\n );\r\n this.setState({ sliderId, minValue, maxValue, labels, sliderThumbs });\r\n }\r\n\r\n /**\r\n * Function to create the labels for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param minPrice - Slider min value.\r\n * @param maxPrice - Slider max value.\r\n * @returns Array labels.\r\n */\r\n private readonly getLabels = (sliderId: string, minPrice: string, maxPrice: string): ISliderLabel[] => {\r\n return [\r\n {\r\n labelId: `${sliderId}_start`,\r\n labelString: `${minPrice}`,\r\n labelPositioning: 'start'\r\n },\r\n {\r\n labelId: `${sliderId}_end`,\r\n labelString: `${maxPrice}`,\r\n labelPositioning: 'end'\r\n }\r\n ];\r\n };\r\n\r\n /**\r\n * Function to create the slider thumbs for slider.\r\n * @param sliderId - Slider element id for the DOM.\r\n * @param sliderKey - Unique key for slider.\r\n * @param selectedMin - Slider selected min value.\r\n * @param selectedMinPrice - Slider selected min price.\r\n * @param selectedMax - Slider selected max value.\r\n * @param selectedMaxPrice - Slider selected max price..\r\n * @param maxPrice - Slider max price..\r\n * @returns Slider Thumb Props.\r\n */\r\n private readonly getSliderThumbs = (\r\n sliderId: string,\r\n sliderKey: string,\r\n selectedMin: string,\r\n selectedMinPrice: string,\r\n selectedMax: string | undefined,\r\n selectedMaxPrice: string,\r\n maxPrice: string\r\n ): ISliderThumbProps[] => {\r\n const sliderThumbDefaultValue = 0;\r\n return [\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_start`,\r\n value: (selectedMin && Number(selectedMin)) || sliderThumbDefaultValue,\r\n ariaLabel: `${this.props.minValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMinPrice}`\r\n },\r\n {\r\n id: `${sliderId}${sliderKey}_slider_thumb_end`,\r\n value: Number(selectedMax) || Number(maxPrice),\r\n ariaLabel: `${this.props.maxValueSliderThumbAriaLabel ?? ''} ${this.currencyCode}`,\r\n ariaValueText: `${selectedMaxPrice}`\r\n }\r\n ];\r\n };\r\n\r\n private _renderInputFields(): JSX.Element | undefined {\r\n const { isDisabled, parentProductRefinerHierarchy, refineItemCommonProps } = this.props;\r\n const { selectedMin, selectedMax, touchedMin, touchedMax, validationErrorMin, validationErrorMax } = this.state;\r\n\r\n const rangeAriaLabel = (refineItemCommonProps.rangeNameFormat || '{0}').replace('{0}', parentProductRefinerHierarchy.KeyName || '');\r\n const formAttrs = {\r\n 'aria-label': rangeAriaLabel,\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n // To enable price formatting of selected fields, this is the approach:\r\n // initial value: min=0 formatted as price, max=undefined\r\n // onFocus/onChange: convert to number (unformat) and mark as touched to indicate value is being edited\r\n // onBlur: validate and format entered value as price\r\n const minInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-min ${\r\n validationErrorMin ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const maxInputClassName = `ms-refine-submenu__input-range refine-submenu__input-range-max ${\r\n validationErrorMax ? 'refine-submenu__input-range--error' : ''\r\n }`;\r\n const minLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-min';\r\n const maxLabelClassName = 'ms-refine-submenu__input-range-label refine-submenu__input-range-label-max';\r\n const formattedSelectedMin = this._getFormattedSelectedValue(selectedMin, touchedMin, validationErrorMin);\r\n const formattedSelectedMax = this._getFormattedSelectedValue(selectedMax, touchedMax, validationErrorMax);\r\n return (\r\n
\r\n \r\n \r\n {validationErrorMin && (\r\n \r\n {validationErrorMin}\r\n \r\n )}\r\n {validationErrorMax && validationErrorMin !== validationErrorMax && (\r\n \r\n {validationErrorMax}\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n private _renderSlider(): JSX.Element | undefined {\r\n const { isDisabled, sliderKey } = this.props;\r\n const ariaAttributes = {\r\n 'aria-disabled': isDisabled\r\n };\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _changeMin(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Min');\r\n }\r\n\r\n private _changeMax(event: React.FocusEvent): void {\r\n this._changeValue(event, 'Max');\r\n }\r\n\r\n private _changeValue(event: React.FocusEvent, inputType: InputType): void {\r\n const selectedKey = `selected${inputType}`;\r\n const touchedKey = `touched${inputType}`;\r\n this.setState({\r\n [selectedKey]: this._getInputWithoutFormatting(event.currentTarget.value),\r\n [touchedKey]: true\r\n });\r\n }\r\n\r\n private _finishChangeMin(event: React.FocusEvent): boolean {\r\n const selectedMinValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMin: selectedMinValue,\r\n minTouched: false\r\n });\r\n const minInput = Number(selectedMinValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const max = (selectedRefinementCriterion && selectedRefinementCriterion.RightValueBoundString) || undefined;\r\n\r\n const maxNum = max ? Number(max) : undefined;\r\n\r\n if (isNaN(minInput)) {\r\n this.setState({ validationErrorMin: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Min');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minInput, maxNum)) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minInput,\r\n rangeEnd: maxNum\r\n });\r\n return true;\r\n }\r\n this._focus('Min');\r\n\r\n return false;\r\n }\r\n\r\n private _finishChangeMax(event: React.FocusEvent): boolean {\r\n const selectedMaxValue = this._getInputWithoutFormatting(event.currentTarget.value);\r\n this.setState({\r\n selectedMax: selectedMaxValue,\r\n maxTouched: false\r\n });\r\n const maxInput = Number(selectedMaxValue);\r\n const {\r\n onToggle,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n refineItemCommonProps,\r\n selectedRefinementCriterion\r\n } = this.props;\r\n const min = (selectedRefinementCriterion && selectedRefinementCriterion.LeftValueBoundString) || '0';\r\n\r\n const minNum = Number(min);\r\n\r\n if (isNaN(maxInput)) {\r\n this.setState({ validationErrorMax: refineItemCommonProps.validationErrorNaN });\r\n this._focus('Max');\r\n return false;\r\n }\r\n\r\n if (this._validateRange(minNum, maxInput)) {\r\n if (productRefinerValue) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: minNum,\r\n rangeEnd: maxInput\r\n });\r\n } else {\r\n this._focus('Max');\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private _focus(inputType: InputType): void {\r\n const ref = inputType === 'Max' ? this.maxInput : this.minInput;\r\n\r\n setTimeout(() => {\r\n if (ref && ref.current) {\r\n ref.current.focus();\r\n }\r\n }, 50);\r\n }\r\n\r\n private _getFormattedSelectedValue(\r\n selected: string | undefined,\r\n touched: boolean,\r\n validationError: string | undefined\r\n ): string | undefined {\r\n if (touched || validationError || selected === undefined) {\r\n return selected;\r\n }\r\n return this._formatPrice(selected);\r\n }\r\n\r\n private _validateRange(min: number, max: number | undefined): boolean {\r\n const { refineItemCommonProps } = this.props;\r\n if (max === undefined) {\r\n return true;\r\n }\r\n\r\n if (min > max) {\r\n this.setState({\r\n validationErrorMin: refineItemCommonProps.validationErrorRange,\r\n validationErrorMax: refineItemCommonProps.validationErrorRange\r\n });\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n private _formatPrice(amount: string | undefined): string {\r\n if (this.props.productRefinerValue.RefinerRecordId === 0) {\r\n const result = this.props.context.cultureFormatter.formatCurrency(Number(amount), this.currencyCode);\r\n return result;\r\n }\r\n return amount || '';\r\n }\r\n\r\n private _getInputWithoutFormatting(input: string): string {\r\n // First try to cast raw input to a number\r\n const inputAsNum = Number(input);\r\n if (!isNaN(inputAsNum)) {\r\n return input;\r\n }\r\n\r\n // Otherwise try a reverse lookup and fall back to the raw input if all else fails\r\n const reverseLookupResult = this._formattedPriceReverseLookup.get(input);\r\n return reverseLookupResult || input;\r\n }\r\n\r\n // NOTE: Fix types once Shared Components build pipeline bug fixed\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private _onRangeUpdate(sliderChangeNotification: any): void {\r\n // Need to filter out mousemove events as these cause errors after the menu updates and slider re-renders\r\n if (sliderChangeNotification.eventType !== 'mousemove') {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private _onRangeUpdateEnd(sliderChangeNotification: any): void {\r\n const { onToggle, parentProductRefinerHierarchy, productRefinerValue } = this.props;\r\n if (productRefinerValue && sliderChangeNotification) {\r\n onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: true,\r\n rangeStart: sliderChangeNotification.firstThumbValue,\r\n rangeEnd: sliderChangeNotification.secondThumbValue\r\n });\r\n\r\n this._focusOnSliderThumb(sliderChangeNotification);\r\n }\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n private _focusOnSliderThumb(sliderChangeNotification: any): void {\r\n if (sliderChangeNotification.id) {\r\n const element = document.getElementById(`${sliderChangeNotification.id}range`);\r\n if (element) {\r\n setTimeout(() => {\r\n element.focus();\r\n }, 0);\r\n }\r\n }\r\n }\r\n\r\n private _handleRangeTooltipText(tooltip: number): string {\r\n return this._formatPrice(`${tooltip}`);\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { RatingComponent, SwatchComponent } from '@msdyn365-commerce/components';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { checkIfShouldDisplayAsSwatch, DimensionTypes, IDimensionsApp, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\n\r\n/**\r\n * RefineItem properties.\r\n */\r\nexport interface IRefineItemProps {\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy;\r\n productRefinerValue: ProductRefinerValue;\r\n selectedRefinementCriterion: ProductRefinerValue | undefined;\r\n selectedRefinerValues?: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n index?: number;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobileView?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onToggle(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine item state.\r\n */\r\nexport interface IRefineItemState extends React.ComponentState {\r\n isChecked: boolean;\r\n renderingError?: object;\r\n}\r\n\r\n/**\r\n * Single-select and multi-select refine item component (controlled by RefineSubmenu).\r\n */\r\nexport default class RefineItem extends React.Component {\r\n private readonly anchorType: React.RefObject;\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IRefineItemProps) {\r\n super(props);\r\n this._onClick = this._onClick.bind(this);\r\n this.state = {\r\n isChecked: !!this.props.selectedRefinementCriterion\r\n };\r\n this.anchorType = React.createRef();\r\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineItemProps, nextState: IRefineItemState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n selectedRefinementCriterion,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n index,\r\n children,\r\n onToggle,\r\n context,\r\n telemetryContent,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n ...attrs\r\n } = this.props;\r\n if (!productRefinerValue) {\r\n refineItemCommonProps.telemetry.error('[refine-item] Cannot render refineItem without productRefinerValue');\r\n return undefined;\r\n }\r\n if (!productRefinerValue.LeftValueBoundString) {\r\n refineItemCommonProps.telemetry.warning(\r\n `[refine-item] RefineItem without LeftValueBoundString: ${JSON.stringify(productRefinerValue)}`\r\n );\r\n }\r\n const isSingleSelect = parentProductRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect;\r\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\r\n itemTypeClassName = `ms-refine-submenu-item ${itemTypeClassName}`;\r\n const inputType = isSingleSelect ? 'radio' : 'checkbox';\r\n const isChecked = !!selectedRefinementCriterion;\r\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\r\n if (parentProductRefinerHierarchy.SourceValue === ProductRefinerSource.Rating) {\r\n return this._renderRating(\r\n productRefinerValue,\r\n parentProductRefinerHierarchy,\r\n isChecked,\r\n context,\r\n index,\r\n telemetryContent,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel\r\n );\r\n }\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString ?? productRefinerValue.LeftValueBoundString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productText = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const productCount = productRefinerValue.Count || 0;\r\n let refineMenuItemAriaLabel;\r\n if (productCount === 1) {\r\n refineMenuItemAriaLabel = refineItemAriaLabel\r\n ? format(refineItemAriaLabel, parentProductRefinerHierarchy.KeyName, productText)\r\n : '';\r\n } else {\r\n refineMenuItemAriaLabel = refineItemsAriaLabel\r\n ? format(refineItemsAriaLabel, parentProductRefinerHierarchy.KeyName, productText, productCount)\r\n : '';\r\n }\r\n\r\n const dimensionType = (this.props.parentProductRefinerHierarchy.KeyName?.toLocaleLowerCase() ?? '') as DimensionTypes;\r\n const shouldDisplayAsSwatch = this._getShouldDisplayAsSwatch(dimensionType);\r\n\r\n let className = 'ms-refine-submenu-item';\r\n if (shouldDisplayAsSwatch) {\r\n className = classnames(className, `ms-refine-submenu-item__dimension__${dimensionType}`);\r\n }\r\n\r\n // If the swatch has no color or image specified, it should be displayed as text.\r\n // We don't use swatch logic to display the number of the results found together with the text.\r\n const hasColor = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchColorHexCode);\r\n const hasImage = !StringExtensions.isNullOrWhitespace(productRefinerValue.SwatchImageUrl);\r\n const hasContentSwatch = hasColor || hasImage;\r\n\r\n return (\r\n
  • \r\n \r\n {hasContentSwatch && shouldDisplayAsSwatch && this._renderSwatch(dimensionType)}\r\n \r\n \r\n
  • \r\n );\r\n }\r\n\r\n private _getShouldDisplayAsSwatch(dimensionType: DimensionTypes) {\r\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(dimensionType, this.props.context as ICoreContext);\r\n return shouldDisplayAsSwatch;\r\n }\r\n\r\n private _renderSwatch(dimensionType: DimensionTypes): JSX.Element | null {\r\n const productRefinerValue = this.props.productRefinerValue;\r\n\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const text = productRefinerValue.LeftValueBoundLocalizedString || productRefinerValue.LeftValueBoundString || '';\r\n const swatchItems = [\r\n {\r\n itemId: `${productRefinerValue.RefinerRecordId ?? ''}-${dimensionType}-${text}`,\r\n value: text,\r\n dimensionType,\r\n colorHexCode: productRefinerValue.SwatchColorHexCode,\r\n imageUrl: productRefinerValue.SwatchImageUrl\r\n }\r\n ];\r\n\r\n return (\r\n \r\n );\r\n }\r\n\r\n private _getRefinerUrl(): string {\r\n const { urlBuilder, parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n\r\n if (productRefinerValue) {\r\n return urlBuilder({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n }\r\n\r\n return '';\r\n }\r\n\r\n private readonly _onClick = (e: React.MouseEvent): void => {\r\n e.preventDefault();\r\n\r\n const { parentProductRefinerHierarchy, productRefinerValue, selectedRefinementCriterion } = this.props;\r\n if (productRefinerValue) {\r\n this.props.onToggle({\r\n parentProductRefinerHierarchy,\r\n productRefinerValue,\r\n isSelecting: !selectedRefinementCriterion\r\n });\r\n\r\n setTimeout(() => {\r\n this.anchorType.current && this.anchorType.current.focus();\r\n }, 0);\r\n }\r\n };\r\n\r\n private _renderRating(\r\n productRefinerValue: ProductRefinerValue,\r\n parentProductRefinerHierarchy: IProductRefinerHierarchy,\r\n isChecked: boolean,\r\n context: ICoreContext,\r\n index?: number,\r\n telemetryContent?: ITelemetryContent,\r\n ratingUserCountAriaLabel?: string,\r\n ratingSingleUserCountAriaLabel?: string\r\n ): JSX.Element | undefined {\r\n if (productRefinerValue.LeftValueBoundString) {\r\n this.payLoad.contentAction.etext = productRefinerValue.LeftValueBoundLocalizedString;\r\n const attribute = getTelemetryAttributes(telemetryContent!, this.payLoad);\r\n const refinerRating = Number.parseInt(productRefinerValue.LeftValueBoundString, 10);\r\n const ratingRefiner = this.props.selectedRefinerValues?.find(\r\n value => value.DataTypeValue === productRefinerValue.DataTypeValue\r\n );\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Replace with actual value for empty string.\r\n const selectedRating = Number.parseInt(ratingRefiner?.LeftValueBoundString || '0', 10);\r\n const defaultChkProductCount = 1;\r\n let ratingComponentClass: string = 'ms-rating-component';\r\n if (refinerRating > selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__up`;\r\n } else if (refinerRating < selectedRating) {\r\n ratingComponentClass = `${ratingComponentClass}__down`;\r\n } else {\r\n ratingComponentClass = `${ratingComponentClass}__current`;\r\n }\r\n const productCountAriaLabelValue =\r\n productRefinerValue.Count !== undefined && productRefinerValue.Count === defaultChkProductCount\r\n ? ratingSingleUserCountAriaLabel && format(ratingSingleUserCountAriaLabel, productRefinerValue.Count)\r\n : ratingUserCountAriaLabel && format(ratingUserCountAriaLabel, productRefinerValue.Count);\r\n return (\r\n \r\n \r\n \r\n \r\n {productRefinerValue.Count !== undefined && `(${productRefinerValue.Count})`}\r\n \r\n \r\n \r\n );\r\n }\r\n return undefined;\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport { DisplayTemplate, ProductRefinerSource, ProductRefinerValue, RefinerType } from '@msdyn365-commerce/retail-proxy';\r\nimport { Button, Collapse, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport RangeRefineItem, { RangeRefineItemType } from './range-refine-item';\r\nimport RefineItem from './refine-item';\r\nimport { IRefineItemCommonProps } from './refine-item.props.common';\r\nimport { IRefineItemToggleNotification } from './refine-item-toggle-notification';\r\nimport { findMatchingRefinementCriterion, isRangeType } from './utilities';\r\n\r\n/**\r\n * Properties associated with the RefineSubmenu component.\r\n */\r\nexport interface IRefineSubmenuProps {\r\n tempRangeTypeTODO: RangeRefineItemType;\r\n minValueSliderThumbAriaLabel?: string;\r\n maxValueSliderThumbAriaLabel?: string;\r\n productRefinerHierarchy: IProductRefinerHierarchy;\r\n selectedRefinerValues: ProductRefinerValue[];\r\n refineItemCommonProps: IRefineItemCommonProps;\r\n isDisabled: boolean;\r\n isExpandedOnInitialLoad: boolean;\r\n context: ICoreContext>;\r\n moduleId: string;\r\n moduleTypeName: string;\r\n productCountAriaLabel?: string;\r\n singleProductCountAriaLabel?: string;\r\n refineItemAriaLabel?: string;\r\n refineItemsAriaLabel?: string;\r\n isMobile?: boolean;\r\n\r\n /**\r\n * The telemetry content\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n onUpdateRefiners(notfication: Readonly): void;\r\n urlBuilder(refiner: IRefineItemToggleNotification): string;\r\n}\r\n\r\n/**\r\n * Refine submenu state.\r\n */\r\nexport interface IRefineSubmenuState extends React.ComponentState {\r\n expanded: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * The RefineSubmenu component renders the submenu category and child items.\r\n * This computed observes the stateful category hierarchy object.\r\n * @extends {React.PureComponent}\r\n */\r\nclass RefineSubmenu extends React.Component {\r\n constructor(props: IRefineSubmenuProps) {\r\n super(props);\r\n\r\n this._onToggleItem = this._onToggleItem.bind(this);\r\n this._onToggleSubmenu = this._onToggleSubmenu.bind(this);\r\n\r\n const isExpanded = this.props.isExpandedOnInitialLoad;\r\n\r\n // If (this.props.productRefinerHierarchy.DataTypeValue === ProductRefinerValueDataTypeValue.Range) {\r\n // isExpanded = true;\r\n // }\r\n\r\n this.state = {\r\n expanded: isExpanded\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IRefineSubmenuProps, nextState: IRefineSubmenuState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const { productRefinerHierarchy, refineItemCommonProps } = this.props;\r\n\r\n if (!productRefinerHierarchy) {\r\n refineItemCommonProps.telemetry.error('Cannot render submenu without refiner hierarchy data');\r\n }\r\n\r\n if (productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating && this.props.context.app.config.hideRating) {\r\n return null;\r\n }\r\n\r\n const className = classnames(\r\n 'ms-refine-submenu',\r\n 'list-group',\r\n productRefinerHierarchy.KeyName // Deprecated because of the localization issues. Leaving for backward compatibility reasons.\r\n );\r\n\r\n return (\r\n
    \r\n \r\n {productRefinerHierarchy.KeyName}\r\n \r\n \r\n {this._renderChildItems(productRefinerHierarchy)}\r\n \r\n
    \r\n );\r\n }\r\n\r\n private _renderChildItems(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n if (isRangeType(productRefinerHierarchy.DataTypeValue)) {\r\n return this._renderRange(productRefinerHierarchy);\r\n }\r\n return this._renderSingleMultiSelect(productRefinerHierarchy);\r\n }\r\n\r\n private _renderSingleMultiSelect(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n productCountAriaLabel,\r\n singleProductCountAriaLabel,\r\n refineItemAriaLabel,\r\n refineItemsAriaLabel,\r\n isMobile\r\n } = this.props;\r\n const isSingleSelect =\r\n productRefinerHierarchy.RefinerTypeValue === RefinerType.SingleSelect &&\r\n productRefinerHierarchy.SourceValue === ProductRefinerSource.Rating;\r\n const role = isSingleSelect ? { role: 'listbox' } : undefined;\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `[refine-submenu] Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n return (\r\n \r\n refinerValuesList.find(value => value.RefinerRecordId === selectedValue.RefinerRecordId)\r\n )}\r\n refineItemCommonProps={refineItemCommonProps}\r\n onToggle={this._onToggleItem}\r\n urlBuilder={this.props.urlBuilder}\r\n isDisabled={isDisabled}\r\n key={index}\r\n index={index}\r\n context={context}\r\n moduleId={this.props.moduleId}\r\n moduleTypeName={this.props.moduleTypeName}\r\n telemetryContent={this.props.telemetryContent}\r\n productCountAriaLabel={productCountAriaLabel}\r\n refineItemAriaLabel={refineItemAriaLabel}\r\n refineItemsAriaLabel={refineItemsAriaLabel}\r\n singleProductCountAriaLabel={singleProductCountAriaLabel}\r\n isMobileView={isMobile}\r\n />\r\n );\r\n });\r\n return (\r\n \r\n {listItems}\r\n \r\n );\r\n }\r\n\r\n private _getRangeType(productRefinerHierarchy: IProductRefinerHierarchy): 'input' | 'slider' {\r\n if (\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Range ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.Slider ||\r\n productRefinerHierarchy.DisplayTemplateValue === DisplayTemplate.SliderWithBars\r\n ) {\r\n return 'slider';\r\n }\r\n return 'input';\r\n }\r\n\r\n private _renderRange(productRefinerHierarchy: IProductRefinerHierarchy): JSX.Element | null {\r\n const {\r\n isDisabled,\r\n refineItemCommonProps,\r\n selectedRefinerValues,\r\n context,\r\n minValueSliderThumbAriaLabel,\r\n maxValueSliderThumbAriaLabel\r\n } = this.props;\r\n const submenuClassNamePrefix = 'ms-refine-submenu__item list-group-item refine-submenu__item';\r\n const refinerValuesList = productRefinerHierarchy.Values || [];\r\n const listItems = refinerValuesList.map((child: ProductRefinerValue, index: number) => {\r\n if (!child) {\r\n refineItemCommonProps.telemetry.error(\r\n `Could not render refine item for refiner ${productRefinerHierarchy.RecordId} (${productRefinerHierarchy.KeyName})`\r\n );\r\n return null;\r\n }\r\n\r\n const selectedRefinementCriterion = findMatchingRefinementCriterion(child, selectedRefinerValues);\r\n\r\n const rangeType = this._getRangeType(productRefinerHierarchy);\r\n const key = selectedRefinementCriterion\r\n ? `${selectedRefinementCriterion.LeftValueBoundString}-${selectedRefinementCriterion.RightValueBoundString}`\r\n : `not-selected-${index}`;\r\n return (\r\n
  • \r\n \r\n
  • \r\n );\r\n });\r\n return
      {listItems}
    ;\r\n }\r\n\r\n private _onToggleItem(itemToggleNotification: IRefineItemToggleNotification): void {\r\n this.props.onUpdateRefiners(itemToggleNotification);\r\n }\r\n\r\n private _onToggleSubmenu(): void {\r\n this.setState(prevState => ({\r\n expanded: !prevState.expanded\r\n }));\r\n }\r\n}\r\n\r\nexport default RefineSubmenu;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ISeparator {\r\n separator: string;\r\n}\r\n\r\nexport const Separator: React.FC = ({ separator }) => (\r\n \r\n {` `}\r\n {separator}\r\n {` `}\r\n \r\n);\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\n\r\ninterface ITitle {\r\n className: string;\r\n text: string;\r\n}\r\n\r\nexport const Title: React.FC = ({ text, className }) => (\r\n \r\n {` `}\r\n {text}\r\n {` `}\r\n \r\n);\r\n","/**\r\n * Copyright (c) Microsoft Corporation\r\n * All rights reserved. See License.txt in the project root for license information.\r\n * ILiquid23SearchResultContainer containerModule Interface Properties\r\n * THIS FILE IS AUTO-GENERATED - MANUAL MODIFICATIONS WILL BE LOST\r\n */\r\n\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport const enum expandRefinersCount {\r\n all = 'all',\r\n one = 'one',\r\n two = 'two',\r\n three = 'three',\r\n four = 'four'\r\n}\r\n\r\nexport interface ILiquid23SearchResultContainerConfig extends Msdyn365.IModuleConfig {\r\n itemsPerPage?: number;\r\n allowBackNavigation?: boolean;\r\n imageSettings?: Msdyn365.IImageSettings;\r\n expandRefinersCount?: expandRefinersCount;\r\n disableHierarchy?: boolean;\r\n includeAttributes?: boolean;\r\n enableAffiliationBasedPricing?: boolean;\r\n updateRefinerPanel?: boolean;\r\n className?: string;\r\n clientRender?: boolean;\r\n}\r\n\r\nexport interface ILiquid23SearchResultContainerResources {\r\n noResultsForRefinersText: string;\r\n resultCategoryNotFoundText: string;\r\n resultSearchNotFoundText: string;\r\n paginationAriaLabel: string;\r\n priceFree: string;\r\n priceRangeSeparator: string;\r\n originalPriceText: string;\r\n currentPriceText: string;\r\n ratingAriaLabel: string;\r\n flipperNext: string;\r\n flipperPrevious: string;\r\n searchTextPrefix: string;\r\n numberOfProducts: string;\r\n oneProduct: string;\r\n categoryLinkAriaLabel: string;\r\n sortByDropdownLabel: string;\r\n sortByOptionNameAsc: string;\r\n sortByOptionNameDesc: string;\r\n sortByOptionPriceAsc: string;\r\n sortByOptionPriceDesc: string;\r\n sortByOptionRatingDesc: string;\r\n sortByOptionBestSelling: string;\r\n sortByOptionNewScore: string;\r\n sortByOptionTrendingScore: string;\r\n sortByOptionRelevanceDesc: string;\r\n placeholderTextMax: string;\r\n minLabel: string;\r\n maxLabel: string;\r\n rangeNameFormat: string;\r\n validationErrorNotNumber: string;\r\n validationErrorNotRange: string;\r\n clearAllText: string;\r\n choiceSummaryLabel: string;\r\n choiceFormat: string;\r\n choiceRangeValueFormat: string;\r\n choiceAriaLabel: string;\r\n closeAriaLabel: string;\r\n modalTitle: string;\r\n modalCloseButtonText: string;\r\n minValueSliderThumbAriaLabel: string;\r\n maxValueSliderThumbAriaLabel: string;\r\n featureSimilarLooksTitle: string;\r\n featureSimilarDescriptionTitle: string;\r\n productCountAriaLabel: string;\r\n singleProductCountAriaLabel: string;\r\n swatchItemAriaLabel: string;\r\n refineItemsAriaLabel: string;\r\n refineItemAriaLabel: string;\r\n}\r\n\r\nexport interface ILiquid23SearchResultContainerProps extends Msdyn365.IModule {\r\n resources: ILiquid23SearchResultContainerResources;\r\n config: ILiquid23SearchResultContainerConfig;\r\n slots: {\r\n quickview: React.ReactNode[];\r\n productComparisonButton: React.ReactNode[];\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport {\r\n CategoryHierarchy as CategoryHierarchyData,\r\n IProductRefinerHierarchy,\r\n IProductsDimensionsAvailabilities\r\n} from '@msdyn365-commerce/commerce-entities';\r\nimport MsDyn365, { getCatalogId, ICoreContext } from '@msdyn365-commerce/core';\r\nimport { format, ProductPrice, ProductRefinerValue, SortColumn, TextValueTranslation } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions,\r\n DimensionAvailabilitiesForProductSearchResultInput,\r\n DimensionTypes,\r\n DimensionSwatchDisplayTypes,\r\n getDimensionAvailabilitiesForProductSearchResultAction,\r\n getPriceForProductSearchResult,\r\n IDimensionsApp,\r\n PriceForProductSearchResultInput\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport {\r\n getTelemetryObject,\r\n ILabeledDropdownOnChangeNotification,\r\n ILabeledDropdownOption,\r\n IModuleProps,\r\n INodeProps,\r\n isMobile,\r\n ITelemetryContent,\r\n LabeledDropdown,\r\n UncontrolledPagination,\r\n VariantType\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, transaction } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n buildListPageUrl,\r\n getCollectionProducts,\r\n getCollectionRefinersAction,\r\n getCurrentUrl,\r\n GetFullProductsByCollectionInput,\r\n IFullProductsSearchResultsWithCount,\r\n parseQueryParam,\r\n ProductListInventoryFilteringOptions,\r\n RefinersByCollectionInput,\r\n sortOptions\r\n} from './actions';\r\nimport { hydrateRefinersFromUrl } from './actions/url-utils';\r\nimport {\r\n ErrorMessage,\r\n FeatureSearchResultItem,\r\n getUpdatedRefinementCriteria,\r\n IChoiceSummaryClickNotification,\r\n IRefineItemCommonProps,\r\n IRefineItemToggleNotification,\r\n ISearchResultModalViewProps,\r\n isMatchingRefinementCriterion,\r\n Link,\r\n ModalToggle,\r\n ProductSearchResultItems,\r\n SearchResultModal,\r\n Separator,\r\n Title\r\n} from './components';\r\nimport ChoiceSummary from './components/choice-summary';\r\nimport RefineSubmenu from './components/refine-submenu';\r\nimport { ListPageState } from './list-page-state';\r\nimport { ILiquid23SearchResultContainerData } from './liquid23-search-result-container.data';\r\nimport { expandRefinersCount, ILiquid23SearchResultContainerProps } from './liquid23-search-result-container.props.autogenerated';\r\n\r\nexport interface ISearchResultContainerViewProps extends ILiquid23SearchResultContainerProps {\r\n products?: React.ReactNode;\r\n className?: string;\r\n SearchResultContainer: IModuleProps;\r\n TitleViewProps: ITitleViewProps;\r\n categoryHierarchy: ICategoryHierarchyViewProps;\r\n pagination?: React.ReactNode;\r\n ProductsContainer: INodeProps;\r\n ProductSectionContainer: INodeProps;\r\n refineMenu: IRefineMenuViewProps;\r\n sortByOptions: ISortByViewProps;\r\n choiceSummary?: React.ReactNode;\r\n modalToggle: React.ReactNode;\r\n searchResultModal: ISearchResultModalViewProps;\r\n isMobile: boolean;\r\n CategoryNavContainer: INodeProps;\r\n RefineAndProductSectionContainer: INodeProps;\r\n errorMessage: React.ReactNode;\r\n FeatureSearchContainer: INodeProps;\r\n similarLookProduct?: React.ReactNode;\r\n productPrices?: ProductPrice[];\r\n}\r\n\r\nexport interface ITitleViewProps {\r\n TitleContainer: INodeProps;\r\n title: ISearchResultTitle;\r\n}\r\n\r\nexport interface IRefineMenuViewProps {\r\n RefineMenuContainer: INodeProps;\r\n RefinerSectionContainer: INodeProps;\r\n refiners?: React.ReactNode[];\r\n}\r\n\r\nexport interface ICategoryHierarchyViewProps {\r\n categoryHierarchyList?: React.ReactNode[];\r\n categoryHierarchySeparator?: React.ReactNode;\r\n CategoryHierarchyContainer: INodeProps;\r\n}\r\n\r\nexport interface ISortByViewProps {\r\n SortingContainer: INodeProps;\r\n sortByDropDown?: React.ReactNode;\r\n}\r\n\r\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/**\r\n * Title component for search result container.\r\n */\r\nexport interface ISearchResultTitle {\r\n titlePrefix?: React.ReactNode;\r\n titleText?: React.ReactNode;\r\n titleCount?: React.ReactNode;\r\n}\r\n\r\nexport interface ISearchResultContainerState {\r\n sortingState: ISortByCollectionState;\r\n modalIsOpen: boolean;\r\n refiners: IProductRefinerHierarchy[];\r\n productsDimensionAvailabilities?: IProductsDimensionsAvailabilities[][];\r\n}\r\n\r\ninterface ISortByCollectionState {\r\n selectedSortByOption: ILabeledDropdownOption;\r\n pending: boolean;\r\n}\r\n\r\n/**\r\n *\r\n * SearchResultContainer component.\r\n * @extends {React.PureComponent>}\r\n */\r\n@observer\r\nexport default class SearchResultContainer extends React.PureComponent<\r\n ILiquid23SearchResultContainerProps,\r\n ISearchResultContainerState\r\n> {\r\n @computed get isMobile(): boolean {\r\n return this._viewport === 'xs' || this._viewport === 'sm';\r\n }\r\n\r\n private readonly sortByDropdownOptions: ILabeledDropdownOption[] = [\r\n { key: sortOptions.sortByOptionRelevanceDesc, value: this.props.resources.sortByOptionRelevanceDesc },\r\n { key: sortOptions.sortByOptionNameAsc, value: this.props.resources.sortByOptionNameAsc },\r\n { key: sortOptions.sortByOptionNameDesc, value: this.props.resources.sortByOptionNameDesc },\r\n { key: sortOptions.sortByOptionPriceAsc, value: this.props.resources.sortByOptionPriceAsc },\r\n { key: sortOptions.sortByOptionPriceDesc, value: this.props.resources.sortByOptionPriceDesc },\r\n { key: sortOptions.sortByOptionRatingDesc, value: this.props.resources.sortByOptionRatingDesc },\r\n { key: sortOptions.sortByOptionBestSelling, value: this.props.resources.sortByOptionBestSelling },\r\n { key: sortOptions.sortByOptionNewScore, value: this.props.resources.sortByOptionNewScore },\r\n { key: sortOptions.sortByOptionTrendingScore, value: this.props.resources.sortByOptionTrendingScore }\r\n ];\r\n\r\n private readonly _refineItemCommonProps: IRefineItemCommonProps;\r\n\r\n private readonly _pageType: string | undefined = this.props.context.request.urlTokens.pageType;\r\n\r\n @observable\r\n private _viewport: GridSize = 'lg';\r\n\r\n private readonly _modalToggleRef: React.RefObject;\r\n\r\n private readonly _sortAndFilterContainerRef: React.RefObject;\r\n\r\n private expandrefinerCount: number | undefined = 0;\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private readonly productPrices: ProductPrice[];\r\n\r\n private readonly defaultPageNumber = 0;\r\n\r\n private readonly catalogId = getCatalogId(this.props.context.request);\r\n\r\n private isListPageStateUpdated: boolean = false;\r\n\r\n public static getFriendlyName(locale: string, nameTranslations?: TextValueTranslation[]): string | undefined {\r\n let nameTranslation: TextValueTranslation | undefined;\r\n if (locale && nameTranslations && ArrayExtensions.hasElements(nameTranslations)) {\r\n nameTranslation = nameTranslations.find(item => item.Language!.toLowerCase() === locale.toLowerCase());\r\n }\r\n\r\n return nameTranslation?.Text;\r\n }\r\n\r\n public constructor(props: ILiquid23SearchResultContainerProps, state: ISearchResultContainerState) {\r\n super(props);\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Check required.\r\n this._viewport = props.context.request?.device?.Type === 'Mobile' ? 'xs' : 'lg';\r\n this._modalToggleRef = React.createRef();\r\n this._sortAndFilterContainerRef = React.createRef();\r\n this._toggleModal = this._toggleModal.bind(this);\r\n this._updateViewport = this._updateViewport.bind(this);\r\n this.productPrices = [];\r\n this.state = {\r\n sortingState: {\r\n pending: false,\r\n selectedSortByOption: this.sortByDropdownOptions[0]\r\n },\r\n modalIsOpen: false,\r\n refiners: []\r\n };\r\n const { placeholderTextMax, minLabel, maxLabel, rangeNameFormat } = this.props.resources;\r\n\r\n const locale = this.props.context.request.locale;\r\n const telemetry = this.props.telemetry;\r\n const validationErrorNaN = this.props.resources.validationErrorNotNumber;\r\n const validationErrorRange = this.props.resources.validationErrorNotRange;\r\n this._refineItemCommonProps = {\r\n telemetry,\r\n locale,\r\n placeholderTextMax,\r\n minLabel,\r\n maxLabel,\r\n rangeNameFormat,\r\n validationErrorNaN,\r\n validationErrorRange\r\n };\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n this._updateViewport();\r\n }\r\n public async componentDidMount(): Promise {\r\n if (MsDyn365.isBrowser && window.addEventListener) {\r\n window.addEventListener('resize', this._updateViewport);\r\n this._updateViewport();\r\n }\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n const products = await this.props.data.products;\r\n\r\n this._updateListPageState(listPageState, products);\r\n\r\n // Initialize reaction based on listPageState properties\r\n reaction(\r\n () => {\r\n return [\r\n listPageState.activeFilters?.length,\r\n listPageState.currentPageNumber,\r\n ArrayExtensions.hasElements(listPageState.sortingCritera?.Columns)\r\n ];\r\n },\r\n async () => {\r\n const newListPageState = await this.props.data.listPageState;\r\n const input = new GetFullProductsByCollectionInput(\r\n newListPageState.pageType,\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(newListPageState.pageSize * (newListPageState.currentPageNumber ?? 0), 0)\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n +(this.props.context.request.urlTokens.recordId || 0),\r\n\r\n // eslint-disable-next-line max-len -- existing code\r\n this.props.context.request.query?.q\r\n ? this.props.context.request.query.q\r\n : JSON.stringify({\r\n ProductId: this.props.context.request.query?.productId,\r\n Recommendation: this.props.context.request.query?.recommendation\r\n }),\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Required check.\r\n !!this.props?.config?.includeAttributes,\r\n this.props.config.updateRefinerPanel,\r\n this.props.context.request.locale,\r\n this.catalogId\r\n );\r\n\r\n const productResults = await getCollectionProducts(input, this.props.context.actionContext);\r\n newListPageState.totalProductCount = productResults.count;\r\n newListPageState.activeProducts = productResults.products;\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- check is required.\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n if (this.props.config.updateRefinerPanel) {\r\n const refinerInput = new RefinersByCollectionInput(\r\n newListPageState.pageType,\r\n this.props.context.request.apiSettings,\r\n {\r\n Paging: {\r\n Top: this.props.config.itemsPerPage,\r\n Skip: Math.max(\r\n newListPageState.pageSize * (newListPageState.currentPageNumber ?? this.defaultPageNumber),\r\n this.defaultPageNumber\r\n )\r\n },\r\n count: true,\r\n Sorting: newListPageState.sortingCritera ?? {}\r\n },\r\n newListPageState.activeFilters ?? [],\r\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- RecordId is string. Check required.\r\n +(this.props.context.request.urlTokens.recordId || 0),\r\n this.props.context.request.query?.q\r\n ? this.props.context.request.query.q\r\n : this.props.context.request.query?.productId,\r\n false,\r\n this.props.config.updateRefinerPanel,\r\n undefined,\r\n this.catalogId\r\n );\r\n\r\n const refiners = await getCollectionRefinersAction(refinerInput, this.props.context.actionContext);\r\n this.setState({ refiners });\r\n }\r\n }\r\n );\r\n\r\n if (\r\n this.props.config.enableAffiliationBasedPricing &&\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Condition required.\r\n this.props.context.actionContext.requestContext?.user?.isAuthenticated\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\r\n this._getActivePrice();\r\n }\r\n\r\n const context = this.props.context as ICoreContext;\r\n const dimensionsToDisplayOnProductCard = context.app.config.dimensionsInProductCard;\r\n const dimensionsToDisplayAsSwatch = context.app.config.dimensionsAsSwatchType;\r\n if (\r\n ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n ArrayExtensions.hasElements(dimensionsToDisplayAsSwatch) &&\r\n !dimensionsToDisplayAsSwatch.includes(DimensionTypes.none) &&\r\n this.props.config.includeAttributes\r\n ) {\r\n await this._getProductsDimensionsAvailabilities();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser && window.removeEventListener) {\r\n window.removeEventListener('resize', this._updateViewport);\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const {\r\n config: { imageSettings, className },\r\n resources,\r\n data: { listPageState, products: productCollection, featureProduct }\r\n } = this.props;\r\n\r\n if (!this.isListPageStateUpdated && listPageState.result && productCollection.result) {\r\n this._updateListPageState(listPageState.result, productCollection.result);\r\n this.isListPageStateUpdated = true;\r\n }\r\n\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const searchProduct = listPageState.result?.featureProduct ?? featureProduct.result ?? null;\r\n let errorText = '';\r\n if (!ArrayExtensions.hasElements(products)) {\r\n errorText = this._pageType === 'Category' ? resources.resultCategoryNotFoundText : resources.resultSearchNotFoundText;\r\n }\r\n const productsComponent = this._getProducts();\r\n const featureComponent = (\r\n \r\n );\r\n\r\n const searchResultContainerViewProps = {\r\n ...this.props,\r\n products: productsComponent,\r\n TitleViewProps: this._getCollectionTitle(),\r\n categoryHierarchy: !this.props.config.disableHierarchy && this._getCategoryHierarchy(),\r\n refineMenu: this._getRefineMenu(),\r\n className: classnames('ms-search-result-container', className),\r\n SearchResultContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-search-result-container', className)\r\n },\r\n sortByOptions: this.props.data.listPageState.result?.totalProductCount !== 0 ? this._getSortingDropDown() : null,\r\n pagination: this._getPagination(),\r\n ProductsContainer: { className: 'ms-search-result-container__Products' },\r\n ProductSectionContainer: { className: 'ms-search-result-container__product-section' },\r\n CategoryNavContainer: { className: 'ms-search-result-container__category-nav-section' },\r\n RefineAndProductSectionContainer: { className: 'ms-search-result-container__refine-product-section' },\r\n choiceSummary: this._getChoiceSummary(),\r\n modalToggle:\r\n this.props.data.listPageState.result?.totalProductCount !== 0 ? (\r\n \r\n ) : null,\r\n searchResultModal: this._getSearchResultModal(),\r\n isMobile: this.isMobile,\r\n errorMessage: errorText && ,\r\n FeatureSearchContainer: { className: 'ms-feature-search-result' },\r\n similarLookProduct: searchProduct ? featureComponent : null,\r\n productPrices: this.productPrices\r\n };\r\n return this.props.renderView(searchResultContainerViewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Update the list page state with initial data.\r\n * @param listPageState -- List page State.\r\n * @param products -- Products.\r\n */\r\n private readonly _updateListPageState = (listPageState: ListPageState, products: IFullProductsSearchResultsWithCount): void => {\r\n let querySorting: SortColumn[] = [];\r\n const defaultPageNumber: number = 10;\r\n\r\n if (this._pageType === 'Category') {\r\n listPageState.pageType = 'Category';\r\n } else {\r\n listPageState.pageType = 'Search';\r\n }\r\n\r\n if (this.props.context.request.query?.sorting) {\r\n querySorting = JSON.parse(decodeURIComponent(this.props.context.request.query.sorting)) as SortColumn[];\r\n }\r\n\r\n listPageState.currentPageNumber =\r\n (this.props.context.request.query &&\r\n +this.props.context.request.query.skip / (this.props.config.itemsPerPage ?? defaultPageNumber)) ||\r\n 0;\r\n listPageState.sortingCritera = { Columns: querySorting };\r\n listPageState.pageSize = this.props.config.itemsPerPage ?? defaultPageNumber;\r\n listPageState.activeProducts = products.products;\r\n listPageState.totalProductCount = products.count;\r\n listPageState.activeFilters = hydrateRefinersFromUrl(this.props.context.request);\r\n if (this.props.context.request.query?.productId) {\r\n const featureProduct = this.props.data.featureProduct.result;\r\n if (featureProduct) {\r\n listPageState.featureProduct = featureProduct;\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Get products dimension availabilities.\r\n * @returns Void.\r\n */\r\n private readonly _getProductsDimensionsAvailabilities = async (): Promise => {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n\r\n const productsDimensionAvailabilities = await getDimensionAvailabilitiesForProductSearchResultAction(\r\n new DimensionAvailabilitiesForProductSearchResultInput(\r\n productsList,\r\n this.props.context as ICoreContext,\r\n DimensionSwatchDisplayTypes.productCard\r\n ),\r\n this.props.context.actionContext\r\n );\r\n\r\n if (ArrayExtensions.hasElements(productsDimensionAvailabilities)) {\r\n this.setState({ productsDimensionAvailabilities });\r\n }\r\n };\r\n\r\n /**\r\n * Get the active price for the products.\r\n */\r\n private readonly _getActivePrice = async (): Promise => {\r\n const productsList = this.props.data.listPageState.result?.activeProducts ?? [];\r\n const products = await getPriceForProductSearchResult(\r\n new PriceForProductSearchResultInput(productsList),\r\n this.props.context.actionContext\r\n );\r\n\r\n const listPageState = await this.props.data.listPageState;\r\n listPageState.activeProducts = products;\r\n };\r\n\r\n private readonly _getSearchResultModal = (): ISearchResultModalViewProps => {\r\n const { resources } = this.props;\r\n return SearchResultModal({\r\n resources: {\r\n modalCloseButtonText: resources.modalCloseButtonText,\r\n modalTitle: resources.modalTitle\r\n },\r\n isOpen: this.state.modalIsOpen,\r\n returnRef: this._modalToggleRef,\r\n onModalToggle: this._toggleModal\r\n });\r\n };\r\n\r\n private readonly _getCollectionTitle = (): ITitleViewProps => {\r\n const { data, context, resources } = this.props;\r\n\r\n let collectionTitle: string | undefined = '';\r\n if (context && context.request && context.request.query && context.request.query.q) {\r\n collectionTitle = `\"${context.request.query.q}\"`;\r\n } else {\r\n collectionTitle =\r\n (data.category.result &&\r\n SearchResultContainer.getFriendlyName(context.request.locale, data.category.result.NameTranslations)) ||\r\n (data.category.result && data.category.result.Name) ||\r\n this.props.context.request.query?.title ||\r\n '';\r\n }\r\n let productCountText = '';\r\n let productCountNumber: number | undefined;\r\n if (data.listPageState && data.listPageState.result && data.listPageState.result.totalProductCount !== undefined) {\r\n productCountNumber = data.listPageState.result.totalProductCount;\r\n } else if (data.products && data.products.result) {\r\n productCountNumber = data.products.result.count;\r\n }\r\n\r\n if (productCountNumber && productCountNumber !== 0) {\r\n productCountText =\r\n productCountNumber !== 1\r\n ? format(this.props.resources.numberOfProducts, productCountNumber)\r\n : this.props.resources.oneProduct;\r\n } else {\r\n productCountText = format(this.props.resources.numberOfProducts, 0);\r\n }\r\n const pageName = context.request.telemetryPageName ? `result-count-${context.request.telemetryPageName.toLowerCase()}` : '';\r\n const titlePrefix = ;\r\n const titleText = collectionTitle && <Title className='ms-search-result__collection-title-text' text={collectionTitle} />;\r\n const titleCount = <Title className='ms-search-result__collection-title-count' text={productCountText} />;\r\n\r\n return {\r\n TitleContainer: { className: `ms-search-result-container__title ${pageName}` },\r\n title: {\r\n titlePrefix,\r\n titleText,\r\n titleCount\r\n }\r\n };\r\n };\r\n\r\n private readonly _getCategoryHierarchy = (): ICategoryHierarchyViewProps => {\r\n const { data } = this.props;\r\n const categoryHierarchy = data.categoryHierarchy.result;\r\n const categoryLinks =\r\n categoryHierarchy &&\r\n categoryHierarchy.map((value: CategoryHierarchyData, index: number) => {\r\n return (\r\n <Link\r\n key={index}\r\n text={value.Name}\r\n ariaLabel={`${this.props.resources.categoryLinkAriaLabel} ${value.Name}`}\r\n href={value.Url}\r\n />\r\n );\r\n });\r\n const categoryLinkSeparator = <Separator separator='/' />;\r\n\r\n return {\r\n CategoryHierarchyContainer: { tag: 'nav', className: 'ms-search-result-container__category-hierarchy' },\r\n categoryHierarchyList: categoryLinks,\r\n categoryHierarchySeparator: categoryLinkSeparator\r\n };\r\n };\r\n\r\n private readonly _getSortingDropDown = (): ISortByViewProps => {\r\n const { resources } = this.props;\r\n const activeDropdown = this._getCurrentlySelectedOption() || this.state.sortingState.selectedSortByOption;\r\n let dropdownOptions = this._getAllSortByOptions();\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- App config settings are of \"any\" value.\r\n if (this.props.context.app.config.hideRating) {\r\n dropdownOptions = dropdownOptions.filter(dropdownOption => dropdownOption.key !== sortOptions.sortByOptionRatingDesc);\r\n }\r\n\r\n const dropdown = (\r\n <LabeledDropdown\r\n labelClassname='reviews-list-sort-by'\r\n labelText={resources.sortByDropdownLabel}\r\n dropdownId='categorySortByDropdown'\r\n dropdownClassname='reviews-list-dropdown'\r\n toggleColor='link'\r\n dropdownOptions={dropdownOptions}\r\n selectedOption={activeDropdown}\r\n onSelectOption={this._updateSortByDropdown}\r\n ref={this._sortAndFilterContainerRef}\r\n />\r\n );\r\n return {\r\n SortingContainer: { className: 'ms-search-result-container__Sort-by-category' },\r\n sortByDropDown: dropdown\r\n };\r\n };\r\n\r\n private readonly _getPagination = (): React.ReactNode => {\r\n const { config, context, data, resources } = this.props;\r\n const listPageState = data.listPageState.result;\r\n const fullUrl = getCurrentUrl(context.request);\r\n const itemsPerPage = config.itemsPerPage || 10;\r\n // eslint-disable-next-line max-len -- existing code\r\n const skipCount = listPageState?.currentPageNumber\r\n ? listPageState.currentPageNumber * (this.props.config.itemsPerPage || 10)\r\n : (this.props.context.request.query && +this.props.context.request.query.skip) || 0;\r\n const totalItems = listPageState?.totalProductCount || 0;\r\n const previousText = resources.flipperPrevious;\r\n const nextText = resources.flipperNext;\r\n\r\n if (totalItems <= itemsPerPage) {\r\n return null;\r\n }\r\n return (\r\n <UncontrolledPagination\r\n className='ms-search-result-container__pagination'\r\n role='navigation'\r\n aria-label={resources.paginationAriaLabel}\r\n url={fullUrl.href}\r\n qsp='skip'\r\n items={totalItems}\r\n itemsPerPage={itemsPerPage}\r\n startingItem={skipCount}\r\n previousText={this._renderPrev(previousText)}\r\n nextText={this._renderNext(nextText)}\r\n previousAriaLabel={previousText}\r\n nextAriaLabel={nextText}\r\n telemetryContent={this.telemetryContent}\r\n />\r\n );\r\n };\r\n\r\n private readonly _getRefineMenu = (): IRefineMenuViewProps => {\r\n const { data, context, config } = this.props;\r\n const tempRangeTypeTODO = context.request.query && context.request.query.inputRange ? 'input' : 'slider';\r\n const validRefiners =\r\n this.props.config.updateRefinerPanel && ArrayExtensions.hasElements(this.state.refiners)\r\n ? this.state.refiners.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n })\r\n : data.refiners.result &&\r\n data.refiners.result.filter(refiner => {\r\n return ArrayExtensions.hasElements(refiner.Values) && !this._shouldHideFromRefiners(refiner);\r\n });\r\n\r\n const activeRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n this._getexpandRefinerCount(validRefiners && validRefiners.length, config.expandRefinersCount);\r\n const expandedRefiners = this.expandrefinerCount;\r\n const subMenus =\r\n validRefiners &&\r\n validRefiners.map((productRefinerHierarchy: IProductRefinerHierarchy, index: number) => {\r\n return (\r\n <RefineSubmenu\r\n productRefinerHierarchy={productRefinerHierarchy}\r\n selectedRefinerValues={activeRefiners}\r\n refineItemCommonProps={this._refineItemCommonProps}\r\n minValueSliderThumbAriaLabel={this.props.resources.minValueSliderThumbAriaLabel}\r\n maxValueSliderThumbAriaLabel={this.props.resources.maxValueSliderThumbAriaLabel}\r\n key={index}\r\n onUpdateRefiners={this._onUpdateRefiners}\r\n urlBuilder={this._buildRefinerUrl}\r\n isDisabled={false}\r\n isExpandedOnInitialLoad={!!(expandedRefiners && expandedRefiners > index)}\r\n tempRangeTypeTODO={tempRangeTypeTODO}\r\n context={context}\r\n moduleId={this.props.id}\r\n moduleTypeName={this.props.typeName}\r\n telemetryContent={this.telemetryContent}\r\n productCountAriaLabel={this.props.resources.productCountAriaLabel}\r\n refineItemAriaLabel={this.props.resources.refineItemAriaLabel}\r\n refineItemsAriaLabel={this.props.resources.refineItemsAriaLabel}\r\n singleProductCountAriaLabel={this.props.resources.singleProductCountAriaLabel}\r\n isMobile={this.isMobile}\r\n />\r\n );\r\n });\r\n\r\n return {\r\n RefineMenuContainer: { className: 'ms-search-result-container__refine-menu' },\r\n RefinerSectionContainer: { className: 'ms-search-result-container__refiner-section' },\r\n refiners: subMenus\r\n };\r\n };\r\n\r\n /**\r\n * Should hide from refiners.\r\n * @param refiner - The refiner.\r\n * @returns ShouldHideFromRefiners.\r\n */\r\n private readonly _shouldHideFromRefiners = (refiner: IProductRefinerHierarchy): boolean => {\r\n // Always hide sortable attribute since it's just for sorting products in Azure search, not for customers\r\n return (\r\n refiner.RecordId === this.props.data.products.result?.inventoryAwareSortableAttributeId ||\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\r\n (this.props.context.app.config.productListInventoryDisplay === ProductListInventoryFilteringOptions.HideOOS &&\r\n refiner.RecordId === this.props.data.products.result?.channelInventoryConfigurationId)\r\n );\r\n };\r\n\r\n private readonly _getChoiceSummary = (): React.ReactNode => {\r\n const { resources, data, telemetry } = this.props;\r\n const selectedRefiners = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n const refinerValueName = this.props.data.refiners.result?.find(n => n.KeyName === 'Rating');\r\n return (\r\n <ChoiceSummary\r\n classNames='ms-choice-summary-by-category'\r\n clearAllText={resources.clearAllText}\r\n label={resources.choiceSummaryLabel}\r\n closeAriaLabel={resources.closeAriaLabel}\r\n selectedChoices={selectedRefiners}\r\n // @ts-expect-error: NOTE Type-unsafe line below, null refinersByCategoryHierarchy case not handled\r\n refinerHierarchy={data.refiners.result}\r\n choiceFormat={resources.choiceFormat}\r\n choiceRangeValueFormat={resources.choiceRangeValueFormat}\r\n telemetry={telemetry}\r\n onChoiceClicked={this._onChoiceClicked}\r\n urlBuilder={this._buildRefinerUrlForChoiceSummary}\r\n choiceAriaLabel={resources.choiceAriaLabel}\r\n telemetryContent={this.telemetryContent}\r\n context={this.props.context}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n refinerValues={refinerValueName}\r\n />\r\n );\r\n };\r\n\r\n /**\r\n * Get Active products.\r\n * @returns - JSX Elements.\r\n */\r\n private readonly _getProducts = (): JSX.Element => {\r\n const {\r\n config: { imageSettings, allowBackNavigation: shouldAllowBackNavigation }\r\n } = this.props;\r\n const { resources } = this.props;\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- Reading config value.\r\n const breadCrumbType: string = this.props.context.app.config.breadcrumbType;\r\n const shouldAllowBack = shouldAllowBackNavigation && (breadCrumbType === 'back' || breadCrumbType === 'categoryAndBack');\r\n\r\n const products = (this.props.data.listPageState.result && this.props.data.listPageState.result.activeProducts) || [];\r\n const quickviewSlot = this.props.slots?.quickview?.[0];\r\n const productComparisonButton = ArrayExtensions.hasElements(this.props.slots.productComparisonButton)\r\n ? this.props.slots.productComparisonButton[0]\r\n : null;\r\n\r\n const isPriceMinMaxFeatureState = this.props.data.featureState.result?.find(\r\n featureState => featureState.Name === 'Dynamics.AX.Application.RetailSearchPriceRangeFeature'\r\n );\r\n return (\r\n <ProductSearchResultItems\r\n products={products}\r\n context={this.props.context}\r\n imageSettings={imageSettings}\r\n resources={resources}\r\n moduleType={this.props.typeName}\r\n moduleId={this.props.id}\r\n allowBackNavigation={shouldAllowBack}\r\n telemetryContent={this.telemetryContent}\r\n quickviewSlot={quickviewSlot}\r\n productComparisonButton={productComparisonButton}\r\n channelInventoryConfigurationId={this.props.data.products.result?.channelInventoryConfigurationId}\r\n isPriceMinMaxEnabled={isPriceMinMaxFeatureState?.IsEnabled}\r\n productsDimensionAvailabilities={this.state.productsDimensionAvailabilities}\r\n />\r\n );\r\n };\r\n\r\n private readonly _updateSortByDropdown = (notification: ILabeledDropdownOnChangeNotification): void => {\r\n const {\r\n context: { request: requestContext, actionContext }\r\n } = this.props;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n // eslint-disable-next-line max-len -- existing code\r\n const error = `[sort-by-category] cannot sort without context: ${!requestContext ? 'requestContext ' : ''} ${\r\n !actionContext ? 'actionContext ' : ''\r\n } could not be found`;\r\n this.props.telemetry.warning(error);\r\n return;\r\n }\r\n\r\n window.history.pushState(\r\n {},\r\n '',\r\n buildListPageUrl(\r\n getCurrentUrl(this.props.context.request),\r\n undefined,\r\n [this._getSortColumnFromSelectedOption(notification.selectedOption)],\r\n undefined\r\n )\r\n );\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.sortingCritera = {\r\n Columns: [this._getSortColumnFromSelectedOption(notification.selectedOption)]\r\n };\r\n });\r\n };\r\n\r\n private readonly _getSortColumnFromSelectedOption = (option: ILabeledDropdownOption): SortColumn => {\r\n const { data } = this.props;\r\n\r\n if (!data.searchConfiguration.result) {\r\n return {};\r\n }\r\n\r\n const mappedConfiguration = data.searchConfiguration.result.find(searchConfiguration => {\r\n return searchConfiguration.key === option.key;\r\n });\r\n\r\n if (mappedConfiguration) {\r\n return mappedConfiguration.sortColumn;\r\n }\r\n\r\n return {};\r\n };\r\n\r\n /**\r\n * Retrieves current sort criteria.\r\n * @returns Sort criteria column which is currently active or undefined if it's not specified.\r\n */\r\n private readonly _getSortCriteriaColumn = (): SortColumn | undefined => {\r\n const sortCriteria = this.props.data.listPageState.result?.sortingCritera;\r\n if (ArrayExtensions.hasElements(sortCriteria?.Columns)) {\r\n return sortCriteria!.Columns[0];\r\n }\r\n\r\n const queryColumns = parseQueryParam<SortColumn[]>('sorting', this.props.context.request);\r\n if (ArrayExtensions.hasElements(queryColumns)) {\r\n return queryColumns[0];\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n /**\r\n * Retrieves dropdown options.\r\n * @returns All dropdown options.\r\n */\r\n private readonly _getAllSortByOptions = (): ILabeledDropdownOption[] => {\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!searchConfiguration) {\r\n return [];\r\n }\r\n\r\n const mappedSearchConfiguration = this.sortByDropdownOptions.filter(mappedSearchConfig =>\r\n searchConfiguration.find(item => mappedSearchConfig.key === item.key)\r\n );\r\n\r\n return ArrayExtensions.validValues(mappedSearchConfiguration);\r\n };\r\n\r\n /**\r\n * Retrieves current selected dropdown option based on the sort criteria.\r\n * @returns Current dropdown option.\r\n */\r\n private readonly _getCurrentlySelectedOption = (): ILabeledDropdownOption | undefined => {\r\n const activeSortColumn = this._getSortCriteriaColumn();\r\n\r\n const searchConfiguration = this.props.data.searchConfiguration.result;\r\n\r\n if (!activeSortColumn || !searchConfiguration) {\r\n return undefined;\r\n }\r\n\r\n const activeMappedConfig = searchConfiguration.find(\r\n mappedSearchConfig =>\r\n mappedSearchConfig.sortColumn.ColumnName === activeSortColumn.ColumnName &&\r\n mappedSearchConfig.sortColumn.IsDescending === activeSortColumn.IsDescending\r\n );\r\n if (!activeMappedConfig) {\r\n return undefined;\r\n }\r\n\r\n return this.sortByDropdownOptions.find(dropdownOption => dropdownOption.key === activeMappedConfig.key);\r\n };\r\n\r\n private readonly _onUpdateRefiners = (itemToggleNotification: IRefineItemToggleNotification): void => {\r\n const {\r\n context: { request: requestContext, actionContext }\r\n } = this.props;\r\n\r\n if (!requestContext || !actionContext || !this.props.data.listPageState.result) {\r\n const error = `Refine menu cannot refine search criteria: \r\n ${!requestContext ? 'requestContext ' : ''} ${!actionContext ? 'actionContext ' : ''} could not be found`;\r\n this.props.telemetry.warning(error);\r\n return;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Server side the list PageState will not be called.\r\n const updatedRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n this.props.data.listPageState.result?.activeFilters || []\r\n );\r\n\r\n window.history.pushState({}, '', buildListPageUrl(getCurrentUrl(this.props.context.request), updatedRefinementCriteria));\r\n transaction(() => {\r\n this.props.data.listPageState.result!.currentPageNumber = 0;\r\n this.props.data.listPageState.result!.activeFilters = updatedRefinementCriteria;\r\n });\r\n };\r\n\r\n private readonly _buildRefinerUrl = (itemToggleNotification: IRefineItemToggleNotification): string => {\r\n if (this.props.data.listPageState.result) {\r\n const newRefinementCriteria = getUpdatedRefinementCriteria(\r\n itemToggleNotification,\r\n this.props.data.listPageState.result.activeFilters || []\r\n );\r\n\r\n return buildListPageUrl(getCurrentUrl(this.props.context.request), newRefinementCriteria);\r\n }\r\n this.props.telemetry.warning('[buildRefinerQueryString]List Page State Not available, unable to build refiner URL');\r\n return '';\r\n };\r\n\r\n private readonly _onChoiceClicked = (notification: IChoiceSummaryClickNotification): void => {\r\n const { data, telemetry } = this.props;\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked]ListPageState unavailable, unable to update refiners.');\r\n return;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!notification.clearAll) {\r\n const selectedChoice = notification.choiceClicked;\r\n if (!selectedChoice) {\r\n telemetry.warning('[choice-summary-by-category._onChoiceClicked] Choice could not be determined');\r\n return;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedChoice, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n\r\n // Set focus to sort and filter\r\n const dropdownElementId = this._sortAndFilterContainerRef.current && this._sortAndFilterContainerRef.current.props.dropdownId;\r\n const dropdownElement = dropdownElementId && document.getElementById(dropdownElementId);\r\n setTimeout(() => {\r\n dropdownElement && dropdownElement.focus();\r\n }, 50);\r\n }\r\n\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n window.history.pushState({}, '', buildListPageUrl(fullUrl, currentRefinementCriteria));\r\n data.listPageState.result.currentPageNumber = 0;\r\n data.listPageState.result.activeFilters = currentRefinementCriteria;\r\n };\r\n\r\n private readonly _buildRefinerUrlForChoiceSummary = (selectedRefiner: ProductRefinerValue, isClearAll: boolean): string => {\r\n const { data, telemetry } = this.props;\r\n const fullUrl = getCurrentUrl(this.props.context.request);\r\n\r\n if (!data.listPageState.result) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl]ListPageState unavailable, unable to create refiner URL.');\r\n return fullUrl.href;\r\n }\r\n\r\n let currentRefinementCriteria = (data.listPageState.result && data.listPageState.result.activeFilters) || [];\r\n\r\n if (!isClearAll) {\r\n if (!selectedRefiner) {\r\n telemetry.warning('[choice-summary-by-category._buildRefinerUrl] URL for Choice could not be determined');\r\n return fullUrl.href;\r\n }\r\n currentRefinementCriteria = currentRefinementCriteria.filter(\r\n (selectedCriterion: ProductRefinerValue) => !isMatchingRefinementCriterion(selectedRefiner, selectedCriterion)\r\n );\r\n } else {\r\n currentRefinementCriteria = [];\r\n }\r\n\r\n return buildListPageUrl(fullUrl, currentRefinementCriteria);\r\n };\r\n\r\n private _getViewport(): GridSize {\r\n if (MsDyn365.isBrowser) {\r\n return isMobile({ variant: VariantType.Browser, context: this.props.context.request });\r\n }\r\n return isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\r\n }\r\n\r\n private _toggleModal(): void {\r\n this.setState({\r\n modalIsOpen: !this.state.modalIsOpen\r\n });\r\n }\r\n\r\n private _updateViewport(): void {\r\n this._viewport = this._getViewport();\r\n\r\n if (this.state.modalIsOpen && !this.isMobile) {\r\n this._toggleModal();\r\n }\r\n }\r\n\r\n private readonly _getexpandRefinerCount = (validRefiners?: number, refinerCount?: expandRefinersCount): void => {\r\n switch (refinerCount) {\r\n case expandRefinersCount.all:\r\n this.expandrefinerCount = validRefiners;\r\n break;\r\n case expandRefinersCount.one:\r\n this.expandrefinerCount = 1;\r\n break;\r\n case expandRefinersCount.two:\r\n this.expandrefinerCount = 2;\r\n break;\r\n case expandRefinersCount.three:\r\n this.expandrefinerCount = 3;\r\n break;\r\n case expandRefinersCount.four:\r\n this.expandrefinerCount = 4;\r\n break;\r\n default:\r\n this.expandrefinerCount = 0;\r\n }\r\n };\r\n\r\n /**\r\n * Renders a Pagination previous text.\r\n * @param paginationPreviousText - Pagination previous text from resources.\r\n * @returns Previous text and flipper icon.\r\n */\r\n private readonly _renderPrev = (paginationPreviousText: string) => {\r\n return (\r\n <div className='msc-pagination__prev'>\r\n <span className='ms-search-result__pagination-left' aria-hidden='true' />\r\n <span className='prev-text'>{paginationPreviousText}</span>\r\n </div>\r\n );\r\n };\r\n\r\n /**\r\n * Renders a Pagination next text.\r\n * @param paginationNextText - Pagination next text from resources.\r\n * @returns Next text and flipper icon.\r\n */\r\n private readonly _renderNext = (paginationNextText: string) => {\r\n return (\r\n <div className='msc-pagination__next'>\r\n <span className='next-text'>{paginationNextText}</span>\r\n <span className='ms-search-result__pagination-right' aria-hidden='true' />\r\n </div>\r\n );\r\n };\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { ISearchResultModalViewProps } from './components';\r\nimport {\r\n ICategoryHierarchyViewProps,\r\n IRefineMenuViewProps,\r\n ISearchResultContainerViewProps,\r\n ISortByViewProps,\r\n ITitleViewProps\r\n} from './liquid23-search-result-container';\r\n\r\nconst SearchResultContainerView: React.FC<ISearchResultContainerViewProps> = props => {\r\n const {\r\n SearchResultContainer,\r\n products,\r\n pagination,\r\n ProductsContainer,\r\n ProductSectionContainer,\r\n choiceSummary,\r\n isMobile,\r\n modalToggle,\r\n searchResultModal,\r\n TitleViewProps,\r\n refineMenu,\r\n categoryHierarchy,\r\n sortByOptions,\r\n CategoryNavContainer,\r\n RefineAndProductSectionContainer,\r\n errorMessage,\r\n FeatureSearchContainer,\r\n similarLookProduct\r\n } = props;\r\n const isRecoSearchPage = props.context.actionContext.requestContext.query?.recommendation;\r\n if (isMobile) {\r\n return (\r\n <Module {...SearchResultContainer}>\r\n {renderCategoryHierarchy(categoryHierarchy)}\r\n {renderTitle(TitleViewProps)}\r\n {choiceSummary}\r\n {modalToggle}\r\n {createSearchResultModal(searchResultModal, refineMenu, sortByOptions, isRecoSearchPage)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...ProductsContainer}>\r\n {errorMessage}\r\n {products}\r\n </Node>\r\n {pagination}\r\n </Module>\r\n );\r\n }\r\n return (\r\n <Module {...SearchResultContainer}>\r\n <Node {...CategoryNavContainer}>\r\n {categoryHierarchy && renderCategoryHierarchy(categoryHierarchy)}\r\n {TitleViewProps && renderTitleCount(TitleViewProps)}\r\n </Node>\r\n <Node {...RefineAndProductSectionContainer}>\r\n {refineMenu && renderRefiner(refineMenu)}\r\n <Node {...ProductSectionContainer}>\r\n {TitleViewProps && renderTitle(TitleViewProps)}\r\n {choiceSummary}\r\n {sortByOptions && !isRecoSearchPage && renderSort(sortByOptions)}\r\n <Node {...FeatureSearchContainer}>{similarLookProduct}</Node>\r\n <Node {...ProductsContainer}>\r\n {errorMessage}\r\n {products}\r\n </Node>\r\n {pagination}\r\n </Node>\r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\nconst createSearchResultModal = (\r\n modalProps: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element => {\r\n return React.cloneElement(\r\n modalProps.modal,\r\n {},\r\n modalProps.modalHeader,\r\n createModalBody(modalProps, refineMenu, sortByDropDown, isRecoSearchPage),\r\n modalProps.modalFooter\r\n );\r\n};\r\n\r\nconst createModalBody = (\r\n props: ISearchResultModalViewProps,\r\n refineMenu: IRefineMenuViewProps,\r\n sortByDropDown: ISortByViewProps,\r\n isRecoSearchPage?: string\r\n): JSX.Element | null => {\r\n if (sortByDropDown) {\r\n return React.cloneElement(props.modalBody, {}, renderSort(sortByDropDown, isRecoSearchPage), renderRefiner(refineMenu));\r\n }\r\n return null;\r\n};\r\n\r\nconst renderRefiner = (props: IRefineMenuViewProps): JSX.Element | null => {\r\n const { refiners, RefineMenuContainer, RefinerSectionContainer } = props;\r\n if (refiners) {\r\n return (\r\n <Node {...RefinerSectionContainer}>\r\n <Node {...RefineMenuContainer}>\r\n {refiners.map((submenu, index) => (\r\n <React.Fragment key={index}>{submenu}</React.Fragment>\r\n ))}\r\n </Node>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst renderSort = (props: ISortByViewProps, isRecoSearchPage?: string): JSX.Element | null => {\r\n const { SortingContainer, sortByDropDown } = props;\r\n if (sortByDropDown && !isRecoSearchPage) {\r\n return <Node {...SortingContainer}>{sortByDropDown}</Node>;\r\n }\r\n return null;\r\n};\r\n\r\nconst renderCategoryHierarchy = (props: ICategoryHierarchyViewProps): JSX.Element | null => {\r\n const { CategoryHierarchyContainer, categoryHierarchyList, categoryHierarchySeparator } = props;\r\n if (categoryHierarchyList) {\r\n return (\r\n <Node {...CategoryHierarchyContainer}>\r\n {categoryHierarchyList.map((category, index) => (\r\n <React.Fragment key={index}>\r\n {category}\r\n {categoryHierarchyList && categoryHierarchyList[index + 1] && categoryHierarchySeparator}\r\n </React.Fragment>\r\n ))}\r\n </Node>\r\n );\r\n }\r\n\r\n return null;\r\n};\r\n\r\nconst renderTitle = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <h2>\r\n {title.titlePrefix}\r\n {title.titleText}\r\n </h2>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nconst renderTitleCount = (props: ITitleViewProps): JSX.Element | null => {\r\n const { title, TitleContainer } = props;\r\n if (title) {\r\n return (\r\n <Node {...TitleContainer}>\r\n <h5>{title.titleCount}</h5>\r\n </Node>\r\n );\r\n }\r\n return null;\r\n};\r\n\r\nexport default SearchResultContainerView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport interface ILogoProps {\r\n image: Msdyn365.IImageData;\r\n gridSettings?: Msdyn365.IGridSettings;\r\n link?: ILinkData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n requestContext: Msdyn365.IRequestContext;\r\n}\r\n\r\nexport interface ILinkData {\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Logo component\r\n * @extends {React.PureComponent<ILogoConfig>}\r\n */\r\nexport class Logo extends React.PureComponent<ILogoProps> {\r\n\r\n private attributes?: Msdyn365.IDictionary<string>;\r\n\r\n constructor(props: ILogoProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Logo);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n public render():JSX.Element {\r\n return(\r\n <div className={this.props.className}>\r\n {this._renderLogo(this.props)}\r\n </div>\r\n );\r\n }\r\n\r\n private _renderLogo(config: ILogoProps):JSX.Element {\r\n if(config.link && config.link.linkUrl.destinationUrl) {\r\n return(\r\n <a\r\n href={config.link.linkUrl.destinationUrl}\r\n aria-label={config.link.ariaLabel}\r\n target={config.link.openInNewTab ? '_blank' : undefined}\r\n {...this.attributes}\r\n >\r\n {this._renderImage(config)}\r\n </a>\r\n );\r\n }\r\n return(\r\n this._renderImage(config)\r\n );\r\n }\r\n\r\n private _renderImage(config: ILogoProps): JSX.Element {\r\n const defaultImageSettings: Msdyn365.IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=132&h=28&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=160&h=48&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n <Msdyn365.Image\r\n {...config.image}\r\n gridSettings={this.props.gridSettings!}\r\n imageSettings={config && config.image && config.image.imageSettings || defaultImageSettings}\r\n loadFailureBehavior='default'\r\n editProps= {{key: config.image || {}, requestContext: this.props.requestContext}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default Logo;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IObrienb2bHeaderResources } from '../obrienb2b-header.props.autogenerated';\r\n\r\nexport interface INavIconProps {\r\n resources: IObrienb2bHeaderResources;\r\n isExpanded: boolean;\r\n targetId: string;\r\n telemetryContent?: ITelemetryContent;\r\n toggleNavBar(): void;\r\n}\r\n\r\n/**\r\n *\r\n * NavIcon component\r\n * @extends {React.PureComponent<INavIconProps>}\r\n */\r\n\r\n@observer\r\nexport class NavIcon extends React.Component<INavIconProps> {\r\n\r\n private attributes?: Msdyn365.IDictionary<string>;\r\n\r\n constructor(props: INavIconProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.NavIcon);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n\r\n public render():JSX.Element {\r\n return (\r\n <Button\r\n className='ms-header__nav-icon'\r\n onClick={this.props.toggleNavBar}\r\n title={this.props.resources.mobileHamburgerAriaLabel}\r\n aria-label={this.props.resources.mobileHamburgerAriaLabel}\r\n aria-expanded={this.props.isExpanded}\r\n aria-controls={this.props.targetId}\r\n {...this.attributes}\r\n ><span>Menu</span></Button>\r\n );\r\n }\r\n}","import { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IObrienb2BHeaderData } from '../obrienb2b-header.data';\r\nimport { IObrienb2bHeaderProps } from '../obrienb2b-header.props.autogenerated';\r\n\r\n/**\r\n * The header preferred store component\r\n */\r\n@observer\r\nexport class HeaderPreferredStore extends React.PureComponent<IObrienb2bHeaderProps<IObrienb2BHeaderData>> {\r\n\r\n public handleClick = () => { return this._findPreferreStoreOnClick(this.props); };\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n slots,\r\n resources\r\n } = this.props;\r\n if (slots && slots.storeSelector && slots.storeSelector.length) {\r\n const storeName = storeSelectorStateManager!.preferredStore && storeSelectorStateManager!.preferredStore.StoreName ?\r\n storeSelectorStateManager!.preferredStore.StoreName :\r\n resources.headerPreferredStoreText;\r\n\r\n return (\r\n <div className='ms-header__preferred-store-container'>\r\n <button className='ms-header__preferred-store-btn msc-btn' color='secondary' aria-label={resources.headerPreferredStoreAriaLabel} onClick={this.handleClick} >\r\n <span className='ms-header__preferred-store-text'>{storeName}</span>\r\n </button>\r\n {slots.storeSelector}\r\n </div>\r\n );\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private async _findPreferreStoreOnClick(props: IObrienb2bHeaderProps<IObrienb2BHeaderData>): Promise<void> {\r\n const { data: { storeSelectorStateManager: { result: storeSelectorStateManager } }, modules } = props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n storeSelectorStateManager.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: orgUnitLocation => {\r\n return Promise.resolve();\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n }\r\n}\r\n\r\nexport default HeaderPreferredStore;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes, Modal,\r\n ModalBody, ModalHeader, onTelemetryClick, Popover, TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport * as React from 'react';\r\nimport { HeaderPreferredStore, Logo, NavIcon } from './components';\r\nimport { IObrienb2BHeaderData } from './obrienb2b-header.data';\r\nimport { IObrienb2bHeaderProps, IObrienb2bHeaderResources, IMyAccountLinksData } from './obrienb2b-header.props.autogenerated';\r\n\r\nexport interface IHeaderState {\r\n mobileMenuCollapsed: boolean;\r\n signinPopoverOpen: boolean;\r\n}\r\n\r\nexport interface IHeaderViewProps extends IObrienb2bHeaderProps<IObrienb2BHeaderData>, IHeaderState {\r\n logo: React.ReactNode;\r\n wishListIconDesktop: React.ReactNode;\r\n wishListIconMobile: React.ReactNode;\r\n cartIcon: React.ReactNode;\r\n navIcon: React.ReactNode;\r\n className: string;\r\n menuBar: React.ReactNode[];\r\n search: React.ReactNode[];\r\n siteOptions: React.ReactNode[];\r\n HeaderTag: IModuleProps;\r\n HeaderContainer: INodeProps;\r\n MobileMenuContainer: INodeProps;\r\n MobileMenuHeader: React.ReactNode;\r\n MobileMenuBodyContainer: INodeProps;\r\n MobileMenuLinksContainer: INodeProps;\r\n HeaderTopBarContainer: INodeProps;\r\n Divider: INodeProps;\r\n\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n preferredStore?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * Header component\r\n * @extends {React.PureComponent<IObrienb2bHeaderProps<IObrienb2bHeaderData>>}\r\n */\r\nclass Header extends React.PureComponent<IObrienb2bHeaderProps<IObrienb2BHeaderData>, IHeaderState> {\r\n private popOverRef: React.RefObject<HTMLButtonElement>;\r\n private telemetryContent: ITelemetryContent;\r\n @computed public get displayName(): Readonly<string | undefined> {\r\n const customer = this.props.data.accountInformation?.result;\r\n return customer ? customer.FirstName || customer.Name : undefined;\r\n }\r\n\r\n constructor(props: IObrienb2bHeaderProps<IObrienb2BHeaderData>) {\r\n super(props);\r\n this.popOverRef = React.createRef();\r\n this._toggleNavbar = this._toggleNavbar.bind(this);\r\n this._togglePopover = this._togglePopover.bind(this);\r\n this._keydown = this._keydown.bind(this);\r\n this.state = {\r\n mobileMenuCollapsed: true,\r\n signinPopoverOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.addEventListener('keydown', this._keydown);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.removeEventListener('keydown', this._keydown, false);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n data: { accountInformation,\r\n cart: { result: cart },\r\n storeSelectorStateManager: {result: storeSelectorStateManager}\r\n },\r\n context: {\r\n request: {\r\n user\r\n }\r\n },\r\n context,\r\n resources: {\r\n cartLabel,\r\n cartQtyLabel\r\n }\r\n } = this.props;\r\n const { logoLink, logoImage } = this.props.config;\r\n const headerClassName = classnames('ms-header', this.props.config.className);\r\n const navbarKey = 'header-nav-mobile';\r\n const customer = accountInformation && accountInformation.result;\r\n const cartIconSlot = this._getSlot('cartIcon');\r\n const menuBarSlot = this._getSlot('obrienb2bMenuBar');\r\n const searchSlot = this._getSlot('search');\r\n const siteOptionsSlot = this._getSlot('siteOptions');\r\n const preferredStoreSlot = this._getSlot('storeSelector');\r\n const viewProps: IHeaderViewProps = {\r\n ...(this.props as IObrienb2bHeaderProps<IObrienb2BHeaderData>),\r\n ...(this.state),\r\n logo: <Logo {...{ link: logoLink, image: logoImage, className: 'ms-header__logo', gridSettings: this.props.context.request.gridSettings, requestContext: this.props.context.request, telemetryContent: this.telemetryContent }} />,\r\n wishListIconDesktop: (\r\n <WishListIconComponent\r\n className='ms-header__wishlist-desktop'\r\n showButtonTooltip={true}\r\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\r\n context={context}\r\n id={id}\r\n typeName={typeName}\r\n telemetryContent={this.telemetryContent}\r\n data={{}}\r\n />\r\n ),\r\n wishListIconMobile: (\r\n <WishListIconComponent\r\n className='ms-header__wishlist-mobile'\r\n showButtonTooltip={true}\r\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\r\n context={context}\r\n id={id}\r\n typeName={typeName}\r\n telemetryContent={this.telemetryContent}\r\n data={{}}\r\n />\r\n ),\r\n cartIcon: (cartIconSlot && cartIconSlot.length > 0)\r\n ? cartIconSlot[0]\r\n : cart && <CartIconComponent cartLabel={cartLabel} cartQtyLabel={cartQtyLabel} context={context} id={id} typeName={typeName} telemetryContent={this.telemetryContent} data={{ cart: cart }} />,\r\n navIcon: <NavIcon {...{ resources: this.props.resources, isExpanded: !this.state.mobileMenuCollapsed, targetId: navbarKey, toggleNavBar: this._toggleNavbar, telemetryContent: this.telemetryContent }} />,\r\n menuBar: menuBarSlot && menuBarSlot.length && menuBarSlot || [],\r\n search: searchSlot && searchSlot.length && searchSlot || [],\r\n siteOptions: siteOptionsSlot && siteOptionsSlot.length && siteOptionsSlot || [],\r\n className: headerClassName,\r\n HeaderTag: {\r\n moduleProps: this.props,\r\n className: classnames(headerClassName),\r\n tag: 'header'\r\n },\r\n HeaderContainer: {\r\n className: classnames('ms-header__container')\r\n },\r\n HeaderTopBarContainer: {\r\n className: classnames('inside-xxl always-flex justify')\r\n },\r\n Divider: {\r\n className: classnames('ms-header__divider')\r\n },\r\n MobileMenuContainer: {\r\n tag: Modal,\r\n id: navbarKey,\r\n className: 'ms-header__mobile-hamburger',\r\n isOpen: !this.state.mobileMenuCollapsed,\r\n wrapClassName: 'ms-header__modal'\r\n },\r\n MobileMenuHeader: (\r\n <ModalHeader\r\n className='ms-header__mobile-hamburger-menu-header'\r\n toggle={this._toggleNavbar}\r\n />\r\n ),\r\n MobileMenuBodyContainer: {\r\n tag: ModalBody,\r\n className: 'ms-header__mobile-hamburger-menu-body',\r\n },\r\n MobileMenuLinksContainer: {\r\n className: 'ms-header__mobile-hamburger-menu-links',\r\n },\r\n AccountInfoDropdownParentContainer: {\r\n className: 'ms-header__account-info'\r\n },\r\n AccountInfoDropdownPopoverConentContainer: customer && this.displayName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: this.state.signinPopoverOpen,\r\n target: this.popOverRef,\r\n toggle: this._togglePopover,\r\n } || undefined,\r\n signInLink: this._getSigninButton(customer, user, this.props.resources),\r\n signOutLink: this._getSignOutButton(customer, user, this.props.resources),\r\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(customer),\r\n accountLinks: this._getAccountLinks(customer),\r\n preferredStore: preferredStoreSlot\r\n && preferredStoreSlot.length\r\n && storeSelectorStateManager\r\n && (<HeaderPreferredStore {...this.props}/>)\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /* Handle link text change*/\r\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent) => {\r\n if (this.props.config.myAccountLinks && this.props.config.myAccountLinks[linkIndex]) {\r\n this.props.config.myAccountLinks[linkIndex].linkText = event.target.value;\r\n }\r\n }\r\n\r\n private _getSlot(slotName: string): React.ReactNode[] | null {\r\n const { slots } = this.props;\r\n return (slots && slots[slotName] && slots[slotName].length && slots[slotName]) || null;\r\n }\r\n\r\n private _getSigninButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IObrienb2bHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignIn);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return !customer && (\r\n <Button\r\n className='ms-header__signin-button'\r\n title={resources.signInLinkText}\r\n href={user && user.signInUrl}\r\n aria-label={resources.signInLinkAriaText}\r\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign in')}\r\n {...attributes}\r\n >\r\n <span className='ms-header__signin-button-text' aria-hidden={true}><span>{resources.signInLinkText}</span></span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getSignOutButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IObrienb2bHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignOut);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n <Button\r\n className={'ms-header__signout-button'}\r\n title={resources.signOutLinkText}\r\n href={user && user.signOutUrl || ''}\r\n aria-label={resources.signOutLinkAriaText}\r\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign out')}\r\n {...attributes}\r\n >\r\n <span className='ms-header__signout-button-text' aria-hidden={true}><span>{resources.signOutLinkText}</span></span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getAccountInfoDropdownButton(customer: Customer | undefined): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.MyProfile);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n <Button\r\n innerRef={this.popOverRef}\r\n className={'ms-header__profile-button'}\r\n aria-describedby='myprofilePopover'\r\n onClick={this._togglePopover}\r\n color='link'\r\n aria-expanded={this.state.signinPopoverOpen}\r\n {...attributes}\r\n >\r\n <span className='ms-profile-button-text'>{this.displayName}</span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\r\n const { myAccountLinks } = this.props.config;\r\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n if(!customer || ! this.displayName || !myAccountLinks || !myAccountLinks.length) {\r\n return undefined;\r\n }\r\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\r\n payLoad.contentAction.etext = cta.linkText;\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n const editableLink: MsDyn365.ILinksData = {\r\n ariaLabel: cta.ariaLabel,\r\n className: 'ms-signin-info__account-link-button',\r\n linkText: cta.linkText,\r\n linkUrl: cta.linkUrl.destinationUrl,\r\n openInNewTab: cta.openInNewTab,\r\n role: 'button',\r\n additionalProperties: attributes\r\n };\r\n\r\n return (\r\n <MsDyn365.Link\r\n key={index}\r\n link={editableLink}\r\n editProps={{ onTextChange: this.handleLinkTextChange(index), requestContext: this.props.context.request }}\r\n />\r\n );\r\n });\r\n }\r\n\r\n private _toggleNavbar(): void {\r\n this.setState({\r\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\r\n });\r\n }\r\n\r\n private _togglePopover(): void {\r\n this.setState({\r\n signinPopoverOpen: !this.state.signinPopoverOpen\r\n });\r\n }\r\n\r\n private _keydown(e: KeyboardEvent): void {\r\n if (e.keyCode === KeyCodes.Escape) {\r\n this.setState({ mobileMenuCollapsed: true });\r\n }\r\n }\r\n}\r\n\r\nexport default Header;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport Transition from 'react-transition-group/Transition';\r\n\r\nimport { mapToCssModules, TransitionStatuses } from '@msdyn365-commerce-modules/utilities';\r\nimport { ICollapseProps } from './Collapse.props';\r\n\r\nexport interface ICollapseState {\r\n height: number | null;\r\n}\r\n\r\ntype IHash = {\r\n [key in TransitionStatuses]: string;\r\n};\r\n\r\n/**\r\n * This is the controlled version of a Collapse component, and as such the toggle behavior is expected to be handled in a parent component.\r\n * @see See [Uncontrolled Components - React](https://reactjs.org/docs/uncontrolled-components.html) to learn more.\r\n * @visibleName Collapse (controlled)\r\n */\r\nexport default class Collapse extends React.Component<ICollapseProps, ICollapseState> {\r\n public static defaultProps: Partial<ICollapseProps> = {\r\n isOpen: false,\r\n tag: 'div',\r\n timeout: 0\r\n };\r\n\r\n public props: ICollapseProps;\r\n\r\n public state: ICollapseState;\r\n\r\n private readonly _transitionStatusToClassHash: IHash = {\r\n entering: 'collapse',\r\n entered: 'collapse show',\r\n exiting: 'collapse',\r\n exited: 'collapse'\r\n };\r\n\r\n private readonly _tagRef: React.RefObject<HTMLElement> = React.createRef<HTMLElement>();\r\n\r\n constructor(props: ICollapseProps) {\r\n super(props);\r\n this.props = props;\r\n\r\n this.state = {\r\n height: 0\r\n };\r\n\r\n this._onEntering = this._onEntering.bind(this);\r\n this._onExit = this._onExit.bind(this);\r\n this._onExited = this._onExited.bind(this);\r\n this._onExiting = this._onExiting.bind(this);\r\n this._reevaluateHeight = this._reevaluateHeight.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n window && window.addEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public componentDidUpdate(nextProps: ICollapseProps): void {\r\n if (nextProps.children !== this.props.children) {\r\n this._reevaluateHeight();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window && window.removeEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICollapseProps,\r\n nextState: ICollapseState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n tag,\r\n isOpen,\r\n className,\r\n children,\r\n navbar,\r\n cssModule,\r\n\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n timeout,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited,\r\n\r\n ...otherProps\r\n } = this.props;\r\n\r\n const Tag = tag || 'div';\r\n const transitionProps = {\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited\r\n };\r\n\r\n //const { height } = this.state;\r\n //const style = height === null || height === 0 ? null : { minHeight: height };\r\n\r\n return (\r\n <Transition\r\n {...transitionProps}\r\n in={isOpen}\r\n timeout={timeout || 0}\r\n onEntering={this._onEntering}\r\n onExit={this._onExit}\r\n onExiting={this._onExiting}\r\n onExited={this._onExited}\r\n >\r\n {(status: TransitionStatuses) => {\r\n const collapseClass = this._getTransitionClass(status);\r\n const classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);\r\n\r\n return (\r\n <Tag\r\n {...otherProps} className={classes} ref={this._tagRef}\r\n >\r\n {children}\r\n </Tag>\r\n );\r\n }}\r\n </Transition>\r\n );\r\n }\r\n\r\n private _reevaluateHeight(): void {\r\n const node = this._tagRef.current;\r\n if (node !== null && node.firstElementChild && node.firstElementChild.scrollHeight > 0) {\r\n this.setState({ height: node.firstElementChild.scrollHeight });\r\n }\r\n }\r\n\r\n private _getTransitionClass(status: TransitionStatuses): string {\r\n return this._transitionStatusToClassHash[status] || 'collapse';\r\n }\r\n\r\n private _onEntering(node: HTMLElement, isAppearing: boolean): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n //if (this.props.onEntering) {\r\n // this.props.onEntering(node, isAppearing);\r\n //}\r\n }\r\n\r\n private _onExit(node: HTMLElement): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n if (this.props.onExit) {\r\n this.props.onExit(node);\r\n }\r\n }\r\n\r\n private _onExiting(node: HTMLElement): void {\r\n this.setState({ height: 0 });\r\n\r\n if (this.props.onExiting) {\r\n this.props.onExiting(node);\r\n }\r\n }\r\n\r\n private _onExited(node: HTMLElement): void {\r\n this.setState({ height: null });\r\n\r\n if (this.props.onExited) {\r\n this.props.onExited(node);\r\n }\r\n }\r\n}\r\n","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from \"react\";\nexport default (({\n styles = {},\n ...props\n}) => /*#__PURE__*/React.createElement(\"svg\", _extends({\n version: \"1.1\",\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n x: \"0\",\n y: \"0\",\n viewBox: \"0 0 2830.95 600.69\",\n xmlSpace: \"preserve\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st0\"] || \"st0\",\n d: \"M1095.41 411.04c-15.25 16.07-33.33 23.81-54.24 23.81H785.79c-21.47 0-39.55-7.15-54.81-23.22-15.25-16.08-22.03-35.12-22.03-57.75V246.12c0-22.03 7.34-41.08 22.03-56.56 15.25-16.07 33.34-23.81 54.81-23.81h255.38c20.9 0 38.98 7.74 54.24 23.81 15.26 16.08 22.6 34.53 22.6 56.56v107.76c0 22.03-7.35 41.08-22.6 57.16zm-28.25-164.92c0-14.29-11.86-26.79-25.99-26.79H785.22c-14.12 0-24.86 12.5-24.86 26.79v107.76c0 18.46 8.47 27.39 25.42 27.39h255.38c14.12 0 25.99-12.5 25.99-27.39V246.12zM1504.43 411.63c-14.69 15.48-32.77 23.22-54.24 23.22h-306.22V165.76h306.22c21.47 0 38.99 7.74 54.24 23.81 15.26 16.08 22.6 34.53 22.6 56.56 0 20.84-6.21 39.3-19.21 54.18 13 14.88 19.21 32.74 19.21 53.58 0 22.62-7.34 41.66-22.6 57.74zm-54.24-192.3h-254.81v54.18h255.37c14.13 0 25.42-12.5 25.42-27.39.01-14.88-10.73-26.79-25.98-26.79zm.56 107.76h-255.37v54.18h254.81c16.95 0 25.43-8.93 25.43-27.39 0-14.29-10.74-26.79-24.87-26.79zM1884.64 434.85v-80.97c0-17.86-8.47-26.79-25.42-26.79h-254.81v107.76H1553V165.76h306.23c21.47 0 38.98 7.74 54.24 23.81 15.26 16.08 22.61 34.53 22.61 56.56 0 20.84-6.22 39.3-19.21 54.18 12.99 14.88 19.21 32.74 19.21 53.58v80.97h-51.44zm-25.42-215.52h-254.81v54.18h254.81c16.95 0 25.42-8.93 25.42-27.39 0-17.86-8.47-26.79-25.42-26.79zM1962.03 434.85v-268.5h50.85v268.5h-50.85zM2038.85 434.85V165.76h383.07v80.37h-51.41c0-17.86-8.48-26.79-24.86-26.79h-255.37v54.18h255.37v53.58h-255.37v54.18h255.37c16.95 0 25.42-8.93 24.86-27.39h51.41v80.97h-383.07zM2779.53 434.85V246.12c0-14.29-11.3-26.79-25.42-26.79h-255.38v215.51h-50.85V165.76h306.23c21.48 0 38.99 7.74 54.24 23.81 15.26 16.08 22.6 34.53 22.6 56.56v188.73h-51.42z\"\n}), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st0\"] || \"st0\",\n d: \"M128.51 210.95v178.79c0 24.88 25.79 45.06 57.59 45.06h147.76c15.32-13.53 61.09-61.12 31.89-124.68 0 0 47.4 70.79 31.4 124.68h17.47c31.81 0 57.59-20.18 57.59-45.06V210.95c0-24.89-25.78-45.06-57.59-45.06H186.1c-31.81 0-57.59 20.17-57.59 45.06zm74.77 33.92c0-11.32 11.72-20.48 26.18-20.48h141.8c14.45 0 26.17 9.16 26.17 20.48v72.55c-2.52-3.13-5.05-6.15-7.6-9.08v-.04l-.06-.02c-72.92-83.45-155.8-83.53-155.8-83.53 59.53 10.38 87.49 47.31 100.37 84.18 5.03 19.92 2.39 47.98-39.52 67.38h-65.37c-14.46 0-26.18-9.17-26.18-20.49V244.87z\"\n})), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st0\"] || \"st0\",\n d: \"M300.35 600.69C134.75 600.69 0 465.95 0 300.34 0 134.74 134.75 0 300.35 0S600.7 134.74 600.7 300.34c0 165.61-134.75 300.35-300.35 300.35zm0-540.56c-132.47 0-240.22 107.75-240.22 240.21s107.75 240.22 240.22 240.22S540.57 432.8 540.57 300.34c0-132.45-107.75-240.21-240.22-240.21z\"\n}))));","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport Collapse from './collapse/Collapse';\r\nimport * as React from 'react';\r\n// import classnames from 'classnames';\r\n// import { Customer } from '@msdyn365-commerce/retail-proxy';\r\n// import { AsyncResult } from '@msdyn365-commerce/core';\r\nimport { IHeaderViewProps } from './obrienb2b-header';\r\n//@ts-ignore\r\nimport Logosvg from '../../../public/obrien/img/Obrien-Logo-Web.svg';\r\n\r\nconst headerView: React.FC<IHeaderViewProps> = props => {\r\n const {\r\n HeaderTag,\r\n HeaderContainer,\r\n HeaderTopBarContainer,\r\n Divider\r\n } = props;\r\n return (\r\n <Module {...HeaderTag}>\r\n <Node {...HeaderContainer}>\r\n <Node {...HeaderTopBarContainer}>\r\n\r\n {/* This is the area that is majorly revamped. Subtract components as needed. */}\r\n\r\n <div className='obrienb2b-logo always-flex align-items-center'>\r\n {props.navIcon}\r\n <Node {...Divider}/>\r\n <div className='obrienSvg'><a href='https://kentsports.commerce.dynamics.com/obb2b'><Logosvg /></a></div>\r\n </div>\r\n \r\n <div className='obrienb2b-other always-flex align-items-center'>\r\n <Node {...Divider}/>\r\n {_renderReactFragment(props.search)}\r\n {_renderDesktopAccountBlock(props)}\r\n {props.cartIcon}\r\n {_renderReactFragment(props.siteOptions)}\r\n </div>\r\n\r\n </Node>\r\n {_renderCollapseMenu(props)}\r\n \r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\nfunction _renderCollapseMenu(props: IHeaderViewProps): JSX.Element | null {\r\n const { MobileMenuLinksContainer, mobileMenuCollapsed } = props;\r\n return (\r\n <Collapse className={'ms-header__collapsible-hamburger'} isOpen={!mobileMenuCollapsed}>\r\n <Node {...MobileMenuLinksContainer}>\r\n <div className='right-here'>\r\n {_renderReactFragment(props.menuBar)}\r\n {/* {_renderMobileAccountBlock(props, true)}\r\n {props.wishListIconMobile} */}\r\n </div>\r\n </Node>\r\n </Collapse>\r\n );\r\n}\r\n\r\n// const renderCustomerName = (accountInformation: AsyncResult<Customer>): React.ReactChild => {\r\n// const customer = accountInformation && accountInformation.result;\r\n// return (\r\n// <>{customer && customer.FirstName}</>\r\n// );\r\n// };\r\n\r\n// function _renderMobileAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n// const {\r\n// AccountInfoDropdownParentContainer,\r\n// signOutLink,\r\n// signInLink,\r\n// data,\r\n// accountLinks } = props;\r\n\r\n// if (AccountInfoDropdownParentContainer) {\r\n// const accountClassName = classnames('ms-header__drawer', AccountInfoDropdownParentContainer.className, renderForMobile ? 'account-mobile' : 'account-desktop');\r\n\r\n// if (accountLinks) {\r\n// return (\r\n// <Drawer className={accountClassName} openGlyph='ms-header__drawer-open' closeGlyph='ms-header__drawer-close' glyphPlacement='end' toggleButtonText={renderCustomerName(data.accountInformation)}>\r\n// <div>\r\n// {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n// {signOutLink}\r\n// </div>\r\n// </Drawer>\r\n// );\r\n// } else if (signInLink) {\r\n// return (\r\n// <Node {...AccountInfoDropdownParentContainer} className={accountClassName}>\r\n// {signInLink}\r\n// </Node>\r\n// );\r\n// }\r\n// }\r\n// return null;\r\n// }\r\n\r\nfunction _renderDesktopAccountBlock(props: IHeaderViewProps): JSX.Element | null {\r\n const {\r\n AccountInfoDropdownParentContainer,\r\n AccountInfoDropdownPopoverConentContainer,\r\n accountInfoDropdownButton,\r\n signOutLink,\r\n signInLink,\r\n accountLinks,\r\n } = props;\r\n\r\n if (AccountInfoDropdownParentContainer) {\r\n if (AccountInfoDropdownPopoverConentContainer) {\r\n return (\r\n <Node {...AccountInfoDropdownParentContainer}>\r\n {accountInfoDropdownButton}\r\n <Node {...AccountInfoDropdownPopoverConentContainer}>\r\n { accountLinks ? accountLinks.map(link => link) : false }\r\n {signOutLink}\r\n </Node>\r\n </Node>\r\n );\r\n } else if (signInLink) {\r\n return (\r\n <Node {...AccountInfoDropdownParentContainer}>\r\n {signInLink}\r\n </Node>\r\n );\r\n }\r\n }\r\n props.context.telemetry.error('Header content is empty, module wont render.');\r\n return null;\r\n}\r\n\r\nfunction _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\r\n return (\r\n <React.Fragment>\r\n {items && items.length\r\n ? items.map((slot: React.ReactNode, index: number) => {\r\n return <React.Fragment key={index}>{slot}</React.Fragment>;\r\n })\r\n : null}\r\n </React.Fragment>\r\n );\r\n}\r\n\r\nexport default headerView;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\n\r\nexport interface ILogoProps {\r\n image: Msdyn365.IImageData;\r\n gridSettings?: Msdyn365.IGridSettings;\r\n link?: ILinkData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n requestContext: Msdyn365.IRequestContext;\r\n}\r\n\r\nexport interface ILinkData {\r\n linkUrl: Msdyn365.ILinkData;\r\n ariaLabel?: string;\r\n openInNewTab?: boolean;\r\n linkText?: string;\r\n}\r\n\r\n/**\r\n *\r\n * Logo component\r\n * @extends {React.PureComponent<ILogoConfig>}\r\n */\r\nexport class Logo extends React.PureComponent<ILogoProps> {\r\n\r\n private attributes?: Msdyn365.IDictionary<string>;\r\n\r\n constructor(props: ILogoProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Logo);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n public render():JSX.Element {\r\n return(\r\n <div className={this.props.className}>\r\n {this._renderLogo(this.props)}\r\n </div>\r\n );\r\n }\r\n\r\n private _renderLogo(config: ILogoProps):JSX.Element {\r\n if(config.link && config.link.linkUrl.destinationUrl) {\r\n return(\r\n <a\r\n href={config.link.linkUrl.destinationUrl}\r\n aria-label={config.link.ariaLabel}\r\n target={config.link.openInNewTab ? '_blank' : undefined}\r\n {...this.attributes}\r\n >\r\n {this._renderImage(config)}\r\n </a>\r\n );\r\n }\r\n return(\r\n this._renderImage(config)\r\n );\r\n }\r\n\r\n private _renderImage(config: ILogoProps): JSX.Element {\r\n const defaultImageSettings: Msdyn365.IImageSettings = {\r\n viewports: {\r\n xs: { q: `w=132&h=28&m=6`, w: 0, h: 0 },\r\n lg: { q: `w=160&h=48&m=6`, w: 0, h: 0 }\r\n },\r\n lazyload: true\r\n };\r\n\r\n return (\r\n <Msdyn365.Image\r\n {...config.image}\r\n gridSettings={this.props.gridSettings!}\r\n imageSettings={config && config.image && config.image.imageSettings || defaultImageSettings}\r\n loadFailureBehavior='default'\r\n editProps= {{key: config.image || {}, requestContext: this.props.requestContext}}\r\n />\r\n );\r\n }\r\n}\r\n\r\nexport default Logo;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IWatersportdiscountsHeaderResources } from '../watersportdiscounts-header.props.autogenerated';\r\n\r\nexport interface INavIconProps {\r\n resources: IWatersportdiscountsHeaderResources;\r\n isExpanded: boolean;\r\n targetId: string;\r\n telemetryContent?: ITelemetryContent;\r\n toggleNavBar(): void;\r\n}\r\n\r\n/**\r\n *\r\n * NavIcon component\r\n * @extends {React.PureComponent<INavIconProps>}\r\n */\r\n\r\n@observer\r\nexport class NavIcon extends React.Component<INavIconProps> {\r\n\r\n private attributes?: Msdyn365.IDictionary<string>;\r\n\r\n constructor(props: INavIconProps) {\r\n super(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.NavIcon);\r\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n }\r\n\r\n public render():JSX.Element {\r\n return (\r\n <Button\r\n className='ms-header__nav-icon'\r\n onClick={this.props.toggleNavBar}\r\n title={this.props.resources.mobileHamburgerAriaLabel}\r\n aria-label={this.props.resources.mobileHamburgerAriaLabel}\r\n aria-expanded={this.props.isExpanded}\r\n aria-controls={this.props.targetId}\r\n {...this.attributes}\r\n ></Button>\r\n );\r\n }\r\n}","import { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport { IWatersportdiscountsHeaderData } from '../watersportdiscounts-header.data';\r\nimport { IWatersportdiscountsHeaderProps } from '../watersportdiscounts-header.props.autogenerated';\r\n\r\n/**\r\n * The header preferred store component\r\n */\r\n@observer\r\nexport class HeaderPreferredStore extends React.PureComponent<IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>> {\r\n\r\n public handleClick = () => { return this._findPreferreStoreOnClick(this.props); };\r\n\r\n public render(): JSX.Element | undefined {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n },\r\n slots,\r\n resources\r\n } = this.props;\r\n if (slots && slots.storeSelector && slots.storeSelector.length) {\r\n const storeName = storeSelectorStateManager!.preferredStore && storeSelectorStateManager!.preferredStore.StoreName ?\r\n storeSelectorStateManager!.preferredStore.StoreName :\r\n resources.headerPreferredStoreText;\r\n\r\n return (\r\n <div className='ms-header__preferred-store-container'>\r\n <button className='ms-header__preferred-store-btn msc-btn' color='secondary' aria-label={resources.headerPreferredStoreAriaLabel} onClick={this.handleClick} >\r\n <span className='ms-header__preferred-store-text'>{storeName}</span>\r\n </button>\r\n {slots.storeSelector}\r\n </div>\r\n );\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private async _findPreferreStoreOnClick(props: IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>): Promise<void> {\r\n const { data: { storeSelectorStateManager: { result: storeSelectorStateManager } }, modules } = props;\r\n if (!storeSelectorStateManager) {\r\n return;\r\n }\r\n let storeSelectorId: string = '';\r\n if (modules && Object.keys(modules).length > 0 && modules.storeSelector && modules.storeSelector.length > 0) {\r\n storeSelectorId = modules.storeSelector[0].id;\r\n }\r\n storeSelectorStateManager.openDialog({\r\n id: storeSelectorId,\r\n showMapViewLink: false,\r\n onLocationSelected: orgUnitLocation => {\r\n return Promise.resolve();\r\n }\r\n }).catch((error: Error) => {\r\n if (props.telemetry) {\r\n props.telemetry.error(error.message);\r\n props.telemetry.debug('Unable to set preferred store');\r\n }\r\n return;\r\n });\r\n }\r\n}\r\n\r\nexport default HeaderPreferredStore;\r\n","import * as React from 'react';\r\nimport { ILinksLeftData } from '../watersportdiscounts-header.props.autogenerated';\r\n\r\nexport interface IContentCardLinksLeft {\r\n linksLeft: ILinksLeftData[];\r\n}\r\n\r\nconst ContentCardLinksLeft: React.FC<IContentCardLinksLeft> = ({ linksLeft }) => (\r\n <div className='linksLeft'>\r\n {linksLeft.map((cta: ILinksLeftData, index: number) => {\r\n \r\n return <a\r\n key={`link-${index}`}\r\n className='flex-vertical'\r\n role='button'\r\n title={cta.linkText}\r\n href={cta.linkUrl && cta.linkUrl.destinationUrl}\r\n aria-label={cta.ariaLabel}\r\n target={cta.openInNewTab ? '_blank' : undefined}\r\n >\r\n <span>{cta.linkText}</span>\r\n </a>;\r\n })}\r\n </div>\r\n);\r\n\r\nexport default ContentCardLinksLeft;","import * as React from 'react';\r\nimport { ILinksRightData } from '../watersportdiscounts-header.props.autogenerated';\r\n\r\nexport interface IContentCardLinksRight {\r\n linksRight: ILinksRightData[];\r\n}\r\n\r\nconst ContentCardLinksRight: React.FC<IContentCardLinksRight> = ({ linksRight }) => (\r\n <div className='linksRight'>\r\n {linksRight.map((cta: ILinksRightData, index: number) => {\r\n \r\n return <a\r\n key={`link-${index}`}\r\n className='flex-vertical'\r\n role='button'\r\n title={cta.linkText}\r\n href={cta.linkUrl && cta.linkUrl.destinationUrl}\r\n aria-label={cta.ariaLabel}\r\n target={cta.openInNewTab ? '_blank' : undefined}\r\n >\r\n <span>{cta.linkText}</span>\r\n </a>;\r\n })}\r\n </div>\r\n);\r\n\r\nexport default ContentCardLinksRight;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n Button, getPayloadObject, getTelemetryAttributes, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent, KeyCodes, Modal,\r\n ModalBody, ModalHeader, onTelemetryClick, Popover, TelemetryConstant\r\n} from '@msdyn365-commerce-modules/utilities';\r\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components';\r\nimport * as MsDyn365 from '@msdyn365-commerce/core';\r\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport { computed } from 'mobx';\r\nimport * as React from 'react';\r\nimport { HeaderPreferredStore, Logo, NavIcon } from './components';\r\nimport { IWatersportdiscountsHeaderData } from './watersportdiscounts-header.data';\r\nimport { IWatersportdiscountsHeaderProps, IWatersportdiscountsHeaderResources, IMyAccountLinksData } from './watersportdiscounts-header.props.autogenerated';\r\n\r\nimport LinksComponentLeft from './components/links-left';\r\nimport LinksComponentRight from './components/links-right';\r\n\r\nexport interface IHeaderState {\r\n mobileMenuCollapsed: boolean;\r\n signinPopoverOpen: boolean;\r\n}\r\n\r\nexport interface IHeaderViewProps extends IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>, IHeaderState {\r\n logo: React.ReactNode;\r\n wishListIconDesktop: React.ReactNode;\r\n wishListIconMobile: React.ReactNode;\r\n cartIcon: React.ReactNode;\r\n navIcon: React.ReactNode;\r\n className: string;\r\n menuBar: React.ReactNode[];\r\n search: React.ReactNode[];\r\n siteOptions: React.ReactNode[];\r\n HeaderTag: IModuleProps;\r\n HeaderContainer: INodeProps;\r\n MobileMenuContainer: INodeProps;\r\n MobileMenuHeader: React.ReactNode;\r\n MobileMenuBodyContainer: INodeProps;\r\n MobileMenuLinksContainer: INodeProps;\r\n HeaderTopBarContainer: INodeProps;\r\n Divider: INodeProps;\r\n\r\n AccountInfoDropdownParentContainer?: INodeProps;\r\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\r\n accountInfoDropdownButton?: React.ReactNode;\r\n\r\n signOutLink?: React.ReactNode;\r\n signInLink?: React.ReactNode;\r\n accountLinks?: React.ReactNode[];\r\n preferredStore?: React.ReactNode;\r\n\r\n logoLinkSvg: string;\r\n linksLeft?: React.ReactNode;\r\n linksRight?: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * Header component\r\n * @extends {React.PureComponent<IWatersportDiscountsHeaderProps<IWatersportDiscountsHeaderData>>}\r\n */\r\nclass Header extends React.PureComponent<IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>, IHeaderState> {\r\n private popOverRef: React.RefObject<HTMLButtonElement>;\r\n private telemetryContent: ITelemetryContent;\r\n @computed public get displayName(): Readonly<string | undefined> {\r\n const customer = this.props.data.accountInformation?.result;\r\n return customer ? customer.FirstName || customer.Name : undefined;\r\n }\r\n\r\n constructor(props: IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>) {\r\n super(props);\r\n this.popOverRef = React.createRef();\r\n this._toggleNavbar = this._toggleNavbar.bind(this);\r\n this._togglePopover = this._togglePopover.bind(this);\r\n this._keydown = this._keydown.bind(this);\r\n this.state = {\r\n mobileMenuCollapsed: true,\r\n signinPopoverOpen: false\r\n };\r\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.addEventListener('keydown', this._keydown);\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.msdyn365Commerce.isBrowser) {\r\n window.removeEventListener('keydown', this._keydown, false);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: max-func-body-length\r\n public render(): JSX.Element | null {\r\n const {\r\n id,\r\n typeName,\r\n data: { accountInformation,\r\n cart: { result: cart },\r\n storeSelectorStateManager: {result: storeSelectorStateManager}\r\n },\r\n context: {\r\n request: {\r\n user\r\n }\r\n },\r\n context,\r\n resources: {\r\n cartLabel,\r\n cartQtyLabel\r\n }\r\n } = this.props;\r\n const { logoLink, logoImage, logoLinkSvg, linksLeft, linksRight } = this.props.config;\r\n const headerClassName = classnames('ms-header', this.props.config.className);\r\n const navbarKey = 'header-nav-mobile';\r\n const customer = accountInformation && accountInformation.result;\r\n const cartIconSlot = this._getSlot('cartIcon');\r\n const menuBarSlot = this._getSlot('WatersportDiscountsMenuBar');\r\n const searchSlot = this._getSlot('search');\r\n const siteOptionsSlot = this._getSlot('siteOptions');\r\n const preferredStoreSlot = this._getSlot('storeSelector');\r\n\r\n const LogoLinkSvg = logoLinkSvg ? logoLinkSvg : 'No Link';\r\n\r\n const contentBlockLinksLeft = linksLeft && linksLeft.length > 0 && <LinksComponentLeft {...{ linksLeft }} />;\r\n const contentBlockLinksRight = linksRight && linksRight.length > 0 && <LinksComponentRight {...{ linksRight }} />;\r\n\r\n const viewProps: IHeaderViewProps = {\r\n ...(this.props as IWatersportdiscountsHeaderProps<IWatersportdiscountsHeaderData>),\r\n ...(this.state),\r\n logo: <Logo {...{ link: logoLink, image: logoImage, className: 'ms-header__logo', gridSettings: this.props.context.request.gridSettings, requestContext: this.props.context.request, telemetryContent: this.telemetryContent }} />,\r\n wishListIconDesktop: (\r\n <WishListIconComponent\r\n className='ms-header__wishlist-desktop'\r\n showButtonTooltip={true}\r\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\r\n context={context}\r\n id={id}\r\n typeName={typeName}\r\n telemetryContent={this.telemetryContent}\r\n data={{}}\r\n />\r\n ),\r\n wishListIconMobile: (\r\n <WishListIconComponent\r\n className='ms-header__wishlist-mobile'\r\n showButtonTooltip={true}\r\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\r\n context={context}\r\n id={id}\r\n typeName={typeName}\r\n telemetryContent={this.telemetryContent}\r\n data={{}}\r\n />\r\n ),\r\n cartIcon: (cartIconSlot && cartIconSlot.length > 0)\r\n ? cartIconSlot[0]\r\n : cart && <CartIconComponent cartLabel={cartLabel} cartQtyLabel={cartQtyLabel} context={context} id={id} typeName={typeName} telemetryContent={this.telemetryContent} data={{ cart: cart }} />,\r\n navIcon: <NavIcon {...{ resources: this.props.resources, isExpanded: !this.state.mobileMenuCollapsed, targetId: navbarKey, toggleNavBar: this._toggleNavbar, telemetryContent: this.telemetryContent }} />,\r\n menuBar: menuBarSlot && menuBarSlot.length && menuBarSlot || [],\r\n search: searchSlot && searchSlot.length && searchSlot || [],\r\n siteOptions: siteOptionsSlot && siteOptionsSlot.length && siteOptionsSlot || [],\r\n className: headerClassName,\r\n logoLinkSvg: LogoLinkSvg,\r\n linksLeft: contentBlockLinksLeft,\r\n linksRight: contentBlockLinksRight,\r\n HeaderTag: {\r\n moduleProps: this.props,\r\n className: classnames(headerClassName),\r\n tag: 'header'\r\n },\r\n HeaderContainer: {\r\n className: classnames('ms-header__container')\r\n },\r\n HeaderTopBarContainer: {\r\n className: classnames('inside-lg always-flex justify')\r\n },\r\n Divider: {\r\n className: classnames('ms-header__divider')\r\n },\r\n MobileMenuContainer: {\r\n tag: Modal,\r\n id: navbarKey,\r\n className: 'ms-header__mobile-hamburger',\r\n isOpen: !this.state.mobileMenuCollapsed,\r\n wrapClassName: 'ms-header__modal'\r\n },\r\n MobileMenuHeader: (\r\n <ModalHeader\r\n className='ms-header__mobile-hamburger-menu-header'\r\n toggle={this._toggleNavbar}\r\n />\r\n ),\r\n MobileMenuBodyContainer: {\r\n tag: ModalBody,\r\n className: 'ms-header__mobile-hamburger-menu-body',\r\n },\r\n MobileMenuLinksContainer: {\r\n className: 'ms-header__mobile-hamburger-menu-links',\r\n },\r\n AccountInfoDropdownParentContainer: {\r\n className: 'ms-header__account-info'\r\n },\r\n AccountInfoDropdownPopoverConentContainer: customer && this.displayName && {\r\n tag: Popover,\r\n id: 'myprofilePopover',\r\n className: 'ms-header__account-info-content',\r\n placement: 'bottom',\r\n isOpen: this.state.signinPopoverOpen,\r\n target: this.popOverRef,\r\n toggle: this._togglePopover,\r\n } || undefined,\r\n signInLink: this._getSigninButton(customer, user, this.props.resources),\r\n signOutLink: this._getSignOutButton(customer, user, this.props.resources),\r\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(customer),\r\n accountLinks: this._getAccountLinks(customer),\r\n preferredStore: preferredStoreSlot\r\n && preferredStoreSlot.length\r\n && storeSelectorStateManager\r\n && (<HeaderPreferredStore {...this.props}/>)\r\n };\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /* Handle link text change*/\r\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent) => {\r\n if (this.props.config.myAccountLinks && this.props.config.myAccountLinks[linkIndex]) {\r\n this.props.config.myAccountLinks[linkIndex].linkText = event.target.value;\r\n }\r\n }\r\n\r\n private _getSlot(slotName: string): React.ReactNode[] | null {\r\n const { slots } = this.props;\r\n return (slots && slots[slotName] && slots[slotName].length && slots[slotName]) || null;\r\n }\r\n\r\n private _getSigninButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IWatersportdiscountsHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignIn);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return !customer && (\r\n <Button\r\n className='ms-header__signin-button'\r\n title={resources.signInLinkText}\r\n href='https://www.watersportdiscounts.com/homesignedin'\r\n aria-label={resources.signInLinkAriaText}\r\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign in')}\r\n {...attributes}\r\n >\r\n <span className='ms-header__signin-button-text' aria-hidden={true}><span>{resources.signInLinkText}</span></span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getSignOutButton(customer: Customer | undefined, user: MsDyn365.IRequestContextUser | undefined, resources: IWatersportdiscountsHeaderResources): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignOut);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n <Button\r\n className={'ms-header__signout-button'}\r\n title={resources.signOutLinkText}\r\n href={user && user.signOutUrl || ''}\r\n aria-label={resources.signOutLinkAriaText}\r\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign out')}\r\n {...attributes}\r\n >\r\n <span className='ms-header__signout-button-text' aria-hidden={true}><span>{resources.signOutLinkText}</span></span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getAccountInfoDropdownButton(customer: Customer | undefined): React.ReactNode | undefined {\r\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.MyProfile);\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n return customer && this.displayName && (\r\n <Button\r\n innerRef={this.popOverRef}\r\n className={'ms-header__profile-button'}\r\n aria-describedby='myprofilePopover'\r\n onClick={this._togglePopover}\r\n color='link'\r\n aria-expanded={this.state.signinPopoverOpen}\r\n {...attributes}\r\n >\r\n <span className='ms-profile-button-text'>{this.displayName}</span>\r\n </Button>\r\n );\r\n }\r\n\r\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\r\n const { myAccountLinks } = this.props.config;\r\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\r\n if(!customer || ! this.displayName || !myAccountLinks || !myAccountLinks.length) {\r\n return undefined;\r\n }\r\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\r\n payLoad.contentAction.etext = cta.linkText;\r\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\r\n const editableLink: MsDyn365.ILinksData = {\r\n ariaLabel: cta.ariaLabel,\r\n className: 'ms-signin-info__account-link-button',\r\n linkText: cta.linkText,\r\n linkUrl: cta.linkUrl.destinationUrl,\r\n openInNewTab: cta.openInNewTab,\r\n role: 'button',\r\n additionalProperties: attributes\r\n };\r\n\r\n return (\r\n <MsDyn365.Link\r\n key={index}\r\n link={editableLink}\r\n editProps={{ onTextChange: this.handleLinkTextChange(index), requestContext: this.props.context.request }}\r\n />\r\n );\r\n });\r\n }\r\n\r\n private _toggleNavbar(): void {\r\n this.setState({\r\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\r\n });\r\n }\r\n\r\n private _togglePopover(): void {\r\n this.setState({\r\n signinPopoverOpen: !this.state.signinPopoverOpen\r\n });\r\n }\r\n\r\n private _keydown(e: KeyboardEvent): void {\r\n if (e.keyCode === KeyCodes.Escape) {\r\n this.setState({ mobileMenuCollapsed: true });\r\n }\r\n }\r\n}\r\n\r\nexport default Header;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport Transition from 'react-transition-group/Transition';\r\n\r\nimport { mapToCssModules, TransitionStatuses } from '@msdyn365-commerce-modules/utilities';\r\nimport { ICollapseProps } from './Collapse.props';\r\n\r\nexport interface ICollapseState {\r\n height: number | null;\r\n}\r\n\r\ntype IHash = {\r\n [key in TransitionStatuses]: string;\r\n};\r\n\r\n/**\r\n * This is the controlled version of a Collapse component, and as such the toggle behavior is expected to be handled in a parent component.\r\n * @see See [Uncontrolled Components - React](https://reactjs.org/docs/uncontrolled-components.html) to learn more.\r\n * @visibleName Collapse (controlled)\r\n */\r\nexport default class Collapse extends React.Component<ICollapseProps, ICollapseState> {\r\n public static defaultProps: Partial<ICollapseProps> = {\r\n isOpen: false,\r\n tag: 'div',\r\n timeout: 0\r\n };\r\n\r\n public props: ICollapseProps;\r\n\r\n public state: ICollapseState;\r\n\r\n private readonly _transitionStatusToClassHash: IHash = {\r\n entering: 'collapse',\r\n entered: 'collapse show',\r\n exiting: 'collapse',\r\n exited: 'collapse'\r\n };\r\n\r\n private readonly _tagRef: React.RefObject<HTMLElement> = React.createRef<HTMLElement>();\r\n\r\n constructor(props: ICollapseProps) {\r\n super(props);\r\n this.props = props;\r\n\r\n this.state = {\r\n height: 0\r\n };\r\n\r\n this._onEntering = this._onEntering.bind(this);\r\n this._onExit = this._onExit.bind(this);\r\n this._onExited = this._onExited.bind(this);\r\n this._onExiting = this._onExiting.bind(this);\r\n this._reevaluateHeight = this._reevaluateHeight.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n window && window.addEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public componentDidUpdate(nextProps: ICollapseProps): void {\r\n if (nextProps.children !== this.props.children) {\r\n this._reevaluateHeight();\r\n }\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n window && window.removeEventListener('resize', this._reevaluateHeight);\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: ICollapseProps,\r\n nextState: ICollapseState): boolean {\r\n if (this.state === nextState && this.props === nextProps) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const {\r\n tag,\r\n isOpen,\r\n className,\r\n children,\r\n navbar,\r\n cssModule,\r\n\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n timeout,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited,\r\n\r\n ...otherProps\r\n } = this.props;\r\n\r\n const Tag = tag || 'div';\r\n const transitionProps = {\r\n in: collapseIn,\r\n mountOnEnter,\r\n unmountOnExit,\r\n appear,\r\n enter,\r\n exit,\r\n onEnter,\r\n onEntering,\r\n onEntered,\r\n onExit,\r\n onExiting,\r\n onExited\r\n };\r\n\r\n //const { height } = this.state;\r\n //const style = height === null || height === 0 ? null : { minHeight: height };\r\n\r\n return (\r\n <Transition\r\n {...transitionProps}\r\n in={isOpen}\r\n timeout={timeout || 0}\r\n onEntering={this._onEntering}\r\n onExit={this._onExit}\r\n onExiting={this._onExiting}\r\n onExited={this._onExited}\r\n >\r\n {(status: TransitionStatuses) => {\r\n const collapseClass = this._getTransitionClass(status);\r\n const classes = mapToCssModules(classNames(className, collapseClass, navbar && 'navbar-collapse'), cssModule);\r\n\r\n return (\r\n <Tag\r\n {...otherProps} className={classes} ref={this._tagRef}\r\n >\r\n {children}\r\n </Tag>\r\n );\r\n }}\r\n </Transition>\r\n );\r\n }\r\n\r\n private _reevaluateHeight(): void {\r\n const node = this._tagRef.current;\r\n if (node !== null && node.firstElementChild && node.firstElementChild.scrollHeight > 0) {\r\n this.setState({ height: node.firstElementChild.scrollHeight });\r\n }\r\n }\r\n\r\n private _getTransitionClass(status: TransitionStatuses): string {\r\n return this._transitionStatusToClassHash[status] || 'collapse';\r\n }\r\n\r\n private _onEntering(node: HTMLElement, isAppearing: boolean): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n //if (this.props.onEntering) {\r\n // this.props.onEntering(node, isAppearing);\r\n //}\r\n }\r\n\r\n private _onExit(node: HTMLElement): void {\r\n this.setState({ height: node.scrollHeight });\r\n\r\n if (this.props.onExit) {\r\n this.props.onExit(node);\r\n }\r\n }\r\n\r\n private _onExiting(node: HTMLElement): void {\r\n this.setState({ height: 0 });\r\n\r\n if (this.props.onExiting) {\r\n this.props.onExiting(node);\r\n }\r\n }\r\n\r\n private _onExited(node: HTMLElement): void {\r\n this.setState({ height: null });\r\n\r\n if (this.props.onExited) {\r\n this.props.onExited(node);\r\n }\r\n }\r\n}\r\n","function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\nimport React from \"react\";\nexport default (({\n styles = {},\n ...props\n}) => /*#__PURE__*/React.createElement(\"svg\", _extends({\n version: \"1.1\",\n id: \"Layer_1\",\n xmlns: \"http://www.w3.org/2000/svg\",\n x: \"0\",\n y: \"0\",\n viewBox: \"0 0 1069.2 392.7\",\n xmlSpace: \"preserve\"\n}, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M276 0L118.4 89.2v214.4L276 392.7h793.2V0H276zm-72.4 217.8h-1.3c-2.3-.1-4.5-.6-6.5-1.4-8-3.1-13.6-10.9-13.6-19.9 0-9 5.6-16.7 13.5-19.9 2-.8 4.2-1.3 6.5-1.5.5 0 .9-.1 1.4-.1 11.8 0 21.4 9.6 21.4 21.4s-9.6 21.4-21.4 21.4z\",\n fill: \"#222\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M283.4 364.7l-136.9-77.5V105.5L283.4 28h757.7v336.6H283.4zm-132-256.3v175.9l133.3 75.4h751.5V33H284.7l-133.3 75.4z\",\n fill: \"#ffe800\"\n}), /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st2\"] || \"st2\",\n d: \"M353.6 197.5h-44.9v111.8h44.9c10.4 0 18.1-7.6 18.1-18.2v-75.5c0-10.5-7.6-18.1-18.1-18.1zm-4.3 88.1c0 2.6-1.8 4.6-4.6 4.6h-13.6v-73.7h13.6c2.8 0 4.6 1.8 4.6 4.6v64.5zM482 243h-17.2c-.8 0-1.5-.8-1.5-1.5v-23.2c0-1 .7-1.8 1.5-1.8h28v-19H453c-7 0-11.9 5-11.9 12.1v41.6c0 7 5 12.1 11.9 12.1h17.2c1 0 1.5.7 1.5 1.5v23.5c0 .8-.5 1.5-1.5 1.5h-29.1v19.5H482c7 0 12.1-5 12.1-12.1v-42.1c0-7.1-5.2-12.1-12.1-12.1zM563.3 196.8H528c-7.6 0-13.1 5.5-13.1 13.4v86.5c0 7.8 5.5 13.2 13.1 13.2h35.3c7.8 0 13.2-5.5 13.2-13.2v-29.1h-22.4v21.5c0 1-.7 1.7-1.5 1.7h-13.9c-.8 0-1.5-.7-1.5-1.7v-71.4c0-1 .7-1.8 1.5-1.8H553c.5 0 1.2.8 1.2 1.8v21.2h22.4v-28.7c0-7.9-5.5-13.4-13.3-13.4zM648.3 196.8h-39.1c-7.3 0-12.1 5-12.1 12.1v88.8c0 7.1 4.8 12.1 12.1 12.1h39.1c7.1 0 12.1-5 12.1-12.1v-88.8c0-7.1-5-12.1-12.1-12.1zM638 289.2c0 .8-.8 1.5-1.3 1.5h-16.1c-.7 0-1.2-.8-1.2-1.5v-71.9c0-.7.3-1.8 1.2-1.8h16.1c.5 0 1.3.8 1.3 1.8v71.9zM725.3 289.1c0 .8-.8 1.5-1.3 1.5h-15c-.3 0-1.2-.7-1.2-1.5v-91.6h-22.4V296c0 7.8 5.5 13.2 13.2 13.2h35.6c7.8 0 13.4-5.5 13.4-13.2v-98.5h-22.5v91.6zM819.2 262.1l-25.7-64.6H774v111.8h19.7v-62l25.5 62h19.7V197.5h-19.7zM855.6 216.5h18.2v92.8h22.4v-92.8h18.2v-19h-58.8zM968.4 243h-17.2c-.8 0-1.5-.8-1.5-1.5v-23.2c0-1 .7-1.8 1.5-1.8h28v-19h-39.7c-7 0-11.9 5-11.9 12.1v41.6c0 7 5 12.1 11.9 12.1h17.2c1 0 1.5.7 1.5 1.5v23.5c0 .8-.5 1.5-1.5 1.5h-29.1v19.5h40.9c7 0 12.1-5 12.1-12.1v-42.1c-.1-7.1-5.2-12.1-12.2-12.1zM389.1 196.2c-1.1 2.6-1.1 5.4 0 8l11.8 27.2v71.9l-4.9 3c-1.3.8-2.1 2-2.1 3.3 0 2.4 2.5 4.3 5.5 4.3h10.2c3 0 5.5-1.9 5.5-4.3 0-1.3-.8-2.5-2.1-3.3l-4.9-3v-71.9l11.8-27.2c1.1-2.6 1.1-5.4 0-8-4.9-11.6-25.9-11.6-30.8 0zm13.8 17c.3-5.1.8-10.1 1.3-15.2h.4c.6 5 1 10.1 1.3 15.2.7 5.1.7 10.3-1.3 15.2h-.4c-2-4.9-1.9-10.1-1.3-15.2z\"\n}), /*#__PURE__*/React.createElement(\"g\", null, /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st2\"] || \"st2\",\n d: \"M377.3 86.8l-13.4 71.1h-16.1l-10.9-39.6-11.3 39.6h-15.8l-13.5-71.1h17.9l6.2 44.6 9.6-44.6h15l9.1 43.4 6.7-43.4h16.5zM445.3 157.9H427v-17.7h-16.1v17.7h-18.3V95.1c0-4.9 3.4-8.3 8.3-8.3H437c4.9 0 8.3 3.4 8.3 8.3v62.8zM427 124.8v-21.4c0-1.3-1.1-2.1-2.5-2.1h-11.4c-1.3 0-2.2.9-2.2 2.1v21.4H427zM511.4 86.8v15.4h-16.1v55.7H477v-55.7h-16.1V86.8h50.5zM527.6 86.8H574v15.3h-28.2v12.4h24.4v15.2h-24.4v12.8H574v15.4h-46.4V86.8zM639 86.8c4.3 0 8 3.5 8 8v32.5c0 4.3-3.7 8-8 8h-.5l8.7 22.5h-17.9l-8.8-22.5h-7.8v22.5h-18.3v-71H639zm-10.2 16.3c0-.5-.5-1.1-.9-1.1h-15.2v19h15.2c.4 0 .9-.5.9-.9v-17zM667 142.5h26.6c.7 0 1.2-.4 1.2-.9v-10.3c0-.5-.4-.9-1.2-.9h-18.3c-4.9 0-8.3-3.4-8.3-8.3v-27c0-4.9 3.4-8.3 8.3-8.3H712v15.3h-25.7c-.6 0-1.1.5-1.1 1.2v10.4c0 .4.4.9 1.1.9h18.3c4.9 0 8.3 3.4 8.3 8.3v26.6c0 4.9-3.4 8.3-8.3 8.3H667v-15.3zM777.4 86.8c4.3 0 8 3.5 8 8v36.5c0 4.2-3.7 8-8 8h-25.2v18.5h-18.3v-71h43.5zm-11.2 37.5c.5 0 .9-.5.9-.9v-20.2c0-.5-.4-1.1-.9-1.1h-13.9v22.2h13.9zM847.3 86.8c4.9 0 8.3 3.4 8.3 8.3v54.4c0 4.9-3.4 8.3-8.3 8.3h-36.5c-4.9 0-8.3-3.4-8.3-8.3V95.1c0-4.9 3.4-8.3 8.3-8.3h36.5zm-10 16.5c0-.6-.5-1.2-1.2-1.2h-14.4c-.4 0-.9.5-.9 1.2v38.2c0 .5.5.9.9.9h14.4c.6 0 1.2-.4 1.2-.9v-38.2zM922.5 86.8c4.3 0 8 3.5 8 8v32.5c0 4.3-3.7 8-8 8h-.5l8.7 22.5h-17.9l-8.8-22.5h-7.8v22.5h-18.3v-71h44.6zm-10.2 16.3c0-.5-.5-1.1-.9-1.1h-15.2v19h15.2c.4 0 .9-.5.9-.9v-17zM995.9 86.8v15.4h-16.1v55.7h-18.3v-55.7h-16.1V86.8h50.5z\"\n})), /*#__PURE__*/React.createElement(\"path\", {\n className: styles[\"st2\"] || \"st2\",\n d: \"M207.1 196.5c0 7.4-1.7 14.5-4.8 21.2-11.8 25.3-44.3 44.4-83.9 48.3-4.8.5-9.8.7-14.8.7C46.5 266.7 0 235.2 0 196.5s46.5-70.2 103.6-70.2c5 0 10 .2 14.8.7v6.6c-4.8-.5-9.8-.7-14.8-.7-53.5 0-97 28.6-97 63.7s43.5 63.7 97 63.7c5 0 10-.2 14.8-.7 36.4-3.7 66.2-20.7 77.4-43.1 3.1-6.2 4.8-12.9 4.8-19.8 0-7-1.7-13.7-4.9-20 2-.8 4.2-1.3 6.5-1.5 3.2 6.6 4.9 13.8 4.9 21.3z\"\n})));","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport Collapse from './collapse/Collapse';\r\nimport * as React from 'react';\r\n//import classnames from 'classnames';\r\n// import { Customer } from '@msdyn365-commerce/retail-proxy';\r\n// import { AsyncResult } from '@msdyn365-commerce/core';\r\nimport { IHeaderViewProps } from './watersportdiscounts-header';\r\n//@ts-ignore\r\nimport Logosvg from '../../../public/watersportdiscounts/img/WatersportDiscountsLogo.svg';\r\n\r\nconst headerView: React.FC<IHeaderViewProps> = props => {\r\n const {\r\n HeaderTag,\r\n HeaderContainer,\r\n HeaderTopBarContainer,\r\n logoLinkSvg,\r\n linksLeft,\r\n linksRight\r\n } = props;\r\n return (\r\n <Module {...HeaderTag}>\r\n <Node {...HeaderContainer}>\r\n <Node {...HeaderTopBarContainer}>\r\n\r\n <div className='always-flex'>\r\n {props.navIcon}\r\n {linksLeft}\r\n </div>\r\n\r\n <div className='WatersportDiscountsLogo'><a href={logoLinkSvg}><Logosvg /></a></div>\r\n \r\n <div className='always-flex'>\r\n {linksRight}\r\n {props.cartIcon}\r\n </div>\r\n\r\n </Node>\r\n {_renderCollapseMenu(props)}\r\n \r\n </Node>\r\n </Module>\r\n );\r\n};\r\n\r\nfunction _renderCollapseMenu(props: IHeaderViewProps): JSX.Element | null {\r\n const { MobileMenuLinksContainer, mobileMenuCollapsed, linksLeft, linksRight } = props;\r\n return (\r\n <Collapse className={'collapsible-hamburger'} isOpen={!mobileMenuCollapsed}>\r\n <Node {...MobileMenuLinksContainer}>\r\n {linksLeft}\r\n {linksRight}\r\n {props.cartIcon}\r\n </Node>\r\n </Collapse>\r\n );\r\n}\r\n\r\n// const renderCustomerName = (accountInformation: AsyncResult<Customer>): React.ReactChild => {\r\n// const customer = accountInformation && accountInformation.result;\r\n// return (\r\n// <>{customer && customer.FirstName}</>\r\n// );\r\n// };\r\n\r\n// function _renderMobileAccountBlock(props: IHeaderViewProps, renderForMobile: boolean): JSX.Element | null {\r\n// const {\r\n// AccountInfoDropdownParentContainer,\r\n// signOutLink,\r\n// signInLink,\r\n// data,\r\n// accountLinks } = props;\r\n\r\n// if (AccountInfoDropdownParentContainer) {\r\n// const accountClassName = classnames('ms-header__drawer', AccountInfoDropdownParentContainer.className, renderForMobile ? 'account-mobile' : 'account-desktop');\r\n\r\n// if (accountLinks) {\r\n// return (\r\n// <Drawer className={accountClassName} openGlyph='ms-header__drawer-open' closeGlyph='ms-header__drawer-close' glyphPlacement='end' toggleButtonText={renderCustomerName(data.accountInformation)}>\r\n// <div>\r\n// {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\r\n// {signOutLink}\r\n// </div>\r\n// </Drawer>\r\n// );\r\n// } else if (signInLink) {\r\n// return (\r\n// <Node {...AccountInfoDropdownParentContainer} className={accountClassName}>\r\n// {signInLink}\r\n// </Node>\r\n// );\r\n// }\r\n// }\r\n// return null;\r\n// }\r\n\r\n// function _renderDesktopAccountBlock(props: IHeaderViewProps): JSX.Element | null {\r\n// const {\r\n// AccountInfoDropdownParentContainer,\r\n// AccountInfoDropdownPopoverConentContainer,\r\n// accountInfoDropdownButton,\r\n// signOutLink,\r\n// signInLink,\r\n// accountLinks,\r\n// } = props;\r\n\r\n// if (AccountInfoDropdownParentContainer) {\r\n// if (AccountInfoDropdownPopoverConentContainer) {\r\n// return (\r\n// <Node {...AccountInfoDropdownParentContainer}>\r\n// {accountInfoDropdownButton}\r\n// <Node {...AccountInfoDropdownPopoverConentContainer}>\r\n// { accountLinks ? accountLinks.map(link => link) : false }\r\n// {signOutLink}\r\n// </Node>\r\n// </Node>\r\n// );\r\n// } else if (signInLink) {\r\n// return (\r\n// <Node {...AccountInfoDropdownParentContainer}>\r\n// {signInLink}\r\n// </Node>\r\n// );\r\n// }\r\n// }\r\n// //@ts-ignore\r\n// props.context.telemetry.error('Header content is empty, module wont render.');\r\n// return null;\r\n// }\r\n\r\n// function _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\r\n// return (\r\n// <React.Fragment>\r\n// {items && items.length\r\n// ? items.map((slot: React.ReactNode, index: number) => {\r\n// return <React.Fragment key={index}>{slot}</React.Fragment>;\r\n// })\r\n// : null}\r\n// </React.Fragment>\r\n// );\r\n// }\r\n\r\nexport default headerView;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ProductPrice } from '@msdyn365-commerce/retail-proxy';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * Interface for price component resources.\r\n * @param {string} priceRangeSeparator - The price range separator.\r\n */\r\nexport interface IPriceComponentResources {\r\n priceRangeSeparator?: string;\r\n}\r\n\r\n/**\r\n * Interface for price component props.\r\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\r\n * @param {IPriceComponentResources} priceResources - The price range resources.\r\n */\r\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\r\n className?: string;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n}\r\nexport interface IPriceComponent extends IComponent<IPriceComponentProps> {\r\n}\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst Price: React.FC<IPriceComponentProps> = (props: IPriceComponentProps) => {\r\n // CustomerContextualPrice could be 0\r\n if (props.data.price.CustomerContextualPrice === undefined) {\r\n return null;\r\n }\r\n\r\n return (\r\n <span className={classnames('msc-price', props.className)}>\r\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\r\n </span>\r\n );\r\n};\r\n\r\nconst showStrikethroughPricing = (props: IPriceComponentProps) => {\r\n const originalPrice = getOriginalPrice(props);\r\n\r\n if (originalPrice && props.data.price.CustomerContextualPrice) {\r\n return originalPrice > props.data.price.CustomerContextualPrice;\r\n }\r\n\r\n return false;\r\n};\r\n\r\nconst getOriginalPrice = (props: IPriceComponentProps) => {\r\n return Math.max(props.data.price.BasePrice || 0, props.data.price.TradeAgreementPrice || 0, props.data.price.AdjustedPrice || 0);\r\n};\r\n\r\nconst formatCurrency = (props: IPriceComponentProps, price: number | undefined, shouldUseFreePriceText: boolean | undefined): string | undefined => {\r\n if (price === undefined) {\r\n return undefined;\r\n }\r\n\r\n if (shouldUseFreePriceText && price === 0 && props.freePriceText) {\r\n return props.freePriceText;\r\n }\r\n\r\n return props.context.cultureFormatter.formatCurrency(price);\r\n};\r\n\r\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element | undefined => {\r\n const initialPrice = formatCurrency(props, props.data.price.CustomerContextualPrice, true);\r\n const maxVariantPrice = formatCurrency(props, props.data.price.MaxVariantPrice, false);\r\n const minVariantPrice = formatCurrency(props, props.data.price.MinVariantPrice, false);\r\n if (props.isPriceMinMaxEnabled && maxVariantPrice !== minVariantPrice && maxVariantPrice && minVariantPrice) {\r\n return (\r\n <span className='msc-price__pricerange' itemProp='price'>\r\n <span className='msc-price__minprice' itemProp='price'>\r\n {minVariantPrice}\r\n </span>\r\n <span className='msc-price__separator' itemProp='price'>\r\n {props.priceResources?.priceRangeSeparator}\r\n </span>\r\n <span className='msc-price__maxprice' itemProp='price'>\r\n {maxVariantPrice}\r\n </span>\r\n </span>\r\n );\r\n }\r\n return (<span className='msc-price__actual' itemProp='price'>\r\n {initialPrice}\r\n </span>);\r\n};\r\n\r\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element | null => {\r\n const originalPrice = getOriginalPrice(props);\r\n const initialPrice = formatCurrency(props, originalPrice, true);\r\n\r\n return (\r\n <>\r\n <span className='sr-only'>\r\n {' '}\r\n {props.originalPriceText}\r\n {' '}\r\n {initialPrice}\r\n {' '}\r\n {props.currentPriceText}\r\n {' '}\r\n {renderCurrentPrice(props)}\r\n </span>\r\n <span className='msc-price__strikethrough' aria-hidden='true'>\r\n {initialPrice}\r\n </span>\r\n <span aria-hidden='true'>\r\n {renderCurrentPrice(props)}\r\n </span>\r\n {props.savingsText && <span className='msc-price__savings'>\r\n {props.savingsText}\r\n </span>}\r\n </>\r\n );\r\n};\r\n\r\nexport const PriceComponent: React.FunctionComponent<IPriceComponentProps> = msdyn365Commerce.createComponent<IPriceComponent>(\r\n 'Price',\r\n { component: Price, ...PriceComponentActions }\r\n);\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { DimensionTypes, generateSwatchImageUrl, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\n/**\r\n * Swatch item data.\r\n */\r\nexport interface ISwatchItem {\r\n value: string;\r\n itemId: string;\r\n dimensionType: DimensionTypes;\r\n colorHexCode?: string;\r\n imageUrl?: string;\r\n productImageUrls?: string[];\r\n isDisabled?: boolean;\r\n\r\n isDefault?: boolean;\r\n}\r\n\r\n/**\r\n * Swatch item configuration.\r\n */\r\nexport interface ISwatchItemProps {\r\n className: string;\r\n apiSettings: ICommerceApiSettings;\r\n\r\n isSelected: boolean;\r\n isSelectionEnabled?: boolean;\r\n\r\n item: ISwatchItem;\r\n\r\n onSelectItem(item: ISwatchItem): void;\r\n}\r\n\r\n/**\r\n * Represents a single item for swatch.\r\n * @param props - Item configuration.\r\n * @returns React node.\r\n */\r\nexport const SwatchItemComponent: React.FC<ISwatchItemProps> = (props: ISwatchItemProps) => {\r\n const { isSelected, className, onSelectItem, item } = props;\r\n const { itemId, value, colorHexCode, imageUrl } = item;\r\n\r\n const style: React.CSSProperties = {};\r\n\r\n let isColored = false;\r\n\r\n const hasColor = !StringExtensions.isNullOrWhitespace(colorHexCode);\r\n const hasImage = !StringExtensions.isNullOrWhitespace(imageUrl);\r\n\r\n const selectItem = React.useCallback(() => {\r\n onSelectItem(item);\r\n }, [onSelectItem, item]);\r\n\r\n const selectionHandler = props.isSelectionEnabled && !item.isDisabled ? selectItem : undefined;\r\n\r\n if (hasColor) {\r\n style.backgroundColor = colorHexCode;\r\n isColored = true;\r\n } else if (hasImage) {\r\n const fullImageUrl = generateSwatchImageUrl(imageUrl!, props.apiSettings);\r\n return (\r\n <img\r\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\r\n src={fullImageUrl}\r\n className={\r\n classnames(\r\n className,\r\n `${className}-${itemId}`,\r\n `${className}__image`,\r\n isSelected ? `${className}__selected` : `${className}__unselected`,\r\n item.isDisabled ? `${className}__disabled` : undefined\r\n )\r\n }\r\n style={style}\r\n onClick={selectionHandler}\r\n onKeyPress={selectionHandler}\r\n title={value}\r\n aria-label={value}\r\n alt={value}\r\n />\r\n );\r\n }\r\n\r\n const shouldDisplayText = !isColored;\r\n\r\n return (\r\n <button\r\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\r\n className={\r\n classnames(\r\n className,\r\n `${className}-${itemId}`,\r\n isSelected ? `${className}__selected` : `${className}__unselected`,\r\n isColored ? `${className}__colored` : `${className}__uncolored`,\r\n item.isDisabled ? `${className}__disabled` : undefined\r\n )\r\n }\r\n style={style}\r\n onClick={selectionHandler}\r\n onKeyPress={selectionHandler}\r\n title={value}\r\n aria-label={value}\r\n disabled={item.isDisabled}\r\n >\r\n {shouldDisplayText && value}\r\n </button>\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\r\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { ISwatchItem, SwatchItemComponent } from './swatch-item';\r\n\r\n/**\r\n * Swatch item configuration.\r\n */\r\nexport interface ISwatchProps {\r\n className?: string;\r\n apiSettings: ICommerceApiSettings;\r\n\r\n list: ISwatchItem[];\r\n isSelectionEnabled?: boolean;\r\n\r\n onSelectItem?(item: ISwatchItem): void;\r\n}\r\n\r\n/**\r\n * Represents a single item for swatch.\r\n * @param props - Item configuration.\r\n * @returns React node.\r\n */\r\nexport const SwatchComponent: React.FC<ISwatchProps> = (props: ISwatchProps) => {\r\n const containerClassName = 'msc-swatch-container';\r\n\r\n const [selectedItemId, setSelectedItemId] = React.useState<string | undefined>(undefined);\r\n const [didUserSetAnyItem, setDidUserSetAnyItem] = React.useState<boolean>(false);\r\n\r\n const isSelectionEnabled = props.isSelectionEnabled ?? true;\r\n\r\n const onSelectItemCallback = props.onSelectItem;\r\n\r\n const onSelectItem = React.useCallback((item: ISwatchItem) => {\r\n setSelectedItemId(item.itemId);\r\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\r\n onSelectItemCallback(item);\r\n }\r\n setDidUserSetAnyItem(true);\r\n }, [setSelectedItemId, onSelectItemCallback]);\r\n\r\n if (!didUserSetAnyItem) {\r\n const defaultItem = props.list.find(item => item.isDefault);\r\n if (defaultItem && defaultItem.itemId !== selectedItemId) {\r\n setSelectedItemId(defaultItem.itemId);\r\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\r\n onSelectItemCallback(defaultItem);\r\n }\r\n }\r\n }\r\n\r\n return (\r\n <div className={classnames(containerClassName, props.className)} >\r\n {\r\n props.list.map(item => {\r\n const itemId = item.itemId;\r\n const isSelected = selectedItemId === itemId;\r\n\r\n return (\r\n <SwatchItemComponent\r\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\r\n className={`${containerClassName}__item`}\r\n item={item}\r\n onSelectItem={onSelectItem}\r\n isSelected={isSelected}\r\n apiSettings={props.apiSettings}\r\n isSelectionEnabled={isSelectionEnabled}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport React from 'react';\r\n\r\nimport { ISwatchItem, SwatchComponent } from './product-dimension';\r\n\r\n/**\r\n * Props for product component swatch.\r\n */\r\nexport interface IProductComponentSwatchProps {\r\n context: ICoreContext;\r\n swatches: ISwatchItem[];\r\n dimensionType?: string;\r\n onSelectDimension(coreContext: ICoreContext, swatchItem: ISwatchItem, dimensionType?: string): void;\r\n}\r\n\r\n/**\r\n * Swatch for the product component.\r\n * @param props - Swatch props.\r\n * @returns React element.\r\n */\r\nexport const ProductComponentSwatchComponent: React.FC<IProductComponentSwatchProps> = (props: IProductComponentSwatchProps) => {\r\n const { context, dimensionType, swatches, onSelectDimension } = props;\r\n\r\n const onSelectItem = React.useCallback((item: ISwatchItem) => {\r\n onSelectDimension(context, item, dimensionType);\r\n }, [onSelectDimension, context, dimensionType]);\r\n if (ArrayExtensions.hasElements(swatches)) {\r\n return (\r\n <SwatchComponent\r\n apiSettings={context.request.apiSettings}\r\n list={swatches}\r\n onSelectItem={onSelectItem}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <div className='msc-swatch-empty' />\r\n );\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IDropdownItemProps, IDropdownProps } from './dropdown.props';\r\n\r\ninterface IDropdownState {\r\n\r\n /**\r\n * @friendlyName selectedIndex\r\n * @description selected index\r\n */\r\n selectedIndex: string;\r\n}\r\n\r\n/**\r\n *\r\n * DropDown component\r\n * @extends {React.PureComponent<IDropdownProps, IDropdownState>}\r\n */\r\nexport class Dropdown extends React.PureComponent<IDropdownProps, IDropdownState> {\r\n private readonly selectMenu: React.RefObject<HTMLSelectElement> = React.createRef<HTMLSelectElement>();\r\n\r\n private readonly payLoad: IPayLoad;\r\n\r\n public constructor(props: IDropdownProps) {\r\n super(props);\r\n this.state = {\r\n selectedIndex: ''\r\n };\r\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\r\n }\r\n\r\n public componentDidMount(): void {\r\n if (this.selectMenu.current) {\r\n this.selectMenu.current.selectedIndex = 0;\r\n }\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\r\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\r\n return (\r\n <select\r\n id={`msc-dropdown__entry-${dropdownId}`}\r\n ref={this.selectMenu}\r\n aria-label={dropdownName}\r\n className='msc-dropdown__select'\r\n onChange={this._onChanged}\r\n {...attribute}\r\n >\r\n <option\r\n value=''\r\n aria-selected={this.state.selectedIndex === ''}\r\n selected={this.state.selectedIndex === ''}\r\n hidden\r\n disabled\r\n >\r\n {dropdownToggleName}\r\n </option>\r\n {dropdownList.map(\r\n (item: IDropdownItemProps) => (<option\r\n value={item.id}\r\n key={item.id}\r\n selected={this.state.selectedIndex === item.id.toString()}\r\n aria-selected={this.state.selectedIndex === item.id.toString()}\r\n >\r\n {item.value}\r\n </option>)\r\n )}\r\n </select>\r\n );\r\n }\r\n\r\n private readonly _onChanged = async (event: React.ChangeEvent<HTMLSelectElement>) => {\r\n this.setState({ selectedIndex: event.target.value });\r\n\r\n if (this.props.onChange) {\r\n await this.props.onChange({\r\n dropdownId: this.props.dropdownId,\r\n selectId: event.target.value,\r\n // eslint-disable-next-line unicorn/prefer-dom-node-text-content -- Auto-suppressed.\r\n selectedValue: event.target.innerText\r\n });\r\n }\r\n };\r\n}\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\r\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { Dropdown, IDropdownItemProps, IDropdownOnSelectionChangeNotification } from './dropdown';\r\nimport { IErrorState,\r\n IProductDimensionCallbacks,\r\n IProductDimensionConfigureDropdownViewProps,\r\n IProductDimensionConfigureResources,\r\n IProductDimensionConfigureViewProps } from './product-dimension-interface';\r\n\r\nlet telemetryContent: ITelemetryContent;\r\n\r\n// Quantity on change.\r\nconst onChange = async (\r\n notification: IDropdownOnSelectionChangeNotification,\r\n dimensionChanged: (newValue: number, selectedDimensionValue: string) => Promise<void>\r\n): Promise<void> => {\r\n await dimensionChanged(+notification.dropdownId, notification.selectId);\r\n};\r\n\r\n// This method will map all product dimension to correct value and returns respective dropdown.\r\nconst mapProductDimensionFullToDropdownViewProps =\r\n (\r\n productDimensionFull: ProductDimensionFull,\r\n moduleName: string,\r\n selectDimensionFormatString: string,\r\n resources: IProductDimensionConfigureResources,\r\n getDropdownName: (dimensionType: number, resources: IProductDimensionConfigureResources) => string,\r\n dropdownCallback: (notification: IDropdownOnSelectionChangeNotification) => Promise<void>,\r\n configureErrors?: { [configureId: string]: string | undefined }\r\n ): IProductDimensionConfigureDropdownViewProps => {\r\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\r\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\r\n const dropdownToggleName = selectDimensionFormatString.replace('{0}', dropdownName.toLocaleLowerCase());\r\n const dropdownList: IDropdownItemProps[] = productDimensionFull.DimensionValues ? productDimensionFull.DimensionValues.map<IDropdownItemProps>(dM => {\r\n return { value: dM.Value || '', id: dM.RecordId.toString() };\r\n }) : [];\r\n const errorMessage = configureErrors ? configureErrors[dropdownId] : '';\r\n\r\n return {\r\n containerProps: {\r\n className: `${moduleName}__dropdown`\r\n },\r\n labelContainerProps: {\r\n tag: 'label',\r\n className: `${moduleName}__dropdown-quantity-label`,\r\n htmlFor: `${moduleName}__dropown-quantity-input-${dropdownId}`\r\n },\r\n errors: errorMessage && (\r\n <span className='msc-alert msc-alert-noborder msc-alert-danger'>\r\n <span className='msi-exclamation-triangle' aria-hidden='true' />\r\n <span>\r\n {errorMessage}\r\n </span>\r\n </span>\r\n ),\r\n heading: (\r\n <div>\r\n {dropdownName}\r\n </div>\r\n ),\r\n select: (\r\n <Dropdown\r\n dropdownId={dropdownId}\r\n dropdownName={dropdownName}\r\n dropdownToggleName={dropdownToggleName}\r\n dropdownList={dropdownList}\r\n onChange={dropdownCallback}\r\n telemetryContent={telemetryContent}\r\n />\r\n )\r\n };\r\n };\r\n\r\nexport const getProductConfigure = (moduleName: string, context: ICoreContext, pageName: string, telemetry: ITelemetry, selectDimensionFormatString: string,\r\n resources: IProductDimensionConfigureResources,\r\n callbacks: IProductDimensionCallbacks, product?: SimpleProduct, productDimensions?: ProductDimensionFull[],\r\n configureErrors?: IErrorState): IProductDimensionConfigureViewProps | undefined => {\r\n\r\n const\r\n { getDropdownName } = callbacks;\r\n\r\n if (!product || !productDimensions) {\r\n return undefined;\r\n }\r\n\r\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) => onChange(notification, callbacks.dimensionSelectedAsync);\r\n\r\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, pageName, telemetry);\r\n\r\n if (!ArrayExtensions.hasElements(productDimensions)) {\r\n return undefined;\r\n }\r\n\r\n const dropdowns = productDimensions.map((productDimensionFull: ProductDimensionFull) => mapProductDimensionFullToDropdownViewProps(productDimensionFull,\r\n moduleName, selectDimensionFormatString, resources, getDropdownName, onChanged, configureErrors?.configureErrors));\r\n\r\n return {\r\n containerProps: {\r\n className: `${moduleName}__configure`\r\n },\r\n dropdowns\r\n };\r\n};\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport React, { useEffect, useState } from 'react';\r\n\r\nexport interface IRatingComponentProps extends IComponentProps<{}> {\r\n readOnly: boolean;\r\n ariaLabel: string;\r\n avgRating: number;\r\n ratingCount?: string;\r\n initialRating?: number;\r\n hideCount?: boolean;\r\n className?: string;\r\n ratingCountAriaLabel?: string;\r\n onChange?(value: number): void;\r\n}\r\nexport interface IRatingComponent extends IComponent<IRatingComponentProps> {\r\n onSliderChanged(): (event: React.ChangeEvent<HTMLInputElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void) => void;\r\n onMouseOver(): (event: React.MouseEvent<HTMLElement>, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\r\n onClick(): (event: React.MouseEvent<HTMLElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void) => void;\r\n onMouseLeave(): (event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\r\n}\r\n\r\ninterface IRatingState {\r\n rating: number;\r\n lastSelectedRating: number;\r\n}\r\n\r\nconst roundUpMin: number = 0.75;\r\nconst roundMidMin: number = 0.25;\r\nconst maxRating: number = 5;\r\n\r\nconst RatingComponentActions = {\r\n onSliderChanged(event: React.ChangeEvent<HTMLInputElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void): void {\r\n const value = Number.parseInt(event.target.value, 10);\r\n setRating({ rating: value, lastSelectedRating: value });\r\n\r\n if (props.onChange) {\r\n props.onChange(value);\r\n }\r\n },\r\n onMouseLeave(_event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\r\n setRating({ rating: rating.lastSelectedRating, lastSelectedRating: rating.lastSelectedRating });\r\n\r\n },\r\n onMouseOver(event: React.MouseEvent<HTMLElement>, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\r\n setRating({ rating: getIndex(event), lastSelectedRating: rating.lastSelectedRating });\r\n },\r\n onClick(event: React.MouseEvent<HTMLElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void): void {\r\n if (!props.readOnly) {\r\n const index = getIndex(event);\r\n setRating({ rating: index, lastSelectedRating: index });\r\n\r\n if (props.onChange) {\r\n props.onChange(index);\r\n }\r\n }\r\n }\r\n};\r\n\r\nconst Rating: React.FC<IRatingComponentProps> = (props: IRatingComponentProps) => {\r\n const initialRating = props.readOnly ? props.avgRating : props.initialRating || 0;\r\n const [rating, setRating] = useState({ rating: initialRating, lastSelectedRating: initialRating });\r\n useEffect(\r\n () => {\r\n const newRating = props.readOnly ? props.avgRating : props.initialRating || 0;\r\n setRating({ rating: newRating, lastSelectedRating: newRating });\r\n },\r\n [props]\r\n );\r\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\r\n RatingComponentActions.onSliderChanged(event, props, setRating);\r\n };\r\n const onMouseLeave = (event: React.MouseEvent) => {\r\n RatingComponentActions.onMouseLeave(event, rating, setRating);\r\n };\r\n const onMouseOver = (event: React.MouseEvent<HTMLElement>) => {\r\n RatingComponentActions.onMouseOver(event, rating, setRating);\r\n };\r\n const onClick = (event: React.MouseEvent<HTMLElement>) => {\r\n RatingComponentActions.onClick(event, props, setRating);\r\n };\r\n\r\n return (\r\n <div className={`msc-rating ${rating.rating > 0 ? 'msc-no-ratings' : ''} ${props.className ? props.className : ''}`}>\r\n {starControl(props.readOnly, rating.rating, props.ariaLabel, props.ratingCountAriaLabel, onChange)}\r\n <div aria-hidden onMouseLeave={props.readOnly ? undefined : onMouseLeave} className='msc-rating__group'>\r\n {renderStars(rating.rating, props, onMouseOver, onClick)}\r\n </div>\r\n { props.ratingCount && <output tabIndex={-1} aria-hidden className='msc-rating__count'>\r\n {' '}\r\n {props.typeName === 'reviews-list' ? `${props.avgRating} / 5 (${props.ratingCount})` : props.ratingCount}\r\n {' '}\r\n </output> }\r\n </div>\r\n );\r\n};\r\n\r\n// Set default props\r\nRating.defaultProps = {\r\n avgRating: 0\r\n} as Partial<IRatingComponentProps>;\r\n\r\n/**\r\n * Rating Review ariaLabel.\r\n * @param readOnly - Boolean.\r\n * @param currentRating - Current rating number.\r\n * @param ariaLabel - Rating AriaLabel.\r\n * @param reviewCountAriaLabel - Product review count.\r\n * @param onChange - On Change function.\r\n * @returns Jsx element.\r\n */\r\nconst starControl = (\r\n readOnly: boolean,\r\n currentRating: number,\r\n ariaLabel: string,\r\n reviewCountAriaLabel: string | undefined,\r\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void): JSX.Element => {\r\n if (readOnly) {\r\n return (<div className='msc-rating__range sr-only'>\r\n {`${ariaLabel}${reviewCountAriaLabel ? ` ${reviewCountAriaLabel}` : ''}`}\r\n </div>);\r\n }\r\n\r\n return (\r\n <input\r\n type='range'\r\n className='msc-rating__range'\r\n min={0}\r\n max={5}\r\n step={1}\r\n value={currentRating}\r\n aria-valuemax={5}\r\n aria-valuemin={0}\r\n aria-valuenow={currentRating}\r\n onChange={onChange}\r\n aria-label={ariaLabel}\r\n />\r\n );\r\n};\r\n\r\nconst renderStars = (rating: number, props: IRatingComponentProps, mouseOver: (event: React.MouseEvent<HTMLElement>) => void, onClick: (event: React.MouseEvent<HTMLElement>) => void): JSX.Element[] => {\r\n const floor = Math.floor(rating);\r\n const remainder = rating - floor;\r\n const filled = remainder < roundUpMin ? floor : floor + 1;\r\n const half = roundMidMin <= remainder && remainder < roundUpMin ? filled + 1 : 0;\r\n const stars = [];\r\n\r\n for (let i = 1; i <= maxRating; i++) {\r\n const glyphClass = filled >= i ? 'msc-rating__star' : (half === i ? 'msc-rating__half-star' : 'msc-rating__empty-star'!);\r\n stars.push(<span\r\n className={glyphClass} data-index={i} key={i}\r\n onMouseOver={props.readOnly ? undefined : mouseOver} onClick={onClick} role='presentation' />);\r\n }\r\n\r\n return stars;\r\n};\r\n\r\nconst getIndex = (event: React.MouseEvent<HTMLElement>): number => {\r\n const target = event.target as HTMLElement;\r\n return Number.parseInt(target.getAttribute('data-index')!, 10);\r\n};\r\n\r\n// @ts-expect-error\r\nexport const RatingComponent: React.FunctionComponent<IRatingComponentProps> = msdyn365Commerce.createComponent<IRatingComponent>(\r\n 'Rating',\r\n { component: Rating, ...RatingComponentActions }\r\n);\r\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent } from '../../../../nickComponents/price.components';\r\nimport { ISwatchItem } from '@msdyn365-commerce/components/src/product-dimension';\r\nimport { RatingComponent } from '../../../../nickComponents/rating.component';\r\nimport { ProductComponentSwatchComponent } from '../../../../nickComponents/product-component-swatch';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n}) => {\r\n const product = data.product;\r\n\r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl = productPageUrlFromSwatch, setProductPageUrl] = useState<string | undefined>();\r\n const [productImageUrl = productImageUrlFromSwatch, setProductImageUrl] = useState<string | undefined>();\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>\r\n {unitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>\r\n {inventoryAvailabilityLabel}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes);\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {\r\n attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault\r\n };\r\n }) ?? [];\r\n if (ArrayExtensions.hasElements(swatches) && !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n <ProductComponentSwatchComponent\r\n key={item.RecordId}\r\n context={context}\r\n onSelectDimension={updatePageAndImageUrl}\r\n swatches={swatches}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component. */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n {...image} {...imageProps} loadFailureBehavior='empty'\r\n requestContext={requestContext}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price. */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n data={{ price }}\r\n savingsText={savingsPriceResourceText}\r\n freePriceText={freePriceResourceText}\r\n originalPriceText={originalPriceResourceText}\r\n currentPriceText={currentPriceResourceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (<p className='msc-product__text'>\r\n {description}\r\n </p>);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='msc-product' {...attribute}>\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n </div>\r\n <div className='flex-vertical'>\r\n <div>\r\n <h4 className='msc-product__title'>\r\n {product.Name}\r\n </h4>\r\n {/* <div className='msc-product__sku'>\r\n SKU: {product.ItemId} \r\n </div> */}\r\n </div>\r\n </div>\r\n </a>\r\n <div className='connellyFlex flex-md'>\r\n {renderProductDimensions(product.AttributeValues)}\r\n <div className='msc-product__details'>\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n </div>\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n <div className='connellyButton flex-vertical'>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='button' {...attribute}>\r\n <div className='newSpot'>Full Details</div>\r\n </a>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<IProductComponent>(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\n\r\nexport default ProductComponent;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent } from '../../../../nickComponents/price.components';\r\nimport { ISwatchItem } from '@msdyn365-commerce/components/src/product-dimension';\r\nimport { RatingComponent } from '../../../../nickComponents/rating.component';\r\nimport { ProductComponentSwatchComponent } from '../../../../nickComponents/product-component-swatch';\r\n\r\n\r\n \r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> { }\r\n\r\n\r\n\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n}) => {\r\n const product = data.product;\r\n\r\n\r\n \r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl = productPageUrlFromSwatch, setProductPageUrl] = useState<string | undefined>();\r\n const [productImageUrl = productImageUrlFromSwatch, setProductImageUrl] = useState<string | undefined>();\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>\r\n {unitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>\r\n {inventoryAvailabilityLabel}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes);\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {\r\n attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault\r\n };\r\n }) ?? [];\r\n if (ArrayExtensions.hasElements(swatches) && !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n <ProductComponentSwatchComponent\r\n key={item.RecordId}\r\n context={context}\r\n onSelectDimension={updatePageAndImageUrl}\r\n swatches={swatches}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component. */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n {...image} {...imageProps} loadFailureBehavior='empty'\r\n requestContext={requestContext}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price. */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n data={{ price }}\r\n savingsText={savingsPriceResourceText}\r\n freePriceText={freePriceResourceText}\r\n originalPriceText={originalPriceResourceText}\r\n currentPriceText={currentPriceResourceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (<p className='msc-product__text'>\r\n {description}\r\n </p>);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='msc-product' {...attribute}>\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n </div>\r\n <h4 className='msc-product__title'>\r\n {product.Name}\r\n </h4>\r\n <div className='msc-product__sku'>\r\n SKU: {product.ItemId} \r\n </div>\r\n </a>\r\n <div className='nickDescriptionText'>\r\n {renderProductDimensions(product.AttributeValues)}\r\n <div className='msc-product__details'>\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n </div>\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n {/* <div className='connellyButton flex-vertical'>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='button' {...attribute}>\r\n <div className='newSpot'>Full Details</div>\r\n </a>\r\n </div> */}\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<IProductComponent>(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\n\r\nexport default ProductComponent;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, ProductDimension, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, checkIfShouldDisplayAsSwatch, convertDimensionTypeToProductDimensionType,\r\n Dictionary,\r\n DimensionSwatchDisplayTypes, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent, ISwatchItem, RatingComponent, ProductComponentSwatchComponent } from '@msdyn365-commerce/components';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\r\n swatchItemAriaLabel?: string;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources,\r\n dimensionAvailabilities,\r\n swatchItemAriaLabel\r\n}) => {\r\n const product = data.product;\r\n\r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!ArrayExtensions.hasElements(colorAttribute?.Swatches)) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute!.Swatches.find(item => item.IsDefault === true) ?? colorAttribute!.Swatches[0];\r\n return defaultSwatch;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productData?.PrimaryImageUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\r\n return productUrl;\r\n }\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl, setProductPageUrl] = useState<string>(productPageUrlFromSwatch);\r\n const [productImageUrl, setProductImageUrl] = useState<string | undefined>(productImageUrlFromSwatch);\r\n const [selectedSwatchItems] = useState(new Dictionary<DimensionTypes, ISwatchItem>());\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\r\n const enableStockCheck = context.app.config.enableStockCheck;\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n selectedSwatchItems.setValue(dimensionType, swatchItem);\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [selectedSwatchItems, context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n const swatchItems = ArrayExtensions.validValues(product.AttributeValues?.map(item => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(\r\n dimensionTypeValue as DimensionTypes,\r\n context as ICoreContext<IDimensionsApp>,\r\n DimensionSwatchDisplayTypes.productCard);\r\n if (!shouldDisplayAsSwatch) {\r\n return null;\r\n }\r\n\r\n const siteContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault,\r\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\r\n isDisabled: enableStockCheck && dimensionAvailabilities?.find(\r\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? ''))?.isDisabled\r\n };\r\n }) ?? [];\r\n if (dimensionToPreSelectInProductCard !== DimensionTypes.none && ArrayExtensions.hasElements(swatches) &&\r\n !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return { recordId: item.RecordId, swatches };\r\n }));\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>\r\n {unitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>\r\n {inventoryAvailabilityLabel}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(): JSX.Element | null {\r\n if (!ArrayExtensions.hasElements(swatchItems)) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {\r\n swatchItems.map(item => {\r\n return (\r\n <ProductComponentSwatchComponent\r\n key={item.recordId}\r\n context={context}\r\n onSelectDimension={updatePageAndImageUrl}\r\n swatches={item.swatches}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component.\r\n */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map<ProductDimension>(swatches => {\r\n return {\r\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\r\n DimensionValue: {\r\n RecordId: 0,\r\n Value: swatches.value\r\n }\r\n };\r\n });\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\r\n const emptyPlaceHolderImage = context.app.config.placeholderImageName as string;\r\n let fallbackImageSource = fallbackImageUrl;\r\n if (emptyPlaceHolderImage && fallbackImageUrl) {\r\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageSource\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n {...image} {...imageProps} loadFailureBehavior='empty'\r\n requestContext={requestContext}\r\n bypassHideOnFailure\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price.\r\n */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n data={{ price }}\r\n savingsText={savingsPriceResourceText}\r\n freePriceText={freePriceResourceText}\r\n originalPriceText={originalPriceResourceText}\r\n currentPriceText={currentPriceResourceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (<p className='msc-product__text'>\r\n {description}\r\n </p>);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='msc-product' {...attribute}>\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n </div>\r\n\r\n <div className='msc-product__details'>\r\n <h4 className='msc-product__title'>\r\n {product.Name}\r\n </h4>\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n </div>\r\n \r\n </a>\r\n {renderProductDimensions()}\r\n \r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n </>\r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<IProductComponent>(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\n\r\nexport default ProductComponent;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent } from '../../../../nickComponents/price.components';\r\nimport { ISwatchItem } from '@msdyn365-commerce/components/src/product-dimension';\r\nimport { RatingComponent } from '../../../../nickComponents/rating.component';\r\nimport { ProductComponentSwatchComponent } from '../../../../nickComponents/product-component-swatch';\r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> { }\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n}) => {\r\n const product = data.product;\r\n\r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl = productPageUrlFromSwatch, setProductPageUrl] = useState<string | undefined>();\r\n const [productImageUrl = productImageUrlFromSwatch, setProductImageUrl] = useState<string | undefined>();\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>\r\n {unitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>\r\n {inventoryAvailabilityLabel}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes);\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {\r\n attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault\r\n };\r\n }) ?? [];\r\n if (ArrayExtensions.hasElements(swatches) && !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n <ProductComponentSwatchComponent\r\n key={item.RecordId}\r\n context={context}\r\n onSelectDimension={updatePageAndImageUrl}\r\n swatches={swatches}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component. */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n {...image} {...imageProps} loadFailureBehavior='empty'\r\n requestContext={requestContext}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price. */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n data={{ price }}\r\n savingsText={savingsPriceResourceText}\r\n freePriceText={freePriceResourceText}\r\n originalPriceText={originalPriceResourceText}\r\n currentPriceText={currentPriceResourceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (<p className='msc-product__text'>\r\n {description}\r\n </p>);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='msc-product' {...attribute}>\r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n </div>\r\n <h4 className='msc-product__title'>\r\n {product.Name}\r\n </h4>\r\n </a>\r\n <div className='connellyFlex flex-sm'>\r\n {renderProductDimensions(product.AttributeValues)}\r\n <div className='msc-product__details'>\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n </div>\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n <div className='connellyButton flex-vertical'>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='button' {...attribute}>\r\n <div className='newSpot'>Full Details</div>\r\n </a>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<IProductComponent>(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\n\r\nexport default ProductComponent;","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport {\r\n IComponent, IComponentProps, ICoreContext, IGridSettings,\r\n IImageData, IImageProps, IImageSettings, Image, IRequestContext, msdyn365Commerce\r\n} from '@msdyn365-commerce/core';\r\nimport { AttributeSwatch, AttributeValue, ProductPrice, ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport {\r\n ArrayExtensions, DimensionTypes, generateImageUrl,\r\n getProductPageUrlSync, IDimensionsApp, StringExtensions\r\n} from '@msdyn365-commerce-modules/retail-actions';\r\nimport { format, getPayloadObject, getTelemetryAttributes, ITelemetryContent, onTelemetryClick } from '@msdyn365-commerce-modules/utilities';\r\nimport React, { useState } from 'react';\r\n\r\nimport { IPriceComponentResources, PriceComponent } from '../../../../nickComponents/price.components';\r\nimport { ISwatchItem } from '@msdyn365-commerce/components/src/product-dimension';\r\nimport { RatingComponent } from '../../../../nickComponents/rating.component';\r\nimport { ProductComponentSwatchComponent } from '../../../../nickComponents/product-component-swatch';\r\n\r\n\r\n \r\n\r\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult }> {\r\n className?: string;\r\n imageSettings?: IImageSettings;\r\n savingsText?: string;\r\n freePriceText?: string;\r\n originalPriceText?: string;\r\n currentPriceText?: string;\r\n ratingAriaLabel?: string;\r\n ratingCountAriaLabel?: string;\r\n allowBack?: boolean;\r\n telemetryContent?: ITelemetryContent;\r\n quickViewButton?: React.ReactNode;\r\n inventoryLabel?: string;\r\n isPriceMinMaxEnabled?: boolean;\r\n priceResources?: IPriceComponentResources;\r\n}\r\n\r\nexport interface IProductComponent extends IComponent<IProductComponentProps> { }\r\n\r\n\r\n\r\n\r\nconst PriceComponentActions = {};\r\n\r\nconst ProductCard: React.FC<IProductComponentProps> = ({\r\n data,\r\n context,\r\n imageSettings,\r\n savingsText,\r\n freePriceText,\r\n originalPriceText,\r\n currentPriceText,\r\n ratingAriaLabel,\r\n ratingCountAriaLabel,\r\n allowBack,\r\n typeName,\r\n id,\r\n telemetryContent,\r\n quickViewButton,\r\n inventoryLabel,\r\n isPriceMinMaxEnabled,\r\n priceResources\r\n}) => {\r\n const product = data.product;\r\n\r\n\r\n \r\n /**\r\n * Updates the product url link to product details page.\r\n * @param productDetailsPageUrl - Product page url.\r\n * @param coreContext - Context of the module using the component.\r\n * @param queryString - Querystring to be added to the URL.\r\n * @returns The update product page url.\r\n */\r\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\r\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\r\n if (sourceUrl.search) {\r\n sourceUrl.search += `&${queryString}`;\r\n } else {\r\n sourceUrl.search += queryString;\r\n }\r\n\r\n const updatedUrl = new URL(sourceUrl.href);\r\n return updatedUrl.pathname + sourceUrl.search;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param productData - Product card to be rendered.\r\n * @returns The default color swatch selected if any.\r\n */\r\n function getDefaultColorSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\r\n if (!productData || !productData.AttributeValues) {\r\n return null;\r\n }\r\n\r\n const colorAttribute = productData.AttributeValues.find(attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === DimensionTypes.color);\r\n if (!colorAttribute) {\r\n return null;\r\n }\r\n\r\n const defaultSwatch = colorAttribute.Swatches?.find(item => item.IsDefault === true) ?? colorAttribute.Swatches?.[0];\r\n return defaultSwatch ?? null;\r\n }\r\n\r\n /**\r\n * Gets the product image from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.ProductImageUrls) ? generateImageUrl(\r\n defaultSwatch.ProductImageUrls[0], coreContext.request.apiSettings) : productData?.PrimaryImageUrl;\r\n }\r\n\r\n /**\r\n * Gets the product page url from the default swatch selected.\r\n * @param coreContext - Context of the module using the component.\r\n * @param productUrl - Product page url for the product card.\r\n * @param productData - Product card to be rendered.\r\n * @returns The product card image url.\r\n */\r\n function getProductPageUrlFromDefaultSwatch(coreContext: ICoreContext, productUrl: string, productData?: ProductSearchResult): string | undefined {\r\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\r\n if (!defaultSwatch || !defaultSwatch.SwatchValue) {\r\n return productUrl;\r\n }\r\n\r\n const queryString = `color=${defaultSwatch.SwatchValue}`;\r\n return updateProductUrl(productUrl, coreContext, queryString);\r\n }\r\n\r\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\r\n if (allowBack && productUrl) {\r\n productUrl = updateProductUrl(productUrl, context, 'back=true');\r\n }\r\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.PrimaryImageUrl;\r\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\r\n const [productPageUrl = productPageUrlFromSwatch, setProductPageUrl] = useState<string | undefined>();\r\n const [productImageUrl = productImageUrlFromSwatch, setProductImageUrl] = useState<string | undefined>();\r\n\r\n /**\r\n * Updates the product page and Image url based on swatch selected.\r\n * @param coreContext - Context of the caller.\r\n * @param swatchItem - Dimension swatch selected.\r\n */\r\n const updatePageAndImageUrl = React.useCallback((coreContext: ICoreContext, swatchItem: ISwatchItem) => {\r\n const dimensionType = swatchItem.dimensionType;\r\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\r\n return;\r\n }\r\n const queryString = `${dimensionType}=${swatchItem.value}`;\r\n let productPageUrlWithSwatch = '';\r\n if (productPageUrl.includes(dimensionType)) {\r\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\r\n newUrl.searchParams.delete(dimensionType);\r\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\r\n } else {\r\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\r\n }\r\n setProductPageUrl(productPageUrlWithSwatch);\r\n if (dimensionType === DimensionTypes.color) {\r\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls) ? swatchItem.productImageUrls[0] : undefined;\r\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\r\n setProductImageUrl(newImageUrl);\r\n }\r\n }, [context, productPageUrl]);\r\n\r\n if (!product) {\r\n return null;\r\n }\r\n\r\n // Construct telemetry attribute to render\r\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\r\n\r\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\r\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\r\n\r\n if (!unitOfMeasure) {\r\n return null;\r\n }\r\n return (\r\n <div className='msc-product__unit-of-measure'>\r\n <span>\r\n {unitOfMeasure}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product availability.\r\n * @param inventoryAvailabilityLabel - The product information.\r\n * @returns The node representing markup for product availability.\r\n */\r\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\r\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__availability'>\r\n <span>\r\n {inventoryAvailabilityLabel}\r\n </span>\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Checks if rendering the particular dimensions is allowed for product card.\r\n * @param dimensionType - Dimension to be displayed.\r\n * @returns Updates the state with new product page url.\r\n */\r\n function shouldDisplayDimension(dimensionType: string): boolean {\r\n const dimensionsContext = context as ICoreContext<IDimensionsApp>;\r\n const dimensionsToDisplayOnProductCard = dimensionsContext.app.config.dimensionsInProductCard;\r\n return ArrayExtensions.hasElements(dimensionsToDisplayOnProductCard) &&\r\n !dimensionsToDisplayOnProductCard.includes(DimensionTypes.none) &&\r\n dimensionsToDisplayOnProductCard.includes(dimensionType.toLocaleLowerCase() as DimensionTypes);\r\n }\r\n\r\n /**\r\n * Gets the react node for product dimension as swatch.\r\n * @param attributeValues - Attribute value property from product.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n function renderProductDimensions(attributeValues?: AttributeValue[]): JSX.Element | null {\r\n if (!attributeValues) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className='msc-product__dimensions'>\r\n {\r\n attributeValues.map((item: AttributeValue) => {\r\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\r\n if (!shouldDisplayDimension(dimensionTypeValue)) {\r\n return null;\r\n }\r\n const dimensionType = dimensionTypeValue as DimensionTypes;\r\n const swatches = item.Swatches?.map<ISwatchItem>(swatchItem => {\r\n return {\r\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\r\n value: swatchItem.SwatchValue ?? '',\r\n dimensionType,\r\n colorHexCode: swatchItem.SwatchColorHexCode,\r\n imageUrl: swatchItem.SwatchImageUrl,\r\n productImageUrls: swatchItem.ProductImageUrls,\r\n isDefault: swatchItem.IsDefault\r\n };\r\n }) ?? [];\r\n if (ArrayExtensions.hasElements(swatches) && !swatches.some(swatch => swatch.isDefault) && dimensionType === DimensionTypes.color) {\r\n swatches[0].isDefault = true;\r\n }\r\n return (\r\n <ProductComponentSwatchComponent\r\n key={item.RecordId}\r\n context={context}\r\n onSelectDimension={updatePageAndImageUrl}\r\n swatches={swatches}\r\n />\r\n );\r\n })\r\n }\r\n </div>\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param quickview - Quick view node.\r\n * @param item - Product id to de displayed in quickview.\r\n * @returns The product quickview component. */\r\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\r\n if (quickview === null) {\r\n return undefined;\r\n }\r\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item });\r\n }\r\n\r\n /**\r\n * Gets the aria label for rating.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Aria label format for rating.\r\n * @returns The product rating aria label string.\r\n */\r\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\r\n if (rating && ratingAriaLabelText) {\r\n const roundedRating = rating.toFixed(2);\r\n return format(ratingAriaLabelText || '', roundedRating, '5');\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label for review count.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Aria label format for review.\r\n * @returns The product review count aria label string.\r\n */\r\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\r\n if (reviewCount && ratingCountAriaLabelText) {\r\n return format(ratingCountAriaLabelText || '', reviewCount);\r\n }\r\n return '';\r\n }\r\n\r\n /**\r\n * Gets the aria label string for product that includes product name with its price and rating.\r\n * @param name - Product name.\r\n * @param price - Product price.\r\n * @param rating - Product rating.\r\n * @param ratingAriaLabelText - Rating aria label text.\r\n * @param reviewCount - Product review count.\r\n * @param ratingCountAriaLabelText - Number of ratings.\r\n * @returns The aria label string for the product card.\r\n */\r\n function renderLabel(\r\n name?: string,\r\n price?: string,\r\n rating?: number,\r\n ratingAriaLabelText?: string,\r\n reviewCount?: number,\r\n ratingCountAriaLabelText?: string): string {\r\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\r\n return (\r\n `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${reviewCountArialableText ? ` ${reviewCountArialableText}` : ''}`\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param productCardimageSettings - Module image settings for product card.\r\n * @param gridSettings - Grid settings defined in theme.\r\n * @param imageUrl - Image url.\r\n * @param fallbackImageUrl - Fallback url for imge.\r\n * @param altText - Image Alt text.\r\n * @param requestContext - Request context using the component.\r\n * @returns React component for product image.\r\n */\r\n function renderProductPlacementImage(\r\n productCardimageSettings?: IImageSettings, gridSettings?: IGridSettings,\r\n imageUrl?: string, fallbackImageUrl?: string, altText?: string, requestContext?: IRequestContext): JSX.Element | null {\r\n\r\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\r\n return null;\r\n }\r\n const image: IImageData = {\r\n src: imageUrl,\r\n altText: altText ? altText : '',\r\n fallBackSrc: fallbackImageUrl\r\n };\r\n const imageProps: IImageProps = { gridSettings };\r\n imageProps.gridSettings = gridSettings;\r\n imageProps.imageSettings = productCardimageSettings;\r\n imageProps.imageSettings.cropFocalRegion = true;\r\n return (\r\n <Image\r\n {...image} {...imageProps} loadFailureBehavior='empty'\r\n requestContext={requestContext}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param basePrice - Product base price.\r\n * @param adjustedPrice - Product adjusted price.\r\n * @param maxVariantPrice - Product variant max price.\r\n * @param minVariantPrice - Product variant min price.\r\n * @param savingsPriceResourceText - Product price saving text.\r\n * @param freePriceResourceText - Product price free text.\r\n * @param originalPriceResourceText - Product price original text.\r\n * @param currentPriceResourceText - Product price current text.\r\n * @returns React component for Product price. */\r\n function renderPrice(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, basePrice?: number, adjustedPrice?: number,\r\n maxVariantPrice?: number, minVariantPrice?: number, savingsPriceResourceText?: string, freePriceResourceText?: string,\r\n originalPriceResourceText?: string, currentPriceResourceText?: string): JSX.Element | null {\r\n const price: ProductPrice = {\r\n BasePrice: basePrice,\r\n AdjustedPrice: adjustedPrice,\r\n CustomerContextualPrice: adjustedPrice,\r\n MaxVariantPrice: maxVariantPrice ? maxVariantPrice : adjustedPrice,\r\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedPrice\r\n };\r\n\r\n return (\r\n <PriceComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n data={{ price }}\r\n savingsText={savingsPriceResourceText}\r\n freePriceText={freePriceResourceText}\r\n originalPriceText={originalPriceResourceText}\r\n currentPriceText={currentPriceResourceText}\r\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\r\n priceResources={priceResources}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Gets the react node for product description.\r\n * @param description - Product description.\r\n * @returns The product description component.\r\n */\r\n function renderDescription(description?: string): JSX.Element | null {\r\n return (<p className='msc-product__text'>\r\n {description}\r\n </p>);\r\n }\r\n\r\n /**\r\n * Gets the react component for product rating.\r\n * @param coreContext - Context of the module using the component.\r\n * @param moduleTypeName - Module type name.\r\n * @param moduleId - Module id using the component.\r\n * @param avgRating - Average rating.\r\n * @param totalRatings - Total rating.\r\n * @param ariaLabel - Aria label for rating.\r\n * @returns React component for Product rating.\r\n */\r\n function renderRating(coreContext: ICoreContext, moduleTypeName: string, moduleId: string, avgRating?: number,\r\n totalRatings?: number, ariaLabel?: string): JSX.Element | null {\r\n if (!avgRating) {\r\n return null;\r\n }\r\n\r\n const numberRatings = totalRatings?.toString() || undefined;\r\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\r\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\r\n\r\n return (\r\n <RatingComponent\r\n context={coreContext}\r\n id={moduleId}\r\n typeName={moduleTypeName}\r\n avgRating={avgRating}\r\n ratingCount={numberRatings}\r\n readOnly\r\n ariaLabel={ratingAriaLabelText}\r\n ratingCountAriaLabel={ratingCountAriaLabelText}\r\n data={{}}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n <>\r\n <a\r\n id={product.ItemId}\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='msc-product' {...attribute}>\r\n \r\n <div className='msc-product__image'>\r\n {renderProductPlacementImage(\r\n imageSettings, context.request.gridSettings, productImageUrl,\r\n product.PrimaryImageUrl, product.Name, context.actionContext.requestContext)}\r\n </div>\r\n <h4 className='msc-product__title'>\r\n {product.Name}\r\n </h4>\r\n \r\n </a>\r\n <div className='nickDescriptionText'>\r\n {renderProductDimensions(product.AttributeValues)}\r\n <div className='msc-product__details'>\r\n {renderPrice(context, typeName, id, product.BasePrice, product.Price,\r\n product.MaxVariantPrice, product.MinVariantPrice, savingsText, freePriceText, originalPriceText, currentPriceText)}\r\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\r\n {renderDescription(product.Description)}\r\n {!context.app.config.hideRating && renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\r\n {renderProductAvailability(inventoryLabel)}\r\n </div>\r\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\r\n {/* <div className='connellyButton flex-vertical'>\r\n <a\r\n href={productPageUrl} onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\r\n aria-label={renderLabel(\r\n product.Name,\r\n context.cultureFormatter.formatCurrency(product.Price),\r\n product.AverageRating, ratingAriaLabel,\r\n product.TotalRatings, ratingCountAriaLabel)}\r\n className='button' {...attribute}>\r\n <div className='newSpot'>Full Details</div>\r\n </a>\r\n </div> */}\r\n </div>\r\n </>\r\n );\r\n};\r\n\r\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponentOverride<IProductComponent>(\r\n 'Product',\r\n { component: ProductCard, ...PriceComponentActions }\r\n);\r\n\r\n\r\nexport default ProductComponent;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartLinePriceEditor, ICartLinePriceEditorResources, PriceComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, { IComponentProps, IGridSettings, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { ChannelDeliveryOptionConfiguration, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { CartLine, ProductCatalog, SalesLine } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions, getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IncrementalQuantity, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\n/**\n * ICartlineResourceString: Interface for specifying the\n * resource strings that the component needs.\n */\nexport interface ICartlineResourceString {\n /**\n * Display string for discount label\n */\n discountStringText: string;\n\n /**\n * String for size key\n */\n sizeString: string;\n\n /**\n * String for color key\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension\n */\n configString: string;\n\n /**\n * String for style key\n */\n styleString: string;\n\n /**\n * String for amount key\n */\n amountString?: string;\n\n /**\n * Display string for quantity label\n */\n quantityDisplayString: string;\n\n /**\n * Display string for quantity label\n */\n inputQuantityAriaLabel: string;\n\n /**\n * Aria label for the decrement button in quantity component\n */\n decrementButtonAriaLabel: string;\n\n /**\n * Aria label for the increment button in quantity component\n */\n incrementButtonAriaLabel: string;\n\n /**\n * Original text screenreader\n */\n originalPriceText: string;\n\n /**\n * Current text screenreader\n */\n currentPriceText: string;\n\n /**\n * Shipping Charges Text\n */\n shippingChargesText: string;\n\n priceEditorResources?: ICartLinePriceEditorResources;\n salesAgreementPricePrompt?: string;\n}\n\ninterface ICartLineData {\n cartLine: CartLine | SalesLine;\n cartState?: ICartState;\n product?: SimpleProduct;\n catalogs?: ProductCatalog[];\n}\n\n/**\n * ICartLineProps: The props required to render cartLineitem.\n */\nexport interface ICartLineProps extends IComponentProps<ICartLineData> {\n /**\n * The flag to change the quantity component from intractable to static.\n */\n disableQuantityInteractivity?: boolean;\n\n /**\n * The primary image url.\n */\n primaryImageUrl?: string;\n\n /**\n * The product url.\n */\n productUrl?: string;\n\n /**\n * GridSettings for the product image in cartLine.\n */\n gridSettings: IGridSettings;\n\n /**\n * ImageSettings for the product image in cartLine.\n */\n imageSettings: IImageSettings;\n\n /**\n * Boolean flag to indicate if the item is out of stock.\n */\n isOutOfStock?: boolean;\n\n /**\n * Flag to make quantity section editable.\n */\n isQuantityEditable?: boolean;\n\n /**\n * Max quantity for line item.\n */\n maxQuantity?: number;\n\n /**\n * Current quantity for line item.\n */\n currentQuantity?: number;\n\n /**\n * Resource string for the component.\n */\n resources: ICartlineResourceString;\n\n /**\n * SalesLine flag.\n */\n isSalesLine?: boolean;\n\n /**\n * Error message to show in place of quantity.\n */\n errorMessage?: string;\n\n /**\n * Inventory information label.\n */\n inventoryInformationLabel?: string;\n\n /**\n * Inventory information class name.\n */\n inventoryLabelClassName?: string;\n\n /**\n * Flag to show/hide shipping charges for line items.\n */\n showShippingChargesForLineItems?: boolean;\n\n /**\n * Boolean flag to indicate if cart state status is ready.\n */\n isCartStateReady?: boolean;\n\n /**\n * Chanel Delivery Option configuration is from api.\n */\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\n\n /**\n * The telemetry content.\n */\n telemetryContent?: ITelemetryContent;\n\n /**\n * The cart line index.\n */\n lineIndex?: number;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): boolean;\n}\n\ninterface IDimensionStrings {\n /**\n * String for size key.\n */\n sizeString: string;\n\n /**\n * String for color key.\n */\n colorString: string;\n\n /**\n * String associated with the configuration product dimension.\n */\n configString: string;\n\n /**\n * String for style key.\n */\n styleString: string;\n\n /**\n * String for amount key.\n */\n amountString?: string;\n}\n\n/**\n * Renders catalog label for the cart line.\n * @param props - Cart line props.\n * @returns Catalog label.\n */\nconst CatalogLabelComponent: React.FC<ICartLineProps> = (props: ICartLineProps) => {\n const catalogId = props.data.cartLine.CatalogId;\n\n if (!props.context.request.user.isB2b || !catalogId || !ArrayExtensions.hasElements(props.data.catalogs)) {\n return null;\n }\n\n const catalog = props.data.catalogs.find(item => item.RecordId === catalogId);\n\n if (!catalog || !catalog.Name) {\n return null;\n }\n\n return <div className='msc-cart-line__catalog-label'>{catalog.Name}</div>;\n};\n\nconst CartLineItemFunctions = {\n renderProductDimensions: (Product: SimpleProduct, DimensionStrings: IDimensionStrings) => {\n if (!Product || !Product.Dimensions) {\n return [];\n }\n\n return Product.Dimensions.map(productDimension => {\n if (productDimension.DimensionTypeValue === 1) {\n return (\n <div key={`${Product.RecordId}ProductDimensions1`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-color'>\n {DimensionStrings.colorString}:\n <span className='name'>{productDimension.DimensionValue && productDimension.DimensionValue.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === 2) {\n return (\n <div key={`${Product.RecordId}ProductDimensions2`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-configuration'>\n {DimensionStrings.configString}:\n <span className='name'>{productDimension.DimensionValue && productDimension.DimensionValue.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === 3) {\n return (\n <div key={`${Product.RecordId}ProductDimensions3`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-size'>\n {DimensionStrings.sizeString}:\n <span className='name'>{productDimension.DimensionValue && productDimension.DimensionValue.Value}</span>\n </span>\n </div>\n );\n }\n\n if (productDimension.DimensionTypeValue === 4) {\n return (\n <div key={`${Product.RecordId}ProductDimensions4`} className='msc-cart-line__product-variant-item'>\n <span className='msc-cart-line__product-variant-style'>\n {Product.IsGiftCard ? DimensionStrings.amountString : DimensionStrings.styleString}:\n <span className='name'>{productDimension.DimensionValue && productDimension.DimensionValue.Value}</span>\n </span>\n </div>\n );\n }\n return null;\n });\n },\n\n renderDiscountLines: (props: ICartLineProps) => {\n if (!props.data.cartLine.DiscountLines || props.data.cartLine.DiscountLines.length === 0) {\n return null;\n }\n\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\n return (\n <div key={discountLine.OfferId || index} className='msc-cart-line-item-product-discount'>\n <span>\n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\n </span>\n <span className='cart-line-item-product-discount-price'>\n <PriceComponent\n data={\n props.isSalesLine\n ? {\n price: {\n // @ts-expect-error\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\n }\n }\n : {\n price: {\n CustomerContextualPrice: discountLine.EffectiveAmount,\n BasePrice: discountLine.EffectiveAmount\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n />\n </span>\n <span>{` (${discountLine.EffectivePercentage !== undefined ? discountLine.EffectivePercentage : ''}%)`}</span>\n </div>\n );\n });\n },\n renderInventoryLabel: (props: ICartLineProps) => {\n if (!props.inventoryInformationLabel) {\n return null;\n }\n const inventoryCssName = props.inventoryLabelClassName\n ? `msc-cart-line__product-inventory-label ${props.inventoryLabelClassName}`\n : 'msc-cart-line__product-inventory-label';\n return <span className={inventoryCssName}>{props.inventoryInformationLabel}</span>;\n },\n\n /**\n * Gets the react node for product unit of measure display.\n * @param props - Icartline props.\n * @returns The node representing markup for unit of measure component.\n */\n renderUnitOfMeasure: (props: ICartLineProps) => {\n if (props.data.cartLine.IsInvoiceLine) {\n return null;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\n return undefined;\n }\n\n const product = props.data.product;\n if (!product || !product.DefaultUnitOfMeasure) {\n return undefined;\n }\n\n return (\n <div className='msc-cartline__product-unit-of-measure'>\n <span>{product.DefaultUnitOfMeasure}</span>\n </div>\n );\n },\n renderShippingLabel: (props: ICartLineProps) => {\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\n const cartline = props.data.cartLine;\n let hasShippingMethod = false;\n if (channelDeliveryOptionConfig !== undefined) {\n hasShippingMethod = !!(\n cartline.DeliveryMode &&\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\n );\n } else {\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\n }\n if (!hasShippingMethod) {\n return undefined;\n }\n\n const shippingChargeLines = (cartline.ChargeLines || []).filter(chargeLine => chargeLine.IsShipping);\n\n if (shippingChargeLines.length === 0) {\n return undefined;\n }\n\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\n return chargeTotal + (chargeLine.CalculatedAmount || 0);\n }, 0);\n\n const priceComponent = (\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: freightFee\n }\n }}\n freePriceText='Free'\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__freight-actual'\n />\n );\n return (\n <>\n <label className='msc-cart-line__freight-label'>{`${props.resources.shippingChargesText}:`}</label>\n <span className='shipping-value'>{priceComponent}</span>\n </>\n );\n },\n renderOtherCharges: (props: ICartLineProps) => {\n const cartline = props.data.cartLine;\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\n\n return (\n (otherCharges &&\n otherCharges.map((otherCharge, key) => {\n return otherCharge && otherCharge.CalculatedAmount ? (\n <div className='msc-cart-line__other-charges' key={key}>\n <label className='msc-cart-line__other-charges-label'>{`${otherCharge.Description}:`}</label>\n <span className='other-charge-value'>\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: otherCharge.CalculatedAmount\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__other-charges-actual'\n />\n </span>\n </div>\n ) : (\n ''\n );\n })) ||\n undefined\n );\n },\n\n /**\n * Render the sales agreement prompt.\n * @param props - The ICartLineProps.\n * @returns The JSX.Element.\n */\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\n return null;\n }\n return <div className='msc-cart-line__sales-agreement-prompt'>{props.resources.salesAgreementPricePrompt}</div>;\n }\n};\n\n// eslint-disable-next-line no-redeclare\nconst CartLine: React.FC<ICartLineProps> = (props: ICartLineProps) => {\n const { isSalesLine, productUrl, resources } = props;\n const { product, cartLine } = props.data;\n\n const destructDimensionStrings = {\n sizeString: resources.sizeString,\n colorString: resources.colorString,\n styleString: resources.styleString,\n configString: resources.configString,\n amountString: resources.amountString\n };\n\n const fallbackImageUrl = product && getFallbackImageUrl(product.ItemId, props.context.actionContext.requestContext.apiSettings);\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const imageSettings = props.imageSettings;\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const renderDisountLines = CartLineItemFunctions.renderDiscountLines(props);\n const renderInventoryLabel = CartLineItemFunctions.renderInventoryLabel(props);\n const renderUnitOfMeasure = CartLineItemFunctions.renderUnitOfMeasure(props);\n const renderShippingLabel = CartLineItemFunctions.renderShippingLabel(props);\n const renderOtherCharges = CartLineItemFunctions.renderOtherCharges(props);\n const renderSalesAgreementPrompt = CartLineItemFunctions.renderSalesAgreementPrompt(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const productName = product?.Name || cartLine.Description;\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\n\n const onChange = (newValue: number): boolean => {\n if (props.quantityOnChange) {\n return props.quantityOnChange(props.data.cartLine, newValue, props.lineIndex);\n }\n return true;\n };\n\n const _generateErrorMessage = (): JSX.Element | null => {\n if (props.errorMessage) {\n return (\n <div className='msc-cart-line__error-message msc-alert__header'>\n <span className='msi-exclamation-triangle' />\n <span>{props.errorMessage}</span>\n </div>\n );\n }\n\n return null;\n };\n\n const _generateQuantityandPrice = (): JSX.Element[] | null => {\n const nodes = [];\n if (props.isOutOfStock) {\n return null;\n }\n\n // No quantity selector for invoice line\n if (!props.data.cartLine.IsInvoiceLine) {\n if (props.data.product && props.isQuantityEditable) {\n nodes.push(\n <div className='msc-cart-line__product-quantity'>\n <div className='msc-cart-line__product-quantity-label'>{resources.quantityDisplayString}</div>\n <IncrementalQuantity\n id={`msc-cart-line__quantity_${props.data.product.RecordId}-${props.data.cartLine.DeliveryMode}-${props.data.cartLine.LineId}`}\n max={props.maxQuantity || 10}\n currentCount={props.currentQuantity}\n onChange={onChange}\n inputQuantityAriaLabel={resources.inputQuantityAriaLabel}\n decrementButtonAriaLabel={resources.decrementButtonAriaLabel}\n incrementButtonAriaLabel={resources.incrementButtonAriaLabel}\n key={props.data.cartLine.LineId}\n disabled={!props.isCartStateReady}\n isGiftCard={props.data.product.IsGiftCard}\n telemetryContent={props.telemetryContent}\n />\n </div>\n );\n } else {\n nodes.push(\n <div className={classNames('msc-cart-line__quantity', { 'single-quantity': props.data.cartLine.Quantity === 1 })}>\n <label className='quantity-label'>{resources.quantityDisplayString}:</label>\n <span className='quantity-value'>{props.data.cartLine.Quantity}</span>\n </div>\n );\n }\n }\n\n nodes.push(\n <div className='msc-cart-line__product-savings'>\n <PriceComponent\n data={\n isSalesLine\n ? {\n price: {\n // @ts-expect-error\n CustomerContextualPrice: props.data.cartLine.NetAmount,\n BasePrice: props.data.cartLine.Price\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\n BasePrice: props.data.cartLine.NetPrice\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__product-savings-actual'\n originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n />\n {(props.data.cartLine.DiscountAmount && props.data.cartLine.DiscountAmount > 0 && (\n <>\n <span className='msc-cart-line__product-savings-label'>\n {` ${props.resources.discountStringText || 'Discount'} `}\n </span>\n <PriceComponent\n data={\n props.isSalesLine\n ? {\n price: {\n // @ts-expect-error\n CustomerContextualPrice: props.data.cartLine.PeriodicDiscount\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.DiscountAmount,\n BasePrice: props.data.cartLine.DiscountAmount\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-cart-line__product-savings-text'\n salesAgreementLineId={props.data.cartLine.SalesAgreementLineRecordId}\n />\n </>\n )) ||\n null}\n </div>\n );\n\n return nodes;\n };\n\n return (\n <>\n <div className='msc-cart-line'>\n <div className={imgeClassName}>\n <Image\n requestContext={props.context.actionContext.requestContext}\n src={props.primaryImageUrl ?? 'empty'}\n fallBackSrc={fallbackImageUrl}\n altText={productName}\n gridSettings={props.gridSettings}\n imageSettings={imageSettings}\n loadFailureBehavior='empty'\n />\n </div>\n <div className='msc-cart-line__content'>\n <div className='msc-cart-line__product'>\n <CatalogLabelComponent {...props} />\n {MsDyn365.isBrowser ? (\n <a className='msc-cart-line__product-title' {...productAttribute} href={productUrl} key={productUrl}>\n {productName}\n </a>\n ) : null}\n {ArrayExtensions.hasElements(productDimensions) ? (\n <div className='msc-cart-line__product-variants'>{productDimensions}</div>\n ) : (\n ''\n )}\n {renderUnitOfMeasure}\n <div className='msc-cart-line__product-price'>\n <PriceComponent\n data={\n isSalesLine\n ? {\n price: {\n // @ts-expect-error - existing code.\n CustomerContextualPrice: props.data.cartLine.NetAmount,\n BasePrice: props.data.cartLine.Price\n }\n }\n : {\n price: {\n CustomerContextualPrice: props.data.cartLine.NetAmountWithoutTax,\n BasePrice: props.data.cartLine.NetPrice\n }\n }\n }\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='discount-value'\n salesAgreementLineId={props.data.cartLine.SalesAgreementLineRecordId}\n />\n </div>\n {renderDisountLines}\n {renderInventoryLabel}\n {props.showShippingChargesForLineItems && <div className='msc-cart-line__freight'>{renderShippingLabel}</div>}\n {renderOtherCharges}\n {renderSalesAgreementPrompt}\n </div>\n {_generateQuantityandPrice()}\n {props.data.cartLine.IsInvoiceLine && props.data.cartState && props.resources.priceEditorResources && (\n <CartLinePriceEditor\n className='msc-cart-line__price-editor-container'\n context={props.context}\n resources={props.resources.priceEditorResources}\n cartState={props.data.cartState}\n cartLine={props.data.cartLine}\n />\n )}\n </div>\n </div>\n {_generateErrorMessage()}\n </>\n );\n};\n\nexport default CartLine;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IHeaderData } from '../header.data';\nimport { IHeaderProps } from '../header.props.autogenerated';\n\n/**\n * The header preferred store component.\n */\n@observer\nexport class HeaderPreferredStore extends React.PureComponent<IHeaderProps<IHeaderData>> {\n private readonly modalCloseButtonRef: React.RefObject<HTMLButtonElement> = React.createRef();\n\n /**\n * Handle click on the store selector.\n * @returns : Promise void.\n */\n public handleClick = () => {\n return this._findPreferredStoreOnClick(this.props);\n };\n\n public render(): JSX.Element | undefined {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n },\n slots,\n resources\n } = this.props;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- slots can be undefined.\n if (ArrayExtensions.hasElements(slots?.storeSelector)) {\n const storeName =\n storeSelectorStateManager?.preferredStore && storeSelectorStateManager.preferredStore.StoreName\n ? storeSelectorStateManager.preferredStore.StoreName\n : resources.headerPreferredStoreText;\n\n return (\n <div className='ms-header__preferred-store-container'>\n <button\n className='ms-header__preferred-store-btn msc-btn'\n color='secondary'\n aria-label={resources.headerPreferredStoreAriaLabel}\n onClick={this.handleClick}\n ref={this.modalCloseButtonRef}\n >\n <span className='ms-header__preferred-store-text'>{storeName}</span>\n </button>\n {slots.storeSelector}\n </div>\n );\n }\n\n return undefined;\n }\n\n private async _findPreferredStoreOnClick(props: IHeaderProps<IHeaderData>): Promise<void> {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n },\n modules\n } = props;\n if (!storeSelectorStateManager) {\n return;\n }\n let storeSelectorId: string = '';\n if (modules && Object.keys(modules).length > 0 && ArrayExtensions.hasElements(modules.storeSelector)) {\n storeSelectorId = modules.storeSelector[0].id;\n }\n await storeSelectorStateManager\n .openDialog({\n id: storeSelectorId,\n showMapViewLink: true,\n parentElementRef: this.modalCloseButtonRef,\n onLocationSelected: orgUnitLocation => {\n return Promise.resolve();\n }\n })\n .catch((error: Error) => {\n if (props.telemetry) {\n props.telemetry.error(error.message);\n props.telemetry.debug('Unable to set preferred store');\n }\n });\n }\n}\n\nexport default HeaderPreferredStore;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ILogoProps {\n image: Msdyn365.IImageData;\n gridSettings?: Msdyn365.IGridSettings;\n link?: ILinkData;\n className?: string;\n telemetryContent?: ITelemetryContent;\n requestContext: Msdyn365.IRequestContext;\n typeName?: string;\n}\n\nexport interface ILinkData {\n linkUrl: Msdyn365.ILinkData;\n ariaLabel?: string;\n openInNewTab?: boolean;\n linkText?: string;\n}\n\n/**\n *\n * Logo component.\n * @extends {React.PureComponent<ILogoConfig>}\n */\nexport class Logo extends React.PureComponent<ILogoProps> {\n private readonly attributes?: Msdyn365.IDictionary<string>;\n\n constructor(props: ILogoProps) {\n super(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Logo);\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n }\n\n public render(): JSX.Element {\n return <div className={this.props.className}>{this._renderLogo(this.props)}</div>;\n }\n\n private _renderLogo(config: ILogoProps): JSX.Element {\n if (config.link && config.link.linkUrl.destinationUrl) {\n return (\n <a\n href={config.link.linkUrl.destinationUrl}\n aria-label={config.link.ariaLabel}\n target={config.link.openInNewTab ? '_blank' : undefined}\n rel='noopener noreferrer'\n {...this.attributes}\n >\n {this._renderImage(config)}\n </a>\n );\n }\n return this._renderImage(config);\n }\n\n private _renderImage(config: ILogoProps): JSX.Element {\n const defaultImageSettings: Msdyn365.IImageSettings = {\n viewports: {\n xs: { q: 'w=132&h=28&m=6', w: 0, h: 0 },\n lg: { q: 'w=160&h=48&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n\n return (\n <Msdyn365.Image\n {...config.image}\n requestContext={this.props.requestContext}\n gridSettings={this.props.gridSettings!}\n imageSettings={(config && config.image && config.image.imageSettings) || defaultImageSettings}\n loadFailureBehavior='default'\n editProps={{\n key: config.image || {},\n requestContext: this.props.requestContext,\n moduleType: this.props.typeName,\n imagePropertyName: 'image'\n }}\n shouldSkipToMainImage\n />\n );\n }\n}\n\nexport default Logo;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { IHeaderResources } from '../header.props.autogenerated';\n\nexport interface INavIconProps {\n resources: IHeaderResources;\n isExpanded: boolean;\n targetId: string;\n telemetryContent?: ITelemetryContent;\n toggleNavBar(): void;\n}\n\n/**\n *\n * NavIcon component.\n * @extends {React.PureComponent<INavIconProps>}\n */\n\n@observer\nexport class NavIcon extends React.PureComponent<INavIconProps> {\n private readonly attributes?: Msdyn365.IDictionary<string>;\n\n constructor(props: INavIconProps) {\n super(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.NavIcon);\n this.attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n }\n\n public render(): JSX.Element {\n return (\n <Button\n className='ms-header__nav-icon'\n onClick={this.props.toggleNavBar}\n title={this.props.resources.mobileHamburgerAriaLabel}\n aria-label={this.props.resources.mobileHamburgerAriaLabel}\n aria-expanded={this.props.isExpanded}\n aria-controls={this.props.targetId}\n {...this.attributes}\n />\n );\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CartIconComponent, WishListIconComponent } from '@msdyn365-commerce/components';\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n getTelemetryObject,\n IModuleProps,\n INodeProps,\n ITelemetryContent,\n KeyCodes,\n Modal,\n ModalBody,\n ModalHeader,\n onTelemetryClick,\n Popover,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { computed, reaction } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { HeaderPreferredStore, Logo, NavIcon } from './components';\nimport { IHeaderData } from './header.data';\nimport { IHeaderProps, IHeaderResources, IMyAccountLinksData } from './header.props.autogenerated';\n\nexport interface IHeaderState {\n mobileMenuCollapsed: boolean;\n signinPopoverOpen: boolean;\n hasSigninerror?: boolean;\n}\n\nexport interface IHeaderViewProps extends IHeaderProps<IHeaderData>, IHeaderState {\n logo: React.ReactNode;\n wishListIconDesktop: React.ReactNode;\n wishListIconMobile: React.ReactNode;\n cartIcon: React.ReactNode;\n navIcon: React.ReactNode;\n className: string;\n menuBar: React.ReactNode[];\n search: React.ReactNode[];\n siteOptions: React.ReactNode[];\n HeaderTag: IModuleProps;\n HeaderContainer: INodeProps;\n MobileMenuContainer: INodeProps;\n MobileMenuHeader: React.ReactNode;\n MobileMenuBodyContainer: INodeProps;\n MobileMenuLinksContainer: INodeProps;\n HeaderTopBarContainer: INodeProps;\n Divider: INodeProps;\n\n AccountInfoDropdownParentContainer?: INodeProps;\n AccountInfoDropdownPopoverConentContainer?: INodeProps;\n accountInfoDropdownButton?: React.ReactNode;\n\n signOutLink?: React.ReactNode;\n signInLink?: React.ReactNode;\n switchCustomerLink?: React.ReactNode;\n isOBORequest?: boolean;\n accountLinks?: React.ReactNode[];\n preferredStore?: React.ReactNode;\n}\n\n/**\n *\n * Header component.\n * @extends {React.PureComponent<IHeaderProps<IHeaderData>>}\n */\n@observer\nclass Header extends React.PureComponent<IHeaderProps<IHeaderData>, IHeaderState> {\n private readonly popOverRef: React.RefObject<HTMLButtonElement>;\n\n private readonly telemetryContent: ITelemetryContent;\n\n private cart: ICartState | undefined;\n\n /**\n * The signed-in user name displayed in the header bar\n */\n @computed public get displayName(): Readonly<string | undefined> {\n const user = this.props.context.request.user;\n return user?.isOBORequest ? this.workerName : this.customerName;\n }\n\n /**\n * OBO scenario. The name of worker who shops on behalf of customer.\n */\n @computed public get workerName(): Readonly<string | undefined> {\n const user = this.props.context.request.user;\n return user?.firstName || user?.name;\n }\n\n @computed public get customerName(): Readonly<string | undefined> {\n const user = this.props.context.request.user;\n const customer = this.props.data.accountInformation?.result;\n if (user?.isOBORequest) {\n // For OBO scenario, display full customer name because multiple customers may have the same first name.\n return customer ? customer.Name : undefined;\n } else {\n return customer ? customer.FirstName || customer.Name : undefined;\n }\n }\n\n public constructor(props: IHeaderProps<IHeaderData>) {\n super(props);\n this.popOverRef = React.createRef();\n this._toggleNavbar = this._toggleNavbar.bind(this);\n this._togglePopover = this._togglePopover.bind(this);\n this._keydown = this._keydown.bind(this);\n this.state = {\n mobileMenuCollapsed: true,\n signinPopoverOpen: false,\n hasSigninerror: false\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public componentDidMount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.addEventListener('keydown', this._keydown);\n }\n reaction(\n () => this.props.data.cart.result,\n () => {\n this.cart = this.props.data.cart.result;\n }\n );\n\n const {\n context: {\n request: { user }\n },\n resources: { signUpCustomerNotFoundTitle, signUpMultipleCustomerFoundTitle, closeNotificationLabel }\n } = this.props;\n\n const signinNotificationError = this._getSigninNotification(user, signUpMultipleCustomerFoundTitle, signUpCustomerNotFoundTitle);\n if (signinNotificationError !== undefined && this.state.hasSigninerror === false) {\n // For signup show simple error notification.\n NotificationsManager.instance().addNotification(new ErrorNotification(signinNotificationError, closeNotificationLabel));\n }\n }\n\n public componentWillUnmount(): void {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n window.removeEventListener('keydown', this._keydown, false);\n }\n }\n\n public render(): JSX.Element | null {\n const {\n id,\n typeName,\n data: { accountInformation, wishlists },\n context: {\n request: { user }\n },\n context,\n resources: { cartLabel, cartQtyLabel }\n } = this.props;\n const { logoLink, logoImage, shouldShowWishlistCount } = this.props.config;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- app config is generic\n const disableTooltip = this.props.context.app.config.disableTooltip || false;\n const headerToggleClass = this.state.mobileMenuCollapsed ? '' : 'ms-header-open';\n const headerClassName = classnames('ms-header', this.props.config.className, headerToggleClass);\n const navbarKey = 'header-nav-mobile';\n const customer = accountInformation && accountInformation.result;\n const cartIconSlot = this._getSlot('cartIcon');\n const menuBarSlot = this._getSlot('menuBar');\n const searchSlot = this._getSlot('search');\n let wishlistCount = 0;\n const siteOptionsSlot = this._getSlot('siteOptions');\n const preferredStoreSlot = this._getSlot('storeSelector');\n if (wishlists !== undefined) {\n if (\n !wishlists.result ||\n !ArrayExtensions.hasElements(wishlists.result) ||\n !wishlists.result[0].CommerceListLines ||\n !ArrayExtensions.hasElements(wishlists.result[0].CommerceListLines)\n ) {\n wishlistCount = 0;\n } else {\n wishlistCount = wishlists.result[0].CommerceListLines.length;\n }\n }\n const viewProps: IHeaderViewProps = {\n ...(this.props as IHeaderProps<IHeaderData>),\n ...this.state,\n logo: (\n <Logo\n {...{\n link: logoLink,\n image: logoImage,\n className: 'ms-header__logo',\n gridSettings: this.props.context.request.gridSettings,\n requestContext: this.props.context.request,\n telemetryContent: this.telemetryContent,\n typeName: this.props.typeName\n }}\n />\n ),\n wishListIconDesktop: (\n <WishListIconComponent\n className='ms-header__wishlist-desktop'\n showButtonTooltip={!disableTooltip}\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\n context={context}\n id={id}\n typeName={typeName}\n telemetryContent={this.telemetryContent}\n data={{}}\n wishlistCount={wishlistCount}\n wishlistCountLabel={this.props.resources.wishlistCountLabel}\n isDispayWishlistCount={shouldShowWishlistCount}\n />\n ),\n wishListIconMobile: (\n <WishListIconComponent\n className='ms-header__wishlist-mobile'\n showButtonTooltip={!disableTooltip}\n wishlistTooltipText={this.props.resources.wishlistTooltipText}\n context={context}\n id={id}\n typeName={typeName}\n telemetryContent={this.telemetryContent}\n data={{}}\n wishlistCount={wishlistCount}\n wishlistCountLabel={this.props.resources.wishlistCountLabel}\n isDispayWishlistCount={shouldShowWishlistCount}\n />\n ),\n cartIcon: ArrayExtensions.hasElements(cartIconSlot) ? (\n cartIconSlot[0]\n ) : (\n <CartIconComponent\n cartLabel={cartLabel}\n cartQtyLabel={cartQtyLabel}\n context={context}\n id={id}\n typeName={typeName}\n telemetryContent={this.telemetryContent}\n data={{ cart: this.cart }}\n />\n ),\n navIcon: (\n <NavIcon\n {...{\n resources: this.props.resources,\n isExpanded: !this.state.mobileMenuCollapsed,\n targetId: navbarKey,\n toggleNavBar: this._toggleNavbar,\n telemetryContent: this.telemetryContent\n }}\n />\n ),\n menuBar: ArrayExtensions.hasElements(menuBarSlot) ? menuBarSlot : [],\n search: ArrayExtensions.hasElements(searchSlot) ? searchSlot : [],\n siteOptions: ArrayExtensions.hasElements(siteOptionsSlot) ? siteOptionsSlot : [],\n className: headerClassName,\n HeaderTag: {\n moduleProps: this.props,\n className: classnames(headerClassName),\n 'aria-label': this.props.resources.headerAriaLabel,\n tag: 'header'\n },\n HeaderContainer: {\n className: classnames('ms-header__container')\n },\n HeaderTopBarContainer: {\n className: classnames('ms-header__topbar')\n },\n Divider: {\n className: classnames('ms-header__divider')\n },\n MobileMenuContainer: {\n tag: Modal,\n id: navbarKey,\n className: 'ms-header__mobile-hamburger',\n isOpen: !this.state.mobileMenuCollapsed,\n wrapClassName: 'ms-header__modal',\n toggle: this._toggleNavbar\n },\n MobileMenuHeader: <ModalHeader className='ms-header__mobile-hamburger-menu-header' toggle={this._toggleNavbar} />,\n MobileMenuBodyContainer: {\n tag: ModalBody,\n className: 'ms-header__mobile-hamburger-menu-body'\n },\n MobileMenuLinksContainer: {\n className: 'ms-header__mobile-hamburger-menu-links'\n },\n AccountInfoDropdownParentContainer: {\n className: 'ms-header__account-info'\n },\n AccountInfoDropdownPopoverConentContainer: this.displayName\n ? {\n tag: Popover,\n id: 'myprofilePopover',\n className: 'ms-header__account-info-content',\n placement: 'bottom',\n isOpen: this.state.signinPopoverOpen,\n target: this.popOverRef,\n toggle: this._togglePopover\n }\n : undefined,\n signInLink: this._getSigninButton(user, this.props.resources),\n signOutLink: this._getSignOutButton(user, this.props.resources),\n isOBORequest: user?.isOBORequest,\n switchCustomerLink: this._getSwitchCustomerButton(user, this.props.resources),\n accountInfoDropdownButton: this._getAccountInfoDropdownButton(user, this.props.resources),\n accountLinks: this._getAccountLinks(customer),\n preferredStore: ArrayExtensions.hasElements(preferredStoreSlot) && <HeaderPreferredStore {...this.props} />\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle link text change.\n * @param linkIndex - Link Index.\n * @returns : Void.\n */\n public handleLinkTextChange = (linkIndex: number) => (event: MsDyn365.ContentEditableEvent): void => {\n if (this.props.config.myAccountLinks?.[linkIndex]) {\n this.props.config.myAccountLinks[linkIndex].linkText = event.target.value;\n }\n };\n\n /**\n * Get the slot.\n * @param slotName - Name of the slot.\n * @returns The slot.\n */\n private _getSlot(slotName: string): React.ReactNode[] | null {\n const { slots } = this.props;\n return (slots && slots[slotName] && slots[slotName].length && slots[slotName]) || null;\n }\n\n /**\n * Renders the sign in button.\n * @param user - Request context user.\n * @param resources - Resources.\n * @returns React Node.\n */\n private _getSigninButton(user: MsDyn365.IRequestContextUser | undefined, resources: IHeaderResources): React.ReactNode | undefined {\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignIn);\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n return (\n !this.displayName && (\n <Button\n className='ms-header__signin-button'\n title={resources.signInLinkText}\n href={user?.signInUrl}\n aria-label={resources.signInLinkAriaText}\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign in')}\n {...attributes}\n >\n <span className='ms-header__signin-button-text' aria-hidden>\n {resources.signInLinkText}\n </span>\n </Button>\n )\n );\n }\n\n /**\n * Renders the sign out button.\n * @param user - Request context user.\n * @param resources - Resources.\n * @returns React Node.\n */\n private _getSignOutButton(user: MsDyn365.IRequestContextUser | undefined, resources: IHeaderResources): React.ReactNode | undefined {\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SignOut);\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n return (\n this.displayName && (\n <Button\n className='ms-header__signout-button'\n title={resources.signOutLinkText}\n href={user?.signOutUrl ?? ''}\n aria-label={resources.signOutLinkAriaText}\n onClick={onTelemetryClick(this.telemetryContent, payLoad, 'Sign out')}\n {...attributes}\n >\n <span className='ms-header__signout-button-text' aria-hidden>\n {resources.signOutLinkText}\n </span>\n </Button>\n )\n );\n }\n\n /**\n * Renders the sign out button.\n * @param user - Request context user.\n * @param resources - Resources.\n * @returns React Node.\n */\n private _getSwitchCustomerButton(\n user: MsDyn365.IRequestContextUser | undefined,\n resources: IHeaderResources\n ): React.ReactNode | undefined {\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.SwitchCustomer);\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n const isOBOAccountSelected = user?.isOBORequest && this.props.context.request.cookies.getAccountSelectionCookie();\n return (\n this.displayName &&\n isOBOAccountSelected && (\n <a\n aria-label={resources.switchCustomerLinkAriaText}\n className='ms-signin-info__account-link-button'\n title={resources.switchCustomerLinkText}\n href={this.getBusinessPartnerSelectionUrl()}\n role='link'\n onClick={() => this.props.context.request.cookies.removeAccountSelectionCookie()}\n {...attributes}\n >\n <div className='ms-header__switchcustomer-button-text'>\n <div className='ms-header__shoppingas-text'>{format(resources.shoppingAsText, this.customerName)}</div>\n <div>{resources.switchCustomerLinkText}</div>\n </div>\n </a>\n )\n );\n }\n\n private getBusinessPartnerSelectionUrl(): string | undefined {\n const route = MsDyn365.getUrlSync('businessPartnerSelection', this.props.context.actionContext);\n if (!route || !MsDyn365.msdyn365Commerce.isBrowser) {\n return undefined;\n }\n\n // MsDyn365.getUrlSync persists some params in the route and remove other params.\n // Among the persisted params, we need to remove catalogid.\n const persistedParamToRemove = ['catalogid'];\n const url = new URL(route, window.location.href);\n persistedParamToRemove.forEach(param => url.searchParams.delete(param));\n return url.href;\n }\n\n private _getSigninNotification(\n user: MsDyn365.IRequestContextUser | undefined,\n signUpMultipleCustomerFoundTitle: string,\n signUpCustomerNotFoundTitle: string\n ): string | undefined {\n const { signUpCustomerNotFound, signUpMultipleCustomerFound } = this.props.config;\n const notFoundError = 'Microsoft_Dynamics_Commerce_Runtime_CustomerNotFound_WhenAutoLinking';\n const multipleAccountError = 'Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountsFoundWithSameEmailAddress';\n\n if (user?.retailServerErrorCode === notFoundError) {\n return signUpCustomerNotFound !== undefined ? signUpCustomerNotFound : signUpCustomerNotFoundTitle;\n } else if (user?.retailServerErrorCode === multipleAccountError) {\n return signUpMultipleCustomerFound !== undefined ? signUpMultipleCustomerFound : signUpMultipleCustomerFoundTitle;\n }\n return undefined;\n }\n\n private _getAccountInfoDropdownButton(\n user: MsDyn365.IRequestContextUser | undefined,\n resources: IHeaderResources\n ): React.ReactNode | undefined {\n const payLoad = getPayloadObject('click', this.telemetryContent, TelemetryConstant.MyProfile);\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n return (\n this.displayName && (\n <Button\n innerRef={this.popOverRef}\n className='ms-header__profile-button'\n aria-describedby='myprofilePopover'\n onClick={this._togglePopover}\n color='link'\n aria-label={this.displayName}\n aria-expanded={this.state.signinPopoverOpen}\n {...attributes}\n >\n <div className='ms-profile-button-text'>\n <div>{this.displayName}</div>\n {user?.isOBORequest && this.customerName && <div>{format(resources.shoppingAsText, this.customerName)}</div>}\n </div>\n </Button>\n )\n );\n }\n\n private _getAccountLinks(customer: Customer | undefined): React.ReactNode[] | undefined {\n const { myAccountLinks } = this.props.config;\n const payLoad = getPayloadObject('click', this.telemetryContent, '');\n if (!customer || !this.displayName || !myAccountLinks || !ArrayExtensions.hasElements(myAccountLinks)) {\n return undefined;\n }\n return myAccountLinks.map((cta: IMyAccountLinksData, index: number) => {\n payLoad.contentAction.etext = cta.linkText;\n const attributes = getTelemetryAttributes(this.telemetryContent, payLoad);\n const editableLink: MsDyn365.ILinksData = {\n ariaLabel: cta.ariaLabel,\n className: 'ms-signin-info__account-link-button',\n linkText: cta.linkText,\n linkUrl: cta.linkUrl.destinationUrl,\n openInNewTab: cta.openInNewTab,\n role: 'link',\n additionalProperties: attributes\n };\n\n return (\n <MsDyn365.Link\n key={index}\n link={editableLink}\n editProps={{ onTextChange: this.handleLinkTextChange(index), requestContext: this.props.context.request }}\n />\n );\n });\n }\n\n private _toggleNavbar(): void {\n this.setState({\n mobileMenuCollapsed: !this.state.mobileMenuCollapsed\n });\n }\n\n private _togglePopover(): void {\n this.setState({\n signinPopoverOpen: !this.state.signinPopoverOpen\n });\n }\n\n private _keydown(event: KeyboardEvent): void {\n if (event.keyCode === KeyCodes.Escape) {\n this.setState({ mobileMenuCollapsed: true });\n }\n }\n}\n\nexport default Header;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IHeaderViewProps } from './header';\n\nconst headerView: React.FC<IHeaderViewProps> = props => {\n const {\n HeaderTag,\n HeaderContainer,\n HeaderTopBarContainer,\n MobileMenuContainer,\n MobileMenuBodyContainer,\n MobileMenuLinksContainer,\n Divider\n } = props;\n return (\n <Module {...HeaderTag}>\n <Node {...HeaderContainer}>\n <Node {...HeaderTopBarContainer}>\n {props.navIcon}\n {props.logo}\n {_renderReactFragment(props.search)}\n {props.preferredStore}\n {_renderDesktopAccountBlock(props)}\n {props.wishListIconDesktop}\n <Node {...Divider} />\n {props.cartIcon}\n {_renderReactFragment(props.siteOptions)}\n </Node>\n <Node {...MobileMenuContainer}>\n <Node {...MobileMenuBodyContainer}>\n {props.MobileMenuHeader}\n {_renderReactFragment(props.menuBar)}\n <Node {...MobileMenuLinksContainer}>\n {props.accountLinks ? props.accountLinks.map(link => link) : false}\n {props.siteOptions}\n {props.wishListIconMobile}\n {props.signInLink}\n {props.signOutLink}\n </Node>\n </Node>\n </Node>\n {_renderReactFragment(props.menuBar)}\n </Node>\n </Module>\n );\n};\n\nfunction _renderDesktopAccountBlock(props: IHeaderViewProps): JSX.Element | null {\n const {\n AccountInfoDropdownParentContainer,\n AccountInfoDropdownPopoverConentContainer,\n accountInfoDropdownButton,\n signOutLink,\n signInLink,\n accountLinks\n } = props;\n\n if (AccountInfoDropdownParentContainer) {\n if (AccountInfoDropdownPopoverConentContainer) {\n return (\n <Node {...AccountInfoDropdownParentContainer}>\n {accountInfoDropdownButton}\n <Node {...AccountInfoDropdownPopoverConentContainer}>\n {accountLinks ? accountLinks.map(link => link) : false}\n {signOutLink}\n </Node>\n </Node>\n );\n } else if (signInLink) {\n return <Node {...AccountInfoDropdownParentContainer}>{signInLink}</Node>;\n }\n }\n props.context.telemetry.error('Header content is empty, module wont render.');\n return null;\n}\n\nfunction _renderReactFragment(items: React.ReactNode[]): JSX.Element | null {\n return (\n <>\n {items && items.length > 0\n ? items.map((slot: React.ReactNode, index: number) => {\n return <React.Fragment key={index}>{slot}</React.Fragment>;\n })\n : null}\n </>\n );\n}\n\nexport default headerView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, { getCatalogId, getUrlSync, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n convertProductDimensionTypeToDimensionTypes,\n getFallbackImageUrl,\n getProductUrlSync,\n ObjectExtensions,\n Random,\n StringExtensions\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, IModuleProps, isMobile, VariantType, INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\nimport { RemoveFromComparisonButtonComponent } from '../product-comparison';\nimport { ProductComparisonState } from '../product-comparison-state';\nimport {\n getProductsInPreviewProductComparisonAction,\n GetProductsInPreviewProductComparisonInput,\n IProductComparisonProductData\n} from './actions';\nimport { IProductComparisonPreviewData } from './product-comparison-preview.data';\nimport { IProductComparisonPreviewProps } from './product-comparison-preview.props.autogenerated';\n\n/**\n * Represents product comparison view props for main product info.\n */\nexport interface IProductComparisonPreviewProductMainInfo {\n productData: IProductComparisonProductData;\n productNameLink?: string;\n\n removeFromComparisonButton: React.ReactNode;\n productImage: React.ReactNode;\n productLink: React.ReactNode;\n}\n\n/**\n * Represents product comparison view props.\n */\nexport interface IProductComparisonPreviewViewProps extends IProductComparisonPreviewProps<{}> {\n moduleProps: IModuleProps;\n collapseButton: INodeProps;\n isMainContentReady: boolean;\n\n hasUserInteractedWithComparison?: boolean;\n isExpanded?: boolean;\n subheaderText?: string;\n productsMainInfo?: IProductComparisonPreviewProductMainInfo[];\n previewGreyPlaceHolders?: React.ReactNode;\n\n productComparisonLink?: string;\n goToComparisonButton?: React.ReactNode;\n clearAllButton?: React.ReactNode;\n\n handleCollapseClick?(): void;\n clearAllProductsFromTheComparison?(): void;\n removeProductFromList?(itemId: string): void;\n}\n\n/**\n * Extended props for the module including info about the product.\n */\nexport interface IProductComparisonPreviewState {\n isExpanded?: boolean;\n productsData?: IProductComparisonProductData[];\n greyPlaceHoldersCount?: number;\n}\n\n/**\n * Extended props for the module including info about the product.\n */\nexport interface IProductComparisonPreviewFullProps extends IProductComparisonPreviewProps<IProductComparisonPreviewData> {}\n\n/**\n * Represents the component which renders product comparison table.\n */\nexport class ProductComparisonPreview extends React.PureComponent<IProductComparisonPreviewFullProps, IProductComparisonPreviewState> {\n public static readonly className = 'ms-product-comparison-preview';\n\n public static readonly containerClassName = `${ProductComparisonPreview.className}__container`;\n\n public static readonly mainContainerClassName = `${ProductComparisonPreview.containerClassName}__main-container`;\n\n public static readonly headerClassName = `${ProductComparisonPreview.mainContainerClassName}__header`;\n\n public static readonly headerLabelClassName = `${ProductComparisonPreview.headerClassName}__label`;\n\n public static readonly tableClassName = `${ProductComparisonPreview.mainContainerClassName}__table`;\n\n public static readonly tableRowClassName = `${ProductComparisonPreview.tableClassName}__product-row`;\n\n public static readonly footerClassName = `${ProductComparisonPreview.mainContainerClassName}__footer`;\n\n public static readonly collapseButtonClassName = `${ProductComparisonPreview.headerClassName}__collapse`;\n\n public static _displayedInstanceId?: string;\n\n private readonly _instanceId: string;\n\n private _hasUserInteractedWithComparison: boolean;\n\n public constructor(props: IProductComparisonPreviewFullProps) {\n super(props);\n\n this.state = {};\n\n this._instanceId = `${ProductComparisonPreview.className}-${this.props.id}-${Random.Guid.generateGuid()}`;\n ProductComparisonPreview._displayedInstanceId = this._instanceId;\n\n this._hasUserInteractedWithComparison = false;\n }\n\n public componentDidMount(): void {\n if (this._instanceId !== ProductComparisonPreview._displayedInstanceId) {\n return;\n }\n\n this._loadProducts();\n ProductComparisonState.instance(this.props.context.request).listModifiedEvent.subscribe({\n instanceId: this._instanceId,\n\n /**\n * Updates the state in case the state for the particular product was changed.\n */\n handler: () => {\n this._hasUserInteractedWithComparison = true;\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data downloading.\n this._loadProducts();\n }\n });\n }\n\n public componentWillUnmount(): void {\n ProductComparisonState.instance(this.props.context.request).listModifiedEvent.unsubscribe(this._instanceId);\n }\n\n public render(): React.ReactNode {\n if (this._instanceId !== ProductComparisonPreview._displayedInstanceId) {\n return null;\n }\n\n const viewProps: IProductComparisonPreviewViewProps = {\n ...this.props,\n moduleProps: {\n moduleProps: this.props,\n className: ProductComparisonPreview.className,\n id: this._instanceId\n },\n collapseButton: this._renderCollapseButton(),\n isMainContentReady: false,\n hasUserInteractedWithComparison: this._hasUserInteractedWithComparison\n };\n\n const productData = this._getProdutComparisonDataByCatalogId(this.state.productsData ?? this.props.data.productsData?.result);\n\n if (!ArrayExtensions.hasElements(productData)) {\n return this.props.renderView(viewProps);\n }\n\n viewProps.isMainContentReady = true;\n\n const productsLimit = this._getProductsLimit();\n if (!ObjectExtensions.isNullOrUndefined(productsLimit)) {\n viewProps.subheaderText = this.props.resources.productComparisonPreviewHeaderTextWithLimit\n .replace('{0}', productData.length.toString())\n .replace('{1}', productsLimit.toString());\n }\n\n viewProps.isExpanded = this.state.isExpanded;\n viewProps.handleCollapseClick = this._handleCollapseClick;\n viewProps.productsMainInfo = this._getProductsMainInfo(productData);\n viewProps.previewGreyPlaceHolders = this._renderGreyPlaceHolders(productData);\n viewProps.productComparisonLink = getUrlSync('product-comparison', this.props.context.actionContext);\n viewProps.clearAllProductsFromTheComparison = this._clearAllProductsFromTheComparison;\n viewProps.removeProductFromList = this._removeProductFromList;\n viewProps.goToComparisonButton = this._renderGoToComparisonButton(viewProps.productComparisonLink);\n viewProps.clearAllButton = this._renderClearAllButton();\n\n return this.props.renderView(viewProps);\n }\n private _getProdutComparisonDataByCatalogId(productData: IProductComparisonProductData[] | undefined): IProductComparisonProductData[] {\n const catalogId = getCatalogId(this.props.context.request);\n const productByCatalogId = productData?.filter(product => product.catalogId === catalogId) ?? [];\n return productByCatalogId;\n }\n private async _loadProducts(): Promise<void> {\n const items = ProductComparisonState.instance(this.props.context.request).items;\n const input = new GetProductsInPreviewProductComparisonInput(items);\n const productData = await getProductsInPreviewProductComparisonAction(input, this.props.context.actionContext);\n const productDataByCatalogId = this._getProdutComparisonDataByCatalogId(productData);\n this.setState({ productsData: productDataByCatalogId });\n this._getGreyPlaceHoldersCount(productDataByCatalogId);\n }\n\n private _getGreyPlaceHoldersCount(productData: IProductComparisonProductData[]): number | undefined {\n if (productData && ArrayExtensions.hasElements(productData)) {\n const limit = this._getProductsLimit();\n if (limit && this.props.context.app.config.displayGreyPlaceHolders) {\n const placeHolder = limit - productData.length;\n this.setState({ greyPlaceHoldersCount: placeHolder });\n return placeHolder;\n }\n }\n return;\n }\n\n private _getProductsMainInfo(products: IProductComparisonProductData[]): IProductComparisonPreviewProductMainInfo[] {\n const productImageContainerClassName = `${ProductComparisonPreview.tableRowClassName}__product-image-container`;\n const productImageClassName = `${productImageContainerClassName}__product-image`;\n const productNameClassName = `${ProductComparisonPreview.tableRowClassName}__product-name`;\n\n return products.map(productData => {\n const product = productData.product;\n\n let productNameLink: string | undefined;\n if (msdyn365Commerce.isBrowser) {\n const productUrl = getProductUrlSync(product, this.props.context.actionContext);\n const fullUrl = new URL(productUrl, window.location.href);\n if (this.props.context.request.user.isB2b) {\n fullUrl.searchParams.set('catalogid', `${productData.catalogId}`);\n }\n product.Dimensions?.map(dimension => {\n const dimensionValue = dimension.DimensionValue?.Value;\n if (!StringExtensions.isNullOrWhitespace(dimensionValue)) {\n const dimensionName = convertProductDimensionTypeToDimensionTypes(dimension.DimensionTypeValue);\n fullUrl.searchParams.set(dimensionName, dimensionValue!);\n }\n });\n productNameLink = fullUrl.href;\n }\n\n return {\n productNameLink,\n productData,\n removeFromComparisonButton: (\n <RemoveFromComparisonButtonComponent\n className={`${ProductComparisonPreview.tableRowClassName}__remove`}\n resources={this.props.resources}\n itemId={productData.itemId}\n onClickHandler={this._removeProductFromList}\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{}}\n />\n ),\n productImage: (\n <a className={productImageContainerClassName} href={productNameLink}>\n {this._renderProductImage(productImageClassName, productData.product)}\n </a>\n ),\n productLink: (\n <a className={productNameClassName} href={productNameLink}>\n {productData.product.Name}\n </a>\n )\n };\n });\n }\n\n /**\n * Represents product comparison preview view.\n * @returns Elements.\n */\n private _renderGreyPlaceHolders = (productData: IProductComparisonProductData[]): React.ReactNode[] | undefined => {\n const counts = this.state.greyPlaceHoldersCount;\n if (this.props.context.app.config.displayGreyPlaceHolders && counts! > 0) {\n const elements = [];\n for (let index = 0; index < counts!; index++) {\n elements.push(\n <td className='' key={index}>\n <div className='placeholder-preview' />\n </td>\n );\n }\n return elements;\n }\n return;\n };\n\n /**\n * Removes the product from a list.\n * @param itemId - The id of a product to remove.\n */\n private readonly _removeProductFromList = (itemId: string): void => {\n ProductComparisonState.instance(this.props.context.request).removeItemById(itemId);\n this.setState(previousState => {\n return {\n productsData: previousState.productsData?.filter(item => item.itemId !== itemId)\n };\n });\n };\n\n /**\n * Toggle collapsing.\n */\n private readonly _handleCollapseClick: () => void = () => {\n this.setState(previousState => {\n return {\n isExpanded: !(previousState.isExpanded ?? this._hasUserInteractedWithComparison)\n };\n });\n };\n\n /**\n * Removes all products from the comparison.\n */\n private readonly _clearAllProductsFromTheComparison = () => {\n ProductComparisonState.instance(this.props.context.request).clearAll();\n this.setState({ productsData: [] });\n };\n\n private _getProductsLimit(): number | undefined {\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n if (viewport === 'xs' || viewport === 'sm') {\n return this.props.context.app.config.productComparisonMobileProductsLimit;\n }\n return this.props.context.app.config.productComparisonDesktopProductsLimit;\n }\n\n /**\n * Retrieves product image react node.\n * @param className - Class name to use.\n * @param product - Product info.\n * @returns React node.\n */\n private _renderProductImage(className: string, product?: SimpleProduct): React.ReactNode | undefined {\n if (ObjectExtensions.isNullOrUndefined(product)) {\n return undefined;\n }\n\n const defaultImageSettingQ = 'w=140&h=140&m=6';\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: defaultImageSettingQ, w: 0, h: 0 },\n lg: { q: defaultImageSettingQ, w: 0, h: 0 },\n xl: { q: defaultImageSettingQ, w: 0, h: 0 }\n },\n lazyload: true\n };\n\n return (\n <Image\n key={product.Name}\n src={product.PrimaryImageUrl ?? ''}\n fallBackSrc={getFallbackImageUrl(product.ItemId, this.props.context.actionContext.requestContext.apiSettings) ?? ''}\n gridSettings={this.props.context.request.gridSettings!}\n imageSettings={defaultImageSettings}\n loadFailureBehavior='empty'\n className={className}\n requestContext={this.props.context.actionContext.requestContext}\n />\n );\n }\n\n private _renderCollapseButton(): INodeProps {\n const shouldBeExpanded = this.state.isExpanded ?? this._hasUserInteractedWithComparison;\n const headerContainerClassName = `${ProductComparisonPreview.mainContainerClassName}__header_button`;\n let collapseClassName = `${ProductComparisonPreview.collapseButtonClassName}__expanded`;\n if (!shouldBeExpanded) {\n collapseClassName = `${ProductComparisonPreview.collapseButtonClassName}__collapsed`;\n }\n\n return {\n className: classnames(headerContainerClassName, ProductComparisonPreview.collapseButtonClassName, collapseClassName),\n onClick: this._handleCollapseClick,\n role: 'button',\n tabIndex: 0\n };\n }\n\n private _renderGoToComparisonButton(productComparisonLink: string | undefined): React.ReactNode {\n return (\n <Button\n className={`${ProductComparisonPreview.footerClassName}__go-to-comparison`}\n href={productComparisonLink}\n title={this.props.resources.productComparisonCompareProductsButtonText}\n >\n {this.props.resources.productComparisonCompareProductsButtonText}\n </Button>\n );\n }\n\n private _renderClearAllButton(): React.ReactNode {\n return (\n <Button\n className={`${ProductComparisonPreview.footerClassName}__clear-all`}\n title={this.props.resources.productComparisonClearAllProductsButtonText}\n onClick={this._clearAllProductsFromTheComparison}\n >\n {this.props.resources.productComparisonClearAllProductsButtonText}\n </Button>\n );\n }\n}\n\nexport default ProductComparisonPreview;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce from '@msdyn365-commerce/core';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IProductComparisonPreviewViewProps, ProductComparisonPreview } from './product-comparison-preview';\n\n/**\n * Represents product comparison preview view.\n * @param props - View props for product comparison preview.\n * @returns Functional component of product comparison preview.\n */\nexport const ProductComparisonPreviewViewFunctionalComponent: React.FC<IProductComparisonPreviewViewProps> = props => {\n if (!props.isMainContentReady) {\n return null;\n }\n\n const shouldBeExpanded = props.isExpanded ?? props.hasUserInteractedWithComparison;\n\n const containerClassName = classnames(\n ProductComparisonPreview.mainContainerClassName,\n shouldBeExpanded ? '' : `${ProductComparisonPreview.mainContainerClassName}__collapsed`\n );\n\n return (\n <Module {...props.moduleProps}>\n <Node className={ProductComparisonPreview.containerClassName}>\n <Node className={containerClassName}>\n <Node className={`${ProductComparisonPreview.mainContainerClassName}__header__section`}>\n <Node {...props.collapseButton}>\n <Node className={ProductComparisonPreview.headerClassName}>\n <Node className={ProductComparisonPreview.headerLabelClassName}>\n <Node className={`${ProductComparisonPreview.headerLabelClassName}__icon`} />\n <Node className={`${ProductComparisonPreview.headerLabelClassName}__main-text`}>\n {props.resources.productComparisonPreviewHeaderText}\n </Node>\n <Node className={`${ProductComparisonPreview.headerLabelClassName}__sub-text`}>\n {props.subheaderText}\n </Node>\n </Node>\n </Node>\n </Node>\n <Node className={ProductComparisonPreview.tableClassName} tag='table'>\n <Node className='' tag='tbody'>\n <Node className={ProductComparisonPreview.tableRowClassName} tag='tr'>\n {props.productsMainInfo?.map(info => {\n return (\n <Node className='' tag='td' key={info.productData.itemId}>\n {info.removeFromComparisonButton}\n {info.productImage}\n </Node>\n );\n })}\n {props.previewGreyPlaceHolders}\n </Node>\n <Node className={ProductComparisonPreview.tableRowClassName} tag='tr'>\n {props.productsMainInfo?.map(info => {\n return (\n <Node className='' tag='td' key={info.productData.itemId}>\n {msdyn365Commerce.isBrowser ? info.productLink : undefined}\n </Node>\n );\n })}\n </Node>\n </Node>\n </Node>\n </Node>\n <Node className={ProductComparisonPreview.footerClassName}>\n {props.clearAllButton}\n {props.goToComparisonButton}\n </Node>\n </Node>\n </Node>\n </Module>\n );\n};\n\nexport default ProductComparisonPreviewViewFunctionalComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getRichTextHtml, ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { AttributeValue } from '@msdyn365-commerce/retail-proxy';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\n/**\n * Represents resources for the component.\n */\nexport interface IProductSpecificationResources {\n productComparisonProductItemSpecificationTrue: string;\n productComparisonProductItemSpecificationFalse: string;\n}\n\n/**\n * Represent configuration of the component.\n */\nexport interface IProductSpecificationProps {\n telemetry: ITelemetry;\n specification?: AttributeValue;\n context: ICoreContext;\n\n resources: IProductSpecificationResources;\n}\n\n/**\n * Represents the product specification values that comes from the server.\n */\nexport enum SpecificationDataTypeValues {\n none = 0,\n currency = 1,\n dateTime = 2,\n decimal = 3,\n integer = 4,\n text = 5,\n boolean = 6,\n video = 40,\n image = 41\n}\n\n/**\n * Represents the component which renders product comparison table.\n */\nexport class ProductSpecification extends React.PureComponent<IProductSpecificationProps> {\n private static _renderCurrencyCell(product: AttributeValue): React.ReactNode | null {\n if (ObjectExtensions.isNullOrUndefined(product.CurrencyValue)) {\n return null;\n }\n\n return (\n <span>\n {product.CurrencyCode}\n {product.CurrencyValue}\n </span>\n );\n }\n\n private static _renderDateTimeCell(product: AttributeValue): React.ReactNode | null {\n if (ObjectExtensions.isFunction(product.DateTimeOffsetValue?.toUTCString)) {\n return null;\n }\n\n return <span>{product.DateTimeOffsetValue!.toUTCString()}</span>;\n }\n\n private static _renderIntegerCell(product: AttributeValue): React.ReactNode | null {\n if (ObjectExtensions.isNullOrUndefined(product.IntegerValue)) {\n return null;\n }\n\n return <span>{product.IntegerValue}</span>;\n }\n\n private static _renderDecimalCell(product: AttributeValue): React.ReactNode | null {\n if (ObjectExtensions.isNullOrUndefined(product.FloatValue)) {\n return null;\n }\n\n return <span>{product.FloatValue}</span>;\n }\n\n private static _renderTextCell(product: AttributeValue): React.ReactNode | null {\n if (ObjectExtensions.isNullOrUndefined(product.TextValue)) {\n return null;\n }\n\n // eslint-disable-next-line react/no-danger -- Implementation is a copy.\n return <span dangerouslySetInnerHTML={getRichTextHtml(product.TextValue)} />;\n }\n\n public constructor(props: IProductSpecificationProps) {\n super(props);\n }\n\n public render(): React.ReactNode | null {\n const specification = this.props.specification;\n if (ObjectExtensions.isNullOrUndefined(specification)) {\n return null;\n }\n\n switch (specification.DataTypeValue) {\n case SpecificationDataTypeValues.none:\n // Return span here instead of null so the row still shows\n return <span />;\n case SpecificationDataTypeValues.currency:\n return ProductSpecification._renderCurrencyCell(specification);\n case SpecificationDataTypeValues.dateTime:\n return ProductSpecification._renderDateTimeCell(specification);\n case SpecificationDataTypeValues.decimal:\n return ProductSpecification._renderDecimalCell(specification);\n case SpecificationDataTypeValues.integer:\n return ProductSpecification._renderIntegerCell(specification);\n case SpecificationDataTypeValues.text:\n return ProductSpecification._renderTextCell(specification);\n case SpecificationDataTypeValues.boolean:\n return this._renderTrueFalseCell(specification);\n case SpecificationDataTypeValues.video:\n this.props.telemetry.warning('Got video specification type, not supported yet so skipping line');\n return null;\n case SpecificationDataTypeValues.image:\n this.props.telemetry.warning('Got image specification type, not supported yet so skipping line');\n return null;\n default:\n this.props.telemetry.warning(`Got unknown specification type ${specification.DataTypeValue ?? 'null'} so skipping line`);\n return null;\n }\n }\n\n private _renderTrueFalseCell(product: AttributeValue): React.ReactNode | null {\n if (product.BooleanValue) {\n return <span>{this.props.resources.productComparisonProductItemSpecificationTrue}</span>;\n }\n return <span>{this.props.resources.productComparisonProductItemSpecificationFalse}</span>;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport React, { useCallback } from 'react';\n\n/**\n * Resources for the remove from comparison button component.\n */\nexport interface IRemoveFromComparisonButtonResources {\n productComparisonRemoveProductFromListAriaLabel: string;\n}\n\n/**\n * The configuration of the remove from comparison button component.\n */\nexport interface IRemoveFromComparisonButtonComponentProps extends IComponentProps {\n className: string;\n itemId: string;\n\n resources: IRemoveFromComparisonButtonResources;\n\n onClickHandler(itemId: string): void;\n}\n\n/**\n * Represents a button which handles adding to product comparison.\n * @param props - Configuration of the component.\n * @returns React functional component.\n */\nconst RemoveFromComparisonButtonFunctionalComponent: React.FC<IRemoveFromComparisonButtonComponentProps> = (\n props: IRemoveFromComparisonButtonComponentProps\n) => {\n const onClick = useCallback(() => {\n props.onClickHandler(props.itemId);\n }, [props]);\n\n const { className } = props;\n\n return <Button className={className} title={props.resources.productComparisonRemoveProductFromListAriaLabel} onClick={onClick} />;\n};\n\n/**\n * Represents a button which handles removing the product from the comparison.\n * @param props - Configuration of the component.\n * @returns React functional component.\n */\nexport const RemoveFromComparisonButtonComponent: React.FunctionComponent<IRemoveFromComparisonButtonComponentProps> = (\n props: IRemoveFromComparisonButtonComponentProps\n) => React.createElement(RemoveFromComparisonButtonFunctionalComponent, props);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { RatingsSummary } from '@msdyn365-commerce/commerce-entities';\nimport { ISwatchItem, PriceComponent, RatingComponent, SwatchComponent } from '@msdyn365-commerce/components';\nimport MsDyn365, { getCatalogId, IImageSettings, Image, msdyn365Commerce, getUrlSync } from '@msdyn365-commerce/core';\nimport { AttributeValue, ProductDimension, ProductDimensionType, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n getFallbackImageUrl,\n getProductUrlSync,\n ObjectExtensions,\n Random,\n StringExtensions,\n convertProductDimensionTypeToDimensionTypes,\n DimensionTypes\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, format, Heading, IModuleProps, INodeProps, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\nimport { debounce } from 'lodash';\n\nimport { ProductComparisonState } from '../product-comparison-state';\nimport {\n getProductsInProductComparisonAction,\n GetProductsInProductComparisonInput,\n IDimensionResult,\n IProductComparisonItemData\n} from './actions';\nimport { ProductSpecification, RemoveFromComparisonButtonComponent } from './base';\nimport { IProductComparisonData } from './product-comparison.data';\nimport { IProductComparisonProps } from './product-comparison.props.autogenerated';\n\n/**\n * Represents product comparison view props for main product info.\n */\nexport interface IProductComparisonProductMainInfo {\n cellContainerProps: INodeProps;\n tableCellProps: INodeProps;\n tableHeaderProps: INodeProps;\n\n product: IProductComparisonItemData;\n productUrl?: string;\n\n isFromCurrentCatalog: boolean;\n\n removeFromComparisonButton: React.ReactNode;\n productImage: React.ReactNode;\n productLink: React.ReactNode;\n productPrice: React.ReactNode;\n quickView: React.ReactNode;\n goToProductDetailsButton: React.ReactNode;\n productRating: React.ReactNode;\n productDescription: React.ReactNode;\n}\n\n/**\n * Specifies the type of selection.\n */\nexport enum SelectionType {\n text = 'text',\n swatch = 'swatch'\n}\n\n/**\n * Represents product comparison view props.\n */\nexport interface IProductComparisonViewProps extends IProductComparisonProps<{}> {\n moduleProps: IModuleProps;\n\n isMainContentReady: boolean;\n isEmptyContent: boolean;\n productCountText?: string;\n\n actionBarContainerProps: INodeProps;\n\n heading: React.ReactNode;\n loading: React.ReactNode;\n emptyComparison: React.ReactNode;\n clearAllButton: React.ReactNode;\n previousClicker: React.ReactNode;\n nextClicker: React.ReactNode;\n backToShopping: React.ReactNode;\n\n productsMainInfo?: IProductComparisonProductMainInfo[];\n\n tableReference?: React.RefObject<HTMLDivElement>;\n\n tableHeaderReference?: React.RefObject<HTMLDivElement>;\n\n tableBodyReference?: React.RefObject<HTMLDivElement>;\n\n tableCellReference?: React.RefObject<HTMLDivElement>;\n\n shouldShowPreviousClicker?: boolean;\n shouldShowNextClicker?: boolean;\n currentClickerPosition?: number;\n\n hoveringCellItemId?: string;\n hoverStateLastUpdate?: number;\n\n uniqueSpecifications?: AttributeValue[];\n uniqueDimensionIds?: number[];\n\n dimensionsProps?: (\n | {\n dimensionId: number;\n dimensionName: string | undefined;\n dimensionClassName: string;\n productDimensionValues: {\n dimensionProps: { RecordId: number; Value: string; DimensionId: number; ImageUrl: string | undefined };\n productMainInfo: IProductComparisonProductMainInfo;\n node: JSX.Element;\n }[];\n }\n | undefined\n )[];\n\n specificationsProps?: {\n specification: AttributeValue;\n specificationClassName: string;\n specificationValues: {\n productSpecification: AttributeValue | undefined;\n productMainInfo: IProductComparisonProductMainInfo;\n node: React.ReactNode;\n }[];\n }[];\n\n clearAllProductsFromComparison(): void;\n removeProductFromList?(itemId: string): void;\n handleScroll?(event: React.UIEvent<HTMLDivElement>): void;\n handleHoverIn?(itemId: string): () => void;\n handleHoverOut?(itemId: string): () => void;\n handlePreviousClick?(): void;\n handleNextClick?(): void;\n}\n\n/**\n * Represents the state of the product comparison component.\n */\nexport interface IProductComparisonState {\n productsData?: IProductComparisonItemData[];\n hoverStateLastUpdate?: number;\n hoveringCellItemId?: string;\n currentClickerPosition?: number;\n}\n\n/**\n * Represents the direction of product clicker.\n */\nexport enum ProductClickerDirections {\n left = 0,\n right = 1\n}\n\n/**\n * Represents the component which renders product comparison table.\n */\nexport class ProductComparison extends React.Component<IProductComparisonProps<IProductComparisonData>, IProductComparisonState> {\n public static readonly className: string = 'msc-product-comparison';\n\n public static readonly mainContainerClassName = `${ProductComparison.className}__main-container`;\n\n public static readonly containerClassName = `${ProductComparison.mainContainerClassName}__container`;\n\n public static readonly tableClassName = `${ProductComparison.containerClassName}__table`;\n\n public static readonly tableHeaderClassName = `${ProductComparison.tableClassName}__header`;\n\n public static readonly productRowClassName = `${ProductComparison.tableHeaderClassName}__product-row`;\n\n public static readonly tableClickerClassName = `${ProductComparison.tableClassName}__clicker`;\n\n public static readonly tableBodyClassName = `${ProductComparison.tableClassName}__body`;\n\n public static readonly tableRowClassName = `${ProductComparison.tableClassName}__row`;\n\n public static readonly dimensionsRowClassName = `${ProductComparison.tableBodyClassName}__dimensions-row`;\n\n public static readonly specificationsRowClassName = `${ProductComparison.tableBodyClassName}__specifications-row`;\n\n public static readonly tableRowContentClassName = `${ProductComparison.tableClassName}__row-content`;\n\n public static readonly tableHeaderCellClassName = `${ProductComparison.tableRowClassName}__header-cell`;\n\n public static readonly tableCellClassName = `${ProductComparison.tableRowClassName}__cell`;\n\n public static readonly actionBarClassName = `${ProductComparison.className}__action-bar`;\n\n public static readonly tableHeaderLockedClassName = `${ProductComparison.tableHeaderClassName}__locked`;\n\n public static readonly tableRowContentInformationClassName = `${ProductComparison.tableRowContentClassName}__information`;\n\n private readonly _tableReference?: React.RefObject<HTMLDivElement>;\n\n private readonly _tableHeaderReference?: React.RefObject<HTMLDivElement>;\n\n private readonly _tableBodyReference?: React.RefObject<HTMLDivElement>;\n\n private readonly _tableCellReference?: React.RefObject<HTMLDivElement>;\n\n private _shouldShowPreviousClicker?: boolean;\n\n private _shouldShowNextClicker?: boolean;\n\n private _hoveringCellItemId?: string;\n\n private readonly _instanceId: string;\n\n private static _getProductsSpecifications(products: IProductComparisonItemData[]): AttributeValue[] {\n const specifications = products.map(product => product.specifications?.specificationsList);\n const allSpecifications: AttributeValue[] = ArrayExtensions.flatten(specifications);\n\n const emptyAttributeValue = 0;\n const specificationNames = ArrayExtensions.validValues(\n allSpecifications\n .filter(specification => specification.AttributeValueId !== emptyAttributeValue)\n .map(specification => specification.Name)\n );\n const uniqueSpecificationNames = ArrayExtensions.unique(specificationNames);\n const uniqueSpecifications = ArrayExtensions.validValues(\n uniqueSpecificationNames.map(name => allSpecifications.find(specification => specification.Name === name))\n );\n\n return uniqueSpecifications;\n }\n\n private static _getProductsDimensions(products: IProductComparisonItemData[]): number[] {\n const dimensions = products.map(product => product.productInfo.Dimensions);\n const allDimensions: ProductDimension[] = ArrayExtensions.flatten(dimensions).filter(\n dimension => !ObjectExtensions.isNullOrUndefined(dimension.DimensionValue)\n );\n\n const dimensionIds = ArrayExtensions.validValues(allDimensions.map(dimension => dimension.DimensionTypeValue));\n const uniqueDimensionIds = ArrayExtensions.unique(dimensionIds);\n\n return uniqueDimensionIds;\n }\n\n private static _renderProductDescription(product?: SimpleProduct): React.ReactNode {\n if (StringExtensions.isNullOrWhitespace(product?.Description)) {\n return null;\n }\n return <p className={`${ProductComparison.className}__description`}>{product!.Description}</p>;\n }\n\n private static _getActionBarContainerProps(): INodeProps {\n return {\n className: ProductComparison.actionBarClassName\n };\n }\n\n public constructor(props: IProductComparisonProps<IProductComparisonData>) {\n super(props);\n\n this._instanceId = `${ProductComparison.className}-${this.props.id}-${Random.Guid.generateGuid()}`;\n\n this.state = {\n productsData: undefined,\n hoverStateLastUpdate: Date.now(),\n hoveringCellItemId: undefined,\n currentClickerPosition: 0\n };\n\n this._tableReference = React.createRef<HTMLDivElement>();\n this._tableHeaderReference = React.createRef<HTMLDivElement>();\n this._tableBodyReference = React.createRef<HTMLDivElement>();\n this._tableCellReference = React.createRef<HTMLDivElement>();\n }\n\n public componentDidMount(): void {\n this._loadProducts();\n ProductComparisonState.instance(this.props.context.request).listModifiedEvent.subscribe({\n instanceId: this._instanceId,\n\n /**\n * Updates the state in case the state for the particular product was changed.\n */\n handler: () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Initialize data downloading.\n this._loadProducts();\n }\n });\n if (MsDyn365.isBrowser) {\n window.addEventListener('scroll', () => {\n this._configureBoxShadowOnScroll();\n });\n }\n this._configureBoxShadowOnScroll();\n }\n\n public componentWillUnmount(): void {\n ProductComparisonState.instance(this.props.context.request).listModifiedEvent.unsubscribe(this._instanceId);\n }\n\n public shouldComponentUpdate(\n nextProps: Readonly<IProductComparisonProps<IProductComparisonData>>,\n nextState: Readonly<IProductComparisonState>\n ): boolean {\n if (this.state.productsData !== nextState.productsData || this.props !== nextProps) {\n return true;\n }\n\n return (\n this.state.hoveringCellItemId !== nextState.hoveringCellItemId ||\n this.state.currentClickerPosition !== nextState.currentClickerPosition\n );\n }\n\n public render(): React.ReactNode | null {\n const viewProps: IProductComparisonViewProps = {\n ...this.props,\n moduleProps: {\n moduleProps: this.props,\n className: ProductComparison.className\n },\n clearAllProductsFromComparison: this._clearAllProductsFromComparison,\n isMainContentReady: false,\n isEmptyContent: false,\n heading: this._renderHeading(),\n loading: this._renderLoading(),\n clearAllButton: this._renderClearAllButton(),\n actionBarContainerProps: ProductComparison._getActionBarContainerProps(),\n previousClicker: this._renderPreviousClicker(),\n nextClicker: this._renderNextClicker(),\n backToShopping: this._renderBackToShoppingButton(),\n emptyComparison: (\n <div className={`${ProductComparison.className}__empty-container`}>{this.props.slots.emptyComparisonContentSlots}</div>\n )\n };\n\n const productsData = this.state.productsData ?? this._getProductComparisonDataByCatalogId(this.props.data.productsData?.result);\n if (productsData === undefined) {\n return this.props.renderView(viewProps) as React.ReactNode;\n }\n\n const isConsentGiven = this.props.context.request.cookies.isConsentGiven();\n if (!isConsentGiven || !ArrayExtensions.hasElements(productsData)) {\n viewProps.isEmptyContent = true;\n return this.props.renderView(viewProps) as React.ReactNode;\n }\n\n if (ArrayExtensions.hasElements(productsData)) {\n viewProps.productCountText = this.props.resources.productComparisonCountText.replace('{0}', productsData.length.toString());\n }\n\n this._checkClickersState();\n const productsMainInfoData = this._getProductsMainInfo(productsData);\n const allUniqueDimensionIds = this.getProductsDimensionsIds(productsData);\n const updatedDimensionProps: (\n | {\n dimensionId: number;\n dimensionName: string | undefined;\n dimensionClassName: string;\n productDimensionValues: {\n dimensionProps: { RecordId: number; Value: string; DimensionId: number; ImageUrl: string | undefined };\n productMainInfo: IProductComparisonProductMainInfo;\n node: JSX.Element;\n }[];\n }\n | undefined\n )[] = [];\n allUniqueDimensionIds?.map(dimension => {\n const dimensionValue = this.getUpdatedDimensionsProps(dimension, productsMainInfoData);\n updatedDimensionProps.push(dimensionValue);\n return updatedDimensionProps;\n });\n viewProps.isMainContentReady = true;\n viewProps.tableReference = this._tableReference;\n viewProps.tableHeaderReference = this._tableHeaderReference;\n viewProps.tableBodyReference = this._tableBodyReference;\n viewProps.tableCellReference = this._tableCellReference;\n viewProps.hoverStateLastUpdate = this.state.hoverStateLastUpdate;\n viewProps.hoveringCellItemId = this.state.hoveringCellItemId;\n viewProps.shouldShowPreviousClicker = this._shouldShowPreviousClicker;\n viewProps.shouldShowNextClicker = this._shouldShowNextClicker;\n viewProps.currentClickerPosition = this.state.currentClickerPosition;\n viewProps.handlePreviousClick = this._handlePreviousClick;\n viewProps.handleNextClick = this._handleNextClick;\n viewProps.handleScroll = this._handleScroll;\n viewProps.handleHoverIn = this._handleHoverIn;\n viewProps.handleHoverOut = this._handleHoverOut;\n viewProps.removeProductFromList = this._removeProductFromList;\n viewProps.productsMainInfo = productsMainInfoData;\n viewProps.uniqueDimensionIds = ProductComparison._getProductsDimensions(productsData);\n viewProps.dimensionsProps = updatedDimensionProps;\n viewProps.uniqueSpecifications = ProductComparison._getProductsSpecifications(productsData);\n viewProps.specificationsProps = this._getSpecificationProps(viewProps.uniqueSpecifications, viewProps.productsMainInfo);\n\n return this.props.renderView(viewProps) as React.ReactNode;\n }\n\n /**\n * Removes all product from the comparison list.\n */\n private readonly _clearAllProductsFromComparison = (): void => {\n ProductComparisonState.instance(this.props.context.request).clearAll();\n this.setState({ productsData: [] });\n };\n\n /**\n * Configures box shadow on scroll.\n */\n private readonly _configureBoxShadowOnScroll = (): void => {\n const defaultValue = 0;\n if (this._tableReference?.current) {\n const comparisonProductCardHeader: HTMLCollectionOf<Element> = this._tableReference.current.getElementsByClassName(\n ProductComparison.tableHeaderClassName\n );\n if (ArrayExtensions.hasElements(Array.from(comparisonProductCardHeader))) {\n if (MsDyn365.isBrowser && document.documentElement.scrollTop > defaultValue) {\n comparisonProductCardHeader[0].classList.add(ProductComparison.tableHeaderLockedClassName);\n } else {\n comparisonProductCardHeader[0].classList.remove(ProductComparison.tableHeaderLockedClassName);\n }\n }\n }\n };\n\n private _getProductComparisonDataByCatalogId(\n productData: IProductComparisonItemData[] | undefined\n ): IProductComparisonItemData[] | undefined {\n const catalogId = getCatalogId(this.props.context.request);\n const productByCatalogId = productData?.filter(product => product.catalogId === catalogId) ?? undefined;\n return productByCatalogId;\n }\n\n private async _loadProducts(): Promise<void> {\n const items = ProductComparisonState.instance(this.props.context.request).items;\n const input = new GetProductsInProductComparisonInput(items);\n let productData: IProductComparisonItemData[] | undefined;\n await getProductsInProductComparisonAction(input, this.props.context.actionContext).then(item => {\n productData = item;\n });\n const productDataByCatalogId = this._getProductComparisonDataByCatalogId(productData);\n this.setState({ productsData: productDataByCatalogId });\n }\n\n /**\n * Handles scroll inside table.\n * Used to update header position accordingly to the scroll in table body.\n * @param event - Scroll event.\n */\n private readonly _handleScroll = (event: React.UIEvent<HTMLDivElement>) => {\n this._tableHeaderReference?.current?.scrollTo({ top: event.currentTarget.scrollTop, left: event.currentTarget.scrollLeft });\n this._checkClickersState();\n };\n\n /**\n * Handles product clicker click.\n * Used to update table scroll position accordingly to the clicker.\n * @param direction - Direction of scrolling.\n */\n private readonly _handleScrollClick = (direction: ProductClickerDirections) => {\n const tableBody = this._tableBodyReference?.current;\n if (!tableBody) {\n return;\n }\n\n let cellWidth = this._tableCellReference?.current?.clientWidth;\n if (cellWidth === undefined) {\n cellWidth = this._getCellWidth();\n }\n\n let newLeftPosition: number | undefined;\n const scrollPosition = Math.ceil(tableBody.scrollLeft);\n if (direction === ProductClickerDirections.left) {\n newLeftPosition = scrollPosition - cellWidth;\n const minLeftPosition = 0;\n newLeftPosition = Math.max(newLeftPosition, minLeftPosition);\n } else {\n const maxScroll = tableBody.scrollWidth - tableBody.clientWidth;\n newLeftPosition = scrollPosition + cellWidth;\n newLeftPosition = Math.min(newLeftPosition, maxScroll);\n }\n\n if (MsDyn365.isBrowser && document.body.parentElement?.getAttribute('dir') === 'rtl') {\n newLeftPosition = -newLeftPosition;\n }\n\n tableBody.scrollTo({\n top: tableBody.scrollTop,\n left: newLeftPosition\n });\n\n this.setState(previousState => {\n if (previousState.currentClickerPosition === undefined) {\n return {};\n }\n let change = 1;\n if (direction === ProductClickerDirections.left) {\n change = -1;\n }\n return {\n currentClickerPosition: previousState.currentClickerPosition + change,\n hoverStateLastUpdate: Date.now(),\n hoveringCellItemId: undefined\n };\n });\n\n this._checkClickersState();\n };\n\n /**\n * Handles previous product click.\n * Used to update table scroll position accordingly to the clicker.\n */\n private readonly _handlePreviousClick = () => {\n if (MsDyn365.isBrowser && document.body.parentElement?.getAttribute('dir') === 'rtl') {\n this._handleScrollClick(ProductClickerDirections.right);\n } else {\n this._handleScrollClick(ProductClickerDirections.left);\n }\n };\n\n /**\n * Handles next product click.\n * Used to update table scroll position accordingly to the clicker.\n */\n private readonly _handleNextClick = () => {\n if (MsDyn365.isBrowser && document.body.parentElement?.getAttribute('dir') === 'rtl') {\n this._handleScrollClick(ProductClickerDirections.left);\n } else {\n this._handleScrollClick(ProductClickerDirections.right);\n }\n };\n\n /**\n * Get set width.\n */\n private readonly _getCellWidth = (): number => {\n const tableBody = this._tableBodyReference?.current;\n const viewport = isMobile({ variant: VariantType.Browser, context: this.props.context.request });\n let cellWidth: number = 400;\n\n if (viewport === 'xs' && tableBody) {\n cellWidth = tableBody && tableBody.clientWidth / 2;\n } else if ((viewport === 'sm' || viewport === 'md') && tableBody) {\n cellWidth = tableBody && tableBody.clientWidth / 3;\n } else {\n if (tableBody) {\n cellWidth = tableBody && tableBody.clientWidth / 4;\n }\n }\n\n cellWidth = Math.floor(cellWidth);\n\n return cellWidth;\n };\n\n /**\n * Updates clickers state.\n */\n private readonly _checkClickersState = () => {\n const tableBody = this._tableBodyReference?.current;\n if (!tableBody) {\n return;\n }\n\n const previousScrollMinLimit = 0;\n const maxScroll = tableBody.scrollWidth - tableBody.clientWidth;\n const scrollPosition = Math.ceil(tableBody.scrollLeft);\n\n if (MsDyn365.isBrowser && document.body.parentElement?.getAttribute('dir') === 'rtl') {\n if (scrollPosition <= previousScrollMinLimit) {\n if (this._shouldShowNextClicker) {\n this._shouldShowNextClicker = false;\n this.forceUpdate();\n }\n } else if (!this._shouldShowNextClicker) {\n this._shouldShowNextClicker = true;\n this.forceUpdate();\n }\n\n if (scrollPosition >= maxScroll) {\n if (this._shouldShowPreviousClicker) {\n this._shouldShowPreviousClicker = false;\n this.forceUpdate();\n }\n } else if (!this._shouldShowPreviousClicker) {\n this._shouldShowPreviousClicker = true;\n this.forceUpdate();\n }\n } else {\n if (scrollPosition <= previousScrollMinLimit) {\n if (this._shouldShowPreviousClicker) {\n this._shouldShowPreviousClicker = false;\n this.forceUpdate();\n }\n } else if (!this._shouldShowPreviousClicker) {\n this._shouldShowPreviousClicker = true;\n this.forceUpdate();\n }\n\n if (scrollPosition >= maxScroll) {\n if (this._shouldShowNextClicker) {\n this._shouldShowNextClicker = false;\n this.forceUpdate();\n }\n } else if (!this._shouldShowNextClicker) {\n this._shouldShowNextClicker = true;\n this.forceUpdate();\n }\n }\n };\n\n /**\n * Removes the product from a list.\n * @param itemId - The id of a product to remove.\n */\n private readonly _removeProductFromList = (itemId: string): void => {\n ProductComparisonState.instance(this.props.context.request).removeItemById(itemId);\n this.setState(previousState => {\n let newClickerPosition = previousState.currentClickerPosition;\n if (newClickerPosition && !this._shouldShowNextClicker && this._shouldShowPreviousClicker) {\n newClickerPosition -= 1;\n }\n return {\n productsData: previousState.productsData?.filter(item => item.itemId !== itemId),\n hoverStateLastUpdate: Date.now(),\n hoveringCellItemId: undefined,\n currentClickerPosition: newClickerPosition\n };\n });\n };\n\n /**\n * Prepares quick view component for the given product.\n * @param product - Product information.\n * @returns The quick view component or null if no quick view info is provided.\n */\n private _renderQuickView(product: IProductComparisonItemData): React.ReactNode | null {\n const quickViewSlot = ArrayExtensions.hasElements(this.props.slots.quickViews) ? this.props.slots.quickViews[0] : null;\n if (ObjectExtensions.isNullOrUndefined(quickViewSlot)) {\n return null;\n }\n\n const selectedDimensions = product.productInfo.Dimensions?.filter(dimension => dimension.DimensionValue?.Value);\n\n return React.cloneElement(quickViewSlot as React.ReactElement, {\n selectedProductId: product.productInfo.RecordId,\n selectedDimensions\n });\n }\n\n /**\n * Handles entering into hover mode.\n * @param itemId - Item id of the cell which is hovered.\n * @returns Event handler.\n */\n private readonly _handleHoverIn = (itemId: string) => () => {\n this._hoveringCellItemId = itemId;\n\n this.setState({\n hoverStateLastUpdate: Date.now(),\n hoveringCellItemId: itemId\n });\n };\n\n /**\n * Handles exiting from the hover mode.\n * @param itemId - Item id of the cell which is hovered.\n * @returns Event handler.\n */\n private readonly _handleHoverOut = (itemId: string) => () => {\n if (this._hoveringCellItemId !== itemId) {\n return;\n }\n\n this._hoveringCellItemId = undefined;\n debounce(() => {\n this.setState({\n hoverStateLastUpdate: Date.now(),\n hoveringCellItemId: undefined\n });\n }, 10);\n };\n\n /**\n * Retrieves product image react node.\n * @param className - Class name to use.\n * @param product - Product info.\n * @returns React node.\n */\n private _renderProductImage(className: string, product?: SimpleProduct): React.ReactNode | undefined {\n if (ObjectExtensions.isNullOrUndefined(product)) {\n return undefined;\n }\n\n const defaultImageSettingsQ = 'w=140&h=140&m=6';\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: defaultImageSettingsQ, w: 0, h: 0 },\n lg: { q: defaultImageSettingsQ, w: 0, h: 0 },\n xl: { q: defaultImageSettingsQ, w: 0, h: 0 }\n },\n lazyload: true\n };\n\n return (\n <Image\n altText={product?.Name}\n key={product.Name}\n src={product.PrimaryImageUrl ?? ''}\n fallBackSrc={getFallbackImageUrl(product.ItemId, this.props.context.actionContext.requestContext.apiSettings) ?? ''}\n gridSettings={this.props.context.request.gridSettings!}\n imageSettings={defaultImageSettings}\n loadFailureBehavior='empty'\n className={className}\n requestContext={this.props.context.actionContext.requestContext}\n />\n );\n }\n\n private _getTableHeaderProps(itemId: string): INodeProps {\n const isHoverModeEnabled = this.state.hoveringCellItemId === itemId;\n let headerClassName = ProductComparison.tableHeaderCellClassName;\n if (isHoverModeEnabled) {\n headerClassName = classnames(headerClassName, 'msc-product-comparison__cell-hover');\n }\n return {\n className: headerClassName,\n key: `${headerClassName}__product-${itemId}-${this.state.hoveringCellItemId}-${this.state.currentClickerPosition}`,\n onMouseEnter: this._handleHoverIn(itemId),\n onMouseLeave: this._handleHoverOut(itemId)\n };\n }\n\n private _getTableCellProps(itemId: string): INodeProps {\n const isHoverModeEnabled = this.state.hoveringCellItemId === itemId;\n let cellClassName = ProductComparison.tableCellClassName;\n if (isHoverModeEnabled) {\n cellClassName = classnames(cellClassName, 'msc-product-comparison__cell-hover');\n }\n return {\n className: cellClassName,\n key: `${cellClassName}__product-${itemId}-${this.state.hoveringCellItemId}`,\n onMouseEnter: this._handleHoverIn(itemId),\n onMouseLeave: this._handleHoverOut(itemId),\n role: 'menuitem',\n tabIndex: 0\n };\n }\n\n private _renderProductRating(rating?: RatingsSummary): React.ReactNode {\n if (ObjectExtensions.isNullOrUndefined(rating?.averageRating)) {\n return null;\n }\n\n const ratingValue = rating!;\n\n const defaultReviewsCount = 0;\n\n return (\n <RatingComponent\n avgRating={ratingValue.averageRating!}\n readOnly\n ariaLabel={format(this.props.resources.productComparisonProductItemRatingAriaLabel, ratingValue.averageRating, '5')}\n ratingCount={`${ratingValue.reviewsCount ?? defaultReviewsCount}`}\n shouldShowFullRatingDescription\n data={{}}\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n />\n );\n }\n\n private _renderBackToShoppingButton() {\n return (\n <Button\n className='msc-product-comparison__back-button'\n {...this.props.telemetry}\n role='button'\n href='#'\n onClick={this._goBack}\n title={this.props.resources.backToShoppingLabel}\n >\n {this.props.resources.backToShoppingLabel}\n </Button>\n );\n }\n\n private readonly _goBack = (): void => {\n const backToShoppingUrl = getUrlSync('home', this.props.context.actionContext) || '';\n if (document.referrer === '') {\n window.location.href = backToShoppingUrl;\n } else {\n window.history.back();\n }\n };\n\n /**\n * Retrieves localized text for dimension.\n * @param dimensionId - Dimension id.\n * @returns Localized text.\n */\n private _getDimensionName(dimensionId: number): string | undefined {\n if (dimensionId === ProductDimensionType.Color) {\n return this.props.resources.productComparisonProductItemColorDimension;\n }\n if (dimensionId === ProductDimensionType.Size) {\n return this.props.resources.productComparisonProductItemSizeDimension;\n }\n\n if (dimensionId === ProductDimensionType.Style) {\n return this.props.resources.productComparisonProductItemStyleDimension;\n }\n return undefined;\n }\n\n private getUpdatedDimensionsProps(dimensionId: number, products: IProductComparisonProductMainInfo[]) {\n const dimensionClassName = `${ProductComparison.dimensionsRowClassName}__dimension-${dimensionId}`;\n const dimensionDescription = this._getDimensionName(dimensionId);\n const dimensionName = convertProductDimensionTypeToDimensionTypes(dimensionId);\n let dimensionSelectionType = SelectionType.text;\n\n const dimensionsAsSwatchConfiguration: DimensionTypes[] | undefined = this.props.context.app.config.dimensionsAsSwatchType;\n if (\n ArrayExtensions.hasElements(dimensionsAsSwatchConfiguration) &&\n !dimensionsAsSwatchConfiguration?.includes(DimensionTypes.none) &&\n dimensionsAsSwatchConfiguration?.includes(dimensionName)\n ) {\n dimensionSelectionType = SelectionType.swatch;\n }\n\n const productDimensionValues = products.map(productMainInfo => {\n let dimension: IDimensionResult[] = [];\n let textValue: string = '';\n let renderSwatch: JSX.Element | undefined;\n this.props.data.productsData?.result?.map(productsDimension => {\n if (productsDimension.productInfo.RecordId === productMainInfo.product.productInfo.RecordId) {\n dimension = productsDimension.dimensions?.dimensions ?? [];\n }\n return dimension;\n });\n\n if (dimensionSelectionType === SelectionType.swatch) {\n renderSwatch = (\n <div className='msc-product__dimensions'>\n {dimension.map(dimensionItems => {\n return (\n <div\n className='msc-product__dimensions-item'\n key={`msc-product__dimensions-item-${productMainInfo.product.itemId}`}\n >\n {dimensionItems.result.map(dimensionItem => {\n let currentDimensionId: number | undefined;\n const swatches =\n dimensionItem.map<ISwatchItem>(swatchItem => {\n let isDefaultDimension: boolean = false;\n const selectedDimensions = productMainInfo.product.productInfo.Dimensions?.filter(\n item => item.DimensionTypeValue === swatchItem.DimensionTypeValue\n );\n selectedDimensions?.map(selectedDimension => {\n if (\n selectedDimension.DimensionValue !== undefined &&\n selectedDimension.DimensionValue.DimensionId ===\n swatchItem.DimensionValue?.DimensionId\n ) {\n isDefaultDimension = true;\n }\n return isDefaultDimension;\n });\n\n if (swatchItem.DimensionTypeValue === dimensionId) {\n currentDimensionId = swatchItem.DimensionTypeValue;\n }\n const dimensionType = dimensionName;\n return {\n itemId: `${swatchItem.DimensionValue?.RecordId ?? ''}-${swatchItem.DimensionValue\n ?.Value ?? ''}`,\n value: swatchItem.DimensionValue?.Value ?? '',\n dimensionType,\n colorHexCode: swatchItem.DimensionValue?.ColorHexCode,\n imageUrl: swatchItem.DimensionValue?.ImageUrl,\n isDefault: isDefaultDimension\n };\n }) ?? [];\n if (currentDimensionId && currentDimensionId === dimensionId) {\n return (\n <SwatchComponent\n apiSettings={this.props.context.request.apiSettings}\n list={swatches}\n isSelectionEnabled={false}\n />\n );\n }\n return null;\n })}\n </div>\n );\n })}\n </div>\n );\n }\n\n if (dimensionSelectionType === SelectionType.text) {\n dimension.map(item => {\n return item.result.map(items => {\n return items.map(dimensionItem => {\n if (dimensionItem.DimensionTypeValue === dimensionId) {\n const productDimensionSeperatorValue =\n textValue !== ''\n ? this.props.resources.productDimensionSeparator\n : this.props.resources.productDimensionSeparator.replace('/', '');\n textValue = textValue + format(productDimensionSeperatorValue, dimensionItem.DimensionValue?.Value ?? '');\n }\n return textValue;\n });\n });\n });\n }\n\n const dimensionProps = {\n RecordId: productMainInfo.product.productInfo.RecordId,\n Value: textValue,\n DimensionId: dimensionId,\n ImageUrl: productMainInfo.product.productInfo.PrimaryImageUrl\n };\n\n return {\n dimensionProps,\n productMainInfo,\n node: (\n <div key={`${productMainInfo.product.itemId}-${dimensionClassName}`}>\n {dimensionSelectionType === SelectionType.swatch ? renderSwatch : dimensionProps.Value}\n </div>\n )\n };\n });\n return {\n dimensionId,\n dimensionName: dimensionDescription,\n dimensionClassName,\n productDimensionValues\n };\n }\n private _getSpecificationProps(specifications: AttributeValue[], products: IProductComparisonProductMainInfo[]) {\n return specifications.map(specification => {\n const specificationClassName = `${ProductComparison.specificationsRowClassName}__specification-${specification.Name!}`;\n\n const specificationValues = products.map(productMainInfo => {\n const productSpecification = productMainInfo.product.specifications?.specificationsList.find(\n productSpecifications => productSpecifications.Name === specification.Name\n );\n\n return {\n productSpecification,\n productMainInfo,\n node: (\n <div key={`${productMainInfo.product.itemId}-${specificationClassName}`}>\n <ProductSpecification\n specification={productSpecification}\n telemetry={this.props.telemetry}\n context={this.props.context}\n resources={this.props.resources}\n />\n </div>\n )\n };\n });\n\n return {\n specification,\n specificationClassName,\n specificationValues\n };\n });\n }\n\n private _renderHeading(): React.ReactNode {\n return <Heading className={`${ProductComparison.className}__header`} text={this.props.resources.productComparisonTitle} />;\n }\n\n private _renderLoading(): React.ReactNode {\n return <div className={`${ProductComparison.className}__loading`}>{this.props.resources.productComparisonLoadingText}</div>;\n }\n\n private _renderClearAllButton(): React.ReactNode {\n return (\n <Button\n className={`${ProductComparison.actionBarClassName}__clear-all-button`}\n aria-label={this.props.resources.productComparisonClearAllButtonAriaLabel}\n onClick={this._clearAllProductsFromComparison}\n >\n {this.props.resources.productComparisonClearAllButtonText}\n </Button>\n );\n }\n\n /**\n * Retrieves unique dimension ids of product.\n * @param products - Product.\n * @returns Unique dimension ids.\n */\n private getProductsDimensionsIds(products: IProductComparisonItemData[]): number[] {\n const dimensions = products.map(product => product.productInfo.Dimensions);\n const allDimensions: ProductDimension[] = ArrayExtensions.flatten(dimensions);\n\n const dimensionIds = ArrayExtensions.validValues(allDimensions.map(dimension => dimension.DimensionTypeValue));\n const uniqueDimensionIds = ArrayExtensions.unique(dimensionIds);\n\n return uniqueDimensionIds;\n }\n\n private _renderPreviousClicker(): React.ReactNode {\n return (\n <Button\n className={classnames(ProductComparison.tableClickerClassName, `${ProductComparison.tableClickerClassName}__previous`)}\n role='button'\n onClick={this._handlePreviousClick}\n onKeyUp={this._handlePreviousClick}\n >\n <span className={`${ProductComparison.tableClickerClassName}__previous__icon`} aria-hidden='true' />\n <span className='screen-reader-only'>{this.props.resources.productComparisonPreviousProduct}</span>\n </Button>\n );\n }\n\n private _renderNextClicker(): React.ReactNode {\n return (\n <Button\n className={classnames(ProductComparison.tableClickerClassName, `${ProductComparison.tableClickerClassName}__next`)}\n role='button'\n onClick={this._handleNextClick}\n onKeyUp={this._handleNextClick}\n >\n <span className={`${ProductComparison.tableClickerClassName}__next__icon`} aria-hidden='true' />\n <span className='screen-reader-only'>{this.props.resources.productComparisonNextProduct}</span>\n </Button>\n );\n }\n\n private _renderRemoveFromComparisonButton(itemId: string): React.ReactNode {\n return (\n <RemoveFromComparisonButtonComponent\n className={`${ProductComparison.productRowClassName}__remove`}\n key={itemId}\n resources={this.props.resources}\n itemId={itemId}\n onClickHandler={this._removeProductFromList}\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{}}\n />\n );\n }\n\n private _getProductsMainInfo(products: IProductComparisonItemData[]): IProductComparisonProductMainInfo[] {\n const currentCatalogId = getCatalogId(this.props.context.request);\n return products.map(product => {\n let productUrlLink: string | undefined;\n if (msdyn365Commerce.isBrowser) {\n const productUrl = getProductUrlSync(product.productInfo, this.props.context.actionContext);\n const fullUrl = new URL(productUrl, window.location.href);\n if (this.props.context.request.user.isB2b) {\n fullUrl.searchParams.set('catalogid', `${product.catalogId}`);\n }\n product.productInfo.Dimensions?.map(dimension => {\n const dimensionValue = dimension.DimensionValue?.Value;\n if (!StringExtensions.isNullOrWhitespace(dimensionValue)) {\n const dimensionName = convertProductDimensionTypeToDimensionTypes(dimension.DimensionTypeValue);\n fullUrl.searchParams.set(dimensionName, dimensionValue!);\n }\n });\n productUrlLink = fullUrl.href;\n }\n const isHoverModeEnabled = this.state.hoveringCellItemId === product.itemId;\n let cellClassName = ProductComparison.tableHeaderCellClassName;\n if (isHoverModeEnabled) {\n cellClassName = classnames(cellClassName, 'msc-product-comparison__cell-hover');\n }\n const isFromCurrentCatalog = product.catalogId === currentCatalogId;\n\n const productImageContainerClassName = `${ProductComparison.productRowClassName}__product-image-container`;\n const productImageClassName = `${productImageContainerClassName}__product-image`;\n const productNameClassName = `${ProductComparison.productRowClassName}__product-name`;\n const productPriceClassName = `${ProductComparison.productRowClassName}__product-price`;\n const cellNewWidth = this._getCellWidth();\n const style = {\n width: `${cellNewWidth}px`,\n minWidth: `${cellNewWidth}px`,\n maxWidth: `${cellNewWidth}px`\n };\n return {\n cellContainerProps: {\n className: cellClassName,\n key: product.itemId,\n ref: this._tableCellReference,\n onMouseEnter: this._handleHoverIn(product.itemId),\n onMouseLeave: this._handleHoverOut(product.itemId),\n role: 'menuitem',\n tabIndex: 0,\n style: style\n },\n product,\n productUrl: productUrlLink,\n removeFromComparisonButton: this._renderRemoveFromComparisonButton(product.itemId),\n productImage: (\n <div className={productImageContainerClassName} key={product.itemId}>\n {this._renderProductImage(productImageClassName, product.productInfo)}\n </div>\n ),\n productLink: (\n <a className={productNameClassName} href={productUrlLink} key={product.itemId}>\n {product.productInfo.Name}\n </a>\n ),\n productPrice: (\n <div className={productPriceClassName} key={product.itemId}>\n {product.price && (\n <PriceComponent\n context={this.props.context}\n id={this.props.id}\n typeName={this.props.typeName}\n data={{ price: product.price }}\n freePriceText={this.props.resources.productComparisonProductItemFreePrice}\n originalPriceText={this.props.resources.productComparisonProductItemOriginalPrice}\n currentPriceText={this.props.resources.productComparisonProductItemCurrentPrice}\n />\n )}\n </div>\n ),\n quickView: this._renderQuickView(product),\n isFromCurrentCatalog,\n goToProductDetailsButton: (\n <Button href={productUrlLink} title={this.props.resources.productComparisonGoToProductDetailsButtonText}>\n {this.props.resources.productComparisonGoToProductDetailsButtonText}\n </Button>\n ),\n tableCellProps: this._getTableCellProps(product.itemId),\n tableHeaderProps: this._getTableHeaderProps(product.itemId),\n productRating:\n product.rating !== undefined ? <div key={product.itemId}>{this._renderProductRating(product.rating)}</div> : undefined,\n productDescription:\n product.productInfo !== undefined ? (\n <div key={product.itemId}>{ProductComparison._renderProductDescription(product.productInfo)}</div>\n ) : (\n undefined\n )\n };\n });\n }\n}\n\nexport default ProductComparison;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce from '@msdyn365-commerce/core';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { IProductComparisonProductMainInfo, IProductComparisonViewProps, ProductComparison } from './product-comparison';\n\n/**\n * Renders dynamic header values.\n * @param values - cd..info.\n * @param headerName - Header Name.\n * @returns List of react nodes.\n */\nconst renderDynamicHeaderCells = (\n values: {\n productMainInfo: IProductComparisonProductMainInfo;\n node: React.ReactNode;\n }[],\n headerName: string,\n currentClickerPosition?: number\n) => {\n return values.map((value, index) => {\n if (index === currentClickerPosition) {\n return (\n <Node\n {...value.productMainInfo.tableHeaderProps}\n role='menuitem'\n tabindex='0'\n style={value.productMainInfo.cellContainerProps.style}\n >\n {headerName}\n </Node>\n );\n }\n return <Node key={index} {...value.productMainInfo.tableHeaderProps} style={value.productMainInfo.cellContainerProps.style}></Node>;\n });\n};\n\n/**\n * Renders dynamic cell values.\n * @param values - Cells info.\n * @param hoveringCellItemId - Currently hovered cell.\n * @returns List of react nodes.\n */\nconst renderDynamicCells = (\n values: {\n productMainInfo: IProductComparisonProductMainInfo;\n node: React.ReactNode;\n }[],\n hoveringCellItemId: string\n) => {\n return values.map(value => {\n return (\n <Node\n {...value.productMainInfo.tableCellProps}\n key={`${value.productMainInfo.product.itemId}-${hoveringCellItemId}`}\n style={value.productMainInfo.cellContainerProps.style}\n >\n {value.node}\n </Node>\n );\n });\n};\n/**\n * Represents product comparison view.\n * @param props - View props for product comparison.\n * @returns Functional component of product comparison.\n */\nexport const ProductComparisonViewFunctionalComponent: React.FC<IProductComparisonViewProps> = props => {\n return (\n <Module {...props.moduleProps}>\n {props.backToShopping}\n {props.heading}\n <Node className={`${ProductComparison.className}__product_count_text`}>{props.productCountText}</Node>\n {props.isEmptyContent || props.isMainContentReady ? undefined : props.loading}\n {props.isEmptyContent ? props.emptyComparison : undefined}\n <Node {...props.actionBarContainerProps}>\n {!props.isEmptyContent && props.isMainContentReady ? props.clearAllButton : undefined}\n </Node>\n {props.isMainContentReady ? (\n <Node className={ProductComparison.mainContainerClassName}>\n <Node className={ProductComparison.containerClassName}>\n <Node className={ProductComparison.tableClassName} ref={props.tableReference}>\n <Node className={`${ProductComparison.tableHeaderClassName}`}>\n <Node\n className={`${ProductComparison.tableHeaderClassName}__header__container`}\n ref={props.tableHeaderReference}\n >\n {props.shouldShowPreviousClicker && props.previousClicker}\n <Node\n className={classnames(\n ProductComparison.tableRowClassName,\n `${ProductComparison.tableHeaderClassName}__product-row`\n )}\n role='menu'\n >\n {props.productsMainInfo?.map(productMainInfo => {\n const isFromCurrentCatalog = productMainInfo.isFromCurrentCatalog;\n const actionsClassName = `${ProductComparison.productRowClassName}__actions`;\n return (\n <Node\n {...productMainInfo.cellContainerProps}\n key={productMainInfo.cellContainerProps.key as string}\n style={productMainInfo.cellContainerProps.style}\n >\n {productMainInfo.removeFromComparisonButton}\n {productMainInfo.productImage}\n {msdyn365Commerce.isBrowser ? productMainInfo.productLink : undefined}\n {productMainInfo.productPrice}\n <Node className={actionsClassName} key={productMainInfo.product.itemId}>\n {isFromCurrentCatalog\n ? productMainInfo.quickView\n : productMainInfo.goToProductDetailsButton}\n </Node>\n </Node>\n );\n })}\n </Node>\n {props.shouldShowNextClicker && props.nextClicker}\n </Node>\n </Node>\n <Node\n className={ProductComparison.tableBodyClassName}\n onScroll={props.handleScroll}\n ref={props.tableBodyReference}\n >\n {props.productsMainInfo?.map((rating, key) => {\n return rating.productRating !== undefined && key === 0 ? (\n <Node\n className={classnames(\n `${ProductComparison.tableBodyClassName}__rating-row`,\n ProductComparison.tableRowClassName\n )}\n >\n <Node\n className={ProductComparison.tableRowContentClassName}\n key={`rating-${props.currentClickerPosition}`}\n role='menu'\n >\n {props.productsMainInfo?.map((productMainInfo, index) => {\n if (index === props.currentClickerPosition) {\n return (\n <Node\n {...productMainInfo.tableHeaderProps}\n role='menuitem'\n tabindex='0'\n style={productMainInfo.cellContainerProps.style}\n >\n {props.resources.productComparisonProductItemRating}\n </Node>\n );\n }\n return (\n <Node\n key={productMainInfo.tableHeaderProps.key}\n {...productMainInfo.tableHeaderProps}\n role='none'\n tabindex='-1'\n style={productMainInfo.cellContainerProps.style}\n ></Node>\n );\n })}\n </Node>\n <Node\n className={`${ProductComparison.tableRowContentClassName} ${ProductComparison.tableRowContentInformationClassName}`}\n role='menu'\n >\n {props.productsMainInfo?.map(productMainInfo => {\n return (\n <Node\n {...productMainInfo.tableCellProps}\n key={`${productMainInfo.product.itemId}-${props.hoveringCellItemId!}`}\n style={productMainInfo.cellContainerProps.style}\n >\n {productMainInfo.productRating}\n </Node>\n );\n })}\n </Node>\n </Node>\n ) : (\n undefined\n );\n })}\n {props.productsMainInfo?.map((description, key) => {\n return description.productDescription !== undefined && key === 0 ? (\n <Node\n className={classnames(\n `${ProductComparison.tableBodyClassName}__description-row`,\n ProductComparison.tableRowClassName\n )}\n >\n <Node\n className={ProductComparison.tableRowContentClassName}\n key={`description-${props.currentClickerPosition}`}\n role='menu'\n >\n {props.productsMainInfo?.map((productMainInfo, index) => {\n if (index === props.currentClickerPosition) {\n return (\n <Node\n {...productMainInfo.tableHeaderProps}\n role='menuitem'\n tabindex='0'\n style={productMainInfo.cellContainerProps.style}\n >\n {props.resources.productComparisonProductItemDescription}\n </Node>\n );\n }\n return (\n <Node\n key={productMainInfo.tableHeaderProps.key}\n {...productMainInfo.tableHeaderProps}\n role='none'\n tabindex='-1'\n style={productMainInfo.cellContainerProps.style}\n ></Node>\n );\n })}\n </Node>\n <Node\n className={`${ProductComparison.tableRowContentClassName} ${ProductComparison.tableRowContentInformationClassName}`}\n role='menu'\n >\n {props.productsMainInfo?.map(productMainInfo => {\n return (\n <Node\n {...productMainInfo.tableCellProps}\n key={`${productMainInfo.product.itemId}-${props.hoveringCellItemId!}`}\n style={productMainInfo.cellContainerProps.style}\n >\n {productMainInfo.productDescription}\n </Node>\n );\n })}\n </Node>\n </Node>\n ) : (\n undefined\n );\n })}\n {props.dimensionsProps?.map(dimensionProps => {\n return (\n dimensionProps?.dimensionName && (\n <Node\n className={classnames(\n ProductComparison.dimensionsRowClassName,\n ProductComparison.tableRowClassName,\n dimensionProps.dimensionClassName\n )}\n key={dimensionProps.dimensionClassName}\n >\n <Node\n className={ProductComparison.tableRowContentClassName}\n key={`${dimensionProps.dimensionName}-${props.currentClickerPosition}`}\n role='menu'\n >\n {renderDynamicHeaderCells(\n dimensionProps.productDimensionValues,\n dimensionProps.dimensionName,\n props.currentClickerPosition\n )}\n </Node>\n\n <Node\n className={`${ProductComparison.tableRowContentClassName} ${ProductComparison.tableRowContentInformationClassName}`}\n role='menu'\n >\n {renderDynamicCells(dimensionProps.productDimensionValues, props.hoveringCellItemId!)}\n </Node>\n </Node>\n )\n );\n })}\n {props.specificationsProps?.map(specificationProps => {\n return StringExtensions.isNullOrEmpty(specificationProps.specification.TextValue) === false ? (\n <Node\n className={classnames(\n ProductComparison.specificationsRowClassName,\n ProductComparison.tableRowClassName,\n specificationProps.specificationClassName\n )}\n key={specificationProps.specificationClassName}\n >\n <Node\n className={ProductComparison.tableRowContentClassName}\n key={`${specificationProps.specification.Name}-${props.currentClickerPosition}`}\n role='menu'\n >\n {renderDynamicHeaderCells(\n specificationProps.specificationValues,\n specificationProps.specification.Name!,\n props.currentClickerPosition\n )}\n </Node>\n <Node\n className={`${ProductComparison.tableRowContentClassName} ${ProductComparison.tableRowContentInformationClassName}`}\n role='menu'\n >\n {renderDynamicCells(specificationProps.specificationValues, props.hoveringCellItemId!)}\n </Node>\n </Node>\n ) : (\n undefined\n );\n })}\n <Node\n className={classnames(\n `${ProductComparison.tableBodyClassName}__sku-row`,\n ProductComparison.tableRowClassName\n )}\n >\n <Node\n className={ProductComparison.tableRowContentClassName}\n key={`sku-${props.currentClickerPosition}`}\n role='menu'\n >\n {props.productsMainInfo?.map((productMainInfo, index) => {\n if (index === props.currentClickerPosition) {\n return (\n <Node\n {...productMainInfo.tableHeaderProps}\n role='menuitem'\n tabindex='0'\n style={productMainInfo.cellContainerProps.style}\n >\n {props.resources.productComparisonProductItemSku}\n </Node>\n );\n }\n return (\n <Node\n key={productMainInfo.tableHeaderProps.key}\n {...productMainInfo.tableHeaderProps}\n style={productMainInfo.cellContainerProps.style}\n ></Node>\n );\n })}\n </Node>\n <Node\n className={`${ProductComparison.tableRowContentClassName} ${ProductComparison.tableRowContentInformationClassName}`}\n role='menu'\n >\n {props.productsMainInfo?.map(productMainInfo => {\n return (\n <Node\n {...productMainInfo.tableCellProps}\n key={`${productMainInfo.product.itemId}-${props.hoveringCellItemId!}`}\n style={productMainInfo.cellContainerProps.style}\n >\n {productMainInfo.product.productInfo.ItemId}\n </Node>\n );\n })}\n </Node>\n </Node>\n </Node>\n </Node>\n </Node>\n </Node>\n ) : (\n undefined\n )}\n </Module>\n );\n};\n\nexport default ProductComparisonViewFunctionalComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { buildHydratedMockActionContext, buildMockRequest, ICoreContext, IRequestContext } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { AsyncResult, Customer } from '@msdyn365-commerce/retail-proxy';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\n\nimport { IHeaderData } from '../header.data';\nimport { IHeaderConfig, IHeaderResources } from '../header.props.autogenerated';\n\nconst mockRequest: IRequestContext = buildMockRequest();\nmockRequest.gridSettings = {\n xs: { w: 767, h: 0 },\n sm: { w: 991, h: 0 },\n md: { w: 1199, h: 0 },\n lg: { w: 1599, h: 0 },\n xl: { w: 1600, h: 0 }\n};\nmockRequest.user.isAuthenticated = true;\nmockRequest.user.signInUrl = '/signin';\nmockRequest.user.signOutUrl = '/signout';\nmockRequest.user.signUpUrl = '/signup';\n\nconst mockAnonRequest = buildMockRequest();\nmockAnonRequest.user.isAuthenticated = false;\nmockAnonRequest.user.signInUrl = '/signin';\nmockAnonRequest.user.signOutUrl = '/signout';\nmockAnonRequest.user.signUpUrl = '/signup';\n\nconst mockSigninErrorRequest = buildMockRequest();\nmockSigninErrorRequest.user.isAuthenticated = false;\nmockSigninErrorRequest.user.retailServerErrorCode = 'Microsoft_Dynamics_Commerce_Runtime_CustomerNotFound_WhenAutoLinking';\nmockSigninErrorRequest.user.signInUrl = '/signin';\nmockSigninErrorRequest.user.signOutUrl = '/signout';\nmockSigninErrorRequest.user.signUpUrl = '/signup';\n\nconst mockActionContext = buildHydratedMockActionContext();\n\n/**\n * Method to mock auth context.\n */\n// @ts-expect-error\nexport const mockAuthContext: ICoreContext = {\n actionContext: mockActionContext,\n request: mockRequest,\n app: {\n config: {\n disableTooltip: true\n },\n routes: {\n wishlist: '/wishlist'\n }\n }\n};\n\n// @ts-expect-error\nexport const mockAnonContext: ICoreContext = {\n actionContext: mockActionContext,\n request: mockAnonRequest,\n app: {\n config: {\n disableTooltip: true\n },\n routes: {\n wishlist: '/wishlist'\n }\n }\n};\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- Due to partial mock.\n// @ts-expect-error\nexport const mockSigninContext: ICoreContext = {\n actionContext: mockActionContext,\n request: mockSigninErrorRequest,\n app: {\n config: {\n disableTooltip: true\n },\n routes: {\n wishlist: '/wishlist'\n }\n }\n};\n\nexport const mockHeaderConfig: IHeaderConfig = {\n logoLink: {\n linkUrl: {\n destinationUrl: 'https://ppe.fabrikam.com/fe'\n },\n ariaLabel: 'fabrikam'\n },\n logoImage: {\n src: 'https://img-prod-cms-mr-microsoft-com.akamaized.net/cms/api/fabrikam/imageFileData/MA1G3L'\n }\n};\n\nexport const mockResources: IHeaderResources = {\n mobileHamburgerAriaLabel: 'Mobile view hamburger aria label',\n wishlistTooltipText: 'My wishlist',\n cartLabel: 'Shopping bag, ({0}) items',\n cartQtyLabel: '({0})',\n signInLinkText: 'Sign In',\n signInLinkAriaText: 'Sign In',\n signOutLinkText: 'Sign Out',\n signOutLinkAriaText: 'Sign Out',\n shoppingAsText: 'Shopping as {0}',\n switchCustomerLinkText: 'Switch customer',\n switchCustomerLinkAriaText: 'Switch customer',\n headerPreferredStoreText: 'Select store',\n headerPreferredStoreAriaLabel: 'select preferred store',\n signUpCustomerNotFoundTitle: 'Error message if cutsomer not found',\n signUpMultipleCustomerFoundTitle: 'Multiple customer found error msg',\n closeNotificationLabel: 'Close',\n wishlistCountLabel: '({0})',\n headerAriaLabel: 'Header'\n};\n\nexport const getMockData = (totalItemsInCart: number = 0, accountNumber: string = '2', firstName: string = ''): IHeaderData => {\n return {\n cart: <AsyncResult<ICartState>>{\n status: 'SUCCESS',\n result: {\n totalItemsInCart\n }\n },\n accountInformation: <AsyncResult<Customer>>{\n status: 'SUCCESS',\n result: {\n AccountNumber: accountNumber,\n FirstName: firstName\n }\n },\n storeSelectorStateManager: <AsyncResult<IStoreSelectorStateManager>>{\n status: 'SUCCESS',\n result: {}\n }\n };\n};\n\nexport const getMockErrorData = (): IHeaderData => {\n return {\n cart: <AsyncResult<ICartState>>{\n status: 'FAILED',\n result: undefined\n },\n accountInformation: <AsyncResult<Customer>>{\n status: 'FAILED',\n result: undefined\n },\n storeSelectorStateManager: <AsyncResult<IStoreSelectorStateManager>>{\n status: 'FAILED',\n result: undefined\n }\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365 from '@msdyn365-commerce/core';\nimport { IHeaderViewProps, Logo } from '@msdyn365-commerce-modules/header';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IHeaderProps } from '../definition-extensions/header.ext.props.autogenerated';\n\n/**\n * GridSizes.\n */\nexport type GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n *\n * HeaderView component.\n * @extends {React.PureComponent<IHeaderViewProps>}\n */\nexport class HeaderView extends React.PureComponent<IHeaderViewProps & IHeaderProps<{}>> {\n private readonly menuNode: React.RefObject<HTMLDivElement>;\n\n public constructor(props: IHeaderViewProps & IHeaderProps<{}>) {\n super(props);\n this.menuNode = React.createRef();\n }\n\n public componentDidMount(): void {\n if (this.props.config.useStickyHeader) {\n // Set header update methods to trigger on scroll\n if (MsDyn365.isBrowser) {\n window.addEventListener('scroll', () => {\n this._configureStickyHeader();\n });\n }\n this._configureStickyHeader();\n }\n }\n\n public render(): JSX.Element | null {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Cannot change the prop names as props are from business logic.\n const {\n HeaderTag,\n HeaderContainer,\n HeaderTopBarContainer,\n Divider,\n MobileMenuContainer,\n MobileMenuBodyContainer,\n MobileMenuLinksContainer\n } = this.props;\n\n return (\n <Module {...HeaderTag}>\n <Node {...HeaderContainer}>\n <Node {...HeaderTopBarContainer}>\n <div className='desktop-navicon-container' ref={this.menuNode}>\n {this._renderReactFragment(this.props.menuBar)}\n </div>\n <div className='mobile-navicon-container'>{this.props.navIcon}</div>\n {this.props.logo}\n {this._renderMobileLogo()}\n {this._renderReactFragment(this.props.search)}\n {this.props.preferredStore}\n {this._renderAccountBlock(this.props)}\n <Node {...Divider} />\n {this.props.cartIcon}\n {this._renderReactFragment(this.props.siteOptions)}\n </Node>\n <Node {...MobileMenuContainer}>\n <Node {...MobileMenuBodyContainer}>\n {this.props.MobileMenuHeader}\n {this._renderReactFragment(this.props.menuBar)}\n <Node {...MobileMenuLinksContainer}>\n {this.props.accountLinks ? this.props.accountLinks.map(link => link) : false}\n {this.props.siteOptions}\n {this.props.wishListIconMobile}\n {this.props.signInLink}\n {this.props.signOutLink}\n </Node>\n </Node>\n </Node>\n </Node>\n </Module>\n );\n }\n\n /**\n * Function to update header.\n */\n private readonly _configureStickyHeader = (): void => {\n // Get heights of cookie and promotion banners\n const defaultValue = 0;\n const headerAlertsContainer: HTMLElement | null = document.querySelector('.ms-promo-banner');\n const bannerHeights = headerAlertsContainer ? headerAlertsContainer.offsetHeight : defaultValue;\n\n // Triggers opacity change of header\n const headerElement = document.querySelector('header .default-container');\n if (headerElement) {\n if (MsDyn365.isBrowser && document.documentElement.scrollTop > defaultValue) {\n headerElement.classList.add('lock-opaque');\n headerElement.classList.add('fixed');\n } else {\n headerElement.classList.remove('lock-opaque');\n headerElement.classList.remove('fixed');\n }\n }\n\n // Update sticky header position and opacity\n const stickyHeader: HTMLElement | null = document.querySelector('.desktop-navicon-container');\n const headerLogo: HTMLElement | null = document.querySelector('.ms-header__logo');\n\n if (stickyHeader && headerLogo) {\n // Fix center sticky header\n const navStickyPos = headerLogo.offsetHeight + bannerHeights;\n if (MsDyn365.isBrowser && document.documentElement.scrollTop > navStickyPos) {\n stickyHeader.classList.add('fixed');\n } else {\n stickyHeader.classList.remove('fixed');\n }\n }\n };\n\n private _renderMobileLogo(): JSX.Element | null {\n const { config, context, typeName } = this.props;\n return (\n <Logo\n {...{\n link: config.logoLink,\n image: config.mobileLogoImage ?? {},\n className: 'ms-header__mobile-logo',\n gridSettings: context.request.gridSettings,\n requestContext: context.request,\n typeName\n }}\n />\n );\n }\n\n /**\n * Function to render account block.\n * @param props - IHeaderViewProps.\n * @returns Returns JSX.Element | null.\n */\n private readonly _renderAccountBlock = (props: IHeaderViewProps): JSX.Element | null => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Cannot change the prop names as props are from business logic.\n const {\n AccountInfoDropdownParentContainer,\n AccountInfoDropdownPopoverConentContainer,\n accountInfoDropdownButton,\n signInLink\n } = props;\n if (AccountInfoDropdownParentContainer) {\n const accountClassName = classnames(AccountInfoDropdownParentContainer.className, 'account-desktop');\n if (AccountInfoDropdownPopoverConentContainer) {\n return (\n <Node {...AccountInfoDropdownParentContainer} className={accountClassName}>\n {accountInfoDropdownButton}\n <Node {...AccountInfoDropdownPopoverConentContainer}>{this._renderAccountDropdownLinks(props)}</Node>\n </Node>\n );\n } else if (signInLink) {\n return (\n <Node {...AccountInfoDropdownParentContainer} className={accountClassName}>\n {signInLink}\n </Node>\n );\n }\n }\n return null;\n };\n\n private readonly _renderAccountDropdownLinks = (props: IHeaderViewProps): JSX.Element | null => {\n const { isOBORequest, switchCustomerLink, accountLinks, signOutLink } = props;\n if (isOBORequest) {\n return (\n <>\n {switchCustomerLink}\n {signOutLink}\n {accountLinks ? <Node className='ms-profile-button-splitter' /> : false}\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\n </>\n );\n } else {\n return (\n <>\n {accountLinks ? accountLinks.map((link: React.ReactNode) => link) : false}\n {signOutLink}\n </>\n );\n }\n };\n\n /**\n * Function to render react fragment.\n * @param items - React nodes.\n * @returns Returns JSX.Element | null.\n */\n private readonly _renderReactFragment = (items: React.ReactNode[]): JSX.Element | null => {\n return (\n <>\n {ArrayExtensions.hasElements(items)\n ? items.map((slot: React.ReactNode) => {\n return <>{slot}</>;\n })\n : null}\n </>\n );\n };\n}\n\nexport default HeaderView;\n"],"names":["Logo","React","constructor","props","super","payLoad","getPayloadObject","telemetryContent","TelemetryConstant","this","attributes","getTelemetryAttributes","render","className","_renderLogo","config","link","linkUrl","destinationUrl","Object","assign","href","ariaLabel","target","openInNewTab","undefined","version","id","x","y","viewBox","d","points","_renderImage","defaultImageSettings","viewports","xs","q","w","h","lg","lazyload","Msdyn365","image","gridSettings","imageSettings","loadFailureBehavior","editProps","key","requestContext","NavIcon","Button","onClick","toggleNavBar","title","resources","mobileHamburgerAriaLabel","isExpanded","targetId","__decorate","observer","HeaderPreferredStore","handleClick","_findPreferreStoreOnClick","data","storeSelectorStateManager","result","slots","storeSelector","length","storeName","preferredStore","StoreName","headerPreferredStoreText","color","headerPreferredStoreAriaLabel","async","modules","storeSelectorId","keys","openDialog","showMapViewLink","onLocationSelected","orgUnitLocation","Promise","resolve","catch","error","telemetry","message","debug","Header","handleLinkTextChange","linkIndex","event","myAccountLinks","linkText","value","popOverRef","_toggleNavbar","bind","_togglePopover","_keydown","state","mobileMenuCollapsed","signinPopoverOpen","getTelemetryObject","context","request","telemetryPageName","friendlyName","displayName","_this$props$data$acco","customer","accountInformation","FirstName","Name","componentDidMount","MsDyn365","isBrowser","window","addEventListener","componentWillUnmount","removeEventListener","typeName","cart","user","cartLabel","cartQtyLabel","logoLink","logoImage","headerClassName","classnames","navbarKey","cartIconSlot","_getSlot","menuBarSlot","searchSlot","siteOptionsSlot","preferredStoreSlot","viewProps","_objectSpread","logo","wishListIconDesktop","WishListIconComponent","showButtonTooltip","wishlistTooltipText","wishListIconMobile","cartIcon","CartIconComponent","navIcon","menuBar","search","siteOptions","HeaderTag","moduleProps","tag","HeaderContainer","HeaderTopBarContainer","Divider","MobileMenuContainer","Modal","isOpen","wrapClassName","MobileMenuHeader","ModalHeader","toggle","MobileMenuBodyContainer","ModalBody","MobileMenuLinksContainer","AccountInfoDropdownParentContainer","AccountInfoDropdownPopoverConentContainer","Popover","placement","signInLink","_getSigninButton","signOutLink","_getSignOutButton","accountInfoDropdownButton","_getAccountInfoDropdownButton","accountLinks","_getAccountLinks","renderView","slotName","SignIn","signInLinkText","signInUrl","signInLinkAriaText","onTelemetryClick","SignOut","signOutLinkText","signOutUrl","signOutLinkAriaText","MyProfile","innerRef","map","cta","index","contentAction","etext","editableLink","role","additionalProperties","onTextChange","setState","e","keyCode","KeyCodes","Escape","computed","renderCustomerName","_renderReactFragment","items","slot","Module","Node","_renderDesktopAccountBlock","Collapse","renderForMobile","accountClassName","Drawer","openGlyph","closeGlyph","glyphPlacement","toggleButtonText","_renderMobileAccountBlock","_renderCollapseMenu","logoLinkSvg","LogoLinkSvg","_transitionStatusToClassHash","entering","entered","exiting","exited","_tagRef","height","_onEntering","_onExit","_onExited","_onExiting","_reevaluateHeight","componentDidUpdate","nextProps","children","shouldComponentUpdate","nextState","_this$props","navbar","cssModule","in","collapseIn","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited","otherProps","_objectWithoutProperties","_excluded","Tag","transitionProps","Transition","status","collapseClass","_getTransitionClass","classes","mapToCssModules","classNames","ref","node","current","firstElementChild","scrollHeight","isAppearing","_extends","i","arguments","source","prototype","hasOwnProperty","call","apply","defaultProps","styles","xmlns","xmlSpace","Logosvg","kentMenuBar","_renderAccountBlock","ProductRefinerValueDataTypeValue","ProductRefinerTypeValue","ProductRefinerSource","isRangeType","dataTypeValue","AttributeDataType","Currency","Decimal","Integer","findMatchingRefinementCriterion","productRefinerValue","refinementCriteria","find","refinementCriterion","isMatchingRefinementCriterion","RefinerRecordId","RefinerSourceValue","DataTypeValue","LeftValueBoundString","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","toggledItemFound","forEach","selectedCriterion","isSelecting","next","rangeStart","RightValueBoundString","rangeEnd","push","Text","TrueFalse","parentProductRefinerHierarchy","RefinerTypeValue","RefinerType","SingleSelect","Values","child","matchingIndex","findIndex","criterion","splice","ChoiceSummary","closeButtonGlyph","_onClick","preventDefault","stopPropagation","currentTarget","clearAll","getAttribute","includes","selectedRefiner","_getSelectedRefinerChoice","onChoiceClicked","itemClicked","choiceClicked","nextItemToFocus","nextSibling","selectedRefinersMap","_this$props$context","selectedChoices","channelInventoryConfigurationId","refinerHierarchy","app","productListInventoryDisplay","ProductListInventoryFilteringOptions","HideOOS","filter","choice","parent","hierarchy","RecordId","_getKeyForRefinerValue","clearAllText","label","choiceAriaLabel","closeAriaLabel","clearAllAttributes","item","attribute","urlBuilder","LeftValueBoundLocalizedString","choiceFormat","choiceRangeValueFormat","refinerValues","overallFormat","rangeFormat","refinerValueName","refinerName","KeyName","warning","replace","_formatPrice","UnitText","filterValue","r","amount","currency","trace","cultureFormatter","formatCurrency","Number","selected","ErrorMessage","_ref","text","FeatureSearchResultItem","product","recommendation","productName","productRecordId","productUrl","getProductPageUrlSync","actionContext","fallbackImage","getFallbackImageUrl","ItemId","apiSettings","heading","featureSimilarDescriptionTitle","featureSimilarLooksTitle","toString","imageUrl","altText","img","src","imageProps","fallBackSrc","Image","renderProductPlacementImage","PrimaryImageUrl","Link","ModalToggle","modalNode","autoFocus","applicationNode","returnFocusRef","returnRef","onModalToggle","zIndex","modalHeaderNode","modalTitle","modalFooterNode","ModalFooter","modalCloseButtonText","getInventoryLabel","ArrayExtensions","hasElements","AttributeValues","inventoryAttribute","TextValue","ProductSearchResultItems","products","moduleType","moduleId","allowBackNavigation","quickviewSlot","productComparisonButton","isPriceMinMaxEnabled","productsDimensionAvailabilities","priceResources","priceRangeSeparator","ProductComponent","freePriceText","priceFree","originalPriceText","currentPriceText","ratingAriaLabel","allowBack","quickViewButton","inventoryLabel","swatchItemAriaLabel","dimensionAvailabilities","dimensionAvailability","masterProductId","MasterProductId","RangeRefineItem","_selectedRefinementCr","_this$props$selectedR","_this$props$selectedR2","_ref2","_this$props$selectedR3","_this$props$selectedR4","_formattedPriceReverseLookup","Map","getLabels","sliderId","minPrice","maxPrice","labelId","labelString","labelPositioning","getSliderThumbs","sliderKey","selectedMin","selectedMinPrice","selectedMax","selectedMaxPrice","_this$props$minValueS","_this$props$maxValueS","minValueSliderThumbAriaLabel","currencyCode","ariaValueText","maxValueSliderThumbAriaLabel","_onRangeUpdate","_onRangeUpdateEnd","_handleRangeTooltipText","_changeMin","_changeMax","_finishChangeMin","_finishChangeMax","minInput","maxInput","selectedRefinementCriterion","initialMin","initialMax","String","minValue","maxValue","labels","sliderKeyString","sliderThumbs","isChecked","validationErrorMin","validationErrorMax","touchedMin","touchedMax","previousProps","updateSliderProps","refineItemCommonProps","rangeType","_renderInputFields","_renderSlider","_ref3","_this$props$selectedR5","_this$props$selectedR6","_ref4","_this$props$selectedR7","_this$props$selectedR8","isDisabled","formAttrs","rangeNameFormat","minInputClassName","maxInputClassName","formattedSelectedMin","_getFormattedSelectedValue","formattedSelectedMax","minLabel","onChange","onFocus","onBlur","maxLabel","placeholder","placeholderTextMax","ariaAttributes","Slider","inForm","min","max","step","orientation","showLabels","showTooltip","onChangeEnd","debounce","handleTooltipText","_changeValue","inputType","selectedKey","touchedKey","_getInputWithoutFormatting","selectedMinValue","minTouched","onToggle","maxNum","isNaN","validationErrorNaN","_focus","_validateRange","selectedMaxValue","maxTouched","minNum","setTimeout","focus","touched","validationError","validationErrorRange","input","inputAsNum","get","sliderChangeNotification","eventType","firstThumbValue","secondThumbValue","_focusOnSliderThumb","element","document","getElementById","tooltip","RefineItem","anchorType","_productRefinerValue$","_this$props$parentPro","_this$props$parentPro2","productCountAriaLabel","singleProductCountAriaLabel","refineItemAriaLabel","refineItemsAriaLabel","attrs","JSON","stringify","isSingleSelect","itemTypeClassName","SourceValue","Rating","_renderRating","productText","productCount","Count","refineMenuItemAriaLabel","format","dimensionType","toLocaleLowerCase","shouldDisplayAsSwatch","_getShouldDisplayAsSwatch","hasColor","StringExtensions","isNullOrWhitespace","SwatchColorHexCode","hasImage","SwatchImageUrl","hasContentSwatch","_getRefinerUrl","tabIndex","_renderSwatch","checkIfShouldDisplayAsSwatch","_productRefinerValue$2","swatchItems","itemId","colorHexCode","SwatchComponent","list","isSelectionEnabled","isRefineItem","ratingUserCountAriaLabel","ratingSingleUserCountAriaLabel","_productRefinerValue$3","refinerRating","parseInt","ratingRefiner","selectedRefinerValues","selectedRating","defaultChkProductCount","ratingComponentClass","productCountAriaLabelValue","isMobileView","RatingComponent","avgRating","ratingCount","hideCount","readOnly","moduleTypeName","RefineSubmenu","_onToggleItem","_onToggleSubmenu","isExpandedOnInitialLoad","expanded","productRefinerHierarchy","hideRating","_renderChildItems","_renderRange","_renderSingleMultiSelect","isMobile","refinerValuesList","listItems","selectedValue","_getRangeType","DisplayTemplateValue","DisplayTemplate","Range","SliderWithBars","onUpdateRefiners","prevState","Separator","separator","Title","expandRefinersCount","SearchResultContainer","SearchResultContainer_1","_props$context$reques","_props$context$reques2","sortByDropdownOptions","sortOptions","sortByOptionRelevanceDesc","sortByOptionNameAsc","sortByOptionNameDesc","sortByOptionPriceAsc","sortByOptionPriceDesc","sortByOptionRatingDesc","sortByOptionBestSelling","sortByOptionNewScore","sortByOptionTrendingScore","_pageType","urlTokens","pageType","_viewport","expandrefinerCount","defaultPageNumber","catalogId","getCatalogId","isListPageStateUpdated","_updateListPageState","listPageState","_this$props$context$r","_this$props$config$it","_this$props$config$it2","_this$props$context$r2","querySorting","query","sorting","parse","decodeURIComponent","currentPageNumber","skip","itemsPerPage","sortingCritera","Columns","pageSize","activeProducts","totalProductCount","count","activeFilters","hydrateRefinersFromUrl","productId","featureProduct","_getProductsDimensionsAvailabilities","_this$props$data$list","_this$props$data$list2","productsList","getDimensionAvailabilitiesForProductSearchResultAction","DimensionAvailabilitiesForProductSearchResultInput","DimensionSwatchDisplayTypes","productCard","_getActivePrice","_this$props$data$list3","_this$props$data$list4","getPriceForProductSearchResult","PriceForProductSearchResultInput","_getSearchResultModal","modal","modalHeader","modalFooter","modalBody","SearchResultModal","modalIsOpen","_modalToggleRef","_toggleModal","_getCollectionTitle","collectionTitle","_this$props$context$r3","category","getFriendlyName","locale","NameTranslations","productCountNumber","productCountText","numberOfProducts","oneProduct","TitleContainer","toLowerCase","titlePrefix","searchTextPrefix","titleText","titleCount","_getCategoryHierarchy","categoryHierarchy","CategoryHierarchyContainer","categoryHierarchyList","categoryLinkAriaLabel","Url","categoryHierarchySeparator","_getSortingDropDown","activeDropdown","_getCurrentlySelectedOption","sortingState","selectedSortByOption","dropdownOptions","_getAllSortByOptions","dropdownOption","SortingContainer","sortByDropDown","LabeledDropdown","labelClassname","labelText","sortByDropdownLabel","dropdownId","dropdownClassname","toggleColor","selectedOption","onSelectOption","_updateSortByDropdown","_sortAndFilterContainerRef","_getPagination","fullUrl","getCurrentUrl","skipCount","totalItems","previousText","flipperPrevious","nextText","flipperNext","UncontrolledPagination","paginationAriaLabel","url","qsp","startingItem","_renderPrev","_renderNext","previousAriaLabel","nextAriaLabel","_getRefineMenu","tempRangeTypeTODO","inputRange","validRefiners","updateRefinerPanel","refiners","refiner","_shouldHideFromRefiners","activeRefiners","_getexpandRefinerCount","expandedRefiners","RefineMenuContainer","RefinerSectionContainer","_refineItemCommonProps","_onUpdateRefiners","_buildRefinerUrl","_this$props$data$prod","_this$props$data$prod2","inventoryAwareSortableAttributeId","_getChoiceSummary","_this$props$data$refi","_this$props$data$prod3","selectedRefiners","n","choiceSummaryLabel","_onChoiceClicked","_buildRefinerUrlForChoiceSummary","_getProducts","_this$props$slots","_this$props$slots$qui","_this$props$data$feat","_this$props$data$prod4","shouldAllowBackNavigation","breadCrumbType","breadcrumbType","shouldAllowBack","quickview","isPriceMinMaxFeatureState","featureState","IsEnabled","notification","history","pushState","buildListPageUrl","_getSortColumnFromSelectedOption","transaction","option","searchConfiguration","mappedConfiguration","sortColumn","_getSortCriteriaColumn","_this$props$data$list5","sortCriteria","queryColumns","parseQueryParam","mappedSearchConfiguration","mappedSearchConfig","validValues","activeSortColumn","activeMappedConfig","ColumnName","IsDescending","_this$props$data$list6","newRefinementCriteria","dropdownElementId","dropdownElement","selectedChoice","isClearAll","refinerCount","all","one","two","three","four","paginationPreviousText","paginationNextText","device","Type","_updateViewport","productPrices","pending","validationErrorNotNumber","validationErrorNotRange","static","nameTranslations","_nameTranslation","nameTranslation","Language","_this$props$context$a3","_this$props$context$a4","reaction","_listPageState$active","_listPageState$sortin","_newListPageState$cur","_newListPageState$sor","_newListPageState$act","_this$props$context$r4","_this$props$context$r5","_this$props$context$r6","_this$props$config","_this$props$context$a","_this$props$context$a2","newListPageState","GetFullProductsByCollectionInput","Paging","Top","Skip","Math","Sorting","recordId","ProductId","Recommendation","includeAttributes","productResults","getCollectionProducts","enableAffiliationBasedPricing","isAuthenticated","_newListPageState$cur2","_newListPageState$sor2","_newListPageState$act2","_this$props$context$r7","_this$props$context$r8","refinerInput","RefinersByCollectionInput","getCollectionRefinersAction","dimensionsToDisplayOnProductCard","dimensionsInProductCard","dimensionsToDisplayAsSwatch","dimensionsAsSwatchType","DimensionTypes","none","_listPageState$result","_listPageState$result2","_this$props$context$r9","_this$props$data$list7","_this$props$data$list8","productCollection","searchProduct","errorText","resultCategoryNotFoundText","resultSearchNotFoundText","productsComponent","featureComponent","searchResultContainerViewProps","TitleViewProps","disableHierarchy","refineMenu","sortByOptions","pagination","ProductsContainer","ProductSectionContainer","CategoryNavContainer","RefineAndProductSectionContainer","choiceSummary","modalToggle","searchResultModal","errorMessage","FeatureSearchContainer","similarLookProduct","_getViewport","variant","VariantType","Browser","Viewport","observable","createSearchResultModal","modalProps","isRecoSearchPage","createModalBody","renderSort","renderRefiner","submenu","renderCategoryHierarchy","renderTitle","renderTitleCount","_props$context$action","linksLeft","linksRight","contentBlockLinksLeft","LinksComponentLeft","contentBlockLinksRight","LinksComponentRight","fill","showStrikethroughPricing","originalPrice","getOriginalPrice","price","CustomerContextualPrice","BasePrice","TradeAgreementPrice","AdjustedPrice","shouldUseFreePriceText","renderCurrentPrice","initialPrice","maxVariantPrice","MaxVariantPrice","minVariantPrice","MinVariantPrice","_props$priceResources","itemProp","renderCurrentPriceWithOriginalPrice","savingsText","PriceComponent","msdyn365Commerce","createComponent","component","SwatchItemComponent","isSelected","onSelectItem","style","isColored","selectItem","selectionHandler","backgroundColor","fullImageUrl","generateSwatchImageUrl","onKeyPress","alt","shouldDisplayText","disabled","_props$isSelectionEna","containerClassName","selectedItemId","setSelectedItemId","didUserSetAnyItem","setDidUserSetAnyItem","onSelectItemCallback","ObjectExtensions","isNullOrUndefined","defaultItem","isDefault","ProductComponentSwatchComponent","swatches","onSelectDimension","Dropdown","selectMenu","_onChanged","selectedIndex","selectId","innerText","dropdownName","dropdownList","dropdownToggleName","hidden","getProductConfigure","moduleName","pageName","selectDimensionFormatString","callbacks","productDimensions","configureErrors","getDropdownName","onChanged","dimensionChanged","dimensionSelectedAsync","dropdowns","productDimensionFull","mapProductDimensionFullToDropdownViewProps","dropdownCallback","DimensionTypeValue","DimensionValues","dM","Value","containerProps","labelContainerProps","htmlFor","errors","select","RatingComponentActions","onSliderChanged","setRating","rating","lastSelectedRating","onMouseLeave","_event","onMouseOver","getIndex","initialRating","useState","useEffect","newRating","starControl","ratingCountAriaLabel","renderStars","currentRating","reviewCountAriaLabel","type","mouseOver","floor","remainder","filled","half","stars","glyphClass","createComponentOverride","_product$Name","_getProductImageUrlFr","_getProductPageUrlFro","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","baseUrl","pathname","getDefaultColorSwatchSelected","productData","_colorAttribute$Swatc","_colorAttribute$Swatc2","_colorAttribute$Swatc3","colorAttribute","attributeValue","_attributeValue$KeyNa","defaultSwatch","Swatches","IsDefault","productImageUrlFromSwatch","ProductImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","SwatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","productImageUrl","setProductImageUrl","updatePageAndImageUrl","swatchItem","productPageUrlWithSwatch","newUrl","searchParams","delete","swatchProductImageUrl","productImageUrls","newImageUrl","isUnitOfMeasureEnabled","unitOfMeasureDisplayType","getRatingAriaLabel","ratingAriaLabelText","roundedRating","toFixed","getReviewAriaLabel","reviewCount","ratingCountAriaLabelText","renderLabel","name","reviewCountArialableText","Price","AverageRating","TotalRatings","productCardimageSettings","fallbackImageUrl","cropFocalRegion","attributeValues","_item$KeyName$toLocal","_item$KeyName","_item$Swatches$map","_item$Swatches","dimensionTypeValue","shouldDisplayDimension","_item$RecordId","_swatchItem$SwatchVal","_swatchItem$SwatchVal2","some","swatch","basePrice","adjustedPrice","savingsPriceResourceText","freePriceResourceText","originalPriceResourceText","currentPriceResourceText","renderPrice","unitOfMeasure","DefaultUnitOfMeasure","description","Description","totalRatings","numberRatings","renderRating","inventoryAvailabilityLabel","selectedProductId","renderQuickView","_product$AttributeVal","dimensionToPreSelectInProductCard","selectedSwatchItems","Dictionary","enableStockCheck","setValue","_dimensionAvailabilit","_swatchItem$SwatchVal3","emptyPlaceHolderImage","placeholderImageName","fallbackImageSource","bypassHideOnFailure","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","DimensionValue","CatalogLabelComponent","cartLine","CatalogId","isB2b","catalogs","catalog","CartLineItemFunctions","renderProductDimensions","Product","DimensionStrings","Dimensions","productDimension","colorString","configString","sizeString","IsGiftCard","amountString","styleString","DiscountLines","discountLine","OfferId","OfferName","discountStringText","isSalesLine","PeriodicDiscount","EffectiveAmount","EffectivePercentage","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","IsInvoiceLine","pickupDeliveryModeCode","channel","PickupDeliveryModeCode","channelDeliveryOptionConfig","cartline","hasShippingMethod","_channelDeliveryOptio","DeliveryMode","PickupDeliveryModeCodes","deliveryMode","shippingChargeLines","ChargeLines","chargeLine","IsShipping","freightFee","reduce","chargeTotal","CalculatedAmount","priceComponent","shippingChargesText","_cartline$ChargeLines","otherCharges","chargeline","otherCharge","SalesAgreementLineRecordId","salesAgreementPricePrompt","_props$primaryImageUr","destructDimensionStrings","renderDisountLines","renderInventoryLabel","renderUnitOfMeasure","renderShippingLabel","renderOtherCharges","renderSalesAgreementPrompt","productAttribute","imgeClassName","newValue","quantityOnChange","lineIndex","primaryImageUrl","NetAmount","NetAmountWithoutTax","NetPrice","salesAgreementLineId","showShippingChargesForLineItems","_generateQuantityandPrice","nodes","isOutOfStock","isQuantityEditable","quantityDisplayString","IncrementalQuantity","LineId","maxQuantity","currentCount","currentQuantity","inputQuantityAriaLabel","decrementButtonAriaLabel","incrementButtonAriaLabel","isCartStateReady","isGiftCard","Quantity","DiscountAmount","cartState","priceEditorResources","CartLinePriceEditor","modalCloseButtonRef","_findPreferredStoreOnClick","parentElementRef","rel","imagePropertyName","shouldSkipToMainImage","_this$props$config$my","hasSigninerror","isOBORequest","workerName","customerName","firstName","signUpCustomerNotFoundTitle","signUpMultipleCustomerFoundTitle","closeNotificationLabel","signinNotificationError","_getSigninNotification","NotificationsManager","instance","addNotification","ErrorNotification","wishlists","shouldShowWishlistCount","disableTooltip","headerToggleClass","wishlistCount","CommerceListLines","wishlistCountLabel","isDispayWishlistCount","headerAriaLabel","switchCustomerLink","_getSwitchCustomerButton","_user$signOutUrl","SwitchCustomer","isOBOAccountSelected","cookies","getAccountSelectionCookie","switchCustomerLinkAriaText","switchCustomerLinkText","getBusinessPartnerSelectionUrl","removeAccountSelectionCookie","shoppingAsText","route","location","param","signUpCustomerNotFound","signUpMultipleCustomerFound","retailServerErrorCode","ProductComparisonPreview","_renderGreyPlaceHolders","counts","greyPlaceHoldersCount","displayGreyPlaceHolders","elements","_removeProductFromList","ProductComparisonState","removeItemById","previousState","_previousState$produc","productsData","_handleCollapseClick","_previousState$isExpa","_hasUserInteractedWithComparison","_clearAllProductsFromTheComparison","_instanceId","Random","Guid","generateGuid","_displayedInstanceId","_loadProducts","listModifiedEvent","subscribe","instanceId","handler","unsubscribe","_this$state$productsD","collapseButton","_renderCollapseButton","isMainContentReady","hasUserInteractedWithComparison","_getProdutComparisonDataByCatalogId","productsLimit","_getProductsLimit","subheaderText","productComparisonPreviewHeaderTextWithLimit","handleCollapseClick","productsMainInfo","_getProductsMainInfo","previewGreyPlaceHolders","productComparisonLink","getUrlSync","clearAllProductsFromTheComparison","removeProductFromList","goToComparisonButton","_renderGoToComparisonButton","clearAllButton","_renderClearAllButton","_productData$filter","GetProductsInPreviewProductComparisonInput","getProductsInPreviewProductComparisonAction","productDataByCatalogId","_getGreyPlaceHoldersCount","limit","placeHolder","productImageContainerClassName","tableRowClassName","productImageClassName","productNameClassName","productNameLink","_product$Dimensions","getProductUrlSync","set","dimension","_dimension$DimensionV","dimensionValue","dimensionName","convertProductDimensionTypeToDimensionTypes","removeFromComparisonButton","RemoveFromComparisonButtonComponent","onClickHandler","productImage","_renderProductImage","productLink","viewport","productComparisonMobileProductsLimit","productComparisonDesktopProductsLimit","_product$PrimaryImage","_getFallbackImageUrl","defaultImageSettingQ","xl","_this$state$isExpande","shouldBeExpanded","headerContainerClassName","mainContainerClassName","collapseClassName","collapseButtonClassName","footerClassName","productComparisonCompareProductsButtonText","productComparisonClearAllProductsButtonText","headerLabelClassName","tableClassName","ProductComparisonPreviewViewFunctionalComponent","_props$isExpanded","_props$productsMainIn","_props$productsMainIn2","productComparisonPreviewHeaderText","info","SpecificationDataTypeValues","ProductSpecification","CurrencyValue","CurrencyCode","_product$DateTimeOffs","isFunction","DateTimeOffsetValue","toUTCString","IntegerValue","FloatValue","dangerouslySetInnerHTML","getRichTextHtml","_specification$DataTy","specification","_renderCurrencyCell","dateTime","_renderDateTimeCell","decimal","_renderDecimalCell","integer","_renderIntegerCell","_renderTextCell","boolean","_renderTrueFalseCell","video","BooleanValue","productComparisonProductItemSpecificationTrue","productComparisonProductItemSpecificationFalse","RemoveFromComparisonButtonFunctionalComponent","useCallback","productComparisonRemoveProductFromListAriaLabel","SelectionType","ProductClickerDirections","ProductComparison","_clearAllProductsFromComparison","_configureBoxShadowOnScroll","_this$_tableReference","_tableReference","comparisonProductCardHeader","getElementsByClassName","tableHeaderClassName","Array","from","documentElement","scrollTop","classList","add","tableHeaderLockedClassName","remove","_handleScroll","_this$_tableHeaderRef","_this$_tableHeaderRef2","_tableHeaderReference","scrollTo","top","left","scrollLeft","_checkClickersState","_handleScrollClick","direction","_this$_tableBodyRefer","_this$_tableCellRefer","_this$_tableCellRefer2","_document$body$parent","tableBody","_tableBodyReference","newLeftPosition","cellWidth","_tableCellReference","clientWidth","_getCellWidth","scrollPosition","ceil","minLeftPosition","maxScroll","scrollWidth","body","parentElement","currentClickerPosition","change","hoverStateLastUpdate","Date","now","hoveringCellItemId","_handlePreviousClick","_document$body$parent2","right","_handleNextClick","_document$body$parent3","_this$_tableBodyRefer2","_this$_tableBodyRefer3","_document$body$parent4","_shouldShowNextClicker","forceUpdate","_shouldShowPreviousClicker","newClickerPosition","_handleHoverIn","_hoveringCellItemId","_handleHoverOut","_debounce","_goBack","backToShoppingUrl","referrer","back","specifications","_product$specificatio","specificationsList","allSpecifications","flatten","specificationNames","AttributeValueId","uniqueSpecificationNames","unique","dimensions","productInfo","allDimensions","dimensionIds","actionBarClassName","clearAllProductsFromComparison","isEmptyContent","_renderHeading","loading","_renderLoading","actionBarContainerProps","_getActionBarContainerProps","previousClicker","_renderPreviousClicker","nextClicker","_renderNextClicker","backToShopping","_renderBackToShoppingButton","emptyComparison","emptyComparisonContentSlots","_getProductComparisonDataByCatalogId","isConsentGiven","productComparisonCountText","productsMainInfoData","allUniqueDimensionIds","getProductsDimensionsIds","updatedDimensionProps","getUpdatedDimensionsProps","tableReference","tableHeaderReference","tableBodyReference","tableCellReference","shouldShowPreviousClicker","shouldShowNextClicker","handlePreviousClick","handleNextClick","handleScroll","handleHoverIn","handleHoverOut","uniqueDimensionIds","_getProductsDimensions","dimensionsProps","uniqueSpecifications","_getProductsSpecifications","specificationsProps","_getSpecificationProps","GetProductsInProductComparisonInput","getProductsInProductComparisonAction","then","_renderQuickView","_product$productInfo$","quickViewSlot","quickViews","defaultImageSettingsQ","_getTableHeaderProps","isHoverModeEnabled","tableHeaderCellClassName","onMouseEnter","_getTableCellProps","cellClassName","tableCellClassName","_renderProductRating","_ratingValue$reviewsC","averageRating","ratingValue","productComparisonProductItemRatingAriaLabel","reviewsCount","shouldShowFullRatingDescription","backToShoppingLabel","_getDimensionName","dimensionId","ProductDimensionType","Color","productComparisonProductItemColorDimension","Size","productComparisonProductItemSizeDimension","Style","productComparisonProductItemStyleDimension","dimensionClassName","dimensionsRowClassName","dimensionDescription","dimensionSelectionType","dimensionsAsSwatchConfiguration","productDimensionValues","productMainInfo","renderSwatch","textValue","productsDimension","_productsDimension$di","_productsDimension$di2","dimensionItems","dimensionItem","_dimensionItem$map","currentDimensionId","_productMainInfo$prod","_swatchItem$Dimension2","_swatchItem$Dimension3","_swatchItem$Dimension4","_swatchItem$Dimension5","_swatchItem$Dimension6","_swatchItem$Dimension7","_swatchItem$Dimension8","_swatchItem$Dimension9","isDefaultDimension","selectedDimension","_swatchItem$Dimension","DimensionId","ColorHexCode","ImageUrl","_dimensionItem$Dimens","_dimensionItem$Dimens2","productDimensionSeperatorValue","productDimensionSeparator","dimensionProps","specificationClassName","specificationsRowClassName","specificationValues","_productMainInfo$prod2","productSpecification","productSpecifications","Heading","productComparisonTitle","productComparisonLoadingText","productComparisonClearAllButtonAriaLabel","productComparisonClearAllButtonText","tableClickerClassName","onKeyUp","productComparisonPreviousProduct","productComparisonNextProduct","_renderRemoveFromComparisonButton","productRowClassName","currentCatalogId","productUrlLink","_product$productInfo$2","_dimension$DimensionV2","isFromCurrentCatalog","productPriceClassName","cellNewWidth","width","minWidth","maxWidth","cellContainerProps","productPrice","productComparisonProductItemFreePrice","productComparisonProductItemOriginalPrice","productComparisonProductItemCurrentPrice","quickView","goToProductDetailsButton","productComparisonGoToProductDetailsButtonText","tableCellProps","tableHeaderProps","productRating","productDescription","_renderProductDescription","tableBodyClassName","tableRowContentClassName","tableRowContentInformationClassName","renderDynamicHeaderCells","values","headerName","tabindex","renderDynamicCells","ProductComparisonViewFunctionalComponent","_props$productsMainIn5","_props$dimensionsProp","_props$specifications","_props$productsMainIn8","_props$productsMainIn9","actionsClassName","onScroll","_props$productsMainIn3","_props$productsMainIn4","productComparisonProductItemRating","_props$productsMainIn6","_props$productsMainIn7","productComparisonProductItemDescription","specificationProps","isNullOrEmpty","productComparisonProductItemSku","mockRequest","buildMockRequest","sm","md","signUpUrl","mockAnonRequest","mockSigninErrorRequest","buildHydratedMockActionContext","HeaderView","_configureStickyHeader","headerAlertsContainer","querySelector","bannerHeights","offsetHeight","headerElement","stickyHeader","headerLogo","navStickyPos","_renderAccountDropdownLinks","menuNode","useStickyHeader","_renderMobileLogo","_config$mobileLogoIma","mobileLogoImage"],"sourceRoot":""}