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T,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,QACT,QAAS,QACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,WACT,QAAS,SACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,WACT,QAAS,QACT,QAAS,QACT,QAAS,SACT,QAAS,WACT,QAAS,mBACT,QAAS,WACT,QAAS,MACT,QAAS,QACT,QAAS,MACT,QAAS,WACT,QAAS,WACT,QAAS,iCACT,QAAS,iBACT,QAAS,kBACT,QAAS,QACT,QAAS,SACT,QAAS,sBACT,QAAS,wBACT,QAAS,SACT,QAAS,UACT,aAAc,SACd,QAAS,aACT,QAAS,YACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,UACT,QAAS,MACT,QAAS,SACT,QAAS,aACT,QAAS,OACT,QAAS,cASAC,EAA2C,CACpD,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,KACT,QAAS,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AOtB,EAE/B1yB,EAAIi0B,EAAI5gF,GAIZ,OADAqI,EAAKg3E,EAAGO,EAAYb,EAAG6B,IAChBvB,MAGVY,IAAUJ,EAAmCF","sources":["webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/player.tsx?8176","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/action-toggle/action-toggle.tsx?246b","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/age-gate/age-gate.tsx?96c8","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/video-closed-captions-settings.ts?2fc2","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-settings.ts?ff45","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-context.ts?2af4","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-time-parser.ts?72f5","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/ttml-parser.ts?6362","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/closed-captions/video-closed-captions.tsx?4d40","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-constants.ts?0a75","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-metadata.ts?24d6","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/data/player-options.ts?0c9c","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/localization-helper.ts?26d0","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/closed-caption-helper.ts?8eff","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/helper/player-helper.ts?800e","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/menu-item/menu-item.tsx?471c","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/menu/menu.tsx?4ce6","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/play-pause-trigger/play-pause-trigger.tsx?3fa4","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/key-codes.ts?1004","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/string-extensions.ts?3689","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/html-extensions.ts?9642","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/player-utility.ts?33e3","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/utilities/utilities.ts?65c9","webpack://Msdyn365.Commerce.Online/./src/video-player-utilities/components/video-controls/video-controls.tsx?32a5","webpack://Msdyn365.Commerce.Online/./src/action-menu/action-menu.component.tsx?7298","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/add-to-cart.component.tsx?c15a","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/items-added-to-cart.ts?4f10","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/items-added-to-cart-error-component.tsx?3e3e","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/items-added-to-cart-dialog-component.tsx?3a1e","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/notifications/item-successfully-added-to-cart-notification-component.tsx?1092","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/notifications/item-successfully-added-to-cart-notification.ts?b5b4","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/notifications/multi-items-successfully-added-to-cart-notification-component.tsx?ec23","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/notifications/multi-items-successfully-added-to-cart-notification.ts?4d32","webpack://Msdyn365.Commerce.Online/./src/add-to-cart/product-model.ts?91f1","webpack://Msdyn365.Commerce.Online/./src/add-to-wishlist/add-to-wishlist.component.tsx?0a03","webpack://Msdyn365.Commerce.Online/./src/carousel/CarouselContext.tsx?5738","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/components/node_modules/react-transition-group/esm/config.js?fb42","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/components/node_modules/react-transition-group/esm/TransitionGroupContext.js?52c4","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/components/node_modules/react-transition-group/esm/utils/reflow.js?ddda","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/components/node_modules/react-transition-group/esm/Transition.js?196e","webpack://Msdyn365.Commerce.Online/./src/carousel/CarouselItem.tsx?ecad","webpack://Msdyn365.Commerce.Online/./src/carousel/Carousel.tsx?9349","webpack://Msdyn365.Commerce.Online/./src/cart-icon/cart-icon.component.tsx?ef29","webpack://Msdyn365.Commerce.Online/./src/cartline/components/cart-line-price-editor.tsx?6767","webpack://Msdyn365.Commerce.Online/./src/cartline/cartlineitem.component.tsx?be39","webpack://Msdyn365.Commerce.Online/./src/order-template/add-order-template-to-cart/add-order-template-to-cart.component.tsx?b3bb","webpack://Msdyn365.Commerce.Online/./src/order-template/rename-order-template/rename-order-template.component.tsx?22f7","webpack://Msdyn365.Commerce.Online/./src/order-template/lines-added-to-cart-dialog/lines-added-to-cart-dialog.component.tsx?3b78","webpack://Msdyn365.Commerce.Online/./src/order-template/order-template-name-dialog/order-template-name-dialog.component.tsx?aa9c","webpack://Msdyn365.Commerce.Online/./src/order-template/order-templates-list/order-template-list.tsx?9a9e","webpack://Msdyn365.Commerce.Online/./src/order-template/add-to-order-template-dialog/add-to-order-template-dialog.component.tsx?94ad","webpack://Msdyn365.Commerce.Online/./src/order-template/lines-added-to-order-template-dialog/lines-added-to-order-template-dialog.component.tsx?8a37","webpack://Msdyn365.Commerce.Online/./src/order-template/add-products-to-order-template/add-products-to-order-template.component.tsx?bf4c","webpack://Msdyn365.Commerce.Online/./src/order-template/duplicate-items-when-adding-to-order-template-dialog/duplicate-items-when-adding-to-order-template-dialog.component.tsx?1ec3","webpack://Msdyn365.Commerce.Online/./src/order-template/item-added-to-order-template-dialog/item-added-to-order-template-dialog.component.tsx?017f","webpack://Msdyn365.Commerce.Online/./src/order-template/add-to-order-template/add-to-order-template.component.tsx?0066","webpack://Msdyn365.Commerce.Online/./src/order-template/item-added-to-cart-dialog/item-added-to-cart-dialog.component.tsx?9757","webpack://Msdyn365.Commerce.Online/./src/order-template/save-cart-to-order-template/save-cart-to-order-template.component.tsx?c47e","webpack://Msdyn365.Commerce.Online/./src/order-template/order-templates-list/order-template-products-preview.tsx?832a","webpack://Msdyn365.Commerce.Online/./src/price/price.components.tsx?7295","webpack://Msdyn365.Commerce.Online/./src/product-card-v2/components/product-component-swatch-v2.tsx?1bc1","webpack://Msdyn365.Commerce.Online/./src/product-card-v2/product-v2.component.tsx?2a5e","webpack://Msdyn365.Commerce.Online/./src/product-card/components/product-component-swatch.tsx?a399","webpack://Msdyn365.Commerce.Online/./src/product-card/product.component.tsx?32e2","webpack://Msdyn365.Commerce.Online/./src/product-dimension/dropdown/dropdown.tsx?9ac3","webpack://Msdyn365.Commerce.Online/./src/product-dimension/product-dimension.component.tsx?387b","webpack://Msdyn365.Commerce.Online/./src/product-dimension/swatch/swatch-item.tsx?72c2","webpack://Msdyn365.Commerce.Online/./src/product-dimension/swatch/swatch.tsx?6550","webpack://Msdyn365.Commerce.Online/./src/product-dimensions-matrix/components/product-dimensions-matrix-dimension-item.tsx?0f56","webpack://Msdyn365.Commerce.Online/./src/product-dimensions-matrix/components/product-dimensions-matrix-dimension-selection.tsx?2e77","webpack://Msdyn365.Commerce.Online/./src/product-dimensions-matrix/components/product-dimensions-matrix-enter-all-quantity-button.tsx?43c1","webpack://Msdyn365.Commerce.Online/./src/product-dimensions-matrix/product-dimensions-matrix.tsx?50f3","webpack://Msdyn365.Commerce.Online/./src/promocode/promocode.component.tsx?37c7","webpack://Msdyn365.Commerce.Online/./src/rating/rating.component.tsx?1ba8","webpack://Msdyn365.Commerce.Online/./src/refiner/common.tsx?5431","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-apply.component.tsx?c65c","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-choice-summary.component.tsx?bb08","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-footer.component.tsx?922c","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-toggle.component.tsx?191b","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-sort.component.tsx?6742","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-header.component.tsx?f32a","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-item-check.component.tsx?49ea","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-item-daterange.component.tsx?a87f","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-modal.component.tsx?e1db","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner-options.component.tsx?7d6b","webpack://Msdyn365.Commerce.Online/./src/refiner/refiner.component.tsx?4a59","webpack://Msdyn365.Commerce.Online/./src/search-bar/search-bar.component.tsx?4f38","webpack://Msdyn365.Commerce.Online/./src/social-media/social-media.components.tsx?9b27","webpack://Msdyn365.Commerce.Online/./src/table/table.component.tsx?d5d2","webpack://Msdyn365.Commerce.Online/./src/wishlist-icon/wishlist-icon.component.tsx?a133","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.match.js?1675","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.split.js?5bb5"],"sourcesContent":["/*!\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, IPayLoad, ISliderChangeNotification, onTelemetryClick, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n AgeGate,\n ClosedCaptionHelper,\n ClosedCaptions,\n closedCaptionsSettingDefaults,\n ClosedCaptionTypes,\n format,\n ICCFile,\n ICurrentClosedCaptionsSettings,\n IPlayerMenu,\n IPlayerMenuItemClickNotification,\n IPlayerProps,\n IPlayPosition,\n isNullOrWhiteSpace,\n isSafari,\n IVideoErrorData,\n IVideoErrorMessageData,\n IVideoMetadata,\n KeyCodes,\n LocalizationConstants,\n LocalizationHelper,\n MediaEvents,\n MenuCategories,\n PlayerConstants,\n PlayerHelper,\n PlayerStates,\n PlayPauseTrigger,\n videoClosedCaptionsConstant,\n VideoControls,\n VideoErrorCodes,\n VideoPlayerNames\n} from './components';\n\n/**\n * Player state interface.\n */\nexport interface IPlayerState {\n playing: boolean;\n mouseHovered: boolean;\n isControlPanelVisible: boolean;\n doControlsHaveFocus: boolean;\n playPosition: IPlayPosition;\n currentVolume: number;\n isTriggerEnabled: boolean;\n previousVolume: number;\n isMuted: boolean;\n isInFullScreen: boolean;\n showSpinner: boolean;\n showErrorMessage: boolean;\n videoErrorMessage: IVideoErrorMessageData;\n screenReaderText: string;\n showClosedCaptions: boolean;\n isAgegateEnabled: boolean;\n currentAudioTrack: string;\n currentAudioTrackURL: string;\n closedCaptionLanguage: string;\n closedCaptionsURL: string;\n currentClosedCaptionsSettings: ICurrentClosedCaptionsSettings;\n mounted: boolean;\n tempClosedCaptionsSettings?: {};\n}\n\n/**\n *\n * Player component.\n *\n */\nexport default class Player extends React.Component<IPlayerProps, IPlayerState> {\n public static defaultProps: Partial<IPlayerProps> = {\n playerData: {\n options: {\n autoplay: true,\n ageGate: false,\n mute: true,\n loop: false,\n playPauseTrigger: false,\n controls: true,\n hidePosterFrame: false,\n lazyLoad: true\n },\n metaData: {\n playerName: 'videoPlayer',\n videoId: '',\n title: '',\n description: '',\n duration: 0,\n posterframeUrl: '',\n shareUrl: '',\n videoFiles: [],\n externalPlayerUrl: '',\n externalSourceId: '',\n videoBinaryReferences: []\n }\n },\n playerResources: {\n playAriaLabel: LocalizationConstants.playAriaLabel,\n pauseAriaLabel: LocalizationConstants.pauseAriaLabel,\n closeAriaLabel: LocalizationConstants.closeAriaLabel,\n muteAriaLabel: LocalizationConstants.muteAriaLabel,\n unMuteAriaLabel: LocalizationConstants.unMuteAriaLabel,\n fullScreenAriaLabel: LocalizationConstants.fullScreenAriaLabel,\n exitFullScreenAriaLabel: LocalizationConstants.exitFullScreenAriaLabel,\n pausedAriaLabel: LocalizationConstants.pausedAriaLabel,\n playingAriaLabel: LocalizationConstants.playingAriaLabel,\n seekBarLabel: LocalizationConstants.seekBarLabel,\n videoTimeDurationLabel: LocalizationConstants.videoTimeDurationLabel,\n closedCaptionLabel: LocalizationConstants.closedCaptionLabel,\n sliderThumbLabel: LocalizationConstants.sliderThumbLabel,\n volumeThumbLabel: LocalizationConstants.volumeThumbLabel\n }\n };\n\n private controlPanelTimer: number = 0;\n\n private readonly playerId: string;\n\n private readonly player: React.RefObject<HTMLVideoElement> = React.createRef<HTMLVideoElement>();\n\n private readonly audio: React.RefObject<HTMLAudioElement> = React.createRef<HTMLAudioElement>();\n\n private readonly playerContainer: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly videoControl: React.RefObject<VideoControls> = React.createRef<VideoControls>();\n\n private readonly ClosedCaptions: React.RefObject<ClosedCaptions> = React.createRef<ClosedCaptions>();\n\n private readonly ageGateContainer: React.RefObject<AgeGate> = React.createRef<AgeGate>();\n\n private videoUrl: string = '';\n\n private posterFrameUrl: string = '';\n\n private seekFrom: number | null = null;\n\n private playerState: PlayerStates;\n\n private readonly playerHelper: PlayerHelper;\n\n private readonly localizationHelper: LocalizationHelper;\n\n private closedCaptionHelper: ClosedCaptionHelper | null = null;\n\n private closedCaptionMenu: IPlayerMenu | null = null;\n\n private optionsMenu: IPlayerMenu | null = null;\n\n private selectedClosedCaptionsLocale: string | null = '';\n\n private isPlayerManuallyPaused: boolean = false;\n\n private isPlayerLoaded: boolean = false;\n\n private playerMetaData: IVideoMetadata;\n\n private readonly isMobileDevice: boolean;\n\n private readonly payLoad: IPayLoad;\n\n private readonly _shouldAutoPlay: boolean;\n\n /**\n * Checks if fullscreen is supported by browser or not.\n * @returns - If native fullscreen enabled.\n */\n private static _isNativeFullscreenEnabled(): boolean {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n return (\n doc.fullscreenEnabled ||\n doc.mozFullScreenEnabled ||\n doc.webkitFullscreenEnabled ||\n doc.webkitSupportsFullscreen ||\n doc.msFullscreenEnabled\n );\n }\n /**\n * Gets the current fullscreen element.\n * @returns - The element in full screen.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static _getElementInFullScreen(): any {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n return doc.fullscreenElement || doc.mozFullScreenElement || doc.webkitFullscreenElement || doc.msFullscreenElement;\n }\n\n public constructor(props: IPlayerProps) {\n super(props);\n\n const {\n playerData: {\n options: {\n shouldDisableAutoPlayOnMobile,\n autoplay: isAutoPlay,\n playPauseTrigger: isPlayPauseTrigger,\n ageGate: isAgeGateEnabled,\n controls: isControlsEnabled,\n mute: isMuted,\n lazyLoad: isLazyLoaded,\n isMobileDevice\n }\n }\n } = this.props;\n\n this.isMobileDevice = this._isMobile() || isMobileDevice!;\n\n this._shouldAutoPlay = this.isMobileDevice && shouldDisableAutoPlayOnMobile ? false : isAutoPlay!;\n\n const state = {\n playing: false,\n mouseHovered: isPlayPauseTrigger! || !this._shouldAutoPlay,\n isControlPanelVisible: !isPlayPauseTrigger,\n doControlsHaveFocus: false,\n isTriggerEnabled: isPlayPauseTrigger! && !this._shouldAutoPlay && isControlsEnabled!,\n currentVolume: isMuted && !this.isMobileDevice ? 0 : PlayerConstants.defaultVolume * 100,\n previousVolume: 0,\n isMuted: isMuted ?? false,\n isInFullScreen: false,\n showSpinner: false,\n isAgegateEnabled: isAgeGateEnabled! && !this._shouldAutoPlay,\n showErrorMessage: false,\n screenReaderText: '',\n closedCaptionLanguage: 'off',\n currentAudioTrack: 'default',\n currentAudioTrackURL: '',\n showClosedCaptions: false,\n mounted: false,\n currentClosedCaptionsSettings: {\n preset: closedCaptionsSettingDefaults.preset,\n text_font: closedCaptionsSettingDefaults.text_font,\n text_color: closedCaptionsSettingDefaults.text_color,\n text_opacity: closedCaptionsSettingDefaults.text_opacity,\n text_size: closedCaptionsSettingDefaults.text_size,\n text_edge_style: closedCaptionsSettingDefaults.text_edge_style,\n text_background_color: closedCaptionsSettingDefaults.text_background_color,\n text_background_opacity: closedCaptionsSettingDefaults.text_background_opacity,\n window_color: closedCaptionsSettingDefaults.window_color,\n window_opacity: closedCaptionsSettingDefaults.window_opacity\n },\n closedCaptionsURL: '',\n videoErrorMessage: {\n title: '',\n message: ''\n },\n playPosition: {\n currentTime: 0,\n startTime: 0,\n endTime: 0,\n bufferedDuration: 0\n },\n tempClosedCaptionsSettings: undefined\n };\n\n this.playerState = 'init';\n this._onTriggerClicked = this._onTriggerClicked.bind(this);\n this._onMouseEvent = this._onMouseEvent.bind(this);\n this._onPlay = this._onPlay.bind(this);\n this._onPause = this._onPause.bind(this);\n this._triggerEvents = this._triggerEvents.bind(this);\n this._triggerAudioEvents = this._triggerAudioEvents.bind(this);\n this._onProgressChange = this._onProgressChange.bind(this);\n this._setMuted = this._setMuted.bind(this);\n this._onVolumeChange = this._onVolumeChange.bind(this);\n this._onFullScreenChanged = this._onFullScreenChanged.bind(this);\n this._toggleFullScreen = this._toggleFullScreen.bind(this);\n this._showControlBar = this._showControlBar.bind(this);\n this._handleControlsKeyDownEvent = this._handleControlsKeyDownEvent.bind(this);\n this._onFullscreenError = this._onFullscreenError.bind(this);\n this._onPlayerKeyDown = this._onPlayerKeyDown.bind(this);\n this._onTriggerFocus = this._onTriggerFocus.bind(this);\n this._onTriggerBlur = this._onTriggerBlur.bind(this);\n this._onVideoControlsFocus = this._onVideoControlsFocus.bind(this);\n this._onVideoControlsBlur = this._onVideoControlsBlur.bind(this);\n this._onPlayerMenuItemClick = this._onPlayerMenuItemClick.bind(this);\n this._onPlayerMenuItemFocus = this._onPlayerMenuItemFocus.bind(this);\n this._onPlayerMenuItemBlur = this._onPlayerMenuItemBlur.bind(this);\n this._validateAgeSubmitHandler = this._validateAgeSubmitHandler.bind(this);\n this._onContextMenuClicked = this._onContextMenuClicked.bind(this);\n this.localizationHelper = new LocalizationHelper(this.props.playerResources!);\n this.playerHelper = new PlayerHelper(this.props, this.localizationHelper, this.isMobileDevice);\n this.playerId = this.playerHelper.isEmptyOrUndefined(this.props.playerId) ? 'vid-0' : this.props.playerId!;\n this.playerMetaData = this.playerHelper.getMetadata();\n this.state = state;\n this.posterFrameUrl = this.playerHelper.getPosterFrameUrl();\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n\n if (!isLazyLoaded) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n }\n }\n\n public shouldComponentUpdate(nextProps: IPlayerProps, nextState: IPlayerState): boolean {\n if (this.state === nextState && this.props.playerData.options === nextProps.playerData.options) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const {\n playerData: {\n options: { loop: isLoop }\n }\n } = this.props;\n\n const maskLevelStyle: React.CSSProperties = {};\n maskLevelStyle.backgroundColor = this._getMaskLevelStyle();\n\n if (this.props.isEditor) {\n this.playerHelper.updatePlayerProps(this.props);\n this.playerMetaData = this.playerHelper.getMetadata();\n if (this.posterFrameUrl !== this.playerHelper.getPosterFrameUrl()) {\n this.posterFrameUrl = this.playerHelper.getPosterFrameUrl();\n }\n if (this.isPlayerLoaded && this.videoUrl !== this.playerHelper.getVideoFileToPlay().url) {\n this._loadPlayer();\n }\n }\n\n const loadMetaData = this._shouldAutoPlay ? 'auto' : 'metadata';\n\n // Set play aria label\n let playAriaLabel: string = '';\n if (this.playerMetaData.title) {\n playAriaLabel = `${this.localizationHelper.getLocalizedValue('playAriaLabel')} ${this.playerMetaData.title}`;\n } else {\n playAriaLabel = LocalizationConstants.playVideoAriaLabel;\n }\n\n return (\n <div\n role='none'\n className={`${VideoPlayerNames.videoplayerContainer}`}\n ref={this.playerContainer}\n onKeyDown={this._onPlayerKeyDown}\n onMouseEnter={this._onMouseEvent}\n onMouseLeave={this._onMouseEvent}\n data-playerid={this.playerId}\n >\n <div className={`${VideoPlayerNames.videoplayerContainer}__wrapper`}>\n {this.state.currentAudioTrack !== '' && this.state.currentAudioTrackURL !== '' && (\n <audio\n ref={this.audio}\n preload='auto'\n src={this.state.currentAudioTrackURL}\n muted={this.state.isMuted}\n loop={isLoop}\n />\n )}\n <video\n className={`${VideoPlayerNames.videoplayerContainer}__video`}\n ref={this.player}\n preload={loadMetaData}\n autoPlay={this._shouldAutoPlay}\n muted={this.state.isMuted}\n loop={isLoop}\n onPlay={this._onPlay}\n onPause={this._onPause}\n onClick={!this.state.isAgegateEnabled ? this._onTriggerClicked : this._onPause}\n src={this.videoUrl}\n onContextMenu={this._onContextMenuClicked}\n poster={this.posterFrameUrl}\n playsInline\n aria-hidden='true'\n />\n <div\n className={`${VideoPlayerNames.videoplayerContainer}__errormessage`}\n role='status'\n aria-hidden={!this.state.showErrorMessage}\n >\n <div className={`${VideoPlayerNames.videoplayerContainer}__errormessage__wrapper`}>\n <p className={`${VideoPlayerNames.videoplayerContainer}__errormessage__heading`}>\n {this.state.videoErrorMessage.title}\n </p>\n </div>\n </div>\n <div className={`${VideoPlayerNames.videoplayerContainer}__screenreader`} aria-live='assertive'>\n {this.state.screenReaderText}\n </div>\n <div\n className={`${VideoPlayerNames.videoplayerContainer}__spinner`}\n role='status'\n aria-hidden={!this.state.showSpinner}\n >\n <Waiting className={`${VideoPlayerNames.videoplayerContainer}__waiting`} />\n </div>\n {this.props.playerData.options.ageGate && this._renderAgeGate()}\n {this._renderPlayPauseTrigger(playAriaLabel, maskLevelStyle)}\n {this.state.showClosedCaptions && this._renderClosedCaptions()}\n {this._renderVideoControls(playAriaLabel)}\n </div>\n </div>\n );\n }\n\n /**\n * Play the video.\n */\n public play(): void {\n this.player.current!.play().catch(() => {\n this._onVideoError();\n });\n if (this.audio.current) {\n this.audio.current.play().catch(() => {\n this._onAudioError();\n });\n }\n }\n\n /**\n * Pause the video.\n */\n public pause(): void {\n this.player.current!.pause();\n if (this.audio.current) {\n this.audio.current.pause();\n }\n }\n\n public componentDidMount(): void {\n const {\n playerData: {\n options: { playPauseTrigger: isPlayPauseTrigger, lazyLoad: isLazyLoaded }\n }\n } = this.props;\n if (!isLazyLoaded) {\n this._onVideoLoadedData();\n this._showControlBar(false);\n }\n\n if (this._shouldAutoPlay || (isLazyLoaded && !isPlayPauseTrigger) || !isLazyLoaded) {\n this._loadPlayer();\n }\n document.addEventListener('fullscreenchange', this._onFullScreenChanged);\n document.addEventListener('mozfullscreenchange', this._onFullScreenChanged);\n document.addEventListener('webkitfullscreenchange', this._onFullScreenChanged);\n document.addEventListener('MSFullscreenChange', this._onFullScreenChanged);\n\n document.addEventListener('fullscreenerror', this._onFullscreenError);\n document.addEventListener('mozfullscreenerror', this._onFullscreenError);\n document.addEventListener('webkitfullscreenerror', this._onFullscreenError);\n document.addEventListener('MSFullscreenError', this._onFullscreenError);\n }\n\n public componentWillUnmount(): void {\n if (this.player.current) {\n for (const mediaEvent of MediaEvents) {\n this.player.current.removeEventListener(mediaEvent, this._triggerEvents);\n }\n }\n document.removeEventListener('fullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('mozfullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('webkitfullscreenchange', this._onFullScreenChanged);\n document.removeEventListener('MSFullscreenChange', this._onFullScreenChanged);\n\n document.removeEventListener('fullscreenerror', this._onFullscreenError);\n document.removeEventListener('mozfullscreenerror', this._onFullscreenError);\n document.removeEventListener('webkitfullscreenerror', this._onFullscreenError);\n document.removeEventListener('MSFullscreenError', this._onFullscreenError);\n }\n\n /**\n * Renders closed captions.\n * @returns Returns closed captions.\n */\n private readonly _renderClosedCaptions = (): JSX.Element => {\n return (\n <ClosedCaptions\n ref={this.ClosedCaptions}\n className={`${VideoPlayerNames.videoplayerContainer}__ccoverlay`}\n showClosedCaptions={this.state.showClosedCaptions}\n currentTime={this.state.playPosition.currentTime}\n ccLanguage={this.state.closedCaptionLanguage}\n ccURL={this.state.closedCaptionsURL}\n errorCallback={this.playerHelper.onErrorCallback}\n isVideoControlVisible={this.state.isControlPanelVisible || this.state.doControlsHaveFocus}\n currentClosedCaptionsSettings={this.state.currentClosedCaptionsSettings}\n tempClosedCaptionsSettings={this.state.tempClosedCaptionsSettings}\n onClosedCaptionClick={this._onTriggerClicked}\n />\n );\n };\n\n /**\n * Renders the play pause trigger.\n * @param playAriaLabel - Aria label for the play button.\n * @param maskLevelStyle - Mask level.\n * @returns Returns play pause trigger.\n */\n private readonly _renderPlayPauseTrigger = (playAriaLabel: string, maskLevelStyle: React.CSSProperties): JSX.Element | undefined => {\n const {\n playerData: {\n options: {\n autoplay: shouldAutoPlay,\n playPauseTrigger: isPlayPauseTrigger,\n controls: isControlsEnabled,\n shouldDisableAutoPlayOnMobile\n }\n }\n } = this.props;\n\n if (!MsDyn365.msdyn365Commerce.isBrowser && isPlayPauseTrigger && shouldAutoPlay && shouldDisableAutoPlayOnMobile) {\n // Rendering an empty div because on server side isMobile will be false at server side.\n return <div className={`${VideoPlayerNames.videoplayerContainer}__playpausetrigger__container`} />;\n }\n\n if (isPlayPauseTrigger && (!isControlsEnabled || this.state.isTriggerEnabled) && !this.state.isAgegateEnabled) {\n return (\n <PlayPauseTrigger\n className={`${VideoPlayerNames.videoplayerContainer}__playpausetrigger`}\n style={maskLevelStyle}\n onChange={this._onTriggerClicked}\n toggled={this.state.playing}\n aria-hidden={!this.state.mouseHovered}\n playAriaLabel={playAriaLabel}\n pauseAriaLabel={this.localizationHelper.getLocalizedValue('pauseAriaLabel')}\n onFocus={this._onTriggerFocus}\n onBlur={this._onTriggerBlur}\n telemetryContent={this.props.telemetryContent}\n />\n );\n }\n\n return undefined;\n };\n\n /**\n * Renders the video controls.\n * @param playAriaLabel - Arial label for the play button.\n * @returns Returns the video control.\n */\n private readonly _renderVideoControls = (playAriaLabel: string): JSX.Element | undefined => {\n const {\n playerData: {\n options: { controls: isControlsEnabled }\n }\n } = this.props;\n\n if (isControlsEnabled && !this.state.isTriggerEnabled && !this.state.isAgegateEnabled) {\n return (\n <VideoControls\n ref={this.videoControl}\n className={`${VideoPlayerNames.videoplayerContainer}__controls ${\n this.state.isControlPanelVisible || this.state.doControlsHaveFocus ? 'show' : 'hide'\n }`}\n aria-hidden={!(this.state.isControlPanelVisible || this.state.doControlsHaveFocus)}\n onPlayClick={this._onTriggerClicked}\n playing={this.state.playing}\n closedCaptionMenu={this.closedCaptionMenu!}\n optionMenu={this.optionsMenu!}\n videoSeekSteps={PlayerConstants.defaultVideoSliderSteps}\n volumeSeekSteps={PlayerConstants.defaultVolumeSliderSteps}\n isMuted={this.state.isMuted}\n onMuteClick={this._setMuted}\n onVolumeChange={this._onVolumeChange}\n onProgressChange={this._onProgressChange}\n playPosition={this.state.playPosition}\n currentClosedCaptionLanguage={this.state.closedCaptionLanguage}\n currentVolume={this.state.currentVolume}\n isInFullScreen={this.state.isInFullScreen}\n toggleFullScreen={this._toggleFullScreen}\n handleControlsKeyDownHandler={this._handleControlsKeyDownEvent}\n isControlPanelVisible={this.state.isControlPanelVisible || this.state.doControlsHaveFocus}\n onFocus={this._onVideoControlsFocus}\n onBlur={this._onVideoControlsBlur}\n onMenuItemClick={this._onPlayerMenuItemClick}\n onMenuItemFocus={this._onPlayerMenuItemFocus}\n onMenuItemBlur={this._onPlayerMenuItemBlur}\n currentAudioTrack={this.state.currentAudioTrack}\n currentAudioTrackURL={this.state.currentAudioTrackURL}\n currentClosedCaptionsSetting={this.state.currentClosedCaptionsSettings}\n isMobileDevice={this.isMobileDevice}\n telemetryContent={this.props.telemetryContent}\n resources={{\n playAriaLabel,\n pauseAriaLabel: this.localizationHelper.getLocalizedValue('pauseAriaLabel'),\n muteAriaLabel: this.localizationHelper.getLocalizedValue('muteAriaLabel'),\n unMuteAriaLabel: this.localizationHelper.getLocalizedValue('unMuteAriaLabel'),\n fullScreenAriaLabel: this.localizationHelper.getLocalizedValue('fullScreenAriaLabel'),\n exitFullScreenAriaLabel: this.localizationHelper.getLocalizedValue('exitFullScreenAriaLabel'),\n seekBarLabel: this.localizationHelper.getLocalizedValue('seekBarLabel'),\n videoTimeDurationLabel: this.localizationHelper.getLocalizedValue('videoTimeDurationLabel'),\n closedCaptionLabel: this.localizationHelper.getLocalizedValue('closedCaptionLabel'),\n optionButtonLabel: this.localizationHelper.getLocalizedValue('optionAriaLabel'),\n sliderThumbLabel: this.localizationHelper.getLocalizedValue('sliderThumbLabel'),\n volumeThumbLabel: this.localizationHelper.getLocalizedValue('volumeThumbLabel')\n }}\n />\n );\n }\n return undefined;\n };\n\n /**\n * Renders the age gate module.\n * @returns Renders the age gate module.\n */\n private readonly _renderAgeGate = (): JSX.Element => {\n return (\n <AgeGate\n ref={this.ageGateContainer}\n onSubmitClick={this._validateAgeSubmitHandler}\n aria-hidden={!this.state.isAgegateEnabled}\n minmumAge={this.playerMetaData.minimumAge}\n />\n );\n };\n\n private _loadPlayer(): void {\n if (this.player.current) {\n this.player.current.volume = this.state.currentVolume / 100;\n\n // Register the media events\n for (const mediaEvent of MediaEvents) {\n this.player.current.addEventListener(mediaEvent, this._triggerEvents);\n }\n }\n\n if (this.props.playerData.options.lazyLoad || this.props.isEditor) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n if (this.player.current) {\n this.player.current.src = this.videoUrl;\n this.player.current.load();\n }\n }\n\n this.isPlayerLoaded = true;\n\n if (this.props.playerData.options.controls) {\n this.closedCaptionHelper = new ClosedCaptionHelper(this.playerMetaData, this.playerHelper, this.localizationHelper);\n this.closedCaptionMenu = this.closedCaptionHelper.getClosedCaptionMenu()!;\n this.optionsMenu = this.playerHelper.getOptionMenu();\n const ccFiles = this.playerMetaData.ccFiles!;\n if (ccFiles !== undefined && ccFiles.length > 0) {\n const autoCaptionsLang = this.props.playerData && this.props.playerData.options.autoCaptions;\n let autoCaptionsLocale: string | null = null;\n for (const ccFile of ccFiles) {\n if (!autoCaptionsLocale && autoCaptionsLang && ccFile.locale.includes(autoCaptionsLang)) {\n autoCaptionsLocale = ccFile.locale;\n }\n }\n this.selectedClosedCaptionsLocale = autoCaptionsLocale;\n if (!isNullOrWhiteSpace(this.selectedClosedCaptionsLocale!)) {\n this.setState({\n closedCaptionLanguage: this.selectedClosedCaptionsLocale!,\n closedCaptionsURL: this.closedCaptionHelper.getClosedCaptionURLFromLocale(this.selectedClosedCaptionsLocale!),\n showClosedCaptions: true\n });\n }\n }\n }\n }\n\n /**\n * Validates the age submitted by the user.\n */\n private _validateAgeSubmitHandler(): void {\n if (this.ageGateContainer.current!.getCalculatedAge()) {\n this.videoUrl = this.playerHelper.getVideoFileToPlay().url;\n this.setState({ isAgegateEnabled: false });\n } else {\n this.setState({ isAgegateEnabled: true });\n this._displayErrorMessage({ title: 'you are not allowed to watch video' });\n }\n }\n\n private _onVideoControlsFocus(): void {\n // No need to call showControlBar, this will make sure it shows\n this.setState({ doControlsHaveFocus: true });\n }\n\n private _onVideoControlsBlur(): void {\n // Call showControlBar to give it the 6 second timeout\n this._showControlBar(true);\n\n this.setState({ doControlsHaveFocus: false });\n }\n\n private _onPlayerMenuItemFocus(notification: IPlayerMenuItemClickNotification): void {\n if (notification.data && notification.data.indexOf(':') > 0) {\n const dataSplit = notification.data.split(':');\n const settingKey = dataSplit[0];\n if (settingKey === videoClosedCaptionsConstant.presetKey) {\n if (this.state.closedCaptionLanguage === 'off') {\n this.setState(\n {\n showClosedCaptions: true\n },\n () => {\n this.ClosedCaptions.current!.showSampleCaptions();\n this._setCCSettings(notification, false);\n }\n );\n } else {\n this._setCCSettings(notification, false);\n }\n }\n } else if (this.state.closedCaptionLanguage === 'off') {\n this.setState({\n showClosedCaptions: false\n });\n }\n }\n\n private _onPlayerMenuItemBlur(): void {\n this._setCCSettings({\n category: MenuCategories.ClosedCaptionSettings,\n id: '',\n data: 'current'\n });\n }\n\n private _onPlayerMenuItemClick(notification: IPlayerMenuItemClickNotification): void {\n switch (notification.category) {\n case MenuCategories.ClosedCaption: {\n this._setCC(notification.id);\n break;\n }\n\n case MenuCategories.ClosedCaptionSettings: {\n this._setCCSettings(notification);\n break;\n }\n\n case MenuCategories.AudioTracks: {\n this._setAudioTracks(notification);\n break;\n }\n default:\n }\n }\n\n /**\n * Sets the close captioning language/locale.\n * @param ccLanguageId - The desired new cc value.\n */\n private _setCC(ccLanguageId: string): void {\n ccLanguageId = this.playerHelper.removeIdPrefix(ccLanguageId);\n let selectedOption: ICCFile | null = null;\n\n if (ccLanguageId && this.playerMetaData.ccFiles) {\n for (const ccFile of this.playerMetaData.ccFiles) {\n if (ccFile.locale === ccLanguageId && (!ccFile.ccType || ccFile.ccType === ClosedCaptionTypes.TTML)) {\n selectedOption = ccFile;\n break;\n }\n }\n }\n\n if (ccLanguageId === 'off') {\n this.setState({\n closedCaptionLanguage: 'off',\n closedCaptionsURL: '',\n showClosedCaptions: false\n });\n } else {\n this.setState({\n closedCaptionLanguage: selectedOption!.locale,\n closedCaptionsURL: selectedOption!.url,\n showClosedCaptions: true\n });\n }\n }\n\n /**\n * Sets the close caption settings.\n * @param notification - The desired new cc value.\n * @param updatePreferences - Update Preferences.\n */\n private _setCCSettings(notification: IPlayerMenuItemClickNotification, updatePreferences?: boolean): void {\n if (notification.data === 'reset') {\n this.setState(\n {\n currentClosedCaptionsSettings: closedCaptionsSettingDefaults\n },\n () => {\n if (this.ClosedCaptions.current !== null) {\n this.ClosedCaptions.current.applySettings();\n this.ClosedCaptions.current.resetCaptions();\n this.ClosedCaptions.current.updateCaptions(this.state.playPosition.currentTime);\n }\n }\n );\n } else if (notification.data === 'current') {\n this.setState({\n tempClosedCaptionsSettings: undefined\n });\n\n if (this.state.closedCaptionLanguage === 'off') {\n this.setState({\n showClosedCaptions: false\n });\n }\n } else {\n const dataSplit = notification.data!.split(':');\n if (!dataSplit) {\n return;\n }\n const settingKey = dataSplit[0];\n const optionKey = dataSplit[1];\n const currentSetting = this.closedCaptionHelper!.getUpdatedClosedCaptionSetting(\n this.state.currentClosedCaptionsSettings,\n settingKey,\n optionKey\n );\n if (updatePreferences === undefined || updatePreferences) {\n this.setState(\n {\n tempClosedCaptionsSettings: undefined,\n currentClosedCaptionsSettings: currentSetting\n },\n () => {\n if (this.ClosedCaptions.current) {\n this.ClosedCaptions.current.applySettings();\n this.ClosedCaptions.current.resetCaptions();\n this.ClosedCaptions.current.updateCaptions(this.state.playPosition.currentTime);\n }\n }\n );\n } else {\n this.setState({\n tempClosedCaptionsSettings: currentSetting\n });\n }\n }\n }\n\n private _setAudioTracks(notification: IPlayerMenuItemClickNotification): void {\n const data = JSON.parse(notification.data!);\n if (data.lang === 'default') {\n this.setState(\n {\n currentAudioTrack: 'default',\n currentAudioTrackURL: ''\n },\n () => {\n this.player.current!.volume = this.state.currentVolume / 100;\n }\n );\n } else {\n this.setState(\n {\n currentAudioTrack: data.lang,\n currentAudioTrackURL: data.url\n },\n () => {\n this.audio.current!.currentTime = this.player.current!.currentTime;\n this.audio.current!.volume = this.state.currentVolume / 100;\n this.player.current!.volume = 0;\n if (!this.player.current!.paused) {\n this.audio.current!.load();\n for (const mediaEvent of MediaEvents) {\n this.audio.current!.addEventListener(mediaEvent, this._triggerAudioEvents);\n }\n }\n }\n );\n }\n }\n\n private _triggerAudioEvents(event: Event): void {\n switch (event.type.toLowerCase()) {\n case 'error':\n this._onAudioError();\n break;\n case 'waiting':\n if (this.playerState === 'playing') {\n this.isPlayerManuallyPaused = true;\n this.pause();\n }\n break;\n\n case 'loadeddata':\n if (this.isPlayerManuallyPaused) {\n this.isPlayerManuallyPaused = false;\n this.play();\n }\n if (!this.player.current!.paused) {\n this.play();\n }\n break;\n\n default:\n }\n }\n\n private _triggerEvents(event: Event): void {\n switch (event.type.toLowerCase()) {\n case 'canplay':\n case 'canplaythrough':\n break;\n\n case 'error':\n this._onVideoError();\n break;\n\n case 'play':\n break;\n\n case 'pause':\n this._updateState('paused');\n if (this.props.playerData.options.playPauseTrigger) {\n this.setState({\n mouseHovered: true\n });\n }\n break;\n\n case 'seeking':\n if (this.playerState !== 'ended' && this.player.current!.seeking) {\n this.seekFrom = this.player.current!.currentTime;\n this._updateState('seeking');\n }\n break;\n\n case 'seeked':\n const currentPlayer = this.player.current;\n const currentTime = currentPlayer!.currentTime;\n if (this.playerState !== 'ended' && this.player.current!.seeking && this.seekFrom !== currentTime) {\n this.seekFrom = null;\n }\n this._updateState(currentPlayer!.paused ? 'paused' : 'playing');\n break;\n\n case 'waiting':\n this._updateState('buffering');\n break;\n\n case 'loadedmetadata':\n break;\n\n case 'loadeddata':\n this._onVideoLoadedData();\n if (!this._shouldAutoPlay) {\n this._showControlBar(false);\n }\n break;\n\n case 'timeupdate':\n this._onTimeUpdate();\n break;\n\n case 'ended':\n this._updateState('ended');\n this._stop();\n break;\n\n case 'playing':\n this._updateState('playing');\n break;\n\n case 'volumechange':\n break;\n\n default:\n }\n }\n\n private _onAudioError(): void {\n this.pause();\n const errorMessage: IVideoErrorMessageData = { title: 'Error while playing audio Track. Switching back to default track' };\n this._displayErrorMessage(errorMessage);\n this._setAudioTracks({ category: 'audioTracks', data: '{ \"lang\": \"default\", \"url\": \"\"}', id: '' });\n setTimeout(() => {\n this.setState(\n {\n showErrorMessage: false\n },\n () => {\n this.play();\n }\n );\n }, 2000);\n }\n\n private _onVideoError(): void {\n this._updateState('error');\n const error: IVideoErrorData | null = this._getError();\n let errorMessage = '';\n if (error?.errorCode) {\n switch (error.errorCode) {\n case VideoErrorCodes.MediaErrorAborted:\n errorMessage = 'video playback was aborted';\n break;\n case VideoErrorCodes.MediaErrorNetwork:\n errorMessage = 'video failed to download';\n break;\n case VideoErrorCodes.MediaErrorDecode:\n errorMessage = 'video is not readable';\n break;\n case VideoErrorCodes.MediaErrorSourceNotSupported:\n errorMessage = 'video format is not supported';\n break;\n default:\n errorMessage = 'unknown error occurred';\n }\n\n this._stopMedia(errorMessage);\n } else {\n this._stopMedia();\n }\n }\n\n private _stopMedia(msgToDisplay?: string): void {\n if (msgToDisplay) {\n this._displayErrorMessage({ title: msgToDisplay });\n this._updateState('stopped');\n }\n }\n\n /**\n * Create an error message overlay.\n * @param errorMessage - Error message content.\n */\n private _displayErrorMessage(errorMessage: IVideoErrorMessageData): void {\n this.setState({ videoErrorMessage: { title: errorMessage.title, message: errorMessage.message } });\n this.setState({ showErrorMessage: true });\n }\n\n /**\n * Gets the video error code of the current error.\n * @returns : Returns the video error code.\n */\n private _getError(): IVideoErrorData | null {\n let contentErrorCode: VideoErrorCodes;\n if (this.player.current!.error) {\n // Video playback failed - show a message saying why\n switch (this.player.current!.error.code) {\n case this.player.current!.error.MEDIA_ERR_ABORTED:\n contentErrorCode = VideoErrorCodes.MediaErrorAborted;\n break;\n case this.player.current!.error.MEDIA_ERR_NETWORK:\n contentErrorCode = VideoErrorCodes.MediaErrorNetwork;\n break;\n case this.player.current!.error.MEDIA_ERR_DECODE:\n contentErrorCode = VideoErrorCodes.MediaErrorDecode;\n break;\n case this.player.current!.error.MEDIA_ERR_SRC_NOT_SUPPORTED:\n contentErrorCode = VideoErrorCodes.MediaErrorSourceNotSupported;\n break;\n default:\n contentErrorCode = VideoErrorCodes.MediaErrorUnknown;\n }\n return { errorCode: contentErrorCode };\n }\n return null;\n }\n\n private _handleControlsKeyDownEvent(e: React.KeyboardEvent): void {\n const keyBrdEvent = (e as unknown) as KeyboardEvent;\n const keycode = keyBrdEvent.keyCode;\n this._showControlBar(true);\n\n // Const castTarget = e.target as HTMLElement;\n\n switch (keycode) {\n case KeyCodes.Home:\n e.stopPropagation();\n e.preventDefault();\n this.player.current!.currentTime = 0;\n if (this.audio.current) {\n this.audio.current.currentTime = 0;\n }\n break;\n case KeyCodes.End:\n e.stopPropagation();\n e.preventDefault();\n this.player.current!.currentTime = this.state.playPosition.endTime;\n if (this.audio.current) {\n this.audio.current.currentTime = this.state.playPosition.endTime;\n }\n break;\n case KeyCodes.ArrowLeft:\n case KeyCodes.ArrowRight:\n e.stopPropagation();\n e.preventDefault();\n let jumpToTime =\n keycode === KeyCodes.ArrowLeft\n ? this.state.playPosition.currentTime - PlayerConstants.defaultVideoSliderSteps\n : this.state.playPosition.currentTime + PlayerConstants.defaultVideoSliderSteps;\n jumpToTime = Math.min(Math.max(this.state.playPosition.startTime, jumpToTime), this.state.playPosition.endTime);\n this.player.current!.currentTime = jumpToTime;\n if (this.audio.current) {\n this.audio.current.currentTime = jumpToTime;\n }\n break;\n case KeyCodes.ArrowUp:\n case KeyCodes.ArrowDown:\n e.stopPropagation();\n e.preventDefault();\n this.videoControl.current!.showVolumeControl(true).call(this);\n const volume =\n keycode === KeyCodes.ArrowDown\n ? Math.max((this.state.currentVolume - PlayerConstants.defaultVolumeSliderSteps) / 100, 0)\n : Math.min((this.state.currentVolume + PlayerConstants.defaultVolumeSliderSteps) / 100, 1);\n this.setState({ currentVolume: Math.round(volume * 100) });\n if (this.audio.current) {\n this.audio.current.volume = volume;\n } else {\n this.player.current!.volume = volume;\n }\n if (volume === 0) {\n this.setState({ isMuted: true });\n } else {\n this.setState({ isMuted: false });\n }\n break;\n default:\n }\n }\n\n private _onPlay(): void {\n this.setState({ playing: true });\n }\n\n private _onPause(): void {\n this.setState({ playing: false });\n }\n\n private _onVolumeChange(notification: ISliderChangeNotification): void {\n this.setState({ currentVolume: notification.firstThumbValue });\n if (this.audio.current) {\n this.audio.current.volume = notification.firstThumbValue / 100;\n } else {\n this.player.current!.volume = notification.firstThumbValue / 100;\n }\n\n if (notification.firstThumbValue === 0) {\n this.setState({ isMuted: true });\n } else if (this.state.isMuted && notification.firstThumbValue > 0) {\n this.setState({ isMuted: false });\n }\n }\n\n private _setMuted(): void {\n if (this.state.isMuted) {\n const newVolume = this.state.previousVolume === 0 ? PlayerConstants.defaultVolume * 100 : this.state.previousVolume;\n\n if (this.audio.current) {\n this.audio.current.volume = newVolume / 100;\n } else {\n this.player.current!.volume = newVolume / 100;\n }\n this.setState({ isMuted: false, currentVolume: newVolume });\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('unMuteAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.unMuteAriaLabel).call(this);\n } else {\n this.setState({ isMuted: true, previousVolume: this.player.current!.volume * 100, currentVolume: 0 });\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('muteAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.muteAriaLabel).call(this);\n }\n }\n\n private _onPlayerKeyDown(e: React.KeyboardEvent): void {\n const keyBrdEvent = (e as unknown) as KeyboardEvent;\n const keycode = keyBrdEvent.keyCode;\n\n if (keycode === KeyCodes.Tab) {\n this._showControlsBasedOnState();\n }\n }\n\n private _onMouseEvent(event: React.MouseEvent<HTMLDivElement>): void {\n if (this.props.playerData.options.controls) {\n this._showControlBar();\n }\n if (!this.state.isTriggerEnabled && this.state.playing) {\n this.setState({ mouseHovered: event.type === 'mouseenter' });\n }\n }\n\n private _showControlBar(autoHide: boolean = true): void {\n if (!this.state.isTriggerEnabled && !this.state.isAgegateEnabled) {\n if (!this.state.isControlPanelVisible) {\n this.setState({ isControlPanelVisible: true });\n }\n if (this.controlPanelTimer) {\n window && window.clearTimeout(this.controlPanelTimer);\n this.controlPanelTimer = 0;\n }\n if (autoHide) {\n this.controlPanelTimer =\n window &&\n window.setTimeout(() => {\n this._hideControlBar();\n }, PlayerConstants.defaultControlPanelTimeout);\n }\n }\n }\n\n private _hideControlBar(): void {\n window && window.clearTimeout(this.controlPanelTimer);\n this.controlPanelTimer = 0;\n this.setState({ isControlPanelVisible: false });\n }\n\n private _onFullScreenChanged(): void {\n this.state.isInFullScreen ? this._onFullscreenExit() : this._onFullscreenEnter();\n }\n\n /**\n * Event handler for fullscreen enter.\n */\n private _onFullscreenEnter(): void {\n this.setState({\n isInFullScreen: true\n });\n }\n\n /**\n * Event handler for fullscreen exit.\n */\n private _onFullscreenExit(): void {\n this.setState({\n isInFullScreen: false\n });\n }\n\n private _toggleFullScreen(): void {\n this.state.isInFullScreen ? this._exitFullScreen() : this._enterFullScreen();\n }\n\n private _onFullscreenError(): void {\n this.setState({\n isInFullScreen: false\n });\n }\n\n private _enterFullScreen(): void {\n if (!Player._isNativeFullscreenEnabled()) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fullscreenElement = this.playerContainer.current! as any;\n const elementInFullScreen = Player._getElementInFullScreen();\n\n // We go to fullscreen only when there is no other element in fullscreen and browser supports fullscreen\n if (fullscreenElement && !elementInFullScreen) {\n const enterFullScreen =\n fullscreenElement.requestFullscreen ||\n fullscreenElement.msRequestFullscreen ||\n fullscreenElement.mozRequestFullScreen ||\n fullscreenElement.webkitRequestFullscreen ||\n fullscreenElement.webkitEnterFullScreen;\n\n enterFullScreen.call(fullscreenElement);\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('fullScreenLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.fullScreenAriaLabel).call(this);\n }\n }\n\n private _exitFullScreen(): void {\n if (!Player._isNativeFullscreenEnabled()) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fullscreenElement = this.playerContainer.current! as any;\n const elementInFullScreen = Player._getElementInFullScreen();\n\n // We only call cancel if we are in fullscreen. If another element went fullscreen that took the player with it then\n // we shouldn't call cancel fullscreen\n if (fullscreenElement && fullscreenElement === elementInFullScreen) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const doc = document as any;\n const cancelFullScreen = doc.cancelFullScreen || doc.msExitFullscreen || doc.mozCancelFullScreen || doc.webkitCancelFullScreen;\n\n cancelFullScreen.call(doc);\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('exitFullScreenLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.exitFullScreenAriaLabel).call(this);\n }\n }\n\n private _onVideoLoadedData(): void {\n this._updateState('ready');\n if (this.props.playerData.options.controls) {\n const position = this._getPlayPosition();\n this.setState({ playPosition: position });\n }\n }\n\n private _onTimeUpdate(): void {\n if (this.props.playerData.options.controls) {\n const position = this._getPlayPosition();\n\n // EndTime changes after playing video for certain time. Keeping this constant.\n position.endTime = this.state.playPosition.endTime;\n this.setState({ playPosition: position });\n if (this.state.playing) {\n if (this.playerState === 'buffering') {\n this._updateState('playing');\n }\n }\n }\n }\n\n private _getBufferedDuration(): number {\n let buffered = 0;\n if (this.player.current!.buffered && this.player.current!.buffered.length) {\n buffered = this.player.current!.buffered.end(this.player.current!.buffered.length - 1);\n }\n return buffered;\n }\n\n private _getPlayPosition(): IPlayPosition {\n const bufferedDuration = this._getBufferedDuration();\n return {\n currentTime: this.player.current!.currentTime,\n startTime: 0,\n endTime: this.player.current!.duration,\n bufferedDuration\n };\n }\n\n private _onProgressChange(notification: ISliderChangeNotification): void {\n let time = notification.firstThumbValue;\n const position = this._getPlayPosition();\n time = Math.max(position.startTime, Math.min(time, position.endTime));\n\n if (Math.abs(time - position.currentTime) >= PlayerConstants.defaultPositionUpdateThreshold) {\n this.player.current!.currentTime = time;\n if (this.audio.current) {\n this.audio.current.currentTime = time;\n }\n }\n }\n\n private _onTriggerClicked(): void {\n const currentPlayer = this.player.current;\n if (!this.isPlayerLoaded) {\n this._loadPlayer();\n this.player.current!.autoplay = true;\n } else if (currentPlayer!.paused) {\n this.play();\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('playingAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.playAriaLabel).call(this);\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPause();\n }\n } else {\n this.pause();\n this._updateScreenReaderElement(this.localizationHelper.getLocalizedValue('pausedAriaLabel'));\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.pauseAriaLabel).call(this);\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPlay();\n }\n }\n\n if (this.state.isTriggerEnabled) {\n this.setState({ isTriggerEnabled: false }, () => {\n setTimeout(() => {\n if (this.videoControl.current) {\n this.videoControl.current.setFocusOnPause();\n }\n }, 500);\n });\n onTelemetryClick(this.props.telemetryContent!, this.payLoad, LocalizationConstants.pauseAriaLabel).call(this);\n if (this.props.playerData.options.playFullScreen) {\n this._enterFullScreen();\n }\n }\n }\n\n private _stop(): void {\n const videoStartingTime: number = 0.1;\n if (isSafari()) {\n // Safari browser has issues with showing the poster frame of the video when ended. So setting the same to 0.1 seconds.\n this._seek(videoStartingTime);\n } else {\n this._seek(0);\n }\n\n if (this.props.playerData.options.controls) {\n this.pause();\n const playPosition = this._getPlayPosition();\n playPosition.endTime = this.state.playPosition.endTime;\n this.setState({ playPosition });\n if (this.audio.current) {\n this.audio.current.pause();\n }\n }\n }\n\n private _seek(time: number): void {\n const position = this._getPlayPosition();\n time = Math.max(position.startTime, Math.min(time, position.endTime));\n\n if (Math.abs(time - position.currentTime) >= PlayerConstants.defaultPositionUpdateThreshold) {\n this.seekFrom = position.currentTime;\n this.player.current!.currentTime = time;\n if (this.audio.current) {\n this.audio.current.currentTime = time;\n }\n }\n }\n\n /**\n * Returns the mask level style.\n * @returns Returns the mask level style.\n */\n private _getMaskLevelStyle(): string {\n let result: string = '';\n if (this.state.isTriggerEnabled) {\n const maskLevel = this.props.playerData.options.maskLevel || PlayerConstants.defaultMaskLevel;\n result = format('rgba(0,0,0,{0})', Number(maskLevel) / 100);\n }\n return result;\n }\n\n /**\n * Updates the current player state.\n * @param newState - Player state.\n */\n private _updateState(newState: PlayerStates): void {\n if (!newState || newState === this.playerState) {\n return;\n }\n\n this.playerState = newState;\n\n this._showControlsBasedOnState();\n this._showSpinnerBasedOnState();\n }\n\n /**\n * Shows or hides the spinner based on player state.\n */\n private _showSpinnerBasedOnState(): void {\n switch (this.playerState) {\n case 'ready':\n case 'playing':\n case 'paused':\n case 'ended':\n case 'stopped':\n case 'error':\n this._hideSpinner();\n break;\n default:\n this._showSpinner();\n }\n }\n\n /**\n * Shows or hides the player controls based on player state.\n */\n private _showControlsBasedOnState(): void {\n switch (this.playerState) {\n case 'error':\n case 'loading':\n case 'init':\n this._hideControlBar();\n break;\n case 'ended':\n this._showControlBar(false);\n break;\n case 'ready':\n case 'paused':\n case 'stopped':\n this._showControlBar(false);\n break;\n default:\n this._showControlBar(true);\n }\n }\n\n private _hideSpinner(): void {\n this.setState({ showSpinner: false });\n }\n\n private _showSpinner(): void {\n this.setState({ showSpinner: true });\n }\n\n /**\n * Play Trigger focus event.\n */\n private _onTriggerFocus(): void {\n this.setState({ mouseHovered: true });\n }\n\n /**\n * Play Trigger Blur event.\n */\n private _onTriggerBlur(): void {\n if (!this.state.isTriggerEnabled && this.state.playing) {\n this.setState({ mouseHovered: false });\n }\n }\n\n /**\n * Updates the screen reader element.\n * @param text - Update the screen reader element with the pased text.\n */\n private _updateScreenReaderElement(text: string): void {\n this.setState({\n screenReaderText: text\n });\n }\n\n /**\n * Avoid opening context menu on righ click.\n * @param e - Mouse Event.\n */\n private _onContextMenuClicked(e: React.MouseEvent): void {\n e.preventDefault();\n }\n\n /**\n * Check for mobile devices.\n * @returns - Return true or false.\n */\n private _isMobile(): boolean {\n if (MsDyn365.msdyn365Commerce.isBrowser) {\n const userAgent = window.navigator.userAgent;\n const isIphone = !!userAgent.match(/iphone/i);\n const isSilk = !!userAgent.match(/silk/i);\n const isWindowsPhone = !!userAgent.match(/windows phone/i);\n const isAndroid = !isWindowsPhone && (isSilk || !!userAgent.match(/android/i));\n return isIphone || isWindowsPhone || isAndroid;\n }\n return false;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nimport { IActionToggleProps } from './action-toggle.props';\n\n/**\n * ActionToggle - This component is toggle button which switches between states\n * and for accessibility reasons are 2 different buttons.\n */\nexport default class ActionToggle extends React.PureComponent<IActionToggleProps> {\n private readonly _divRef: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private _focusElement: HTMLElement | null = null;\n\n public constructor(props: Readonly<IActionToggleProps>) {\n super(props);\n this._onClick = this._onClick.bind(this);\n }\n\n public getSnapshotBeforeUpdate(): null {\n this._focusElement = null;\n if (this._divRef.current?.contains(document.activeElement)) {\n this._focusElement = document.activeElement as HTMLElement;\n }\n return null;\n }\n\n public render(): JSX.Element | null {\n const { className, children, toggled, onChange, ...props } = this.props;\n const classes = `action-toggle${className ? ' ' : ''}${className || ''}`;\n return React.Children.count(children) !== 2 ? null : (\n <div className={classes} {...props} ref={this._divRef}>\n {React.Children.map(children, (child: React.ReactNode, index: number) => {\n const hidden = (!index && !!toggled) || (!!index && !toggled);\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return React.cloneElement(child as any, { 'aria-hidden': hidden, onClick: this._onClick });\n })}\n </div>\n );\n }\n\n private _onClick(event: React.KeyboardEvent): void {\n event.stopPropagation();\n if (this.props.onChange) {\n this.props.onChange({ id: this.props.id, actionToggle: this, toggled: !!this.props.toggled, event });\n }\n if (this._divRef.current && this._focusElement) {\n const focusTarget = this._divRef.current.children[this.props.toggled ? 1 : 0] as HTMLElement;\n if (focusTarget !== document.activeElement) {\n focusTarget.focus();\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 * as React from 'react';\n\nimport { PlayerConstants, VideoPlayerNames } from '../data';\nimport { IAgeGateProps } from './age-gate.props';\n\n/**\n *\n * AgeGate React component for video player.\n *\n */\nexport interface IDropdownState {\n monthValue: string;\n dayValue: string;\n yearValue: string;\n}\n\n/**\n * AgeGate class.\n */\nexport default class AgeGate extends React.PureComponent<IAgeGateProps, IDropdownState> {\n public static defaultProps: Partial<IAgeGateProps> = {\n minmumAge: 18\n };\n\n private readonly ageGateDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n public constructor(props: IAgeGateProps) {\n super(props);\n this._filterDateMonthYear = this._filterDateMonthYear.bind(this);\n this.state = {\n monthValue: 'Month',\n dayValue: 'Day',\n yearValue: 'Year'\n };\n }\n\n public render(): JSX.Element {\n const enabled =\n PlayerConstants.regxForAgeGateInputValidation.test(this.state.dayValue) &&\n PlayerConstants.regxForAgeGateInputValidation.test(this.state.monthValue) &&\n PlayerConstants.regxForAgeGateInputValidation.test(this.state.yearValue);\n return (\n <div\n className={`${VideoPlayerNames.videoplayerContainer}__agegate__container`}\n ref={this.ageGateDiv}\n aria-hidden={this.props['aria-hidden']}\n >\n <div>\n <div>\n <h3> Enter your date of birth </h3>\n <fieldset>\n <div>{this.renderSelectMonth()}</div>\n <div>{this.renderSelectDay()}</div>\n <div>{this.renderSelectYear()}</div>\n <button disabled={!enabled} onClick={this.props.onSubmitClick}>\n Submit\n </button>\n </fieldset>\n </div>\n </div>\n </div>\n );\n }\n\n public getCalculatedAge = () => {\n const day: number = Number(this.state.dayValue);\n const month: number = Number(this.state.monthValue);\n const year: number = Number(this.state.yearValue);\n const today: Date = new Date();\n let age = today.getFullYear() - year;\n const birthdayMonthHasNotHappenedYet: boolean = today.getMonth() + 1 < month;\n const birthdayDayHasNotHappenedYet: boolean = today.getMonth() + 1 === month && today.getDate() < day;\n if (birthdayMonthHasNotHappenedYet || birthdayDayHasNotHappenedYet) {\n // User has not reached their birth month and/or birth day-of-month in the current year\n age--;\n }\n const minimmumage = Number(this.props.minmumAge);\n if (age >= minimmumage) {\n return true;\n }\n return false;\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private _filterDateMonthYear(event: any): void {\n switch (event.target.id) {\n case 'selectDay': {\n this.setState({ dayValue: event.target.value });\n break;\n }\n case 'selectMonth': {\n this.setState({ monthValue: event.target.value });\n break;\n }\n case 'selectYear': {\n this.setState({ yearValue: event.target.value });\n break;\n }\n default:\n break;\n }\n }\n\n private readonly renderSelectMonth = (): JSX.Element => {\n const maxOffset = 12;\n const allMonth = [];\n for (let month = 1; month <= maxOffset; month++) {\n allMonth.push(month);\n }\n const monthList = allMonth.map(month => {\n return (\n <option role='menuitem' key={month} value={month}>\n {month.toFixed(0)}\n </option>\n );\n });\n return (\n <select\n aria-expanded='false'\n className={`${VideoPlayerNames.videoplayerContainer}__agegate__select`}\n role='menu'\n onChange={this._filterDateMonthYear}\n value={this.state.monthValue}\n aria-label='Enter your month of birth'\n name='selectMonth'\n id='selectMonth'\n >\n <option role='menuitem'>Month</option>\n {monthList}\n </select>\n );\n };\n\n private readonly renderSelectDay = (): JSX.Element => {\n const maxOffset = 31;\n const allDay = [];\n for (let day = 1; day <= maxOffset; day++) {\n allDay.push(day);\n }\n const dayList = allDay.map(day => {\n return (\n <option role='menuitem' key={day}>\n {day.toFixed(0)}\n </option>\n );\n });\n return (\n <select\n aria-expanded='false'\n className={`${VideoPlayerNames.videoplayerContainer}__agegate__select`}\n role='menu'\n onChange={this._filterDateMonthYear}\n value={this.state.dayValue}\n aria-label='Enter your day of birth'\n name='selectDay'\n id='selectDay'\n >\n <option role='menuitem'>Day</option>\n {dayList}\n </select>\n );\n };\n\n private readonly renderSelectYear = (): JSX.Element => {\n const maxOffset = 100;\n const thisYear = new Date().getFullYear();\n const allYear = [];\n for (let year = 1; year <= maxOffset; year++) {\n allYear.push(thisYear - year);\n }\n const yearList = allYear.map(year => {\n return (\n <option role='menuitem' key={year}>\n {year.toFixed(0)}\n </option>\n );\n });\n return (\n <select\n aria-expanded='false'\n className={`${VideoPlayerNames.videoplayerContainer}__agegate__select`}\n role='menu'\n onChange={this._filterDateMonthYear}\n value={this.state.yearValue}\n aria-label='Enter your year of birth'\n name='selectYear'\n id='selectYear'\n >\n <option role='menuitem'>Year</option>\n {yearList}\n </select>\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 { ICurrentClosedCaptionsSettings } from '../data';\nimport { IDictionaryStringString } from '../utilities';\n\n/**\n * Video closed captions constant.\n */\nexport const videoClosedCaptionsConstant = {\n presetKey: 'preset'\n};\n\n/**\n * @name - closedCaptionsSettinsDefaults\n * @description - The default value for closed captions settings.\n */\nexport const closedCaptionsSettingDefaults: ICurrentClosedCaptionsSettings = {\n preset: 'preset1',\n text_font: 'proportionalsansserif',\n text_color: 'white',\n text_opacity: '100',\n text_size: 'default',\n text_edge_style: 'none',\n text_background_color: 'black',\n text_background_opacity: '100',\n window_color: 'black',\n window_opacity: '0'\n};\n\n/**\n * @name - closedCaptionsSettingsMap\n * @description - The closed captions settings map.\n */\nexport const closedCaptionsSettingsMap: IClosedCaptionsSettingsMap = {\n text_font: { value: 'font-family:', option: 'font' },\n text_color: { value: 'color:', option: 'color' },\n text_size: { value: 'font-size:', option: 'text_size' },\n text_edge_style: { value: 'text-shadow:', option: 'text_edge_style' },\n text_opacity: { value: 'color:', option: 'percent' },\n text_background_color: { value: 'background:', option: 'color' },\n text_background_opacity: { value: 'background:', option: 'percent' },\n window_color: { value: 'background:', option: 'color' },\n window_opacity: { value: 'background:', option: 'percent' }\n};\n\n/**\n * @interface IClosedCaptionsSettingsMap\n * @description - The data contract interface used for storing closed caption setting map.\n */\nexport interface IClosedCaptionsSettingsMap {\n [key: string]: IClosedCaptionsSettings;\n}\n\n/**\n * @interface IClosedCaptionsSettings\n * @description - The data contract interface used for storing closed caption setting values.\n */\nexport interface IClosedCaptionsSettings {\n value: string;\n option: string;\n}\n\n/**\n * Closed Captions Preset Map Interface.\n */\nexport interface IClosedCaptionsPresetMap {\n [key: string]: IDictionaryStringString;\n}\n\n/**\n * @name - closedCaptionsPresetMap\n * @description - The closed captions preset settings map.\n */\nexport const closedCaptionsPresetMap: IClosedCaptionsPresetMap = {\n preset1: {\n text_font: 'proportionalsansserif',\n text_color: 'white',\n text_opacity: '100',\n text_background_color: 'black',\n text_background_opacity: '100'\n },\n preset2: {\n text_font: 'monospacedserif',\n text_color: 'white',\n text_opacity: '100',\n text_background_color: 'black',\n text_background_opacity: '100'\n },\n preset3: {\n text_font: 'proportionalsansserif',\n text_color: 'yellow',\n text_opacity: '100',\n text_background_color: 'black',\n text_background_opacity: '100'\n },\n preset4: {\n text_font: 'proportionalsansserif',\n text_color: 'blue',\n text_opacity: '100',\n text_background_color: 'grey',\n text_background_opacity: '100'\n },\n preset5: {\n text_font: 'casual',\n text_color: 'white',\n text_opacity: '100',\n text_background_color: 'black',\n text_background_opacity: '100'\n }\n};\n\n/**\n * @name - closedCaptionsSettingsOptions\n * @description - The closed captions settings options and value map.\n */\nexport const closedCaptionsSettingsOptions: IClosedCaptionsOptionsMap = {\n font: {\n pre: 'cc_font_name_', // Key prefix for the localization\n map: {\n casual: 'Verdana;font-variant:normal',\n cursive: 'Zapf-Chancery,Segoe script,Cursive;font-variant:normal',\n monospacedsansserif: 'Lucida sans typewriter,Lucida console,Consolas;font-variant:normal',\n monospacedserif: 'Courier;font-variant:normal',\n proportionalsansserif: 'Arial,Sans-serif;font-variant:normal',\n proportionalserif: 'Times New Roman,Serif;font-variant:normal',\n smallcapitals: 'Arial,Helvetica,Sans-serif;font-variant:small-caps'\n }\n },\n percent: {\n pre: 'cc_percent_', // Key prefix for the options\n map: {\n 0: '0',\n 50: '0.5',\n 75: '0.75',\n 100: '1'\n }\n },\n text_size: {\n pre: 'cc_text_size_', // Key prefix for the options\n map: {\n small: '75%',\n default: '100%',\n large: '125%',\n extralarge: '150%',\n maximum: '200%'\n }\n },\n color: {\n pre: 'cc_color_', // Key prefix for the options\n map: {\n white: '#FFFFFF',\n black: '#000000',\n blue: '#0000FF',\n cyan: '#00FFFF',\n green: '#00FF00',\n grey: '#BCBCBC',\n magenta: '#FF00FF',\n red: '#FF0000',\n yellow: '#FFFF00'\n }\n },\n text_edge_style: {\n pre: 'cc_text_edge_style_', // Key prefix for the options\n map: {\n none: 'none',\n depressed: '1px 1px 0 #FFF,-1px -1px 0 #000',\n dropshadow: '1px 1px 0 #000',\n raised: '1px 1px 0 #000,-1px -1px 0x #FFF',\n uniform: '1px 1px 0 #000,-1px 1px 0 #000,1px -1px 0 #000,-1px -1px 0 #000'\n }\n }\n};\n\n/**\n * @interface IClosedCaptionOptionsMap\n * @description - The data contract interface used for storing player closed captions options map.\n */\nexport interface IClosedCaptionsOptionsMap {\n [key: string]: IClosedCaptionsOptions;\n}\n\n/**\n * @interface IClosedCaptionsOptions\n * @description - The data contract interface used for storing closed captions options values.\n */\nexport interface IClosedCaptionsOptions {\n pre: string;\n map: IDictionaryStringString;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { extend, IClientDimension, IDictionaryStringString, IGrid } from '../utilities';\n\n/**\n * Timed Text Markup Language (TTML).\n * See http://www.w3.org/TR/ttml1/ for more details.\n */\nexport const xmlNS = 'http://www.w3.org/XML/1998/namespace';\n\n/**\n * @interface ITtmlSettings\n * @classdesc - The ITtmlSettings interface contract.\n */\nexport interface ITtmlSettings {\n ttmlNamespace?: string;\n ttmlStyleNamespace?: string;\n ttmlParameterNamespace?: string;\n ttmlMetaNamespace?: string;\n idPrefix?: string;\n mediaFrameRate?: number;\n mediaFrameRateMultiplier?: number;\n mediaSubFrameRate?: number;\n mediaTickRate?: number;\n supportedTimeBase?: string;\n rootContainerRegionDimensions?: IClientDimension | null;\n relatedMediaObjectRegion?: IClientDimension | null;\n cellResolution?: IGrid;\n defaultRegionStyle?: IDictionaryStringString;\n fontMap?: IDictionaryStringString;\n log?: Function;\n}\n\n/**\n *\n * The TtmlSettings class.\n * The TtmlSettings class is used to pass settings between the ttml parser, the ttml context, and the outside world.\n * It supplies default values which can be overridden via overrides passed to the constructor.\n */\nexport class TtmlSettings implements ITtmlSettings {\n /**\n * @name - ttmlNamespace\n * @description - The ttml namespace to use.\n * @public\n * @type {string}\n */\n public ttmlNamespace: string = 'http://www.w3.org/ns/ttml';\n\n /**\n * @name - ttmlStyleNamespace\n * @description - The ttml style namespace to use.\n * @public\n * @type {string}\n */\n public ttmlStyleNamespace: string = 'http://www.w3.org/ns/ttml#styling';\n\n /**\n * @name - ttmlParameterNamespace\n * @description - The ttml parameter namespace to use.\n * @public\n * @type {string}\n */\n public ttmlParameterNamespace: string = 'http://www.w3.org/ns/ttml#parameter';\n\n /**\n * @name - ttmlMetaNamespace\n * @description - The ttml metadata namespace to use.\n * @public\n * @type {string}\n */\n public ttmlMetaNamespace: string = 'http://www.w3.org/ns/ttml#metadata';\n\n /**\n * @name - idPrefix\n * @description - The id prefix to use so ids copied from the ttml doc are unique.\n * @public\n * @type {string}\n */\n public idPrefix: string = '';\n\n /**\n * @name - mediaFrameRate\n * @description - The media frame rate to use.\n * @public\n * @type {number}\n */\n public mediaFrameRate: number = 30;\n\n /**\n * @name - mediaFrameRateMultiplier\n * @description - The media frame rate multiplier to use.\n * @public\n * @type {number}\n */\n public mediaFrameRateMultiplier: number = 1;\n\n /**\n * @name - mediaSubFrameRate\n * @description - The media sub frame rate to use.\n * @public\n * @type {number}\n */\n public mediaSubFrameRate: number = 1;\n\n /**\n * @name - mediaTickRate\n * @description - The media tick rate to use.\n * @public\n * @type {number}\n */\n public mediaTickRate: number = 1000;\n\n /**\n * @name - supportedTimeBase\n * @description - The support timebase value.\n * @public\n * @type {string}\n */\n public supportedTimeBase: string = 'media';\n\n /**\n * @name - rootContainerRegionDimensions\n * @description - The root container's dimensions.\n * @public\n * @type {IClientDimension}\n */\n public rootContainerRegionDimensions: IClientDimension | null = null;\n\n /**\n * @name - relatedMediaObjectRegion\n * @description - The media object's dimensions.\n * @public\n * @type {IClientDimension}\n */\n public relatedMediaObjectRegion: IClientDimension | null = null;\n\n /**\n * @name - cellResolution\n * @description - The default cell grid.\n * @public\n * @type {IGrid}\n */\n public cellResolution: IGrid = { rows: 15, columns: 32 };\n\n /**\n * @name - defaultRegionStyle\n * @description - The default region style.\n * @public\n * @type {IDictionaryStringString}\n */\n public defaultRegionStyle: IDictionaryStringString = {\n backgroundColor: 'transparent',\n color: '#E8E9EA',\n direction: 'ltr',\n display: 'auto',\n displayAlign: 'before',\n extent: 'auto',\n fontFamily: 'default',\n fontSize: '1c',\n fontStyle: 'normal',\n fontWeight: 'normal',\n lineHeight: 'normal',\n opacity: '1',\n origin: 'auto',\n overflow: 'hidden',\n padding: '0',\n showBackground: 'always',\n textAlign: 'start',\n textDecoration: 'none',\n textOutline: 'none',\n unicodeBidi: 'normal',\n visibility: 'visible',\n wrapOption: 'normal',\n writingMode: 'lrtb'\n };\n\n /**\n * @name - fontMap\n * @description - The default font map.\n * @public\n * @type {IDictionaryStringString}\n */\n public fontMap: IDictionaryStringString = {};\n\n /**\n * @name - log\n * @description - The logging function to use in debug mode.\n * @public\n * @type {Function}\n */\n public log: Function | undefined;\n\n /*\n * Constructor for the TtmlSettings class.\n */\n public constructor(settingsOverrides?: ITtmlSettings) {\n // These are from the Simple Delivery Profile\n // Per spec recommendation that default be monospace sans serif.\n this.fontMap.default = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.monospaceSerif = 'Courier';\n this.fontMap.proportionalSerif = 'Times New Roman, Serif';\n this.fontMap.monospaceSansSerif = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.proportionalSansSerif = 'Arial, Sans-serif';\n this.fontMap.casual = 'Verdana';\n this.fontMap.cursive = 'Zapf-Chancery, Segoe script, Cursive';\n this.fontMap.smallCaps = 'Arial, Helvetica';\n\n // These are others from the broader ttml (v1.0)\n this.fontMap.monospace = 'Lucida sans typewriter, Lucida console, Consolas';\n this.fontMap.sansSerif = 'Arial, Sans-serif';\n this.fontMap.serif = 'Times New Roman, Serif';\n\n if (settingsOverrides) {\n extend(this, settingsOverrides);\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 {\n addClass,\n css,\n extend,\n format,\n getDimensions,\n getText,\n IClientDimension,\n IDictionaryStringString,\n isNullOrWhiteSpace,\n nodeListToArray,\n trim\n} from '../utilities';\nimport { ITtmlEvent, TtmlParser } from './ttml-parser';\nimport { TtmlSettings, xmlNS } from './ttml-settings';\n\n// Timed Text Markup Language (TTML).\n// See http://www.w3.org/TR/ttml1/ for more details.\n\n/**\n * @interface ITtmlContext\n * @classdesc - The TtmlContext interface contract.\n */\nexport interface ITtmlContext {\n setOwnerDocument(ownerDocument: Document): void;\n updateRelatedMediaObjectRegion(dimensions: IClientDimension): boolean;\n resetCurrentEvents(): void;\n hasEvents(): boolean;\n updateCurrentEvents(time: number): boolean;\n getCues(time: number): HTMLElement[];\n}\n\n/**\n * @interface ITtmlTranslationResult\n * @classdesc - The ITtmlTranslationResult interface contract.\n */\ninterface ITtmlTranslationResult {\n outerNode: HTMLElement | null;\n innerNode: HTMLElement | null;\n inheritableStyleSet?: IDictionaryStringString | null;\n}\n\n/**\n * @interface ITtmlPruneResult\n * @classdesc - The ITtmlPruneResult interface contract.\n */\ninterface ITtmlPruneResult {\n prunedElement: Element;\n hasPreservedContent: boolean;\n}\n\n/**\n * The TtmlContext. An instance of this class is returned from the TttmlParser.parse() method after it parses a ttml file.\n * This context is then used by the VideoClosedCaptions object to get the captions for any play position of the video.\n */\nexport class TtmlContext implements ITtmlContext {\n /**\n * @name - lengthRegEx\n * The regular expression pattern used in ttml->css text outline conersion.\n * @static\n * @private\n * @type {RegExp}\n */\n private static readonly lengthRegEx: RegExp = /\\s*(\\d+\\.*\\d*)(.*)\\s*/;\n\n /**\n * @name - rgbaRegEx\n * The regular expression pattern used in ttml->css color conersion.\n * @static\n * @private\n * @type {RegExp}\n */\n private static readonly rgbaRegEx: RegExp = /\\s*rgba\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*\\)\\s*/;\n\n /**\n * @name - TtmlNamedColorMap\n * The table used to map named ttml color values to css color values.\n * @static\n * @private\n * @type {IDictionaryStringString}\n */\n private static readonly TtmlNamedColorMap: IDictionaryStringString = {\n transparent: 'rgba(0,0,0,0)',\n black: 'rgba(0,0,0,1)',\n silver: 'rgba(192,192,192,1)',\n gray: 'rgba(128,128,128,1)',\n white: 'rgba(255,255,255,1)',\n maroon: 'rgba(128,0,0,1)',\n red: 'rgba(255,0,0,1)',\n purple: 'rgba(128,0,128,1)',\n fuchsia: 'rgba(255,0,255,1)',\n magenta: 'rgba(255,0,255,1)',\n green: 'rgba(0,128,0,1)',\n lime: 'rgba(0,255,0,1)',\n olive: 'rgba(128,128,0,1)',\n yellow: 'rgba(255,255,0,1)',\n navy: 'rgba(0,0,128,1)',\n blue: 'rgba(0,0,255,1)',\n teal: 'rgba(0,128,128,1)',\n aqua: 'rgba(0,255,255,1)',\n cyan: 'rgba(0,255,255,1)'\n };\n\n /**\n * @name - events\n * The set of all ttml events.\n * @public\n * @type {ITtmlEvent[]}\n */\n public events!: ITtmlEvent[];\n\n /**\n * @name - settings\n * The ttml settings.\n * @public\n * @type {TtmlSettings}\n */\n public settings!: TtmlSettings;\n\n /**\n * @name - styleSetCache\n * The ttml styleSet cache.\n * @public\n * @type {IDictionaryStringString[]}\n */\n public styleSetCache!: IDictionaryStringString[];\n\n /**\n * @name - rootContainerRegion\n * The root container region.\n * @public\n * @type {Element}\n */\n public rootContainerRegion!: Element;\n\n /**\n * @name - root\n * The root element.\n * @public\n * @type {Element}\n */\n public root!: Element;\n\n /**\n * @name - body\n * The body element.\n * @public\n * @type {Element}\n */\n public body!: Element;\n\n /**\n * @name - layout\n * The layout element.\n * @public\n * @type {Element}\n */\n public layout!: Element;\n\n /**\n * @name - ownerDocument\n * The owner document for this context. Used to create html elements.\n * @private\n * @type {Document}\n */\n private ownerDocument!: Document;\n\n /**\n * @name - currentEvents\n * The current set of temporally active events.\n * @private\n * @type {ITtmlEvent[]}\n */\n private currentEvents!: ITtmlEvent[];\n\n /**\n * @name - currentEventsTime\n * The time the currentEvents was populated.\n * @private\n * @type {number}\n */\n private currentEventsTime!: number;\n\n /**\n * Converts a ttml text decoration style value to a css one.\n * @param ttmlTextDecoration - The ttml value.\n * @returns - The css value.\n */\n private static _ttmlToCssTextDecoration(ttmlTextDecoration: string): string {\n let textDecoration = '';\n const parts = ttmlTextDecoration.split(/\\s+/);\n\n // Since we have no CSS for the 'no' values just replace them all with a none at the front of the list.\n for (const value of parts) {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'none':\n case 'noUnderline':\n case 'noLineThrough':\n case 'noOverline':\n textDecoration = 'none';\n }\n }\n\n // Then append all the others.\n for (const value of parts) {\n switch (value) {\n case 'none':\n case 'noUnderline':\n case 'noLineThrough':\n case 'noOverline':\n break;\n case 'lineThrough':\n textDecoration += ' line-through';\n break;\n default:\n textDecoration += ` ${value}`;\n }\n }\n\n return trim(textDecoration);\n }\n\n /**\n * Converts a ttml text color style value to a css one.\n * #RRGGBB and rgb(rrr,ggg,bbb) do not need conversion and are not modified.\n * #RRGGBBAA is modified because css doesn't support it (at least as implemented in todays browsers).\n * rgba(rrr,ggg,bbb,aaa) is converted to rgba(rrr,ggg,bbb,0-1).\n * ttml namedColors are converted to rgb(rrr,ggg,bbb) in the unlikely event that their alpha (only) is overridden.\n * @param color - The ttml value.\n * @returns - The css value.\n */\n private static _ttmlToCssColor(color: string): string {\n let mappedColor = color;\n\n color = color.toLowerCase();\n\n if (color.startsWith('rgba')) {\n const parts = TtmlContext.rgbaRegEx.exec(color);\n\n if (parts && parts.length === 5) {\n const red = parts[1];\n const green = parts[2];\n const blue = parts[3];\n const alpha = Number.parseInt(parts[4], 10);\n\n mappedColor = format('rgba({0},{1},{2},{3})', red, green, blue, Math.round((alpha * 100) / 255) / 100);\n }\n } else if (color.startsWith('#') && color.length === 9) {\n const red = Number.parseInt(color.substr(1, 2), 16);\n const green = Number.parseInt(color.substr(3, 2), 16);\n const blue = Number.parseInt(color.substr(5, 2), 16);\n const alpha = Number.parseInt(color.substr(7, 2), 16);\n\n mappedColor = format('rgba({0},{1},{2},{3})', red, green, blue, Math.round((alpha * 100) / 255) / 100);\n } else if (TtmlContext.TtmlNamedColorMap[color]) {\n mappedColor = TtmlContext.TtmlNamedColorMap[color];\n }\n\n return mappedColor;\n }\n\n /**\n * Applies default styles to the element to match the ttml defaults.\n * @param element - The element to set the default styles on.\n * @returns - The specified element (for chaining).\n */\n private static _defaultStyle(element: HTMLElement): HTMLElement {\n // Set some element styles to our ttml defaults for them.\n css(element, 'background-color', TtmlContext.TtmlNamedColorMap.transparent);\n css(element, 'offset', '0');\n css(element, 'margin', '0');\n css(element, 'padding', '0');\n css(element, 'border', '0');\n return element;\n }\n\n /**\n * Set the context's owner document. It will use this to create elements during translation.\n * @param ownerDocument - The owner document for this context.\n */\n public setOwnerDocument(ownerDocument: Document): void {\n this.ownerDocument = ownerDocument;\n }\n\n /**\n * Updates the context's media object region.\n * @public\n * @param dimensions - The desired dimensions for the region.\n * @returns - True if the dimensions where changed, otherwise false.\n */\n public updateRelatedMediaObjectRegion(dimensions: IClientDimension): boolean {\n if (\n dimensions !== null &&\n (!this.settings.relatedMediaObjectRegion ||\n dimensions.width !== this.settings.relatedMediaObjectRegion.width ||\n dimensions.height !== this.settings.relatedMediaObjectRegion.height)\n ) {\n this.settings.relatedMediaObjectRegion = {\n width: dimensions.width,\n height: dimensions.height\n };\n\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates whether or not the context has events.\n * @returns - True if the context has events, otherwise false.\n */\n public hasEvents(): boolean {\n return this.events && !!this.events.length;\n }\n\n /**\n * Resets the context's currentEvents.\n */\n public resetCurrentEvents(): void {\n this.currentEvents = [];\n }\n\n /**\n * Updates the context's currentEvents if there are new events for the specified time.\n * @param time - The time to get events for.\n * @returns - True if the events for the specified time are different than the currentEvents, otherwise false.\n */\n public updateCurrentEvents(time: number): boolean {\n const timeEvents = this._getTemporallyActiveEvents(time);\n\n // As a shortcut compare lengths first.\n const currentEventsLength = this.currentEvents ? this.currentEvents.length : 0;\n const timeEventsLength = timeEvents ? timeEvents.length : 0;\n\n if (currentEventsLength !== timeEventsLength) {\n this.currentEventsTime = time;\n this.currentEvents = timeEvents;\n return true;\n }\n\n if (this.currentEvents) {\n for (let index = 0; index < currentEventsLength; index++) {\n if (this.currentEvents[index].time !== timeEvents[index].time) {\n this.currentEventsTime = time;\n this.currentEvents = timeEvents;\n return true;\n }\n }\n }\n\n return false;\n }\n\n /**\n * The set of cues that apply to the specified time.\n * @param time - The time to get cues for.\n * @returns - The set of cues for the specified time, otherwise an empty [].\n */\n public getCues(time: number): HTMLElement[] {\n let cues: HTMLElement[] = [];\n\n if (this.currentEventsTime !== time) {\n this.updateCurrentEvents(time);\n }\n\n // Find all the region elements in the TTML namespace.\n const preserveSpace = TtmlParser.getAttributeNS(this.root, 'space', xmlNS) === 'preserve';\n const regions = <HTMLElement[]>(this.layout ? this.layout.getElementsByTagNameNS(this.settings.ttmlNamespace, 'region') : []);\n\n for (const region of regions) {\n const regionId = TtmlParser.getAttributeNS(region, 'id', xmlNS);\n const anonymousId = region.getAttribute('data-isanonymous');\n\n if (anonymousId || regionId) {\n const translation = this._translate(region, this.settings.defaultRegionStyle, preserveSpace, time, this.translateToHtml);\n\n if (translation.outerNode && translation.innerNode) {\n const innerNode = translation.innerNode;\n const outerNode = translation.outerNode;\n\n // Create a new subtree for the body element, prune elements\n // not associated with the region, and if its not empty then\n // select it into this region by adding it to div container.\n for (const event of this.events) {\n if (event.element) {\n if (this._isInRegion(event.element, anonymousId ? '' : regionId)) {\n const pruneResult = this._prune(\n event.element,\n translation.inheritableStyleSet!,\n preserveSpace,\n time,\n this.translateToHtml\n );\n let cueBody: Element | null = pruneResult.prunedElement;\n\n if (!pruneResult.hasPreservedContent && cueBody && !trim(getText(cueBody)).length) {\n cueBody = null;\n }\n\n if (cueBody) {\n innerNode.appendChild(cueBody);\n }\n }\n }\n }\n\n const showAlways = outerNode.getAttribute('data-showBackground') === 'always';\n\n if (showAlways || innerNode.children.length) {\n if (showAlways) {\n // Just needed internally for the previous check, don't pass through on the cue.\n outerNode.removeAttribute('data-showBackground');\n }\n\n cues.push(outerNode);\n }\n }\n }\n }\n\n // If we ended up with any displayable cues add them all to the rootContainerRegion cue.\n if (cues.length) {\n const rcr = this._translate(this.rootContainerRegion, { overflow: 'hidden', padding: '0' }, false, time, this.translateToHtml);\n\n for (const cue of cues) {\n rcr.innerNode!.appendChild(cue);\n }\n\n cues = [];\n cues.push(rcr.outerNode!);\n }\n\n return cues;\n }\n\n /**\n * Get the list of temporally active events for the specified time.\n * @private\n * @param time - The time to get the active events for.\n * @returns - The set of active events for the specified time, otherwise an empty [].\n */\n private _getTemporallyActiveEvents(time: number): ITtmlEvent[] {\n return this.events.filter(event => {\n return event.element ? this._isTemporallyActive(event.element, time) : true;\n });\n }\n\n /**\n * Determines whether or not the specified element is temporally active at the specified time.\n * @param element - The element to check.\n * @param time - The time to check against.\n * @returns - True if the element is active at the specified time, otherwise false.\n */\n private _isTemporallyActive(element: Element, time: number): boolean {\n return (\n (Number.parseInt(element.getAttribute('data-time-start')!, 10) || 0) <= time &&\n time < (Number.parseInt(element.getAttribute('data-time-end')!, 10) || 0)\n );\n }\n\n /**\n * Convert a ttml element into the equivalent in another format via the supplied translator function.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The element's inherited style set.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param translator - The translator function to use. Originally supported both xml/html but is always using html in MWF.\n * @returns - A ITtmlTranslationResult instance containing the translation results.\n */\n private _translate(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n preserveSpace: boolean,\n time: number,\n translator: Function\n ): ITtmlTranslationResult {\n let translation: ITtmlTranslationResult;\n let computedStyleSet: IDictionaryStringString;\n\n if (this._isTemporallyActive(element, time)) {\n const tag = this._getTagNameEquivalent(element);\n\n computedStyleSet = this._getComputedStyleSet(element, inheritedStyleSet, tag, time);\n\n if (computedStyleSet.display !== 'none') {\n const applicableStyleSet = this._getApplicableStyleSet(computedStyleSet, tag);\n\n translation = translator(element, applicableStyleSet, preserveSpace);\n\n return {\n outerNode: translation.outerNode,\n innerNode: translation.innerNode,\n inheritableStyleSet: this._getInheritableStyleSet(computedStyleSet)\n };\n }\n }\n\n return { outerNode: null, innerNode: null, inheritableStyleSet: null };\n }\n\n /**\n * Convert a ttml element into the its equivalent html element.\n * @param element - The ttml element to translate.\n * @param applicableStyleSet - The style set applicable to this element.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @returns - A ITtmlTranslationResult instance containing the translation results.\n */\n private readonly translateToHtml = (\n element: Element,\n applicableStyleSet: IDictionaryStringString,\n preserveSpace: boolean\n ): ITtmlTranslationResult => {\n let translation: HTMLElement;\n let innerNode: HTMLElement;\n const name = this._getTagNameEquivalent(element);\n let htmlName = '';\n let htmlClass = '';\n switch (name) {\n case 'ttml:region':\n htmlClass = 'cue ';\n\n /* Falls through */\n // break;\n case 'ttml:rootcontainerregion':\n case 'ttml:body':\n case 'ttml:div':\n htmlName = 'div';\n break;\n case 'ttml:p':\n htmlName = 'p';\n break;\n case 'ttml:span':\n htmlName = 'span';\n break;\n case 'ttml:br':\n htmlName = 'br';\n break;\n default:\n }\n\n const role = TtmlParser.getAttributeNS(element, 'role', this.settings.ttmlMetaNamespace);\n\n if (role) {\n htmlClass += ` ${role}`;\n }\n\n const agent = TtmlParser.getAttributeNS(element, 'agent', this.settings.ttmlMetaNamespace);\n\n if (agent) {\n htmlClass += ` ${agent}`;\n }\n\n // Hack until display:ruby on other elements works.\n if (role === 'x-ruby') {\n htmlName = 'ruby';\n } else if (role === 'x-rubybase') {\n htmlName = 'rb';\n } else if (role === 'x-rubytext') {\n htmlName = 'rt';\n }\n\n if (!isNullOrWhiteSpace(htmlName)) {\n translation = TtmlContext._defaultStyle(this.ownerDocument.createElement(htmlName));\n addClass(translation, trim(htmlClass));\n\n const title = TtmlParser.getAttributeNS(element, 'title', this.settings.ttmlMetaNamespace);\n\n if (title) {\n translation.setAttribute('title', title);\n }\n\n const id = TtmlParser.getAttributeNS(element, 'id', xmlNS);\n\n if (id && this.settings.idPrefix) {\n // Migrate the ttml doc id's over to the html markup.\n // Use idPrefix to ensure there are no name clases on id's already in target doc.\n translation.setAttribute('id', this.settings.idPrefix + id);\n }\n\n if (name === 'ttml:region') {\n // To get a <region> to display properly we are actually going to need to create two nested <div>s\n // This is because for displayAlign to work we need a table-cell <div> inside a table <div>.\n innerNode = translation.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('div')));\n innerNode.setAttribute('style', 'display:table; border-spacing:0; cell-spacing:0; cell-padding:0; width:100%; height:100%');\n innerNode = innerNode.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('div')));\n css(innerNode, 'display', 'table-cell');\n\n // Apply the displayAlign style to inner table-cell <div>\n if (applicableStyleSet.displayAlign) {\n this._translateStyle(name, innerNode, { displayAlign: applicableStyleSet.displayAlign });\n\n // Then remove displayAlign from the applicableStyleSet so as not to also later apply it to the outer table <div>\n applicableStyleSet.displayAlign = '';\n }\n }\n\n // If we're preserving space add an inner <span> with 'white-space: pre'.\n // This is how we implement preserving space in css and we need an inner\n // span because the 'real' span will already be setting it's css white-space\n // value to either normal or nowrap and we can't collide with that.\n if (preserveSpace && name === 'ttml:span') {\n innerNode = translation.appendChild(TtmlContext._defaultStyle(this.ownerDocument.createElement('span')));\n css(innerNode, 'white-space', 'pre');\n }\n\n // Default some css properties that we don't want to inadvertantly end up\n // inheriting values for that might cause adverse layout impacts for us.\n css(translation, 'position', 'static');\n css(translation, 'width', '100%');\n\n // Copy style from element over to html, translating into CSS as we go.\n this._translateStyle(name, translation, applicableStyleSet);\n }\n\n return { outerNode: translation!, innerNode: innerNode! ? innerNode! : translation! };\n };\n\n /**\n * Translate the ttml styles in a styleSet to their equivalent css styles and apply them to the specified html element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param element - The ttml element to translate.\n * @param applicableStyleSet - The style set applicable to this element.\n */\n private _translateStyle(tagName: string, element: HTMLElement, applicableStyleSet: IDictionaryStringString): void {\n for (const style in applicableStyleSet) {\n if (applicableStyleSet[style]) {\n this._applyStyle(element, tagName, style, applicableStyleSet[style]);\n }\n }\n }\n\n /**\n * Convert the element if it is in the region, then recurse into its contents.\n * If it ends up with no children then we dont add it to the region, we prune it.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The style set inherited by this element.\n * @param preserveSpace - Indicates whether or not space should be preserved.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param translator - The translator function to use. Originally supported both xml/html but is always using html in MWF.\n * @param [ignoreAncestors] - Specifies whether or not to ignore the element's ancestors.\n * @returns - A ITtmlPruneResult instance containing the prune results.\n */\n private _prune(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n preserveSpace: boolean,\n time: number,\n translator: Function,\n ignoreAncestors: boolean = false\n ): ITtmlPruneResult {\n let outerNode: Element;\n let hasPreservedContent = false;\n\n let translation = this._translate(element, inheritedStyleSet, preserveSpace, time, translator);\n\n if (translation.outerNode !== null) {\n const tag = this._getTagNameEquivalent(element);\n\n outerNode = translation.outerNode;\n let innerNode = translation.innerNode;\n\n for (const child of nodeListToArray<Node>(element.childNodes)) {\n if (child.nodeType === Node.COMMENT_NODE) {\n // Do nothing.\n } else if (child.nodeType === Node.TEXT_NODE) {\n innerNode!.appendChild(document.createTextNode((<Text>child).data));\n\n if (preserveSpace && tag === 'ttml:span') {\n hasPreservedContent = true;\n }\n } else {\n let childPreserveSpace = preserveSpace;\n const spaceAttr = TtmlParser.getAttributeNS(<Element>child, 'space', xmlNS);\n\n if (spaceAttr) {\n childPreserveSpace = spaceAttr === 'preserve';\n }\n\n const pruneRecord = this._prune(\n <Element>child,\n translation.inheritableStyleSet!,\n childPreserveSpace,\n time,\n translator,\n true\n );\n\n hasPreservedContent = hasPreservedContent || pruneRecord.hasPreservedContent;\n\n if (pruneRecord.prunedElement) {\n innerNode!.appendChild(pruneRecord.prunedElement);\n }\n }\n }\n\n // Now traverse back till the body and build the corresponding structures.\n if (!ignoreAncestors) {\n let ancestor = <Element>element.parentNode;\n\n while (ancestor !== null && ancestor.nodeType === Node.ELEMENT_NODE && ancestor !== this.body) {\n translation = this._translate(ancestor, inheritedStyleSet, preserveSpace, time, translator);\n if (translation.outerNode) {\n innerNode = translation.innerNode;\n innerNode!.appendChild(outerNode);\n outerNode = translation.outerNode;\n } else {\n break;\n }\n\n ancestor = <Element>ancestor.parentNode;\n }\n }\n }\n\n return { prunedElement: outerNode!, hasPreservedContent };\n }\n\n /**\n * Build this element's ttml computed styleset.\n * This is used as the base styleSet to filter the inherited styleSet from for an element's children.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The styleSet inherited by this element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @returns - The resulting computed styleSet.\n */\n private _getComputedStyleSet(\n element: Element,\n inheritedStyleSet: IDictionaryStringString,\n tagName: string,\n time: number\n ): IDictionaryStringString {\n // Start off with a clone of the inherited styleset.\n const computedStyleSet = extend({}, inheritedStyleSet);\n\n // Iterate over this nodes ttml styles and pave them onto it's computed styleset.\n extend(computedStyleSet, this.styleSetCache[Number.parseInt(element.getAttribute('data-styleSet')!, 10)]);\n\n // Apply any temporally active style animations.\n const sets = element.getElementsByTagNameNS(this.settings.ttmlNamespace, 'set');\n\n for (const set of nodeListToArray(sets)) {\n if (this._isTemporallyActive(<Element>set, time)) {\n TtmlParser.applyInlineStyles(this.settings, computedStyleSet, <Element>set);\n }\n }\n\n if (tagName === 'ttml:p' && computedStyleSet.lineHeight === 'normal') {\n // Special case for <p>'s with tts:lineHeight='normal'\n // This means use the largest tts:fontSize value of any\n // of it's descendant <span>'s. Since we don't know what\n // values those might be until translateStyle we'll just\n // save them all and figure it out then.\n const fontSizes = this._appendSpanFontSizes(element, this._getInheritableStyleSet(computedStyleSet), time, '');\n\n if (fontSizes) {\n computedStyleSet['computed-lineHeight'] = fontSizes;\n }\n }\n\n return computedStyleSet;\n }\n\n /**\n * Build this tags ttml applicable styleset from the specified computed styleSet to apply only to it.\n * @param computedStyleSet - The style set inherited by this element.\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @returns - The resulting applicable styleSet.\n */\n private _getApplicableStyleSet(computedStyleSet: IDictionaryStringString, tagName: string): IDictionaryStringString {\n const applicableStyleSet: IDictionaryStringString = {};\n\n // Special case extent to the front of the list as later processing of\n // padding will depend on it having already been set first.\n if (computedStyleSet.extent && this._isStyleApplicable(tagName, 'extent')) {\n applicableStyleSet.extent = computedStyleSet.extent;\n }\n\n // Special case color to the front of the list as later processing of\n // textOutline will depend on it having already been set first.\n if (computedStyleSet.color && this._isStyleApplicable(tagName, 'color')) {\n applicableStyleSet.color = computedStyleSet.color;\n }\n\n for (const style in computedStyleSet) {\n if (this._isStyleApplicable(tagName, style)) {\n applicableStyleSet[style] = computedStyleSet[style];\n }\n }\n\n return applicableStyleSet;\n }\n\n /**\n * Determines if the specified style applies to the specified ttml tagName.\n * NOTE: The ttml spec doesn't mention ttml:br in the styles 'applies to' sections but\n * as noted in the span section everything that applies to ttml:span also applies to ttml:br.\n * @private\n * @param tagName - The ttml element tagName. All styles do not apply to all tagNames.\n * @param style - The style to check against the tagName.\n * @returns - True if the ttml:style applies to the ttml:tag, otherwise false.\n */\n private _isStyleApplicable(tagName: string, style: string): boolean {\n switch (style) {\n case 'backgroundColor':\n case 'display':\n case 'visibility':\n return 'ttml:body ttml:div ttml:p ttml:region ttml:rootcontainerregion ttml:span ttml:br'.includes(tagName);\n\n // Technically these font styles do not apply to <p>s but for some reason the resulting html/css\n // for span/br doesnt compute line-height correctly if the entire containing <p> (div) isn't all the same...\n case 'fontFamily':\n case 'fontSize':\n case 'fontStyle':\n case 'fontWeight':\n return 'ttml:p ttml:span ttml:br'.includes(tagName);\n\n case 'color':\n case 'textDecoration':\n case 'textOutline':\n case 'wrapOption':\n return 'ttml:span ttml:br'.includes(tagName);\n\n case 'direction':\n case 'unicodeBidi':\n return 'ttml:p ttml:span ttml:br'.includes(tagName);\n\n case 'displayAlign':\n case 'opacity':\n case 'origin':\n case 'overflow':\n case 'padding':\n case 'showBackground':\n case 'writingMode':\n case 'zIndex':\n return 'ttml:region ttml:rootcontainerregion'.includes(tagName);\n\n case 'extent':\n return 'ttml:tt ttml:region ttml:rootcontainerregion'.includes(tagName);\n\n case 'computed-lineHeight':\n case 'lineHeight':\n case 'textAlign':\n return 'ttml:p'.includes(tagName);\n\n default:\n return false;\n }\n }\n\n /**\n * Filters a computed styleSet into an inheritable styleSet subset to pass on to children.\n * Not all styles are inheritable.\n * @private\n * @param computedStyleSet - The computed styleSet to filter.\n * @returns - The resulting inheritable styleSet.\n */\n private _getInheritableStyleSet(computedStyleSet: IDictionaryStringString): IDictionaryStringString {\n const inheritedStyleSet: IDictionaryStringString = {};\n\n for (const style in computedStyleSet) {\n if (computedStyleSet.hasOwnProperty(style)) {\n switch (style) {\n case 'backgroundColor':\n case 'computed-lineHeight':\n case 'display':\n case 'displayAlign':\n case 'extent':\n case 'opacity':\n case 'origin':\n case 'overflow':\n case 'padding':\n case 'showBackground':\n case 'unicodeBidi':\n case 'writingMode':\n case 'zIndex':\n break;\n default:\n inheritedStyleSet[style] = computedStyleSet[style];\n }\n }\n }\n\n return inheritedStyleSet;\n // eslint-disable-next-line max-lines\n }\n\n /**\n * Recurses through an element and it's descendants finding the font sizess of all it's <span>'s.\n * @param element - The ttml element to translate.\n * @param inheritedStyleSet - The element's inherited styleSet.\n * @param time - The time to translate against. Elements and styles are temporally transient.\n * @param value - The list of font sizes to append to.\n * @returns - The value with any additional font sizes appended to it.\n */\n private _appendSpanFontSizes(element: Element, inheritedStyleSet: IDictionaryStringString, time: number, value: string): string {\n for (const child of nodeListToArray<Element>(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n const tag = this._getTagNameEquivalent(child);\n\n if (tag === 'ttml:span') {\n const computedStyleSet = this._getComputedStyleSet(child, inheritedStyleSet, 'ttml:span', time);\n const fontSize = computedStyleSet.fontSize;\n\n if (fontSize) {\n value += (value ? ',' : '') + fontSize;\n }\n\n value = this._appendSpanFontSizes(child, this._getInheritableStyleSet(computedStyleSet), time, value);\n }\n }\n }\n\n return value;\n }\n\n /**\n * Determines whether or not the specified element is associated with the specified region.\n * Ttml defines 5 ordered rules, where the first rule satisfied is used and remaining rules are skipped.\n * @param element - The ttml element to check.\n * @param regionId - The id of the region to see if the element is associated with.\n * @returns - True if the specified element is within the specified region, otherwise false.\n */\n private _isInRegion(element: Element, regionId: string): boolean {\n // Quick test: Out of normal order, but makes following rules simpler.\n // This is a shortcut to check step #4 first\n if (!regionId) {\n return true;\n }\n\n const elemRegion = TtmlParser.getAttributeNS(element, 'region', this.settings.ttmlNamespace);\n\n // 1. If the element specifies a region attribute, then the element is\n // associated with the region referenced by that attribute;\n if (elemRegion === regionId) {\n return true;\n }\n\n if (!elemRegion) {\n // 2. If some ancestor of that element specifies a region attribute, then the element is\n // associated with the region referenced by the most immediate ancestor that specifies\n // this attribute;\n let ancestor = <Element>element.parentNode;\n\n while (ancestor !== null && ancestor.nodeType === Node.ELEMENT_NODE) {\n const id = this._getRegionId(ancestor);\n if (id) {\n return id === regionId;\n }\n ancestor = <Element>ancestor.parentNode;\n }\n\n // 3. If the element contains a descendant element that specifies a region attribute,\n // then the element is associated with the region referenced by that attribute;\n for (const node of nodeListToArray(element.getElementsByTagName('*'))) {\n if (this._getRegionId(<Element>node) === regionId) {\n return true;\n }\n }\n }\n\n // 5. The element is not associated with any region.\n return false;\n }\n\n /**\n * Gets the region id for the specified element.\n * @param element - The ttml element to check.\n * @returns - The id of the region the element is associated with.\n */\n private _getRegionId(element: Element): string {\n let regionId: string;\n\n if (element.nodeType === Node.ELEMENT_NODE && element.namespaceURI === this.settings.ttmlNamespace) {\n if (TtmlParser.getLocalTagName(element) === 'region') {\n regionId = TtmlParser.getAttributeNS(element, 'id', xmlNS);\n } else {\n regionId = TtmlParser.getAttributeNS(element, 'region', this.settings.ttmlNamespace);\n }\n }\n\n return regionId!;\n }\n\n /**\n * Gets the tagName of the element with the current ttml namespace prepended if non-standard.\n * @param element - The ttml element to get the tagName of.\n * @returns - The tagName or '' if the namespace isn't one of the ttml ones.\n */\n private _getTagNameEquivalent(element: Element): string {\n const tagName = TtmlParser.getLocalTagName(element);\n const nameSpace = element.namespaceURI;\n\n if (nameSpace === this.settings.ttmlNamespace) {\n return `ttml:${tagName}`;\n }\n\n if (nameSpace === 'http://www.w3.org/1999/xhtml') {\n return tagName;\n }\n\n return '';\n }\n\n /**\n * Translates the ttml style/value into one or more css styles/values and applies them to the element.\n * @param element - The ttml element to apply the css style(s) too.\n * @param tagName - The ttml tagName associated with the element.\n * @param style - The ttml style name.\n * @param value - The ttml style value.\n */\n // eslint-disable-next-line complexity\n private _applyStyle(element: HTMLElement, tagName: string, style: string, value: string): void {\n let mappedValue = value;\n\n switch (style) {\n case 'color':\n case 'backgroundColor': {\n mappedValue = TtmlContext._ttmlToCssColor(value);\n css(element, style, mappedValue);\n return;\n }\n\n case 'direction':\n case 'display': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'displayAlign': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'before':\n mappedValue = 'top';\n break;\n case 'center':\n mappedValue = 'middle';\n break;\n case 'after':\n mappedValue = 'bottom';\n }\n\n css(element, 'vertical-align', mappedValue);\n return;\n }\n\n case 'extent': {\n let width: string;\n let height: string;\n\n if (value !== 'auto') {\n // Get the individual components.\n const coords = value.split(/\\s+/);\n\n if (coords.length === 2) {\n width = this._ttmlToCssUnits(coords[0], true);\n height = this._ttmlToCssUnits(coords[1], false);\n }\n }\n\n if (!width!) {\n width = `${(this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions.width\n : this.settings.relatedMediaObjectRegion!.width\n ).toString()}px`;\n height = `${(this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions.height\n : this.settings.relatedMediaObjectRegion!.height\n ).toString()}px`;\n }\n\n css(element, 'position', 'absolute');\n css(element, 'width', width!);\n css(element, 'min-width', width!);\n css(element, 'max-width', width!);\n css(element, 'height', height!);\n css(element, 'min-height', height!);\n css(element, 'max-height', height!);\n return;\n }\n\n case 'fontFamily': {\n if (this.settings.fontMap && this.settings.fontMap[value]) {\n mappedValue = this.settings.fontMap[value];\n }\n\n if (value === 'smallCaps') {\n // Need to additionally add font-variant: small-caps.\n css(element, 'fontVariant', 'small-caps');\n }\n\n css(element, style, mappedValue);\n return;\n }\n\n case 'fontSize': {\n const parts = value.split(/\\s+/);\n\n // For two part fontSize values we use the vertical size which is in the second part.\n const size = parts.length > 1 ? parts[1] : parts[0];\n\n // Set the fontsize scaleFactor to 75% (of cell size) to account for ascenders/descenders etc.\n mappedValue = this._ttmlToCssFontSize(size, false, 0.75, tagName === 'ttml:region');\n\n css(element, style, mappedValue);\n return;\n }\n\n case 'fontStyle':\n case 'fontWeight': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'lineHeight': {\n // Spec doesn't qualify what % lengths mean so I'm going to assume it's % of a\n // cell and therefore use fontSize conversion method.\n mappedValue = value === 'normal' ? value : this._ttmlToCssFontSize(value, false);\n\n css(element, 'line-height', mappedValue);\n return;\n }\n\n case 'computed-lineHeight': {\n const values = value.split(',');\n let max = -1;\n\n for (const fontSize of values) {\n // Computed-lineHeight is based off of fontSize so use fontSize conversion method.\n mappedValue = this._ttmlToCssFontSize(fontSize, false);\n\n if (mappedValue && mappedValue.indexOf('px') === mappedValue.length - 2) {\n const height = Number.parseFloat(mappedValue.substr(0, mappedValue.length - 2));\n\n if (!isNaN(height) && height > max) {\n max = height;\n }\n }\n }\n\n if (max >= 0) {\n css(element, 'line-height', `${max}px`);\n }\n\n return;\n }\n\n case 'origin': {\n if (value !== 'auto') {\n // Get the individual components.\n const coords = value.split(/\\s+/);\n\n if (coords.length === 2) {\n css(element, 'position', 'absolute');\n css(element, 'left', this._ttmlToCssUnits(coords[0], true));\n css(element, 'top', this._ttmlToCssUnits(coords[1], false));\n }\n }\n\n return;\n }\n\n case 'opacity': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'padding': {\n const contextRect = getDimensions(element);\n\n // Get the individual components.\n const parts = value.split(/\\s+/);\n let first: string;\n let second: string;\n let third: string;\n let forth: string;\n\n // eslint-disable-next-line default-case\n switch (parts.length) {\n case 1:\n // Value is used for all 4 sides.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[0], true, contextRect!);\n mappedValue = format('{0} {1} {0} {1}', first, second);\n break;\n case 2:\n // First is top/bottom, second is left/right.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n mappedValue = format('{0} {1} {0} {1}', first, second);\n break;\n case 3:\n // First is top, second is left/right, third is bottom.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n third = this._ttmlToCssUnits(parts[2], false, contextRect!);\n mappedValue = format('{0} {1} {2} {1}', first, second, third);\n break;\n case 4:\n // Top, right, bottom, left.\n first = this._ttmlToCssUnits(parts[0], false, contextRect!);\n second = this._ttmlToCssUnits(parts[1], true, contextRect!);\n third = this._ttmlToCssUnits(parts[2], false, contextRect!);\n forth = this._ttmlToCssUnits(parts[3], true, contextRect!);\n mappedValue = format('{0} {1} {2} {3}', first, second, third, forth);\n }\n\n // Using border width to implement tts:padding as neither padding nor margin fix the size (height) of the content area.\n css(element, 'box-sizing', 'border-box');\n\n // TODO: See if we work in FF without the following commented out -moz-box-sizing line now and if so remove it.\n /// /// css(element, '-moz-box-sizing', 'border-box');\n css(element, 'border-style', 'solid');\n css(element, 'border-color', 'transparent');\n\n // It can be helpful when debugging to change the border-color from transparent to something like rgba(255,255,200,0.5)\n // css(element, 'border-color', 'rgba(255,255,200,0.5)');\n css(element, 'border-width', mappedValue);\n return;\n }\n\n // If you know what this was for please document it here and uncomment it.\n // As of now the caller appeared to be doing nothing with it so commenting it out.\n /// /// case 'showBackground': {\n /// /// return this.getAttribute('data-showBackground', value);\n /// /// }\n\n case 'textAlign': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'start':\n mappedValue = 'left'; // TODO: handle rtl correctly.\n break;\n case 'end':\n mappedValue = 'right'; // TODO: handle rtl correctly.\n }\n\n css(element, 'text-align', mappedValue);\n return;\n }\n\n case 'textDecoration': {\n mappedValue = TtmlContext._ttmlToCssTextDecoration(value);\n css(element, 'text-decoration', mappedValue);\n return;\n }\n\n case 'textOutline': {\n const defaultColor = css(element, 'color');\n css(element, 'text-shadow', this._ttmlToCssTextOutline(mappedValue, defaultColor));\n return;\n }\n\n case 'unicodeBidi': {\n // TODO: Handle multiple options correctly.\n // eslint-disable-next-line default-case\n switch (value) {\n case 'bidiOverride':\n mappedValue = 'bidi-override';\n }\n css(element, 'unicode-bidi', mappedValue);\n return;\n }\n\n case 'visibility': {\n // No change.\n css(element, style, mappedValue);\n return;\n }\n\n case 'writingMode': {\n // eslint-disable-next-line default-case\n switch (value) {\n case 'lr':\n case 'lrtb': {\n css(element, 'writing-mode', 'horizontal-tb'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-writing-mode', 'horizontal-tb'); // Webkit for Chrome\n css(element, 'writing-mode', 'lr-tb'); // IE specific\n return;\n }\n case 'rl':\n case 'rltb': {\n css(element, 'writing-mode', 'horizontal-tb'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-writing-mode', 'horizontal-tb'); // Webkit for Chrome\n css(element, 'writing-mode', 'rl-tb'); // IE specific\n return;\n }\n case 'tblr': {\n css(element, 'text-orientation', 'upright'); // CCS3 standard: Doesn't work yet\n css(element, 'writing-mode', 'vertical-lr'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-text-orientation', 'upright'); // Webkit for Chrome\n css(element, '-webkit-writing-mode', 'vertical-lr'); // Webkit for Chrome\n css(element, 'writing-mode', 'tb-lr'); // IE specific\n return;\n }\n case 'tb':\n case 'tbrl': {\n css(element, 'text-orientation', 'upright'); // CCS3 standard: Doesn't work yet\n css(element, 'writing-mode', 'vertical-rl'); // CCS3 standard: Doesn't work yet\n css(element, '-webkit-text-orientation', 'upright'); // Webkit for Chrome\n css(element, '-webkit-writing-mode', 'vertical-rl'); // Webkit for Chrome\n css(element, 'writing-mode', 'tb-rl'); // IE specific\n return;\n }\n }\n return;\n }\n\n case 'wrapOption': {\n css(element, 'white-space', value === 'noWrap' ? 'nowrap' : value === 'pre' ? 'pre' : 'normal');\n return;\n }\n\n case 'zIndex': {\n css(element, style, mappedValue); // Requires global information...\n return;\n }\n\n default: {\n css(element, style, mappedValue);\n }\n }\n }\n\n /**\n * Converts a ttml unit string to a css one.\n * @param ttmlUnits - The ttml value.\n * @param width - Indicates whether to perform a width based or a height based conversion.\n * @param [contextRect] - The context rectangle to use for conversion.\n * @returns - The css value.\n */\n private _ttmlToCssUnits(ttmlUnits: string, width: boolean, contextRect?: IClientDimension): string {\n let cssUnits = ttmlUnits;\n\n if (ttmlUnits) {\n const unit = ttmlUnits.charAt(ttmlUnits.length - 1);\n\n // Need to special case handle ttml cell metrics.\n if (unit === 'c' || unit === '%') {\n const container = this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions\n : this.settings.relatedMediaObjectRegion;\n const length = Number.parseFloat(ttmlUnits.substr(0, ttmlUnits.length - 1));\n let containerSize = width ? container!.width : container!.height;\n let value: number;\n\n if (unit === 'c') {\n const gridSize = width ? this.settings.cellResolution.columns : this.settings.cellResolution.rows;\n\n value = (length * containerSize) / gridSize;\n } else if (unit === '%') {\n // If % units calls also specify a contextRect use that instead of the container.\n if (contextRect) {\n containerSize = width ? contextRect.width : contextRect.height;\n }\n\n // Have to convert % to px because padding and vertical-align (displayAlign) are not\n // working together if the extent width/height are % instead of px.\n value = (containerSize * length) / 100;\n }\n\n // Round to 1 decimal place\n value = Math.round(value! * 10) / 10;\n cssUnits = `${value}px`;\n }\n }\n\n return cssUnits;\n }\n\n /**\n * Converts a ttml font size to a css one.\n * @param ttmlUnits - The ttml value.\n * @param width - Indicates whether to perform a width based or a height based conversion.\n * @param [scaleFactor] - The scale factor to use for conversion.\n * @param [isRegion] - Indicates whether or not the conversion is being done for a <region>.\n * @returns - The css value.\n */\n private _ttmlToCssFontSize(ttmlUnits: string, width: boolean, scaleFactor: number = 1, isRegion: boolean = false): string {\n let cssUnits = ttmlUnits;\n\n if (ttmlUnits) {\n const unit = ttmlUnits.charAt(ttmlUnits.length - 1);\n\n // Need to special case handle ttml cell metrics and % units.\n if (unit === 'c' || (isRegion && unit === '%')) {\n const container = this.settings.rootContainerRegionDimensions\n ? this.settings.rootContainerRegionDimensions\n : this.settings.relatedMediaObjectRegion;\n const length = Number.parseFloat(ttmlUnits.substr(0, ttmlUnits.length - 1));\n const containerSize = width ? container!.width : container!.height;\n const gridSize = width ? this.settings.cellResolution.columns : this.settings.cellResolution.rows;\n let value = (length * containerSize) / gridSize;\n\n if (unit === '%') {\n // Length is % so divide by 100.\n value /= 100;\n }\n\n // Apply the scale factor and limit to one decimal place precision.\n value = Math.floor(value * scaleFactor * 10) / 10;\n\n cssUnits = `${value}px`;\n }\n }\n\n return cssUnits;\n }\n\n /**\n * Converts a ttml text outline style value to a css one.\n * @param textOutline - The ttml value.\n * @param defaultColor - Default value of the outline color.\n * @returns - The css value.\n */\n private _ttmlToCssTextOutline(textOutline: string, defaultColor: string): string {\n let textShadow = 'none';\n\n if (!isNullOrWhiteSpace(textOutline) && textOutline !== 'none') {\n let parts: string[] = textOutline.split(/\\s+/);\n let color: string = '';\n let thickness: string = '';\n let blur: string = '';\n\n if (parts.length === 1) {\n color = defaultColor;\n thickness = parts[0];\n blur = '';\n } else if (parts.length === 3) {\n color = parts[0];\n thickness = parts[1];\n blur = parts[2];\n } else if (parts.length === 2) {\n const firstChar = parts[0].charAt(0);\n\n if (firstChar >= '0' && firstChar <= '9') {\n color = defaultColor;\n thickness = parts[0];\n blur = parts[1];\n } else {\n color = parts[0];\n thickness = parts[1];\n blur = '';\n }\n }\n\n // Spec doesn't qualify what % lengths mean so I'm going to assume it's % of a cell\n // and therefore use fontSize conversion method with the same scaleFactor applied\n // to fontSize since it's the font that we're outlining here.\n blur = this._ttmlToCssFontSize(blur, false, 0.75);\n thickness = this._ttmlToCssFontSize(thickness, false, 0.75);\n\n parts = <string[]>TtmlContext.lengthRegEx.exec(thickness);\n\n if (parts && parts.length === 3) {\n const width = Math.round(Number.parseFloat(parts[1]));\n const units = parts[2];\n\n textShadow = '';\n\n for (let x = -width; x <= width; x++) {\n for (let y = -width; y <= width; y++) {\n if (x !== 0 || y !== 0) {\n textShadow += format('{0}{4} {1}{4} {2} {3}, ', x, y, blur, TtmlContext._ttmlToCssColor(color), units);\n }\n }\n }\n\n if (textShadow) {\n textShadow = textShadow.substr(0, textShadow.length - 2);\n }\n }\n }\n\n return textShadow;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * TtmlTimeParser class.\n * @classdesc - The TtmlTimeParser class is used to parse ttml time expressions which can be absolute or relative.\n */\nexport class TtmlTimeParser {\n /**\n * @name - absoluteTimeRegex\n * Regex to parse absolute ttml times. (clock-time).\n * Hours \":\" minutes \":\" seconds ( fraction | \":\" frames ( \".\" sub-frames )? )?.\n * NOTE: (johnlemi) Our clocktime regex matches 1 or 2 digits for hours instead of 2 because even.\n * though the spec says 2 we have some existing ttml from the Office team with end attrs with 1 hour digit.\n * @static\n * @private\n * @type {string}\n */\n private static readonly absoluteTimeRegex: RegExp = /^(\\d+):(\\d{2}):(\\d{2})((\\.\\d+)|:(\\d{2,}(\\.\\d+)?))?$/;\n\n /**\n * @name - relativeTimeRegex\n * Regex to parse relative ttml times. (offset-time).\n * time-count fraction? metric.\n * @static\n * @private\n * @type {string}\n */\n private static readonly relativeTimeRegex: RegExp = /^(\\d+(\\.\\d+)?)(ms|[fhmst])$/;\n\n /**\n * @name - mediaFrameRate.\n * @description - mediaFrameRate.\n * @private\n * @type {string}\n */\n private readonly mediaFrameRate: number;\n\n /**\n * @name - mediaTickRate.\n * @description - mediaTickRate.\n * @private\n * @type {string}\n */\n private readonly mediaTickRate: number;\n\n /**\n * Constructor for the TtmlTimeParser class.\n * @param _mediaFrameRate - The ttml media frame rate.\n * @param _mediaTickRate - The ttml media tick rate.\n */\n public constructor(_mediaFrameRate: number, _mediaTickRate: number) {\n this.mediaFrameRate = _mediaFrameRate;\n this.mediaTickRate = _mediaTickRate;\n }\n\n /**\n * Parses a ttml time expression string into a number.\n * @param ttmlTime - The time expression to parse.\n * @returns - The number the time expression represents, or 0 if the exression doesn't match.\n */\n public parse(ttmlTime: string): number {\n if (!ttmlTime) {\n return 0;\n }\n\n const absoluteTime = TtmlTimeParser.absoluteTimeRegex.exec(ttmlTime);\n\n if (absoluteTime && absoluteTime.length > 3) {\n const hours = Number.parseInt(absoluteTime[1], 10) * 60 * 60;\n const minutes = Number.parseInt(absoluteTime[2], 10) * 60;\n const seconds = Number.parseInt(absoluteTime[3], 10);\n let subseconds = 0;\n\n if (absoluteTime[5]) {\n subseconds = Number.parseFloat(absoluteTime[4]) * 1000;\n }\n\n if (absoluteTime[6]) {\n subseconds = Math.round(Number.parseFloat(absoluteTime[6]) * this._getTimeUnitMultiplier('f'));\n }\n\n return (hours + minutes + seconds) * 1000 + subseconds;\n }\n\n const relativeTime = TtmlTimeParser.relativeTimeRegex.exec(ttmlTime);\n\n if (relativeTime && relativeTime.length > 3) {\n return Math.round(Number.parseFloat(relativeTime[1]) * this._getTimeUnitMultiplier(relativeTime[3]));\n }\n\n return 0;\n }\n\n /**\n * Converts a ttml time unit expression string into a multiplier number.\n * @param timeUnit - The time unit expression.\n * @returns - The multiplier value, or 0 if the unit exression doesn't match.\n */\n private _getTimeUnitMultiplier(timeUnit: string): number {\n switch (timeUnit) {\n case 'h':\n return 1000 * 60 * 60;\n case 'ms':\n return 1;\n case 'm':\n return 1000 * 60;\n case 's':\n return 1000;\n case 'f':\n return 1000 / this.mediaFrameRate;\n case 't':\n return 1000 / this.mediaTickRate;\n default:\n return 0;\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 { format, IDictionaryStringString, IGrid, nodeListToArray, trim } from '../utilities';\nimport { ITtmlContext, TtmlContext } from './ttml-context';\nimport { ITtmlSettings, TtmlSettings, xmlNS } from './ttml-settings';\nimport { TtmlTimeParser } from './ttml-time-parser';\n\n// Timed Text Markup Language (TTML).\n// See http://www.w3.org/TR/ttml1/ for more details.\n\n/**\n * @interface ITtmlEvent\n * @classdesc - The ITtmlEvent interface contract.\n * @export\n */\nexport interface ITtmlEvent {\n time: number;\n element?: Element;\n}\n\n/**\n * @interface ITtmlTimingBounds\n * @classdesc - The ITtmlTimingBounds interface contract.\n * @export\n */\ninterface ITtmlTimingBounds {\n start: number;\n end: number;\n}\n\n/**\n *\n * The TtmlParser class.\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class TtmlParser {\n /**\n * @name - mediaStart\n * Used as the start time for applyTiming when applying to the entire document.\n * @static\n * @private\n * @type {number}\n */\n private static readonly mediaStart: number = -1;\n\n /**\n * @name - mediaEnd\n * Used as the end time for applyTiming when applying to the entire document.\n * Picking a number that should always be greater than any real media end time.\n * @static\n * @private\n * @type {number}\n */\n private static readonly mediaEnd: number = 99_999_999;\n\n /**\n * Gets the local tagName of a Node.\n * @param node - The node to get the tagName of.\n * @returns - The tagName.\n */\n public static getLocalTagName(node: Node): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return (<Element>node).localName || (<any>node).baseName;\n }\n\n /**\n * Gets the value of a namespaced attribute. First tries element.getAttributeNS() but falls back\n * to scanning each attribute if that fails.\n * If you know which cases go into the fallback code please document it here.\n * @param element - The element to get the attribute of.\n * @param name - The attribute name.\n * @param namespace - The attribute namespace.\n * @returns - The attribute value. Or an empty string if a matching attribute is not found.\n */\n public static getAttributeNS(element: Element, name: string, namespace: string): string {\n let result = element.getAttributeNS(namespace, name);\n\n if (!result) {\n // Go through all the attributes looking for a match.\n for (const attribute of nodeListToArray(element.attributes)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if ((<any>attribute).localName === name && attribute.lookupNamespaceURI((<any>attribute).prefix) === namespace) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result = (<any>attribute).value;\n break;\n }\n }\n }\n\n return result!;\n }\n\n /**\n * Parses a ttml document and builds a ttmlContext instance from it.\n * @param ttmlDocument - The ttml document to parse.\n * @param settingsOverrides - The ttml settings overrides to use.\n * @returns - The resulting ttmlContext instance that can be used to get cues by time.\n */\n public static parse(ttmlDocument: XMLDocument, settingsOverrides: ITtmlSettings): ITtmlContext {\n ttmlDocument = typeof ttmlDocument === 'string' ? TtmlParser._parseXml(ttmlDocument) : ttmlDocument;\n\n const ttmlContext = new TtmlContext();\n\n // Start initializing the context.\n ttmlContext.settings = new TtmlSettings(settingsOverrides);\n ttmlContext.root = TtmlParser._verifyRoot(ttmlDocument, ttmlContext);\n ttmlContext.body = TtmlParser._getFirstElementByTagNameNS(ttmlContext.root, 'body', ttmlContext.settings.ttmlNamespace);\n ttmlContext.events = [];\n ttmlContext.styleSetCache = [];\n\n if (ttmlContext.body) {\n // Parse the root <tt> attributes.\n TtmlParser._parseTtAttrs(ttmlContext);\n\n // Set up our regions.\n const head = TtmlParser._ensureRegions(ttmlContext);\n\n const timeBase =\n TtmlParser.getAttributeNS(ttmlContext.root, 'timeBase', ttmlContext.settings.ttmlParameterNamespace) || 'media';\n\n if (ttmlContext.settings.supportedTimeBase.includes(timeBase)) {\n // Process textnodes into anonymous spans.\n TtmlParser._processAnonymousSpans(ttmlContext, ttmlContext.body);\n\n const timeParser = new TtmlTimeParser(ttmlContext.settings.mediaFrameRate, ttmlContext.settings.mediaTickRate);\n\n // Apply the intervals over the tree.\n TtmlParser._applyTiming(\n ttmlContext,\n ttmlContext.root,\n { start: TtmlParser.mediaStart, end: TtmlParser.mediaEnd },\n true,\n timeParser\n );\n\n // Apply the style inheritance over the tree.\n TtmlParser._applyStyling(ttmlContext, head);\n }\n\n // Add an dummy end event for the captions to appear until end of video.\n // Not sure why we need to do this, please add to this comment if you know.\n ttmlContext.events.push({ time: TtmlParser.mediaEnd, element: undefined });\n\n // Sort events into temporal order.\n ttmlContext.events.sort((event1: ITtmlEvent, event2: ITtmlEvent) => {\n return event1.time - event2.time;\n });\n }\n\n return ttmlContext;\n }\n\n /**\n * Applies the elements inline styles into the styleSet.\n * @param settings - The TtmlSettings for this document.\n * @param styleSet - The styleSet to build upon.\n * @param element - The element to apply the styles of.\n */\n public static applyInlineStyles(settings: TtmlSettings, styleSet: IDictionaryStringString, element: Element): void {\n for (const attribute of nodeListToArray(element.attributes)) {\n if (attribute.namespaceURI === settings.ttmlStyleNamespace) {\n // Trim() because we see lots of ttml attribute values with trailing space...\n styleSet[TtmlParser.getLocalTagName(attribute)] = trim(attribute.nodeValue!);\n }\n }\n }\n\n /**\n * Parses an xml document in string format to an XMLDocument.\n * @param xmlString - The xml string to parse.\n * @returns - The resulting XMLDocument, or null if the xml string failed to parse.\n */\n private static _parseXml(xmlString: string): XMLDocument {\n let xml: XMLDocument;\n\n if (window.DOMParser) {\n const domParser = new window.DOMParser();\n xml = domParser.parseFromString(xmlString, 'application/xml');\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const domParser = new (<any>window).ActiveXObject('Microsoft.XMLDOM');\n domParser.async = false;\n domParser.loadXML(xmlString);\n xml = <XMLDocument>domParser;\n }\n return xml;\n }\n\n /**\n * Verifies that root <tag> of the specified document is the expected ttml <tt> tagName and\n * updates the settings namespaces from it if they are non standard.\n * @param ttmlDocument - The ttml document to verify.\n * @param ttmlContext - The ttmlContext for this document.\n * @returns - The valid root Element, or or null if the root Element was not valid.\n */\n private static _verifyRoot(ttmlDocument: XMLDocument, ttmlContext: TtmlContext): Element {\n let root: Element;\n const candidate = ttmlDocument.documentElement;\n\n if (TtmlParser.getLocalTagName(candidate) === 'tt') {\n if (candidate.namespaceURI !== 'http://www.w3.org/ns/ttml') {\n ttmlContext.settings.ttmlNamespace = candidate.namespaceURI!;\n ttmlContext.settings.ttmlStyleNamespace = `${ttmlContext.settings.ttmlNamespace}#styling`;\n ttmlContext.settings.ttmlParameterNamespace = `${ttmlContext.settings.ttmlNamespace}#parameter`;\n ttmlContext.settings.ttmlMetaNamespace = `${ttmlContext.settings.ttmlNamespace}#metadata`;\n }\n\n root = candidate;\n }\n\n return root!;\n }\n\n /**\n * Parses the <tt> tag attributes and initializes ttmlContext properties from them.\n * @param ttmlContext - The ttmlContext for this document.\n */\n private static _parseTtAttrs(ttmlContext: TtmlContext): void {\n const cellRes = TtmlParser.getAttributeNS(ttmlContext.root, 'cellResolution', ttmlContext.settings.ttmlParameterNamespace);\n const extent = TtmlParser.getAttributeNS(ttmlContext.root, 'extent', ttmlContext.settings.ttmlStyleNamespace);\n let cellGrid: IGrid | null = null;\n\n if (cellRes) {\n const parts = trim(cellRes).split(/\\s+/);\n\n if (parts.length === 2) {\n const columns = Math.round(Number.parseFloat(parts[0]));\n const rows = Math.round(Number.parseFloat(parts[1]));\n\n if (rows > 0 && columns > 0) {\n cellGrid = { rows, columns };\n }\n }\n }\n\n if (cellGrid) {\n ttmlContext.settings.cellResolution = cellGrid;\n }\n\n if (extent) {\n if (extent !== 'auto') {\n // Get the individual components.\n const coords = extent.split(/\\s+/);\n\n if (\n coords.length === 2 &&\n coords[0].substr(coords[0].length - 2) === 'px' &&\n coords[1].substr(coords[1].length - 2) === 'px'\n ) {\n const width = Number.parseFloat(coords[0].substr(0, coords[0].length - 2));\n const height = Number.parseFloat(coords[1].substr(0, coords[1].length - 2));\n\n // Round to integer.\n ttmlContext.settings.rootContainerRegionDimensions = { width: Math.round(width), height: Math.round(height) };\n }\n }\n }\n }\n\n /**\n * Ensures we have the elements/regions we require by either finding them or creating them if they are not present.\n * @param ttmlContext - The ttmlContext for this document.\n * @returns - The <head> element.\n */\n private static _ensureRegions(ttmlContext: TtmlContext): Element {\n // Create our rootContainerRegion\n ttmlContext.rootContainerRegion = ttmlContext.root.ownerDocument.createElementNS(\n ttmlContext.settings.ttmlNamespace,\n 'rootcontainerregion'\n );\n\n ttmlContext.root.appendChild(ttmlContext.rootContainerRegion);\n\n const extents = ttmlContext.settings.rootContainerRegionDimensions\n ? format(\n '{0}px {1}px',\n ttmlContext.settings.rootContainerRegionDimensions.width,\n ttmlContext.settings.rootContainerRegionDimensions.height\n )\n : 'auto';\n\n ttmlContext.rootContainerRegion.setAttributeNS(ttmlContext.settings.ttmlStyleNamespace, 'extent', extents);\n\n let head = TtmlParser._getFirstElementByTagNameNS(ttmlContext.root, 'head', ttmlContext.settings.ttmlNamespace);\n\n // Ensure we have a <head>\n if (!head) {\n // No <head> so we need to create that now.\n head = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'head');\n ttmlContext.root.appendChild(head);\n }\n\n // Ensure we have a <layout>\n ttmlContext.layout = TtmlParser._getFirstElementByTagNameNS(head, 'layout', ttmlContext.settings.ttmlNamespace);\n\n if (!ttmlContext.layout) {\n // No <layout> so we need to create that now.\n ttmlContext.layout = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'layout');\n ttmlContext.root.appendChild(ttmlContext.layout);\n }\n\n // Create an anonymous region if we have no regions.\n const regions = ttmlContext.layout.getElementsByTagNameNS(ttmlContext.settings.ttmlNamespace, 'region');\n\n if (!regions.length) {\n const anonymousRegion = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'region');\n\n anonymousRegion.setAttributeNS(xmlNS, 'id', 'anonymous');\n anonymousRegion.setAttribute('data-isanonymous', '1');\n ttmlContext.layout.appendChild(anonymousRegion);\n\n ttmlContext.body.setAttributeNS(ttmlContext.settings.ttmlNamespace, 'region', 'anonymous');\n }\n\n return head;\n }\n\n /**\n * Recurses through all the <p> elements in the document and groups all the contiguous TEXT_NODES together into <span>'s.\n * @param ttmlContext - The ttmlContext for this document.\n * @param element - The element to process the TEXT_NODES of.\n */\n private static _processAnonymousSpans(ttmlContext: TtmlContext, element: Element): void {\n // If this element is <p> then group all contiguous textnodes together in <span>\n if (TtmlParser._isTagNS(element, 'p', ttmlContext.settings.ttmlNamespace)) {\n const textNodeGroups: Node[][] = [];\n let prevNodeType: number = 0;\n\n for (const child of nodeListToArray(element.childNodes)) {\n if (child.nodeType === Node.TEXT_NODE) {\n if (prevNodeType !== Node.TEXT_NODE) {\n textNodeGroups.push([]);\n }\n\n textNodeGroups[textNodeGroups.length - 1].push(child);\n }\n\n prevNodeType = child.nodeType;\n }\n\n for (const group of textNodeGroups) {\n const anonSpan = ttmlContext.root.ownerDocument.createElementNS(ttmlContext.settings.ttmlNamespace, 'span');\n\n anonSpan.appendChild(group[0].parentNode!.replaceChild(anonSpan, group[0]));\n\n for (let index = 1; index < group.length; index++) {\n anonSpan.appendChild(group[index]);\n }\n }\n }\n\n // Then recurse through the contents doing the same thing for those.\n for (const child of nodeListToArray<Element>(element.childNodes)) {\n this._processAnonymousSpans(ttmlContext, child);\n }\n }\n\n /**\n * Recurses through the document element tree to determine the absolute start and end times of all the elements\n * using the TTML subset of the SMIL timing model. The reference times passed in 'bound' are absolute times.\n * The result of calling this is to set the local start time and end time to absolute times between these two\n * reference times, based on the begin, end and dur attributes and to recursively set all of the children.\n * @param ttmlContext - The ttmlContext for this document.\n * @param element - The element to apply the timing to.\n * @param bound - The bounds for the timing.\n * @param isParallelContext - Indicates whether or not this element is in a parallel timing context.\n * @param timeParser - The TtmlTimeParser to use to parse this elements time attributes.\n */\n private static _applyTiming(\n ttmlContext: TtmlContext,\n element: Element,\n bound: ITtmlTimingBounds,\n isParallelContext: boolean,\n timeParser: TtmlTimeParser\n ): void {\n const beginAttribute = TtmlParser.getAttributeNS(element, 'begin', ttmlContext.settings.ttmlNamespace);\n let startTime = beginAttribute ? timeParser.parse(beginAttribute) : bound.start;\n let endTime = 0;\n\n // Compute the simple duration of the interval.\n let duration = 0;\n let end = 0;\n const durationAttribute = TtmlParser.getAttributeNS(element, 'dur', ttmlContext.settings.ttmlNamespace);\n const endAttribute = TtmlParser.getAttributeNS(element, 'end', ttmlContext.settings.ttmlNamespace);\n\n if (!durationAttribute && !endAttribute) {\n // No direct timing attested, so use default based on context.\n // Parallel children have indefinite default duration, truncated by bounds.\n if (isParallelContext) {\n // Sequential children have zero default duration.\n if (startTime <= bound.end) {\n endTime = bound.end;\n } else {\n endTime = 0;\n }\n }\n } else if (durationAttribute && endAttribute) {\n // Both duration and end attested, the minimum interval applies.\n duration = timeParser.parse(durationAttribute);\n end = timeParser.parse(endAttribute);\n const minEnd = Math.min(startTime + duration, bound.start + end);\n endTime = Math.min(minEnd, bound.end);\n } else if (endAttribute) {\n // Only end attested.\n end = timeParser.parse(endAttribute);\n endTime = Math.min(bound.start + end, bound.end);\n } else {\n // Only dur attested.\n duration = timeParser.parse(durationAttribute);\n endTime = Math.min(startTime + duration, bound.end);\n }\n\n if (endTime < startTime) {\n endTime = startTime;\n }\n\n startTime = Math.floor(startTime);\n endTime = Math.floor(endTime);\n\n element.setAttribute('data-time-start', startTime.toString());\n element.setAttribute('data-time-end', endTime.toString());\n\n if (\n startTime >= 0 &&\n ttmlContext.events.filter(event => {\n return event.time === startTime;\n }).length <= 0\n ) {\n ttmlContext.events.push({ time: startTime, element });\n }\n\n let start = startTime;\n\n for (const child of nodeListToArray<Element>(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n // Parallel is the default so null is OK here.\n if (TtmlParser.getAttributeNS(element, 'timeContainer', ttmlContext.settings.ttmlNamespace) !== 'seq') {\n this._applyTiming(ttmlContext, child, { start: startTime, end: endTime }, true, timeParser);\n } else {\n this._applyTiming(ttmlContext, child, { start, end: endTime }, false, timeParser);\n start = Number.parseInt(child.getAttribute('data-time-end')!, 10);\n }\n }\n }\n }\n\n /**\n * Recurses through all the elements in <head> applying the ttml sytling to them based on the <style>'s.\n * @param ttmlContext - The ttmlContext for this document.\n * @param head - The element to process the TEXT_NODES of.\n */\n private static _applyStyling(ttmlContext: TtmlContext, head: Element): void {\n // First find all the <style>'s\n const styling = TtmlParser._getFirstElementByTagNameNS(head, 'styling', ttmlContext.settings.ttmlNamespace);\n const styles = styling ? nodeListToArray(styling.getElementsByTagNameNS(ttmlContext.settings.ttmlNamespace, 'style')) : [];\n\n // Apply the styles to every element in the body\n for (const element of nodeListToArray(ttmlContext.root.querySelectorAll('*'))) {\n this._applyStyle(ttmlContext, element, <Element[]>styles);\n }\n }\n\n /**\n * Applies the ttml styling to the specified element.\n * Apply styles in the correct order to element by building a styleSet, adding it\n * to the stlyeSetCache, and the adding reference to the cached styleSet to the element.\n * @param ttmlContext - The ttmlContext for this document.\n * @param element - The element to apply the ttml styling to.\n * @param styles - The set of styles to apply.\n */\n private static _applyStyle(ttmlContext: TtmlContext, element: Element, styles: Element[]): void {\n const styleSet: IDictionaryStringString = {};\n\n // Find all the applicable styles and set them as properties on styleSet.\n this._applyStylesheet(ttmlContext.settings, styleSet, element, styles);\n TtmlParser.applyInlineStyles(ttmlContext.settings, styleSet, element);\n\n let empty = true;\n\n for (const style in styleSet) {\n // Just need to see if there's at least one.\n if (styleSet.hasOwnProperty(style)) {\n empty = false;\n break;\n }\n }\n\n if (!empty) {\n // Record the applied set to the element.\n element.setAttribute('data-styleSet', ttmlContext.styleSetCache.length.toString());\n ttmlContext.styleSetCache.push(styleSet);\n }\n }\n\n /**\n * For each style id on the element, find the corresponding style element and then\n * apply the stylesheet into styleset; this recurses over the tree of referenced styles.\n * @param settings - The TtmlSettings for this document.\n * @param styleSet - The styleSet to build upon.\n * @param element - The element to apply the styles of.\n * @param styles - The set of styles to apply.\n */\n private static _applyStylesheet(settings: TtmlSettings, styleSet: IDictionaryStringString, element: Element, styles: Element[]): void {\n // Find all the style ID references.\n const styleAttribute = TtmlParser.getAttributeNS(element, 'style', settings.ttmlNamespace);\n const ids = styleAttribute ? styleAttribute.split(/\\s+/) : [];\n\n for (const styleId of ids) {\n for (const style of styles) {\n // Filter on those whose id is the one we want.\n if (TtmlParser.getAttributeNS(style, 'id', xmlNS) === styleId) {\n // Recurse into its style references.\n this._applyStylesheet(settings, styleSet, style, styles);\n\n // Do inline styles.\n TtmlParser.applyInlineStyles(settings, styleSet, style);\n }\n }\n }\n\n // If the element is a region do nested styles. NOTE regions can only be referenced from elements in the body.\n if (TtmlParser._isTagNS(element, 'region', settings.ttmlNamespace)) {\n // Find all the style elements in the TTML namespace.\n for (const style of nodeListToArray(element.getElementsByTagNameNS(settings.ttmlNamespace, 'style'))) {\n TtmlParser.applyInlineStyles(settings, styleSet, <Element>style);\n }\n }\n }\n\n /**\n * Determines whether or not the namespace and local tagName of an element matches\n * the specified namespace and tag name.\n * @param element - The node to compare against.\n * @param tagName - The tag name.\n * @param namespace - The attribute namespace.\n * @returns - True if the elements ns/tagName match, otherwise false.\n */\n private static _isTagNS(element: Element, tagName: string, namespace: string): boolean {\n return element.namespaceURI === namespace && this.getLocalTagName(element) === tagName;\n }\n\n /**\n * Gets the first matching element that matches the specified tagName and namespace.\n * @param context - The context to search within.\n * @param tagName - The tagName to match.\n * @param namespace - The namespace to match.\n * @returns - The first matching element found, or null if there are no matches.\n */\n private static _getFirstElementByTagNameNS(context: Element, tagName: string, namespace: string): Element {\n let result: Element;\n if (context) {\n const matches = context.getElementsByTagNameNS(namespace, tagName);\n\n if (matches && matches.length) {\n result = matches[0];\n }\n }\n\n return result!;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nimport { ICurrentClosedCaptionsSettings } from '../data';\nimport {\n css,\n format,\n getDimensions,\n IDictionaryStringString,\n PlayerUtility,\n removeInnerHtml,\n selectElements,\n selectFirstElement\n} from '../utilities';\nimport { IClosedCaptionsProps } from './closed-captions-props';\nimport { ITtmlContext } from './ttml-context';\nimport { TtmlParser } from './ttml-parser';\nimport { ITtmlSettings } from './ttml-settings';\nimport { closedCaptionsSettingsMap, closedCaptionsSettingsOptions } from './video-closed-captions-settings';\n\n/**\n *\n * ClosedCaptions React component for video player.\n *\n */\nexport default class ClosedCaptions extends React.Component<IClosedCaptionsProps> {\n /**\n * @name - currentSettings\n * @description - The current closed captions settings.\n * @private\n * @type {IDictionaryStringString}\n */\n public currentSettings: ICurrentClosedCaptionsSettings | undefined;\n\n /**\n * @name - userPreferences\n * @description - The user preference overrides for the closed captions.\n * @static\n * @public\n * @type {ICcUserPreferences}\n */\n private userPreferences: ICcUserPreferences = {\n text: {},\n window: {}\n };\n\n private readonly closedCaptionDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n /**\n * @name - lastPlayPosition\n * @description - The last player position passed to updateCaptions.\n * This is used to call updateCaptions again when the cc language is changed.\n * Play could be paused at that time.\n * @private\n * @type {number}\n */\n private lastPlayPosition: number = 0;\n\n /**\n * @name - ttmlContext\n * @description - The ttmlContext for the current ttml document.\n * @private\n * @type {ITtmlContext}\n */\n private ttmlContext: ITtmlContext | null = null;\n\n public constructor(props: IClosedCaptionsProps) {\n super(props);\n this.resetCaptions();\n this.clicked = this.clicked.bind(this);\n }\n\n public render(): JSX.Element {\n const { className } = this.props;\n const closedCaptionDivStyle = {\n bottom: this.props.isVideoControlVisible ? '2.5em' : '0',\n transition: 'bottom 0.5s ease-in 0s'\n };\n return (\n <div\n role='none'\n className={className}\n ref={this.closedCaptionDiv}\n aria-hidden={!this.props.showClosedCaptions}\n style={closedCaptionDivStyle}\n onClick={this.clicked}\n />\n );\n }\n\n public clicked(): void {\n this.props.onClosedCaptionClick();\n }\n\n public componentDidMount(): void {\n if (this.props.ccURL) {\n this._setCcLanguage(this.props.ccURL);\n }\n window &&\n window.addEventListener('resize', () => {\n if (this.props.showClosedCaptions) {\n this.updateCaptions(this.props.currentTime);\n }\n });\n }\n\n public shouldComponentUpdate(nextProps: IClosedCaptionsProps): boolean {\n let shouldRender = false;\n if (nextProps.showClosedCaptions || this.props.showClosedCaptions !== nextProps.showClosedCaptions) {\n shouldRender = true;\n }\n return shouldRender;\n }\n\n public componentWillUnmount(): void {\n window &&\n window.removeEventListener('resize', () => {\n if (this.props.showClosedCaptions) {\n this.updateCaptions(this.props.currentTime);\n }\n });\n }\n\n public componentDidUpdate(prevProps: IClosedCaptionsProps): void {\n if (this.props.showClosedCaptions) {\n if (prevProps.ccLanguage! !== this.props.ccLanguage!) {\n if (this.props.ccURL) {\n this._setCcLanguage(this.props.ccURL);\n }\n }\n this.applySettings();\n this.resetCaptions();\n this.updateCaptions(this.props.currentTime);\n if (prevProps.isVideoControlVisible !== this.props.isVideoControlVisible) {\n this.applySettings();\n this.resetCaptions();\n\n // Setting up a delay so that right height and width is calculated\n window.setTimeout(() => {\n this.updateCaptions(this.props.currentTime);\n }, 500);\n }\n }\n }\n\n /**\n * Displays a mocked caption container with content, used to show the caption preset preview.\n */\n public showSampleCaptions(): void {\n this.ttmlContext = null;\n const mockCaptions: XMLDocument = new DOMParser().parseFromString(\n `<?xml version='1.0' encoding='utf-8'?>\n<tt xml:lang='en-us' xmlns='http://www.w3.org/ns/ttml' xmlns:tts='http://www.w3.org/ns/ttml#styling'\nxmlns:ttm='http://www.w3.org/ns/ttml#metadata'>\n <head>\n <metadata>\n <ttm:title>Media.wvx.aib</ttm:title>\n <ttm:copyright>Copyright (c) 2013 Microsoft Corporation. All rights reserved.</ttm:copyright>\n </metadata>\n <styling>\n <style xml:id='Style1' tts:fontFamily='proportionalSansSerif' tts:fontSize='0.8c' tts:textAlign='center'\n tts:color='white' />\n </styling>\n <layout>\n <region style='Style1' xml:id='CaptionArea' tts:origin='0c 12.6c' tts:extent='32c 2.4c'\n tts:backgroundColor='rgba(0,0,0,160)' tts:displayAlign='center' tts:padding='0.3c 0.5c' />\n </layout>\n </head>\n <body region='CaptionArea'>\n <div>\n <p begin='00:00:01.140' end='99:99:99.999'>EXAMPLE CAPTIONS!</p>\n </div>\n </body>\n</tt>`,\n 'text/xml'\n );\n\n this._onClosedCaptionsLoaded(mockCaptions);\n const dimensions = getDimensions(this.closedCaptionDiv.current!);\n this.ttmlContext!.updateRelatedMediaObjectRegion(dimensions!);\n this.closedCaptionDiv.current!.style.bottom = '2.5rem';\n }\n\n /**\n * Update the captionContainer with the captions that correspond to the current time.\n * @param playPosition - The video's play position to sync the captions to.\n */\n public updateCaptions(playPosition: number): void {\n let output: string = '';\n this.lastPlayPosition = playPosition;\n\n if (this.ttmlContext && this.ttmlContext.hasEvents()) {\n const tick = Math.floor(playPosition * 1000);\n\n const dimensions = getDimensions(this.closedCaptionDiv.current!);\n if (this.ttmlContext.updateRelatedMediaObjectRegion(dimensions!)) {\n // Call resetCaptions to force an update since the relatedMediaObjectRegion size has changed.\n this.resetCaptions();\n }\n\n if (this.ttmlContext.updateCurrentEvents(tick)) {\n removeInnerHtml(this.closedCaptionDiv.current!);\n\n for (const cue of this.ttmlContext.getCues(tick)) {\n this._applyUserPreferencesOverrides(cue);\n\n // Background color is not honored in high contrast mode,\n // thus remove it from this wrapper div to avoid video not getting displayed in high contrast mode\n // with close captions enabled\n css(cue, 'background-color', '');\n output = cue.outerHTML;\n }\n\n this.closedCaptionDiv.current!.innerHTML = output;\n }\n }\n }\n\n /**\n * Resets the ttml caption container.\n * This should be called when user preferences change.\n */\n public resetCaptions(): void {\n if (this.ttmlContext) {\n this.ttmlContext.resetCurrentEvents();\n }\n\n if (this.closedCaptionDiv.current!) {\n removeInnerHtml(this.closedCaptionDiv.current!);\n }\n this.applySettings();\n }\n\n /**\n * Applies the closed captions settings.\n */\n public applySettings(): void {\n const prefs: IDictionaryStringString = {};\n\n const currentSettings = this.props.tempClosedCaptionsSettings\n ? this.props.tempClosedCaptionsSettings\n : this.props.currentClosedCaptionsSettings;\n\n for (const settingKey in currentSettings) {\n if (currentSettings.hasOwnProperty(settingKey)) {\n const optionValue = this._getOptionValue(settingKey, currentSettings[settingKey]);\n\n if (optionValue) {\n prefs[settingKey] = `${closedCaptionsSettingsMap[settingKey].value}${optionValue}`;\n }\n }\n }\n\n this.userPreferences.text = this._getPrefsCss(prefs, 'text');\n this.userPreferences.window = this._getPrefsCss(prefs, 'window');\n }\n\n /**\n * Loads the close captioning ttml file.\n * @param href - The cc href.\n */\n private _loadClosedCaptions(href: string): void {\n PlayerUtility.ajax(\n href,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (result: any) => {\n this._onClosedCaptionsLoaded(result);\n },\n () => {\n if (this.props.errorCallback) {\n this.props.errorCallback({\n errorType: 'Player.error.loadClosedCaptions.ajax',\n errorDesc: `Ajax call failed: ' ${href}`\n });\n }\n }\n );\n }\n\n /**\n * Close captioning ttml file loaded handler.\n * @param ttmlDocument - The ttml document containing the closed captions.\n */\n private _onClosedCaptionsLoaded(ttmlDocument: XMLDocument): void {\n if (!ttmlDocument) {\n if (this.props.errorCallback) {\n this.props.errorCallback({\n errorType: 'Player.error.onClosedCaptionsLoaded.ttmlDoc',\n errorDesc: 'No ttmlDocument found'\n });\n }\n return;\n }\n\n // This.closedCaptionDiv.current!.setAttribute(ClosedCaptions.ariaHidden, 'false');\n\n const id = this.closedCaptionDiv.current!.id ? `${this.closedCaptionDiv.current!.id} '-'` : '';\n const settingsOverrides: ITtmlSettings = {\n idPrefix: id,\n fontMap: { default: 'Segoe ui, Arial' },\n relatedMediaObjectRegion: getDimensions(this.closedCaptionDiv.current!)\n };\n\n try {\n this.ttmlContext = TtmlParser.parse(ttmlDocument, settingsOverrides);\n\n if (this.ttmlContext) {\n this.ttmlContext.setOwnerDocument(this.closedCaptionDiv.current!.ownerDocument);\n\n if (this.ttmlContext.hasEvents()) {\n this.updateCaptions(this.lastPlayPosition);\n }\n }\n } catch (error) {\n if (this.props.errorCallback) {\n this.props.errorCallback({\n errorType: 'Player.error.onClosedCaptionsLoaded.ttmlParser',\n errorDesc: `'TtmlDocument parser error: ' ${error.message}`\n });\n }\n }\n }\n\n /**\n * Applies user preference overrides to the specified cue.\n * @param cue - The cue to apply any overrides to.\n */\n private _applyUserPreferencesOverrides(cue: HTMLElement): void {\n if (!this.userPreferences) {\n return;\n }\n\n if (this.userPreferences.text) {\n for (const element of selectElements('span, br', cue)) {\n for (const property in this.userPreferences.text) {\n if (this.userPreferences.text.hasOwnProperty(property)) {\n css(element, property, this.userPreferences.text[property]);\n }\n }\n }\n }\n\n if (this.userPreferences.window) {\n const winElement: HTMLElement | null = selectFirstElement('p', cue);\n if (winElement) {\n for (const property in this.userPreferences.window) {\n if (this.userPreferences.window.hasOwnProperty(property)) {\n css(winElement, property, this.userPreferences.window[property]);\n }\n }\n }\n }\n }\n\n /**\n * Updates the component if there is any change to its underlying DOM.\n * @param href - The ttml href.\n */\n private _setCcLanguage(href: string): void {\n this.ttmlContext = null;\n this.resetCaptions();\n if (!href) {\n return;\n }\n this._loadClosedCaptions(href);\n }\n\n /**\n * Gets the value of closed captions settings option.\n * @param settingKey - The closed ceptions settings key.\n * @param optionKey - The closed captions option key.\n */\n private _getOptionValue(settingKey: string, optionKey: string): string {\n const setting = closedCaptionsSettingsMap[settingKey];\n if (setting) {\n const option = closedCaptionsSettingsOptions[setting.option];\n return option && option.map[optionKey];\n }\n return '';\n }\n\n /**\n * Gets the css for the preferences.\n * @param prefs - The preferences to get css for.\n * @param prefix - The closed captions type (text/window).\n */\n private _getPrefsCss(prefs: IDictionaryStringString, prefix: string): IDictionaryStringString {\n const prefsCss: IDictionaryStringString = {};\n\n // First store all the non-transparency values\n for (const pref in prefs) {\n if (prefs.hasOwnProperty(pref)) {\n const propVal = prefs[pref];\n\n if (pref.startsWith(prefix) && !pref.includes('opacity')) {\n if (propVal && propVal.length > 0) {\n const styles = propVal.split(';');\n\n for (const style of styles) {\n const pVal = style.split(':');\n\n if (pVal.length > 1) {\n prefsCss[pVal[0].trim()] = pVal[1].trim();\n }\n }\n }\n }\n }\n }\n\n // Then go through all the transparency values and\n // map them onto their non-transparent color counterparts\n for (const pref in prefs) {\n if (prefs.hasOwnProperty(pref)) {\n const propVal = prefs[pref];\n if (pref.startsWith(prefix) && pref.indexOf('opacity') > 0) {\n const pVal = propVal.split(':');\n\n if (pVal.length > 1) {\n const colorValue = prefsCss[pVal[0].trim()];\n const opacityValue = pVal[1].trim();\n prefsCss[pVal[0].trim()] = this._formatAsRgba(colorValue, opacityValue);\n }\n }\n }\n }\n\n return prefsCss;\n }\n\n /**\n * Formats the color value from css to rgba value.\n * @param cssColor - The css color value.\n * @param opacity - The opacity value.\n * @returns - The Rgb.\n */\n private _formatAsRgba(cssColor: string, opacity: string): string {\n let result = format('rgba(0,0,0,{0})', opacity);\n const colorStart = cssColor ? cssColor.indexOf('#') : -1;\n\n if (colorStart >= 0) {\n const fullColorString = cssColor.substr(colorStart + 1);\n const colorLenght = fullColorString.length / 3;\n\n if (colorLenght > 0) {\n const red = Number.parseInt(fullColorString.substr(0, colorLenght), 16);\n const green = Number.parseInt(fullColorString.substr(colorLenght, colorLenght), 16);\n const blue = Number.parseInt(fullColorString.substr(colorLenght * 2, colorLenght), 16);\n result = format('rgba({0},{1},{2},{3})', red, green, blue, opacity);\n }\n }\n\n return result;\n }\n}\n\n/**\n * @interface ICcUserPreferences\n * @classdesc - Describes the closed caption user preferences data structure.\n */\nexport interface ICcUserPreferences {\n text: IDictionaryStringString;\n window: IDictionaryStringString;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Player constants.\n */\nexport const PlayerConstants = {\n defaultVolume: 0.8,\n defaultVolumeSliderSteps: 5,\n defaultVideoSliderSteps: 1,\n defaultControlPanelTimeout: 6500,\n defaultPositionUpdateThreshold: 0.1,\n defaultMaskLevel: 40,\n defaultPlayGlyphIcon: 'fas fa-play',\n defaultPauseGlyphIcon: 'fas fa-pause',\n defaultMuteGlyphIcon: 'fas fa-volume-up',\n defaultUnMuteGlyphIcon: 'fas fa-volume-off',\n defaultFullScreenGlyphIcon: 'fas fa-expand',\n defaultExitFullScreenGlyphIcon: 'fas fa-compress',\n closedCaptionGlyphClassName: 'fas fa-closed-captioning',\n thumbnailFullWidth: 1110,\n thumbnailFullHeight: 624,\n ccLangPrefKey: 'vidccpref',\n seekBarLabel: 'Seek bar',\n regxForAgeGateInputValidation: /^[\\d\\b]+$/,\n mutePrefKey: 'vidmut',\n volumePrefKey: 'vidvol'\n};\n\n/**\n * @description - names used for video and player html elements.\n */\nexport const VideoPlayerNames = {\n videoplayerContainer: 'msc-videoplayer',\n mediaType: 'video/mp4'\n};\n\n/**\n * Menu Categories.\n */\nexport const MenuCategories = {\n AudioTracks: 'audio-tracks',\n ClosedCaption: 'close-caption',\n ClosedCaptionSettings: 'cc-settings',\n PlaybackSpeed: 'playback-speed',\n Quality: 'quality',\n Share: 'share',\n Download: 'download',\n Options: 'options'\n};\n\n/**\n * Media Events.\n */\nexport const MediaEvents = [\n 'abort',\n 'canplay',\n 'canplaythrough',\n 'emptied',\n 'ended',\n 'error',\n 'loadeddata',\n 'loadedmetadata',\n 'loadstart',\n 'pause',\n 'play',\n 'playing',\n 'progress',\n 'ratechange',\n 'readystatechange',\n 'seeked',\n 'seeking',\n 'stalled',\n 'suspend',\n 'timeupdate',\n 'volumechange',\n 'waiting'\n];\n\n/**\n * Play Positon Interface.\n */\nexport interface IPlayPosition {\n /**\n * @name startTime\n * @type {number}\n * Start position of the buffer, in seconds.\n * For VoD this is usually 0.\n * For live stream this is a position of beginning of DVR window, relative to the stream start time.\n */\n startTime: number;\n\n /**\n * @name endTime\n * @type {number}\n * @description End position of the buffer, in seconds.\n * For VoD this is normally a video duration.\n * For live stream this is normally a \"live\" position, relative to the stream start time.\n */\n endTime: number;\n\n /**\n * @name currentTime\n * @type {number}\n * @description Position currently on the screen, relative to the stream start time, in seconds.\n */\n currentTime: number;\n\n /**\n * @name bufferedDuration\n * @type {number}\n * @description Buffered duration of the video.\n */\n bufferedDuration: number;\n}\n\n/**\n * Current Closed Captions Settings Interface.\n */\nexport interface ICurrentClosedCaptionsSettings {\n preset: string;\n text_font: string;\n text_color: string;\n text_opacity: string;\n text_size: string;\n text_edge_style: string;\n text_background_color: string;\n text_background_opacity: string;\n window_color: string;\n window_opacity: string;\n}\n\n/**\n * @name - PlayerEvents\n * @description - Player states.\n * @type {IPlayerState}\n */\nexport type PlayerStates =\n | 'init'\n | 'playerLoaded'\n | 'loading'\n | 'ready'\n | 'playing'\n | 'paused'\n | 'buffering'\n | 'seeking'\n | 'ended'\n | 'error'\n | 'stopped';\n\n/**\n * @enum VideoErrorCodes\n * @description - Enum for supported media quality.\n */\nexport enum VideoErrorCodes {\n // Buffering.\n BufferingFirstByteTimeout = 2000,\n\n // Media element errors.\n MediaErrorAborted = 2100,\n MediaErrorNetwork = 2101,\n MediaErrorDecode = 2102,\n MediaErrorSourceNotSupported = 2103,\n MediaErrorUnknown = 2104,\n\n // Media selection.\n MediaSelectionNoMedia = 2200\n}\n\n/**\n * @interface IVideoErrorData\n * @description - The data contract interface used for storing references to video error data.\n */\nexport interface IVideoErrorData {\n errorCode: VideoErrorCodes;\n message?: string;\n}\n\n/**\n * @interface IVideoErrorMessageData\n * @description - The data contract interface used for supplying content to an error message.\n */\nexport interface IVideoErrorMessageData {\n title?: string;\n message?: string;\n}\n\n/**\n * @interface - IPlayerMenuItem\n * The IPlayerMenuItem interface that defines the data structure used to store menu item information.\n */\nexport interface IPlayerMenuItem {\n id: string;\n label: string;\n className?: string;\n language?: string;\n data?: string;\n image?: string;\n itemCount?: number;\n itemIndex?: number;\n imageAlt?: string;\n glyph?: string;\n selected?: boolean;\n selectable?: boolean;\n hasMouseHoverEvents?: boolean;\n persistOnClick?: boolean;\n isBackButton?: boolean;\n ariaLabel?: string;\n subMenu?: IPlayerMenu;\n hasFocus?: boolean;\n}\n\n/**\n * @interface - IPlayerMenu\n * The IPlayerMenu interface that defines the data structure used to store menu information.\n */\nexport interface IPlayerMenu {\n id: string;\n category: string;\n items: IPlayerMenuItem[];\n label?: string;\n glyph?: string;\n cssClass?: string;\n hideBackButton?: boolean;\n}\n\n/**\n * Player Menu Item Click Notification Interface.\n */\nexport interface IPlayerMenuItemClickNotification {\n category: string;\n id: string;\n data?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAudioTrack } from './player-interface';\n\n/**\n * @interface ICCFile\n * @description - The data contract interface used for storing references to closed caption files.\n */\nexport interface ICCFile {\n url: string;\n locale: string;\n ccType?: ClosedCaptionTypes;\n}\n\n/**\n * @interface IDownloadableFile\n * @description - The data contract interface used for storing references downloadable media files.\n */\nexport interface IDownloadableFile {\n mediaType: DownloadableMediaTypes;\n url: string;\n locale: string;\n}\n\n/**\n * @enum MediaTypes\n * @description - Enum for supported media types.\n */\nexport enum MediaTypes {\n MP4 = 'MP4',\n DASH = 'DASH',\n SMOOTH = 'SMOOTH',\n HLS = 'HLS'\n}\n\n/**\n * @enum MediaQuality\n * @description - Enum for supported media quality.\n */\nexport enum MediaQuality {\n HD = 'HD',\n HDX = 'HDX',\n HQ = 'HQ',\n SD = 'SD',\n LO = 'LO'\n}\n\n/**\n * @enum ClosedCaptionTypes\n * @description - Enum for supported closed caption types.\n */\nexport enum ClosedCaptionTypes {\n VTT = 'VTT',\n TTML = 'TTML'\n}\n\n/**\n * @enum DownloadableMediaTypes\n * @description - Enum for supported downloadable media types.\n */\nexport enum DownloadableMediaTypes {\n transcript = 'transcript',\n audio = 'audio',\n video = 'video',\n videoWithCC = 'videoWithCC'\n}\n\n/**\n * Cms datatype of video binary reference.\n */\nexport interface IVideoBinaryReference {\n /// <summary>Gets the video binary file format.</summary>\n format: string;\n\n /// <summary>Gets the video bit rate.</summary>\n frameRate: number;\n\n /// <summary>Gets the URL used on the clients to play the video.</summary>\n ClientHref: string;\n}\n\n/**\n * Cms datatype of video transcript binary reference.\n */\nexport interface IVideoTranscriptBinaryReference {\n /// <summary>Gets the locale.</summary>\n locale: string;\n\n /// <summary>Gets the URL used on the clients to play the video.</summary>\n clientHref: string;\n}\n\n/**\n * Cms datatype of video closed captions binary reference.\n */\nexport interface IVideoClosedCaptionBinaryReference {\n /// <summary>Gets the locale.</summary>\n locale: string;\n\n /// <summary>Gets the URL used on the clients to play the video.</summary>\n clientHref: string;\n}\n\n/**\n * Cms datatype of video closed captions binary reference.\n */\nexport interface IAudioBinaryReference {\n /// <summary>Gets the locale.</summary>\n locale: string;\n\n /// <summary>Gets the audio type.</summary>\n audioType: string;\n\n /// <summary>Gets the URL used on the clients to play the video.</summary>\n clientHref: string;\n}\n\n/**\n * IVideoMetadata.\n * @description - The data contract interface used for storing references to video metadata.\n */\nexport interface IVideoMetadata {\n playerName?: string;\n videoId?: string;\n title?: string;\n description?: string;\n duration?: number;\n posterframeUrl?: string;\n shareUrl?: string;\n videoFiles?: IVideoFile[];\n externalPlayerUrl?: string;\n externalSourceId?: string;\n interactiveTriggersEnabled?: boolean;\n interactiveTriggersUrl?: string;\n minimumAge?: number;\n videoBinaryReferences?: IBinaryReference[];\n ccFiles?: ICCFile[];\n audioTracks?: IAudioTrack[];\n}\n\n/**\n * @description - The data contract interface used for storing references to video files.\n */\nexport interface IVideoFile {\n url: string;\n mediaType: MediaTypes;\n quality: MediaQuality;\n width?: number;\n height?: number;\n formatCode?: string;\n}\n\n/**\n * Cms datatype of BinaryReference.\n */\nexport interface IBinaryReference {\n format?: string;\n bitrate?: number;\n clientHref?: string;\n height?: number;\n width?: number;\n alias?: string;\n contentType?: string;\n description?: string;\n extension?: string;\n sizeInBytes?: number;\n sourceHref?: string;\n href?: string;\n locale?: string;\n $type?: string;\n audioType?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Player Options Interface.\n */\nexport interface IPlayerOptions {\n autoplay?: boolean;\n mute?: boolean;\n loop?: boolean;\n playPauseTrigger?: boolean;\n controls?: boolean;\n maskLevel?: number;\n market?: string;\n playbackSpeed?: boolean;\n download?: boolean;\n playFullScreen?: boolean;\n hidePosterFrame?: boolean;\n autoCaptions?: string;\n flexSize?: boolean;\n aspectRatio?: number;\n userMinimumAge?: number;\n showEndImage?: boolean;\n showImageForVideoError?: boolean;\n inviewPlay?: boolean;\n inviewThreshold?: number;\n inViewWidthFraction?: number;\n inViewHeightFraction?: number;\n controlPanelTimeout?: number;\n thumbnailFullWidth?: boolean;\n ageGate?: boolean;\n lazyLoad?: boolean;\n mobileVideoQuality?: MobileVideoQuality;\n shouldDisableAutoPlayOnMobile?: boolean;\n isMobileDevice?: boolean;\n}\n\n/**\n * Mobile video quality.\n */\nexport enum MobileVideoQuality {\n hdx = 'hdx',\n hq = 'hq',\n sd = 'sd',\n lo = 'lo'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IPlayerResources } from '../data';\nimport { IDictionaryStringString } from '../utilities';\n\n/**\n * @name - ccCultureLocStrings\n * @description - The localized names for the close caption menu options.\n * @constant\n * @type {IDictionaryStringString}\n */\nexport const ccCultureLocStrings: IDictionaryStringString = {\n 'ar-ab': 'عربي',\n 'ar-xm': 'عربي',\n 'ar-ma': 'عربي',\n 'ar-sa': 'عربي',\n 'eu-es': 'Euskara',\n 'bg-bg': 'БългарÑки',\n 'ca-es': 'Català ',\n 'zh-cn': '简体ä¸æ–‡',\n 'zh-hk': 'ç¹é«”ä¸æ–‡',\n 'zh-tw': 'ç¹é«”ä¸æ–‡',\n 'hr-hr': 'Hrvatski',\n 'cs-cz': 'ÄŒeÅ¡tina',\n 'da-dk': 'Dansk',\n 'nl-be': 'Nederlands',\n 'nl-nl': 'Nederlands',\n 'en-ab': 'English',\n 'en-aa': 'English',\n 'en-au': 'English',\n 'en-ca': 'English',\n 'en-eu': 'English',\n 'en-hk': 'English',\n 'en-in': 'English',\n 'en-id': 'English',\n 'en-ie': 'English',\n 'en-jm': 'English',\n 'en-my': 'English',\n 'en-nz': 'English',\n 'en-pk': 'English',\n 'en-ph': 'English',\n 'en-sg': 'English',\n 'en-za': 'English',\n 'en-tt': 'English',\n 'en-gb': 'English',\n 'en-us': 'English',\n 'et-ee': 'Eesti',\n 'fi-fi': 'Suomi',\n 'fr-ab': 'Français',\n 'fr-be': 'Français',\n 'fr-ca': 'Français',\n 'fr-fr': 'Français',\n 'fr-xf': 'Français',\n 'fr-ch': 'Français',\n 'gl-es': 'Galego',\n 'de-de': 'Deutsch',\n 'de-at': 'Deutsch',\n 'de-ch': 'Deutsch',\n 'el-gr': 'Ελληνικά',\n 'he-il': 'עברית',\n 'hi-in': 'हिंदी',\n 'hu-hu': 'Magyar',\n 'is-is': 'Ãslenska',\n 'id-id': 'Bahasa Indonesia',\n 'it-it': 'Italiano',\n 'ja-jp': '日本語',\n 'kk-kz': 'Қазақ',\n 'ko-kr': 'í•œêµì–´',\n 'lv-lv': 'LatvieÅ¡u',\n 'lt-lt': 'Lietuvių',\n 'ms-my': 'Bahasa Melayu (Asia Tenggara)‎',\n 'nb-no': 'Norsk (bokmÃ¥l)',\n 'nn-no': 'Norsk (nynorsk)',\n 'fa-ir': 'Ùارسی',\n 'pl-pl': 'Polski',\n 'pt-br': 'Português (Brasil)‎',\n 'pt-pt': 'Português (Portugal)‎',\n 'ro-ro': 'Română',\n 'ru-ru': 'РуÑÑкий',\n 'sr-latn-rs': 'Srpski',\n 'sk-sk': 'SlovenÄina',\n 'sl-si': 'Slovenski',\n 'es-ar': 'Español',\n 'es-cl': 'Español',\n 'es-co': 'Español',\n 'es-cr': 'Español',\n 'es-do': 'Español',\n 'es-ec': 'Español',\n 'es-us': 'Español',\n 'es-gt': 'Español',\n 'es-hn': 'Español',\n 'es-xl': 'Español',\n 'es-mx': 'Español',\n 'es-ni': 'Español',\n 'es-pa': 'Español',\n 'es-py': 'Español',\n 'es-pe': 'Español',\n 'es-pr': 'Español',\n 'es-es': 'Español',\n 'es-uy': 'Español',\n 'es-ve': 'Español',\n 'sv-se': 'Svenska',\n 'tl-ph': 'Tagalog',\n 'th-th': 'ไทย',\n 'tr-tr': 'Türkçe',\n 'uk-ua': 'УкраїнÑька',\n 'ur-pk': 'اردو',\n 'vi-vn': 'Tiếng Việt'\n};\n\n/**\n * @name - ccLanguageCodes\n * @description - The 2 character language codes for use with the lang attribute .\n * @constant\n * @type {IDictionaryStringString}\n */\nexport const ccLanguageCodes: IDictionaryStringString = {\n 'ar-ab': 'ar',\n 'ar-xm': 'ar',\n 'ar-ma': 'ar',\n 'ar-sa': 'ar',\n 'eu-es': 'eu',\n 'bg-bg': 'bg',\n 'ca-es': 'ca',\n 'zh-cn': 'zh',\n 'zh-hk': 'zh',\n 'zh-tw': 'zh',\n 'hr-hr': 'hr',\n 'cs-cz': 'cs',\n 'da-dk': 'da',\n 'nl-be': 'nl',\n 'nl-nl': 'nl',\n 'en-ab': 'en',\n 'en-aa': 'en',\n 'en-au': 'en',\n 'en-ca': 'en',\n 'en-eu': 'en',\n 'en-hk': 'en',\n 'en-in': 'en',\n 'en-id': 'en',\n 'en-ie': 'en',\n 'en-jm': 'en',\n 'en-my': 'en',\n 'en-nz': 'en',\n 'en-pk': 'en',\n 'en-ph': 'en',\n 'en-sg': 'en',\n 'en-za': 'en',\n 'en-tt': 'en',\n 'en-gb': 'en',\n 'en-us': 'en',\n 'et-ee': 'et',\n 'fi-fi': 'fi',\n 'fr-ab': 'fr',\n 'fr-be': 'fr',\n 'fr-ca': 'fr',\n 'fr-fr': 'fr',\n 'fr-xf': 'fr',\n 'fr-ch': 'fr',\n 'gl-es': 'gl',\n 'de-de': 'de',\n 'de-at': 'de',\n 'de-ch': 'de',\n 'el-gr': 'el',\n 'he-il': 'he',\n 'hi-in': 'hi',\n 'hu-hu': 'hu',\n 'is-is': 'is',\n 'id-id': 'id',\n 'it-it': 'it',\n 'ja-jp': 'ja',\n 'kk-kz': 'kk',\n 'ko-kr': 'ko',\n 'lv-lv': 'lv',\n 'lt-lt': 'lt',\n 'ms-my': 'ms‎',\n 'nb-no': 'nb',\n 'nn-no': 'nn',\n 'fa-ir': 'fa',\n 'pl-pl': 'pl',\n 'pt-br': 'pt‎',\n 'pt-pt': 'pt‎',\n 'ro-ro': 'ro',\n 'ru-ru': 'ru',\n 'sr-latn-rs': 'sr',\n 'sk-sk': 'sk',\n 'sl-si': 'sl',\n 'es-ar': 'es',\n 'es-cl': 'es',\n 'es-co': 'es',\n 'es-cr': 'es',\n 'es-do': 'es',\n 'es-ec': 'es',\n 'es-us': 'es',\n 'es-gt': 'es',\n 'es-hn': 'es',\n 'es-xl': 'es',\n 'es-mx': 'es',\n 'es-ni': 'es',\n 'es-pa': 'es',\n 'es-py': 'es',\n 'es-pe': 'es',\n 'es-pr': 'es',\n 'es-es': 'es',\n 'es-uy': 'es',\n 'es-ve': 'es',\n 'sv-se': 'sv',\n 'tl-ph': 'tl',\n 'th-th': 'th',\n 'tr-tr': 'tr',\n 'uk-ua': 'uk',\n 'ur-pk': 'ur',\n 'vi-vn': 'vi'\n};\n\n/**\n * @name - playerLocKeys\n * @description - Key names to get localized values.\n * @constant\n */\nexport const PlayerLocKeys = {\n audio_tracks: 'audio_tracks',\n closecaption_off: 'closecaption_off',\n audio_tracks_default: 'audio_tracks_default',\n geolocation_error: 'geolocation_error',\n media_err_aborted: 'media_err_aborted',\n media_err_decode: 'media_err_decode',\n media_err_network: 'media_err_network',\n media_err_src_not_supported: 'media_err_src_not_supported',\n media_err_unknown_error: 'media_err_unknown_error',\n media_err_amp_encrypt: 'media_err_amp_encrypt',\n media_err_amp_player_mismatch: 'media_err_amp_player_mismatch',\n browserunsupported: 'browserunsupported',\n browserunsupported_download: 'browserunsupported_download',\n expand: 'expand',\n mute: 'mute',\n nullvideoerror: 'nullvideoerror',\n pause: 'pause',\n play: 'play',\n play_video: 'play_video',\n playing: 'playing',\n paused: 'paused',\n play_pause_button_tooltip: 'play_pause_button_tooltip',\n live_caption: 'live_caption',\n live_label: 'live_label',\n playbackerror: 'playbackerror',\n standarderror: 'standarderror',\n time: 'time',\n more_caption: 'more_caption',\n data_error: 'data_error',\n seek: 'seek',\n unexpand: 'unexpand',\n unmute: 'unmute',\n volume: 'volume',\n quality: 'quality',\n quality_hd: 'quality_hd',\n quality_hq: 'quality_hq',\n quality_lo: 'quality_lo',\n quality_sd: 'quality_sd',\n quality_auto: 'quality_auto',\n cc_customize: 'cc_customize',\n cc_text_font: 'cc_text_font',\n cc_text_color: 'cc_text_color',\n cc_color_black: 'cc_color_black',\n cc_color_blue: 'cc_color_blue',\n cc_color_cyan: 'cc_color_cyan',\n cc_color_green: 'cc_color_green',\n cc_color_grey: 'cc_color_grey',\n cc_color_magenta: 'cc_color_magenta',\n cc_color_red: 'cc_color_red',\n cc_color_white: 'cc_color_white',\n cc_color_yellow: 'cc_color_yellow',\n cc_font_name_casual: 'cc_font_name_casual',\n cc_font_name_cursive: 'cc_font_name_cursive',\n cc_font_name_monospacedsansserif: 'cc_font_name_monospacedsansserif',\n cc_font_name_proportionalsansserif: 'cc_font_name_proportionalsansserif',\n cc_font_name_monospacedserif: 'cc_font_name_monospacedserif',\n cc_font_name_proportionalserif: 'cc_font_name_proportionalserif',\n cc_font_name_smallcapitals: 'cc_font_name_smallcapitals',\n cc_text_size: 'cc_text_size',\n cc_text_size_default: 'cc_text_size_default',\n cc_text_size_extralarge: 'cc_text_size_extralarge',\n cc_text_size_large: 'cc_text_size_large',\n cc_text_size_maximum: 'cc_text_size_maximum',\n cc_text_size_small: 'cc_text_size_small',\n cc_appearance: 'cc_appearance',\n cc_preset1: 'cc_preset1',\n cc_preset2: 'cc_preset2',\n cc_preset3: 'cc_preset3',\n cc_preset4: 'cc_preset4',\n cc_preset5: 'cc_preset5',\n cc_presettings: 'cc_presettings',\n cc_text_background_color: 'cc_text_background_color',\n cc_text_background_opacity: 'cc_text_background_opacity',\n cc_text_opacity: 'cc_text_opacity',\n cc_percent_0: 'cc_percent_0',\n cc_percent_100: 'cc_percent_100',\n cc_percent_25: 'cc_percent_25',\n cc_percent_50: 'cc_percent_50',\n cc_percent_75: 'cc_percent_75',\n cc_text_edge_color: 'cc_text_edge_color',\n cc_text_edge_style: 'cc_text_edge_style',\n cc_text_edge_style_depressed: 'cc_text_edge_style_depressed',\n cc_text_edge_style_dropshadow: 'cc_text_edge_style_dropshadow',\n cc_text_edge_style_none: 'cc_text_edge_style_none',\n cc_text_edge_style_raised: 'cc_text_edge_style_raised',\n cc_text_edge_style_uniform: 'cc_text_edge_style_uniform',\n cc_window_color: 'cc_window_color',\n cc_window_opacity: 'cc_window_opacity',\n cc_reset: 'cc_reset',\n closecaption: 'closecaption',\n close_text: 'close_text',\n playbackspeed: 'playbackspeed',\n playbackspeed_normal: 'playbackspeed_normal',\n sharing_label: 'sharing_label',\n sharing_facebook: 'sharing_facebook',\n sharing_twitter: 'sharing_twitter',\n sharing_linkedin: 'sharing_linkedin',\n sharing_skype: 'sharing_skype',\n sharing_mail: 'sharing_mail',\n sharing_copy: 'sharing_copy',\n loading_value_text: 'loading_value_text',\n loading_aria_label: 'loading_aria_label',\n descriptive_audio: 'descriptive_audio',\n unknown_language: 'unknown_language',\n download_label: 'download_label',\n download_transcript: 'download_transcript',\n download_audio: 'download_audio',\n download_video: 'download_video',\n download_videoWithCC: 'download_videoWithCC',\n agegate_day: 'agegate_day',\n agegate_month: 'agegate_month',\n agegate_year: 'agegate_year',\n agegate_enterdate: 'agegate_enterdate',\n agegate_enterdate_arialabel: 'agegate_enterdate_arialabel',\n agegate_fail: 'agegate_fail',\n agegate_verifyyourage: 'agegate_verifyyourage',\n agegate_submit: 'agegate_submit',\n agegate_dateorder: 'agegate_dateorder',\n previous_menu_aria_label: 'previous_menu_aria_label',\n reactive_menu_aria_label: 'reactive_menu_aria_label',\n reactive_menu_aria_label_closedcaption: 'reactive_menu_aria_label_closedcaption',\n interactivity_show: 'interactivity_show',\n interactivity_hide: 'interactivity_hide'\n};\n\n/**\n * Localization Constants.\n */\nexport const LocalizationConstants = {\n playVideoAriaLabel: 'play video',\n playAriaLabel: 'play',\n pauseAriaLabel: 'pause',\n closeAriaLabel: 'close',\n optionAriaLabel: 'More options',\n muteAriaLabel: 'mute',\n unMuteAriaLabel: 'unmute',\n fullScreenAriaLabel: 'full screen',\n exitFullScreenAriaLabel: 'exit full screen',\n playingAriaLabel: 'paying',\n pausedAriaLabel: 'paused',\n seekBarLabel: 'Seek bar',\n sliderThumbLabel: 'Slider thumb',\n volumeThumbLabel: 'Volume thumb',\n videoTimeDurationLabel: 'Video time duration',\n closedCaptionLabel: 'Closed caption',\n audio_tracks: 'Audio Tracks',\n descriptive_audio: 'Audio descriptions',\n closecaption_off: 'Off',\n audio_tracks_default: 'Default Track',\n cc_customize: 'Customize',\n cc_text_font: 'Font',\n cc_text_color: 'Text color',\n cc_color_black: 'Black',\n cc_color_blue: 'Blue',\n cc_color_cyan: 'Cyan',\n cc_color_green: 'Green',\n cc_color_grey: 'Grey',\n cc_color_magenta: 'Magenta',\n cc_color_red: 'Red',\n cc_color_white: 'White',\n cc_color_yellow: 'Yellow',\n cc_font_name_casual: 'Casual',\n cc_font_name_cursive: 'Cursive',\n cc_font_name_monospacedsansserif: 'Monospaced Sans Serif',\n cc_font_name_monospacedserif: 'Monospaced Serif',\n cc_font_name_proportionalserif: 'Proportional Serif',\n cc_font_name_proportionalsansserif: 'Proportional Sans Serif',\n cc_font_name_smallcapitals: 'Small Capitals',\n cc_text_size: 'Text size',\n cc_text_size_default: 'Default',\n cc_text_size_extralarge: 'Extra Large',\n cc_text_size_large: 'Large',\n cc_text_size_maximum: 'Maximum',\n cc_text_size_small: 'Small',\n cc_appearance: 'Appearance',\n cc_preset1: 'Preset 1 ',\n cc_preset2: 'Preset 2',\n cc_preset3: 'Preset 3',\n cc_preset4: 'Preset 4',\n cc_preset5: 'Preset 5',\n cc_presettings: 'Close captions appearance {0}: ({1}:{2}, {3}:{4})',\n cc_text_background_color: 'Background color',\n cc_text_background_opacity: 'Background opacity',\n cc_text_opacity: 'Text opacity',\n cc_percent_0: '0%',\n cc_percent_100: '100%',\n cc_percent_25: '25%',\n cc_percent_50: '50%',\n cc_percent_75: '75%',\n cc_text_edge_color: 'Text edge color',\n cc_text_edge_style: 'Text edge style',\n cc_text_edge_style_depressed: 'Depressed',\n cc_text_edge_style_dropshadow: 'Drop shadow',\n cc_text_edge_style_none: 'No edge',\n cc_text_edge_style_raised: 'Raised',\n cc_text_edge_style_uniform: 'Uniform',\n cc_window_color: 'Window color',\n cc_window_opacity: 'Window opacity',\n cc_reset: 'Reset'\n};\n\n/**\n *\n * Closed Caption helper class.\n *\n */\nexport default class LocalizationHelper {\n private readonly playerResources: IPlayerResources;\n\n public constructor(props: IPlayerResources) {\n this.playerResources = props;\n }\n\n /**\n * Gets the localized value for given key.\n * @param key - The key to look for.\n * @returns The localization string.\n */\n public getLocalizedValue(key: string): string {\n return this.playerResources[key] || LocalizationConstants[key] || '';\n }\n\n /**\n * Converts from a locale ID to a 2 character language code.\n * @public\n * @param locale - Locale ID string.\n * @returns The localization string.\n */\n public getLanguageCodeFromLocale(locale: string): string {\n return ccLanguageCodes[locale] || '';\n }\n\n /**\n * Converts from language ID or locale name to a localized language name.\n * @public\n * @param locale - Language ID string or locale name string.\n * @returns Language Name from locale.\n */\n public getLanguageNameFromLocale(locale: string): string {\n return ccCultureLocStrings[locale] || this.getLocalizedValue(PlayerLocKeys.unknown_language);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n closedCaptionsPresetMap,\n closedCaptionsSettingsMap,\n closedCaptionsSettingsOptions,\n videoClosedCaptionsConstant\n} from '../closed-captions';\nimport { ClosedCaptionTypes, ICurrentClosedCaptionsSettings, IPlayerMenu, IPlayerMenuItem, IVideoMetadata, MenuCategories } from '../data';\nimport { format } from '../utilities';\nimport LocalizationHelper, { ccCultureLocStrings, PlayerLocKeys } from './localization-helper';\nimport PlayerHelper from './player-helper';\n\n/**\n *\n * Closed Caption helper class.\n *\n */\nexport default class ClosedCaptionHelper {\n private readonly playerMetaData: IVideoMetadata;\n\n private readonly playerHelper: PlayerHelper;\n\n private readonly localizationHelper: LocalizationHelper;\n\n public constructor(props: IVideoMetadata, playerHelper: PlayerHelper, localizationHelper: LocalizationHelper) {\n this.playerMetaData = props;\n this.playerHelper = playerHelper;\n this.localizationHelper = localizationHelper;\n }\n\n public checkClosedCaptionsFiles(): boolean {\n if (this.playerMetaData.ccFiles && this.playerMetaData.ccFiles.length > 0) {\n return true;\n }\n return false;\n }\n\n public getClosedCaptionMenu(): IPlayerMenu | null {\n if (this.playerMetaData.ccFiles && this.playerMetaData.ccFiles.length > 0) {\n const ccFiles = this.playerMetaData.ccFiles;\n\n const ccMenuItems: IPlayerMenuItem[] = [];\n\n for (const ccFile of ccFiles) {\n // If ccType is not provided we default to TTML\n if (!ccFile.ccType || ccFile.ccType === ClosedCaptionTypes.TTML) {\n const lang = this.localizationHelper.getLanguageCodeFromLocale(ccFile.locale.toLowerCase());\n\n const ccMenuItem: IPlayerMenuItem = {\n id: this.playerHelper.addIdPrefix(ccFile.locale),\n label: ccCultureLocStrings[ccFile.locale],\n language: lang,\n data: ccFile.locale,\n selected: false,\n selectable: true,\n persistOnClick: true,\n ariaLabel: `${ccCultureLocStrings[ccFile.locale]} ${this.localizationHelper.getLocalizedValue(\n PlayerLocKeys.closecaption\n )}`\n };\n ccMenuItems.push(ccMenuItem);\n }\n }\n\n ccMenuItems.push({\n id: this.playerHelper.addIdPrefix('appearance'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n selected: false,\n selectable: false,\n subMenu: this._getClosedCaptionsSettingsMenu()\n });\n\n // Add 'off' option to the top of the list\n ccMenuItems.unshift({\n id: this.playerHelper.addIdPrefix('off'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption_off),\n selected: false,\n data: 'off',\n selectable: true,\n persistOnClick: true,\n ariaLabel: `${this.localizationHelper.getLocalizedValue(\n PlayerLocKeys.closecaption_off\n )} ${this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption)}`\n });\n\n return {\n category: MenuCategories.ClosedCaption,\n id: this.playerHelper.addIdPrefix(MenuCategories.ClosedCaption),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.closecaption),\n items: ccMenuItems\n };\n }\n return null;\n }\n\n public getUpdatedClosedCaptionSetting(\n currentClosedCaptionsSetting: ICurrentClosedCaptionsSettings,\n settingKey: string,\n optionKey: string\n ): ICurrentClosedCaptionsSettings {\n if (settingKey === videoClosedCaptionsConstant.presetKey) {\n const presetValue = closedCaptionsPresetMap[optionKey];\n\n return {\n window_color: currentClosedCaptionsSetting.window_color,\n window_opacity: currentClosedCaptionsSetting.window_opacity,\n text_background_color: presetValue.text_background_color,\n text_background_opacity: presetValue.text_background_opacity,\n text_color: presetValue.text_color,\n text_edge_style: presetValue.text_edge_style,\n text_font: presetValue.text_font,\n text_opacity: presetValue.text_opacity,\n text_size: presetValue.text_size,\n preset: optionKey\n };\n }\n if (this._getOptionValue(settingKey, optionKey)) {\n currentClosedCaptionsSetting[videoClosedCaptionsConstant.presetKey] = 'none';\n currentClosedCaptionsSetting[settingKey] = optionKey;\n return currentClosedCaptionsSetting;\n }\n return currentClosedCaptionsSetting;\n }\n\n /**\n * Gets the value of closed captions URL from the locale.\n * @param locale - Locale.\n * @returns Returns the closed caption URL.\n */\n public getClosedCaptionURLFromLocale(locale: string): string {\n let url: string = '';\n const ccFiles = this.playerMetaData.ccFiles!;\n for (const ccFile of ccFiles) {\n if (ccFile.locale === locale) {\n url = ccFile.url;\n }\n }\n return url;\n }\n\n /**\n * Gets the value of closed captions settings option.\n * @private\n * @param settingKey - The closed ceptions settings key.\n * @param optionKey - The closed captions option key.\n * @returns - The option value.\n */\n private _getOptionValue(settingKey: string, optionKey: string): string {\n const setting = closedCaptionsSettingsMap[settingKey];\n if (setting) {\n const option = closedCaptionsSettingsOptions[setting.option];\n return option && option.map[optionKey];\n }\n return '';\n }\n\n /**\n * Gets the closed captions settings menu to be added to options menu.\n * @returns - The player menu.\n */\n private _getClosedCaptionsSettingsMenu(): IPlayerMenu {\n // Const currentSettings = currentClosedCaptionsSetting;\n\n // create customize settings menu\n const settingsMenuItems: IPlayerMenuItem[] = [];\n\n for (const settingKey of Object.keys(closedCaptionsSettingsMap)) {\n const setting = closedCaptionsSettingsMap[settingKey];\n\n const option = closedCaptionsSettingsOptions[setting.option];\n const optionMenuItem: IPlayerMenuItem[] = [];\n\n // eslint-disable-next-line guard-for-in\n for (const optionKey in option.map) {\n optionMenuItem.push({\n id: this._getCCMenuItemId(settingKey, optionKey),\n label: this.localizationHelper.getLocalizedValue(`${option.pre}${optionKey}`),\n selectable: true,\n selected: false,\n persistOnClick: true,\n data: `${settingKey}:${optionKey}`\n });\n }\n\n // Add back button\n optionMenuItem.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`),\n ariaLabel: `${settingKey} - go back to previous menu`,\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n\n settingsMenuItems.push({\n id: this.playerHelper.addIdPrefix(`${settingKey}_item`),\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`),\n selectable: false,\n subMenu: {\n id: this._getCCSettingsMenuId(settingKey),\n category: MenuCategories.ClosedCaptionSettings,\n items: optionMenuItem,\n label: this.localizationHelper.getLocalizedValue(`cc_${settingKey}`)\n }\n });\n }\n\n settingsMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n ariaLabel: 'Customize - go back to previous menu',\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n\n const settingsMenu: IPlayerMenu = {\n id: this.playerHelper.addIdPrefix(MenuCategories.ClosedCaptionSettings),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n category: MenuCategories.ClosedCaptionSettings,\n items: settingsMenuItems\n };\n\n // Create preset items menu\n const presetItems: IPlayerMenuItem[] = [];\n\n for (const preset of Object.keys(closedCaptionsPresetMap)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const presetSetting: any = closedCaptionsPresetMap[preset];\n const font: string = presetSetting.text_font;\n const color: string = presetSetting.text_color;\n\n const ariaLabelValue = format(\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_presettings),\n '',\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_text_font),\n this.localizationHelper.getLocalizedValue(`cc_font_name_${font}`),\n this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_text_color),\n this.localizationHelper.getLocalizedValue(`cc_color_${color}`)\n );\n\n presetItems.push({\n id: this._getCCMenuItemId(videoClosedCaptionsConstant.presetKey, preset),\n label: this.localizationHelper.getLocalizedValue(`cc_${preset}`),\n data: `preset:${preset}`,\n selectable: true,\n selected: false,\n persistOnClick: true,\n ariaLabel: ariaLabelValue,\n hasMouseHoverEvents: true\n });\n }\n\n presetItems.push({\n id: this.playerHelper.addIdPrefix('cc-customize'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_customize),\n subMenu: settingsMenu,\n hasMouseHoverEvents: true\n });\n\n presetItems.push({\n id: 'reset',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_reset),\n data: 'reset',\n persistOnClick: true,\n hasMouseHoverEvents: true\n });\n\n presetItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n ariaLabel: 'Appreance - go back to previous menu',\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true,\n hasMouseHoverEvents: true\n });\n\n return {\n id: this._getCCSettingsMenuId(videoClosedCaptionsConstant.presetKey),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.cc_appearance),\n category: MenuCategories.ClosedCaptionSettings,\n items: presetItems\n };\n }\n\n /**\n * Gets the close captions setting menu item id.\n * @param settingId - The setting key.\n * @param optionId - The option key.\n * @returns - Menu Id.\n */\n private _getCCMenuItemId(settingId: string, optionId: string): string {\n return this.playerHelper.addIdPrefix(`cc-${settingId}-${optionId}`);\n }\n\n /**\n * Gets the close captions setting menu id.\n * @param settingId - The setting key.\n * @returns Setting menu Id.\n */\n private _getCCSettingsMenuId(settingId: string): string {\n return this.playerHelper.addIdPrefix(`cc-${settingId}`);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n ClosedCaptionTypes,\n IAudioTrack,\n IBinaryReference,\n ICCFile,\n IPlayerMenu,\n IPlayerMenuItem,\n IPlayerProps,\n IVideoFile,\n IVideoMetadata,\n MediaQuality,\n MediaTypes,\n MenuCategories,\n PlayerConstants\n} from '../data';\nimport { startsWith } from '../utilities';\nimport LocalizationHelper, { PlayerLocKeys } from './localization-helper';\n\n/**\n *\n * Player helper class.\n *\n */\nexport default class PlayerHelper {\n private playerProps: IPlayerProps;\n\n private readonly localizationHelper: LocalizationHelper;\n\n private readonly _isMobileDevice?: boolean;\n\n public constructor(props: IPlayerProps, localizationHelper: LocalizationHelper, isMobileDevice?: boolean) {\n this.playerProps = props;\n this.localizationHelper = localizationHelper;\n this._isMobileDevice = isMobileDevice;\n }\n\n public getMetadata(): IVideoMetadata {\n this._mapVideoFiles();\n this._setCCFiles();\n this._setAudioTracks();\n return this.playerProps.playerData.metaData;\n }\n\n public updatePlayerProps(props: IPlayerProps): void {\n this.playerProps = props;\n this._clearVideoPlayerMetaData();\n }\n\n public getOptionMenu(): IPlayerMenu | null {\n const audioTracks = this._getAudioTracksMenu();\n if (audioTracks === null) {\n return null;\n }\n const optionMenuItems: IPlayerMenuItem[] = [];\n\n optionMenuItems.push({\n id: this.addIdPrefix('audioTracks'),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n selected: false,\n selectable: false,\n subMenu: audioTracks\n });\n\n return {\n category: MenuCategories.Options,\n id: this.addIdPrefix(MenuCategories.Options),\n label: 'Options',\n items: optionMenuItems\n };\n }\n\n /**\n * Get Poster Frame URL.\n * @returns Returns the poster image URL.\n */\n public getPosterFrameUrl(): string {\n let posterFrameUrl = '';\n if (!this.playerProps.playerData.options.hidePosterFrame && this.playerProps.playerData.metaData.posterframeUrl) {\n posterFrameUrl = this._removeProtocolFromUrl(this.playerProps.playerData.metaData.posterframeUrl);\n if (this.playerProps.playerData.options.thumbnailFullWidth) {\n if (posterFrameUrl.indexOf('?') > 0) {\n posterFrameUrl = `${posterFrameUrl}${'&w='}${PlayerConstants.thumbnailFullWidth}${'&h='}${\n PlayerConstants.thumbnailFullHeight\n }`;\n } else {\n posterFrameUrl = `${posterFrameUrl}${'?w='}${PlayerConstants.thumbnailFullWidth}${'&h='}${\n PlayerConstants.thumbnailFullHeight\n }`;\n }\n }\n }\n return posterFrameUrl;\n }\n\n public getVideoFileToPlay(): IVideoFile {\n let videoFile: IVideoFile = {\n url: '',\n mediaType: MediaTypes.MP4,\n quality: MediaQuality.LO\n };\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n\n const mpVideoFiles = this._getVideoFileByType(MediaTypes.MP4, videoMetaData.videoFiles!);\n\n if (this._isMobileDevice && this.playerProps.playerData.options.mobileVideoQuality) {\n const mobileVideoFile = this._getVideoFileByQuality(\n this.playerProps.playerData.options.mobileVideoQuality.toUpperCase() as MediaQuality,\n mpVideoFiles\n );\n if (mobileVideoFile) {\n return mobileVideoFile;\n }\n }\n\n const hdVideoFile = this._getVideoFileByQuality(MediaQuality.HDX, mpVideoFiles);\n if (hdVideoFile !== null) {\n videoFile = hdVideoFile;\n } else {\n const hqVideoFile = this._getVideoFileByQuality(MediaQuality.HQ, mpVideoFiles);\n if (hqVideoFile !== null) {\n videoFile = hqVideoFile;\n } else {\n const sdVideoFile = this._getVideoFileByQuality(MediaQuality.SD, mpVideoFiles);\n if (sdVideoFile !== null) {\n videoFile = sdVideoFile;\n } else {\n const loVideoFile = this._getVideoFileByQuality(MediaQuality.LO, mpVideoFiles);\n if (loVideoFile !== null) {\n videoFile = loVideoFile;\n }\n }\n }\n }\n return videoFile;\n }\n\n /**\n * Callback function when error happen.\n * @param errorType - Error Type.\n * @param message - Error message.\n */\n public onErrorCallback = (errorType: string, message: string): void => {\n console.log(`ErrorType : ${errorType}, Message : ${message}`);\n };\n\n public isEmptyOrUndefined(value?: string): boolean {\n if (value === undefined || value === '') {\n return true;\n }\n return false;\n }\n\n /**\n * Adds the id prefix to form a child id.\n * @param childId - The child id to prefix.\n * @returns - The prefixed id or the original id if no prefix is built.\n */\n public addIdPrefix(childId: string): string {\n const prefix = this.isEmptyOrUndefined(this.playerProps.playerId) ? null : `${this.playerProps.playerId}-`;\n\n return prefix && !startsWith(childId, prefix, false) ? prefix + childId : childId;\n }\n\n /**\n * Removes the id prefix from a child id.\n * @param childId - The child id to prefix.\n * @returns - The un-prefixed id or the original id if no prefix was found.\n */\n public removeIdPrefix(childId: string): string {\n const prefix = this.isEmptyOrUndefined(this.playerProps.playerId) ? null : `${this.playerProps.playerId}-`;\n\n return prefix && startsWith(childId, prefix, false) ? childId.substring(prefix.length) : childId;\n }\n\n private _getAudioTracksMenu(): IPlayerMenu | null {\n const audioTracksMenuItems: IPlayerMenuItem[] = [];\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n if (videoMetaData.audioTracks !== undefined && videoMetaData.audioTracks.length > 0) {\n // Check if there are multiple \"Descriptive Audio\" tracks, in which case we will want to show language\n let descriptiveAudioTrackCount = 0;\n for (const track of videoMetaData.audioTracks) {\n if (track.isDescriptiveAudio) {\n descriptiveAudioTrackCount++;\n }\n }\n\n let trackIndex: number = 0;\n for (const audioTrack of videoMetaData.audioTracks) {\n let label: string;\n let languageCode: string = '';\n if (audioTrack.isDescriptiveAudio) {\n // Descriptive audio labels look like:\n // \"Descriptive audio\" -- when only one descriptive audio track exists\n // or\n // \"Descriptive audio - English\" -- if there is more than one descriptive audio track\n const descriptiveAudioLabel = this.localizationHelper.getLocalizedValue(PlayerLocKeys.descriptive_audio);\n if (descriptiveAudioTrackCount > 1) {\n const language = this.localizationHelper.getLanguageNameFromLocale(audioTrack.languageCode);\n label = `${descriptiveAudioLabel} - ${language}`;\n } else {\n label = descriptiveAudioLabel;\n }\n languageCode = `daudio-${audioTrack.languageCode.toLowerCase()}`;\n } else {\n // Regular tracks display language of the stream only.\n label = this.localizationHelper.getLanguageNameFromLocale(audioTrack.languageCode);\n languageCode = audioTrack.languageCode.toLowerCase();\n }\n\n const audioMenuItem: IPlayerMenuItem = {\n label,\n language: languageCode,\n data: audioTrack.url,\n id: this.addIdPrefix(`audio-${trackIndex}`),\n selected: false,\n selectable: true,\n persistOnClick: true\n };\n\n audioTracksMenuItems.push(audioMenuItem);\n trackIndex++;\n }\n\n audioTracksMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks_default),\n ariaLabel: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks_default),\n language: 'default',\n data: 'default',\n selectable: true,\n selected: false,\n persistOnClick: true\n });\n\n audioTracksMenuItems.unshift({\n id: '',\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n ariaLabel: `${this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks)} - go back to previous menu`,\n selectable: false,\n selected: false,\n persistOnClick: false,\n isBackButton: true\n });\n return {\n category: MenuCategories.AudioTracks,\n id: this.addIdPrefix(MenuCategories.AudioTracks),\n label: this.localizationHelper.getLocalizedValue(PlayerLocKeys.audio_tracks),\n items: audioTracksMenuItems\n };\n }\n return null;\n }\n\n private _clearVideoPlayerMetaData(): void {\n this.playerProps.playerData.metaData.videoFiles = [];\n this.playerProps.playerData.metaData.audioTracks = [];\n this.playerProps.playerData.metaData.ccFiles = [];\n }\n\n private _setCCFiles(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n const ccFiles: ICCFile[] = [];\n if (!(videoMetaData.ccFiles && videoMetaData.ccFiles.length > 0)) {\n if (videoMetaData.videoBinaryReferences && videoMetaData.videoBinaryReferences.length > 0) {\n for (const binaryRef of videoMetaData.videoBinaryReferences) {\n // Skip all other format except ttml/closedcaption\n if (\n (binaryRef.extension && binaryRef.extension === 'ttml') ||\n binaryRef.$type === 'videoClosedCaptionBinaryReference'\n ) {\n const ccFile: ICCFile = {\n ccType: ClosedCaptionTypes.TTML,\n locale: binaryRef.locale!,\n url: binaryRef.sourceHref!\n };\n ccFiles.push(ccFile);\n }\n }\n this.playerProps.playerData.metaData.ccFiles = ccFiles;\n }\n }\n }\n\n private _setAudioTracks(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n const audioTracks: IAudioTrack[] = [];\n if (videoMetaData.videoBinaryReferences && videoMetaData.videoBinaryReferences.length > 0) {\n for (const binaryRef of videoMetaData.videoBinaryReferences) {\n if (binaryRef.$type && binaryRef.$type === 'audioBinaryReference') {\n const audioTrack: IAudioTrack = {\n isDescriptiveAudio: binaryRef.audioType === 'descriptiveAudio',\n bitrate: binaryRef.bitrate!,\n languageCode: binaryRef.locale === undefined ? '' : binaryRef.locale,\n name: binaryRef.alias!,\n url: binaryRef.clientHref!\n };\n audioTracks.push(audioTrack);\n }\n }\n }\n this.playerProps.playerData.metaData.audioTracks = audioTracks;\n }\n\n private _mapVideoFiles(): void {\n const videoMetaData: IVideoMetadata = this.playerProps.playerData.metaData;\n if (!videoMetaData.videoFiles || videoMetaData.videoFiles.length === 0) {\n const videoFiles: IVideoFile[] = [];\n const videoBinaryFiles: IBinaryReference[] = videoMetaData.videoBinaryReferences!;\n if (videoBinaryFiles && videoBinaryFiles.length > 0) {\n for (const binaryRef of videoBinaryFiles) {\n if (binaryRef.format) {\n // Skip the unsupported 1001 format\n if (binaryRef.format === '1001') {\n continue;\n }\n\n // Handle all other video/audio format\n const mediaTypeAndQuality = this._getMediaTypeAndQuality(binaryRef.format);\n let urlRef;\n if (mediaTypeAndQuality.mediaType === MediaTypes.MP4) {\n urlRef = binaryRef.clientHref;\n } else {\n urlRef = binaryRef.sourceHref;\n }\n\n if (urlRef) {\n urlRef = this._removeProtocolFromUrl(urlRef);\n }\n\n if (urlRef) {\n videoFiles.push({\n url: urlRef,\n quality: mediaTypeAndQuality.quality,\n mediaType: mediaTypeAndQuality.mediaType,\n formatCode: binaryRef.format\n });\n }\n }\n }\n }\n this.playerProps.playerData.metaData.videoFiles = videoFiles;\n }\n }\n\n /**\n * Gets video quality and media type from stream name.\n * @param format - The stream name.\n * @returns The mediaType and MediaQuality.\n */\n private _getMediaTypeAndQuality(format: string): { mediaType: MediaTypes; quality: MediaQuality } {\n let mType: MediaTypes = MediaTypes.MP4;\n let mQuality: MediaQuality = MediaQuality.SD;\n\n switch (format) {\n case '101':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.LO;\n break;\n case '102':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.SD;\n break;\n case '103':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HQ;\n break;\n case '104':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HDX;\n break;\n case '105':\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.HD;\n break;\n case '1004':\n mType = MediaTypes.SMOOTH;\n break;\n case '1006':\n mType = MediaTypes.HLS;\n break;\n case '1007':\n mType = MediaTypes.DASH;\n break;\n default:\n mType = MediaTypes.MP4;\n mQuality = MediaQuality.SD;\n }\n\n return {\n mediaType: mType,\n quality: mQuality\n };\n }\n\n /**\n * Removes protocol from url.\n * @param url - The url.\n * @returns The URL.\n */\n private _removeProtocolFromUrl(url: string): string {\n return url.replace(/(^\\w+:|^)\\/\\//, '//');\n }\n\n /**\n * Gets the video file of specified quality.\n * @param quality - The desired quality to look for.\n * @param videoFiles - The video files.\n * @returns Returns the video file.\n */\n private _getVideoFileByQuality(quality: MediaQuality, videoFiles: IVideoFile[]): IVideoFile | null {\n let videoFile = null;\n for (const file of videoFiles) {\n if (file.quality === quality) {\n videoFile = file;\n break;\n }\n }\n\n return videoFile;\n }\n\n /**\n * Gets the video file of specified type.\n * @param mediaType - The media type to look for.\n * @param videoFiles - The video files.\n * @returns Returns the video file.\n */\n private _getVideoFileByType(mediaType: MediaTypes, videoFiles: IVideoFile[]): IVideoFile[] {\n const videoFile: IVideoFile[] = [];\n for (const file of videoFiles) {\n if (file.mediaType === mediaType) {\n videoFile.push(file);\n }\n }\n return videoFile;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React from 'react';\n\nimport { IMenuItemProps } from './menu-item-props';\n\n/**\n *\n * PlayPauseTrigger React component for video player.\n *\n */\nexport default class MenuItem extends React.PureComponent<IMenuItemProps> {\n private readonly menuItem: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n public constructor(props: IMenuItemProps) {\n super(props);\n this._onClick = this._onClick.bind(this);\n this._onFocus = this._onFocus.bind(this);\n this._onMouseOver = this._onMouseOver.bind(this);\n this._onMouseOut = this._onMouseOut.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onKeyUp = this._onKeyUp.bind(this);\n this._onBlur = this._onBlur.bind(this);\n }\n\n public render(): JSX.Element {\n const { ...props } = this.props;\n let className = this.props.className;\n const hasChildren = !!props.subMenu;\n if (hasChildren) {\n className += ' menu__parent menu__position__right';\n } else if (this.props.selected) {\n className += ' menu__selected menu__position__right';\n } else if (this.props.isBackButton) {\n className += ' menu__back menu__position__left';\n }\n return (\n <li id={props.id} role='presentation'>\n <button\n ref={this.menuItem}\n className={className}\n data-has-children={hasChildren}\n {...(props.data ? { 'data-info': props.data } : {})}\n role={props.selectable ? 'menuitemradio' : 'menuitem'}\n aria-setsize={props.itemCount}\n aria-posinset={props.itemIndex! + 1}\n data-itemindex={props.itemIndex!}\n data-isbackbutton={props.isBackButton}\n {...(props.selectable && props.selected ? { 'aria-selected': true, 'aria-checked': true } : {})}\n {...(props.selectable ? { 'data-video-selectable': true } : {})}\n {...(hasChildren ? { 'aria-expanded': false, 'aria-haspopup': true } : {})}\n {...(props.persistOnClick ? { 'data-persist': true } : {})}\n {...(props.ariaLabel ? { 'aria-label': props.ariaLabel } : {})}\n {...(props.language ? { lang: props.language } : {})}\n {...(props.hasMouseHoverEvents ? { 'data-has-events': props.hasMouseHoverEvents } : {})}\n onClick={this._onClick}\n onFocus={this._onFocus}\n onMouseOver={this._onMouseOver}\n onMouseOut={this._onMouseOut}\n onKeyDown={this._onKeyDown}\n onKeyUp={this._onKeyUp}\n onBlur={this._onBlur}\n >\n {props.image && <img src={props.image} alt={props.imageAlt || ''} className='menu__image' />}\n {props.label}\n </button>\n </li>\n );\n }\n\n public componentDidMount(): void {\n if (this.props.hasFocus) {\n setTimeout(() => {\n this.menuItem.current!.focus();\n }, 0);\n }\n }\n\n public componentDidUpdate(): void {\n if (this.props.hasFocus) {\n setTimeout(() => {\n this.menuItem.current!.focus();\n }, 0);\n }\n }\n\n private _onClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void {\n this.props.onClick!((event as unknown) as Event);\n }\n\n private _onFocus(event: React.FocusEvent<HTMLButtonElement>): void {\n this.props.onFocus!((event as unknown) as Event);\n }\n\n private _onMouseOver(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void {\n this.props.onMouseOver!((event as unknown) as Event);\n }\n\n private _onMouseOut(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void {\n this.props.onMouseOut!((event as unknown) as Event);\n }\n\n private _onKeyDown(event: React.KeyboardEvent<HTMLButtonElement>): void {\n event.stopPropagation();\n this.props.onKeyDown!((event as unknown) as Event);\n }\n\n private _onKeyUp(event: React.KeyboardEvent<HTMLButtonElement>): void {\n event.stopPropagation();\n this.props.onKeyUp!((event as unknown) as Event);\n }\n\n private _onBlur(event: React.FocusEvent<HTMLButtonElement>): void {\n this.props.onBlur!((event as unknown) as Event);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nimport { IMenuItemProps, MenuItem } from '../menu-item';\nimport { IMenuProps } from './menu-props';\n\n/**\n *\n * Menu React component for video player.\n *\n */\nexport default class Menu extends React.Component<IMenuProps> {\n private readonly target: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n public constructor(props: IMenuProps) {\n super(props);\n this.handleDocumentClick = this.handleDocumentClick.bind(this);\n this._onKeyDown = this._onKeyDown.bind(this);\n this._onKeyUp = this._onKeyUp.bind(this);\n }\n\n public componentDidMount(): void {\n ['click', 'touchstart'].forEach((event: string) => {\n window && window.addEventListener(event, this.handleDocumentClick, true);\n });\n }\n\n public componentWillUnmount(): void {\n ['click', 'touchstart'].forEach((event: string) => {\n window && window.removeEventListener(event, this.handleDocumentClick, true);\n });\n }\n\n public getMenuWidth(): number {\n return this.target.current!.offsetWidth;\n }\n\n public shouldComponentUpdate(nextProps: IMenuProps): boolean {\n let shouldRender = false;\n if (nextProps.playerMenu !== this.props.playerMenu) {\n shouldRender = true;\n }\n return shouldRender;\n }\n\n public render(): JSX.Element {\n const { className, style } = this.props;\n const menuItems: IMenuItemProps[] = this.props.playerMenu.items;\n const count: number = menuItems.length;\n return (\n <div className={className} style={style} ref={this.target} data-category={this.props.playerMenu.category}>\n <ul role='menu' className={`${className}__list`} onKeyDown={this._onKeyDown} onKeyUp={this._onKeyUp}>\n {menuItems.map((menuItem: IMenuItemProps, index: number) => {\n return (\n <MenuItem\n id={menuItem.id}\n key={index}\n label={menuItem.label}\n className={`${className}__menuitem`}\n language={menuItem.language}\n data={menuItem.data}\n isBackButton={menuItem.isBackButton}\n image={menuItem.image}\n imageAlt={menuItem.imageAlt}\n itemCount={count}\n itemIndex={index}\n glyph={menuItem.glyph}\n selected={menuItem.selected}\n selectable={menuItem.selectable}\n persistOnClick={menuItem.persistOnClick}\n {...(menuItem.id.includes('cc-preset') ? {} : { ariaLabel: menuItem.ariaLabel })}\n subMenu={menuItem.subMenu}\n hasMouseHoverEvents={menuItem.hasMouseHoverEvents}\n hasChildren={\n !!(menuItem.subMenu !== undefined && menuItem.subMenu.items && menuItem.subMenu.items.length > 0)\n }\n onClick={this.props.onMenuItemClick}\n onFocus={this.props.onFocus}\n onBlur={this.props.onBlur}\n onKeyDown={this.props.onKeyDown}\n onKeyUp={this.props.onKeyUp}\n onMouseOver={this.props.onMouseOver}\n onMouseOut={this.props.onMouseOut}\n hasFocus={menuItem.hasFocus}\n />\n );\n })}\n </ul>\n </div>\n );\n }\n\n public handleDocumentClick(e: Event): void {\n const target = e.target as HTMLElement;\n if (\n this.target !== undefined &&\n !(this.target.current !== null && (e.target === this.target.current || this.target.current.contains(target)))\n ) {\n this.props.onDocumentClick(e);\n }\n }\n\n private _onKeyDown(event: React.KeyboardEvent<HTMLUListElement>): void {\n this.props.onKeyDown!((event as unknown) as Event);\n }\n\n private _onKeyUp(event: React.KeyboardEvent<HTMLUListElement>): void {\n this.props.onKeyUp!((event as unknown) as Event);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ActionToggle } from '../action-toggle';\nimport { LocalizationConstants } from '../helper';\nimport { IPlayPauseTriggerProps } from './play-pause-trigger.props';\n\n/**\n *\n * PlayPauseTrigger React component for video player.\n *\n */\nexport default class PlayPauseTrigger extends React.PureComponent<IPlayPauseTriggerProps> {\n public static defaultProps: Partial<IPlayPauseTriggerProps> = {\n playAriaLabel: 'play',\n pauseAriaLabel: 'pause'\n };\n\n private readonly playRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly pauseRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly payLoad: IPayLoad;\n\n public constructor(props: IPlayPauseTriggerProps) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public render(): JSX.Element {\n const { className, playAriaLabel, pauseAriaLabel, style, ...props } = this.props;\n this.payLoad.contentAction.etext = this.props.toggled ? LocalizationConstants.pauseAriaLabel : LocalizationConstants.playAriaLabel;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n <div className={`${className}__container`} onClick={this.props.onChange} style={style} role='none'>\n <ActionToggle className={this.props.className} {...props}>\n <button aria-label={playAriaLabel} className={`${className}__playbtn`} ref={this.playRef} {...attribute} />\n <button aria-label={pauseAriaLabel} className={`${className}__pausebtn`} ref={this.pauseRef} {...attribute} />\n </ActionToggle>\n <UncontrolledTooltip trigger='hover focus' target={this.playRef}>\n {' '}\n {playAriaLabel}\n </UncontrolledTooltip>\n <UncontrolledTooltip trigger='hover focus' target={this.pauseRef}>\n {' '}\n {pauseAriaLabel}\n </UncontrolledTooltip>\n </div>\n );\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * KeyCodes Enum.\n */\nexport enum KeyCodes {\n Back = 8,\n Tab = 9,\n Enter = 13,\n Shift = 16,\n Ctrl = 17,\n Alt = 18,\n Break = 19,\n CapsLock = 20,\n Escape = 27,\n Space = 32,\n PageUp = 33,\n PageDown = 34,\n End = 35,\n Home = 36,\n ArrowLeft = 37,\n ArrowUp = 38,\n ArrowRight = 39,\n ArrowDown = 40,\n Print = 44,\n Insert = 45,\n Delete = 46,\n Colon2 = 59, // Opera and Firefox\n Equals2 = 61, // Opera\n Equals3 = 107, // Firefox\n Minus2 = 109, // Opera and Firefox\n Period = 190,\n WindowsLeft = 91,\n WindowsRight = 92,\n WindowsOpera = 219, // Opera\n Menu = 93,\n NumPad0 = 96,\n NumPad1 = 97,\n NumPad2 = 98,\n NumPad3 = 99,\n NumPad4 = 100,\n NumPad5 = 101,\n NumPad6 = 102,\n NumPad7 = 103,\n NumPad8 = 104,\n NumPad9 = 105,\n NumPadMultiply = 106,\n NumPadPlus = 107,\n NumPadMinus = 109,\n NumPadDot = 110,\n NumPadDivide = 111,\n Function1 = 112,\n Function2 = 113,\n Function3 = 114,\n Function4 = 115,\n Function5 = 116,\n Function6 = 117,\n Function7 = 118,\n Function8 = 119,\n Function9 = 120,\n Function10 = 121,\n Function11 = 122,\n Function12 = 123,\n NavigationUp = 138,\n NavigationDown = 139,\n NavigationLeft = 140,\n NavigationRight = 141,\n NavigationAccept = 142,\n NumLock = 144,\n ScrollLock = 145,\n Colon = 186,\n Equals = 187,\n Comma = 188,\n Minus = 189,\n ForwardSlash = 191,\n Tilde = 192,\n GamepadA = 195,\n GamepadB = 196,\n GamepadX = 197,\n GamepadY = 198,\n GamepadRightButton = 199,\n GamepadLeftButton = 200,\n GamepadLeftTrigger = 201,\n GamepadRightTrigger = 202,\n GamepadDPadUp = 203,\n GamepadDPadDown = 204,\n GamepadDPadLeft = 205,\n GamepadDPadRight = 206,\n GamepadSelect = 207,\n GamepadStart = 208,\n GamepadLeftThumbstick = 209,\n GamepadRightThumbstick = 210,\n GamepadLeftThumbstickUp = 211,\n GamepadLeftThumbstickDown = 212,\n GamepadLeftThumbstickRight = 213,\n GamepadLeftThumbstickLeft = 214,\n GamepadRightThumbstickUp = 215,\n GamepadRightThumbstickDown = 216,\n GamepadRightThumbstickRight = 217,\n GamepadRightThumbstickLeft = 218,\n OpenBracket = 219,\n BackSlash = 220,\n CloseBracket = 221,\n Quote = 222\n}\n\n/**\n * Here for test coverage.\n */\nexport class KeycodesClass {\n public testCoverage(): string {\n return ':(';\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Format the passed string.\n * @param formatSpecifier - FormatSpecifier.\n * @param parameters -- Any number of parameters.\n * @returns The formated string.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function format(formatSpecifier: string, ...parameters: any[]): string {\n if (!formatSpecifier) {\n return '';\n }\n\n return formatSpecifier.replace(/{(\\d+)}/g, (match: string, index: number) => {\n if (index >= parameters.length) {\n return match;\n }\n\n const value = parameters[index];\n\n if (typeof value !== 'number' && !value) {\n return '';\n }\n\n if (typeof value === 'string') {\n return value;\n }\n\n return value.toString();\n });\n}\n\n/**\n * Determines if the specified string is undefined, null, empty, or whitespace.\n * @param value - The string to examine.\n * @returns - True if the value is undefined, null, empty, or whitespace, otherwise false.\n */\nexport function isNullOrWhiteSpace(value: string): boolean {\n return !value || typeof value !== 'string' || !trim(value);\n}\n\n/**\n * Trims leading and trailing whitespace from the string.\n * @param value - The string to examine.\n * @returns - The trimmed string.\n */\nexport function trim(value: string): string {\n // Any flavor of !value (ie. null/undefined/'') should return itself.\n if (!value || typeof value !== 'string') {\n return value;\n }\n\n if (value.trim) {\n return value.trim();\n }\n\n return value.replace(/^\\s+|\\s+$/g, '');\n}\n\n/**\n * Determines if the specified string starts with the specified value.\n * @param value - The string to look in.\n * @param prefix - The prefix to look for.\n * @param ignoreCase - Ignore Case.\n * @returns - True if the string starts with the prefix, otherwise false.\n */\nexport function startsWith(value: string, prefix: string, ignoreCase: boolean = true): boolean {\n if (!value || !prefix) {\n return false;\n }\n\n if (ignoreCase) {\n value = value.toLocaleLowerCase();\n prefix = prefix.toLocaleLowerCase();\n }\n\n if (value.startsWith) {\n return value.startsWith(prefix);\n }\n\n return value.startsWith(prefix);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { isNullOrWhiteSpace, trim } from './string-extensions';\n\n/**\n * Get the text of the element.\n * @param element - HTML element.\n * @returns The content of the element.\n */\nexport function getText(element?: HTMLElement | Element): string {\n return element ? element.textContent || '' : '';\n}\n\n/**\n * Add a css class to an element.\n * @param element - The element to add the css class to.\n * @param cssClass - The css class to add.\n */\nexport function addClass(element: HTMLElement, cssClass: string): void {\n if (element && !isNullOrWhiteSpace(cssClass) && !hasClass(element, cssClass)) {\n if (element.classList) {\n element.classList.add(cssClass);\n } else {\n element.className = trim(`${element.className} ${cssClass}`);\n }\n }\n}\n\n/**\n * Checks for the presence of a css class on an element.\n * @param element - The element to check the css class of.\n * @param cssClass - The css class to check for.\n * @returns True if the element's className has the specified class, otherwise false.\n */\nexport function hasClass(element: HTMLElement, cssClass: string): boolean {\n if (!element || isNullOrWhiteSpace(cssClass)) {\n return false;\n } else if (element.classList) {\n return element.classList.contains(cssClass);\n }\n return `' ' ${element.className} ' '`.includes(`' ' ${trim(cssClass)} ' '`);\n}\n\n/**\n * Convert node list to array.\n * @param nodeList - Node List.\n * @returns Array of the node list.\n */\nexport function nodeListToArray<T extends Node>(\n nodeList: NodeListOf<T> | NodeListOf<Element> | HTMLCollection | NodeList | NamedNodeMap\n): T[] {\n if (!nodeList) {\n return [];\n }\n\n const elements: T[] = [];\n\n for (let n = 0; n < nodeList.length; n++) {\n elements.push(<T>nodeList[n]);\n }\n\n return elements;\n}\n\n/**\n * Select elements in a context.\n * @param selector - Can be class, id or tag selector.\n * @param [context] - Any element to scope the selection. It's optional. If not provided document will be assumed.\n * @returns HTMLElement[].\n */\nexport function selectElements(selector: string, context?: HTMLElement): HTMLElement[] {\n return selectElementsT<HTMLElement>(selector, context);\n}\n\n/**\n * Select elements in a context.\n * @param selector - Can be class, id or tag selector.\n * @param [context] - Any element to scope the selection. It's optional. If not provided document will be assumed.\n * @returns T[].\n */\nexport function selectElementsT<T extends HTMLElement>(selector: string, context?: HTMLElement): T[] {\n if (isNullOrWhiteSpace(selector) || selector === '#') {\n return <T[]>[];\n }\n\n const currentContext: HTMLElement | Document = context || document;\n\n // Check if the first character is class or id.\n if (/^[#.]?[\\w-]+$/.test(selector)) {\n // eslint-disable-next-line default-case\n switch (selector[0]) {\n case '.':\n if (currentContext.getElementsByClassName) {\n return nodeListToArray<T>(currentContext.getElementsByClassName(selector.slice(1)));\n }\n return nodeListToArray<T>(currentContext.querySelectorAll(selector));\n\n case '#':\n const element = currentContext.querySelector(selector);\n return <T[]>(element ? [element] : []);\n }\n\n return nodeListToArray<T>(currentContext.getElementsByTagName(selector));\n }\n\n return nodeListToArray<T>(currentContext.querySelectorAll(selector));\n}\n\n/**\n * Sets or gets CSS properties.\n * @param element - HTML Element.\n * @param property - The CSS property name.\n * @param [value] - The value to set on the CSS property.\n * @returns - The value of the CSS property.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function css(element: HTMLElement | Node, property: string, value?: any): any {\n if (!element) {\n return null;\n }\n\n if (value || value === '') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (<any>element).style[property] = value;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value = (<any>element).style[property];\n\n if (isNullOrWhiteSpace(value)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value = getComputedStyle(element as any);\n value = value[property];\n }\n\n return value;\n }\n}\n\n/**\n * Remove all inner HTML from a parent element - used to delete child elements.\n * @param parentElement - The parent element from which all children should be removed.\n */\nexport function removeInnerHtml(parentElement: HTMLElement): void {\n if (parentElement) {\n parentElement.innerHTML = '';\n }\n}\n\n/**\n * Select first element from the selected elements using provided selector.\n * @param selector - Element selector.\n * @param [context] - An optional context to scope the selection.\n * @returns - The first element from the match.\n */\nexport function selectFirstElement(selector: string, context?: HTMLElement): HTMLElement | null {\n const elementsSelected = selectElementsT<HTMLElement>(selector, context);\n return !elementsSelected || !elementsSelected.length ? null : elementsSelected[0];\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare let window: any;\n\n/**\n * @name - XDomainRequest\n * @description - typescript declaration for XDomainRequest object.\n * @type {object}\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare let XDomainRequest: any;\n\n/**\n * PlayerUtilities class.\n * @classdesc - The PlayerOptions class is used to pass player options settings to the player.\n * It supplies default values which can be overridden via overrides passed to the constructor.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class PlayerUtility {\n /**\n * @name - pendingAjaxRequests\n * @description - array to hold pending ajax requests.\n * @private\n * @static\n * @returns {any}\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static readonly pendingAjaxRequests: any = [];\n\n /**\n * Gets request data using ajax call.\n * @param url - Url from where to fetch data.\n * @param done - On success callback function.\n * @param failed - On failed callback function.\n */\n public static ajax(url: string, done: Function, failed?: Function): void {\n if (!url) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let ajaxRequest: any = null;\n\n // For IE 9 and below use XDomainRequest\n if (window.XDomainRequest) {\n ajaxRequest = new XDomainRequest();\n\n ajaxRequest.addEventListener('load', () => {\n done && done(ajaxRequest.responseText);\n PlayerUtility._removeFromPendingAjaxRequests(ajaxRequest);\n });\n\n // IE8 and IE9 have a bug where garbage collector will clear XDomainRequest object\n // before the call is completed. Thus add a reference to the object so that request\n // is not aborted by garbage collector.\n PlayerUtility.pendingAjaxRequests.push(ajaxRequest);\n } else if (window.XMLHttpRequest) {\n ajaxRequest = new XMLHttpRequest();\n\n ajaxRequest.onreadystatechange = () => {\n if (ajaxRequest.readyState === 4) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let result: any = null;\n if (ajaxRequest.status === 200) {\n result = ajaxRequest.responseText;\n }\n done && done(result);\n } else {\n // The following console.log useful for debugging and is left in commented out for easy restoration.\n // console.log('Localization-helper: readystate(' + xhttp.readyState + ') status(' + xhttp.status + ')');\n }\n };\n }\n\n // Attach common event handlers and make the request.\n if (ajaxRequest) {\n ajaxRequest.ontimeout = ajaxRequest.addEventListener('error', () => {\n PlayerUtility._removeFromPendingAjaxRequests(ajaxRequest);\n failed && failed();\n });\n ajaxRequest.open('GET', url, true);\n ajaxRequest.send();\n }\n }\n\n /**\n * Removes object from array to hold pending ajax requests.\n * @param obj - Object.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private static _removeFromPendingAjaxRequests(obj: any): void {\n // When the call is completed remove it from the array\n let index = -1;\n for (let i = 0; i < PlayerUtility.pendingAjaxRequests.length; i++) {\n if (obj === PlayerUtility.pendingAjaxRequests[i]) {\n index = i;\n break;\n }\n }\n if (index >= 0) {\n PlayerUtility.pendingAjaxRequests.splice(index, 1);\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Client Dimension Interface.\n */\nexport interface IClientDimension {\n width: number;\n height: number;\n}\n\n/**\n * Dictionary String Interface.\n */\nexport interface IDictionaryStringString {\n [key: string]: string;\n}\n\n/**\n * @interface IGrid\n * @classdesc - The IGrid interface contract.\n */\nexport interface IGrid {\n rows: number;\n columns: number;\n}\n\n/**\n * Clamp position between a range.\n * @param value - Value to be clamped.\n * @param min - Minimum value in range.\n * @param max - Maximum value in range.\n * @returns The clap value if min passed is less than max else returns 0.\n */\nexport function clamp(value: number, min: number, max: number): number {\n if (min <= max) {\n return Math.min(Math.max(value, min), max);\n }\n return 0;\n}\n\n/**\n * Upper case the first letter of the string, if only one char exists on the string, uppercase it.\n * @param value - Value to be upper cased.\n * @returns The upper cased string of the passed value, if it has just one char uppercase it.\n */\nexport function toUpperCaseFirstChar(value: string): string {\n if (value.length > 1) {\n return value.charAt(0).toUpperCase() + value.substr(1);\n }\n if (value.length === 1) {\n return value.charAt(0).toUpperCase();\n }\n return '';\n}\n\n/**\n * HTML collectio to Array.\n * @param nodeList - Html Collection.\n * @returns - An array of the HTML Element.\n */\nexport function htmlCollectionToArray(nodeList: HTMLCollection): HTMLElement[] {\n return Array.prototype.slice.call(nodeList);\n}\n\n/**\n * Get CSS for the Element.\n * @param element - The HTML Element.\n * @param property - The HTML property.\n * @returns - The value of the required property.\n */\nexport function getCSS(element: HTMLElement, property: string): string {\n let style = element.style[property];\n\n if (!style) {\n style = getComputedStyle(element)[property];\n }\n\n return style;\n}\n\n/**\n * Create Throttled Event.\n * @param listener - The Event Listener.\n * @param threshold - The threshold number.\n * @returns The event.\n */\nexport function createThrottledEvent(listener: EventListener, threshold: number): (event: Event) => void {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let timer: any;\n let last = 0;\n\n return (event: Event) => {\n const now = Date.now();\n\n if (timer) {\n clearTimeout(timer);\n timer = undefined;\n }\n\n if (last && now < last + threshold) {\n timer = setTimeout(() => {\n last = Date.now();\n listener(event);\n }, threshold - (now - last));\n } else {\n last = now;\n listener(event);\n }\n };\n}\n\n/**\n * Add the Throrrled Event.\n * @param target - Event Targer.\n * @param name - Name of the Event.\n * @param listener - The Event Listener.\n * @param threshold - The Threshold number.\n * @returns - Returns the Throttled Event.\n */\nexport function addThrottledEvent(\n target: EventTarget,\n name: string,\n listener: EventListener,\n threshold: number = 150\n): (event: Event) => void {\n const throttledEventHandler = createThrottledEvent(listener, threshold);\n target.addEventListener(name, throttledEventHandler, false);\n\n return throttledEventHandler;\n}\n\n/**\n * Map the CSS to the modules.\n * @param className - Class name.\n * @param cssModule - CSS modules.\n * @returns - Returns the map CSS.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function mapToCssModules(className: string = '', cssModule: any): string {\n if (!cssModule) {\n return className;\n }\n\n return className\n .split(' ')\n .map((c: string) => cssModule[c] || c)\n .join(' ');\n}\n\n/**\n * Check the raget object is reference.\n * @param target - Target object.\n * @returns Returns boolean.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isRef(target: any): boolean {\n if (!target) {\n return false;\n }\n\n return (<React.RefObject<HTMLElement>>target).current !== undefined;\n}\n\n/**\n * Check if the passed target is element.\n * @param target - Target element.\n * @returns Returns boolean.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isElement(target: any): boolean {\n if (!target) {\n return false;\n }\n\n return (<HTMLElement>target).addEventListener !== undefined;\n}\n\n/**\n * KeyCodes Enum.\n */\nexport const keyCodes = {\n esc: 27,\n space: 32,\n tab: 9,\n up: 38,\n down: 40,\n enter: 13\n};\n\n/**\n * Map Interface.\n */\ninterface IMap<T> {\n [key: string]: T;\n}\nconst warned: IMap<boolean> = {};\n\n/**\n * Warn once.\n * @param message - Message to warned.\n */\nexport function warnOnce(message: string): void {\n if (!warned[message]) {\n if (typeof console !== 'undefined') {\n throw new Error(message);\n }\n warned[message] = true;\n }\n}\n\n/**\n * Can use DOM..\n */\nexport const canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\n\n/**\n * Find the required DOM element.\n * @param target - Targert Dom Element.\n * @returns - The DOM Element or string or null.\n */\nexport function findDOMElements(target: string): NodeListOf<Element> | string | null {\n try {\n if (typeof target === 'string' && canUseDOM) {\n let selection = document.querySelectorAll(target);\n\n if (!selection.length) {\n selection = document.querySelectorAll(`#${target}`);\n }\n\n if (!selection.length) {\n throw new Error();\n }\n return selection;\n }\n\n return target;\n } catch {\n console.error(`The target '${target}' could not be identified in the dom, tip: check spelling`);\n return null;\n }\n}\n\n/**\n * Get the Target element.\n * @param target - Target Element.\n * @returns - Returns the HTMLElement or null or string.\n */\nexport function getTarget(target: string | HTMLElement | React.Ref<HTMLElement>): HTMLElement | React.Ref<HTMLElement> | null | string {\n const selection = findDOMElements(<string>target);\n if (selection && selection.length) {\n return <HTMLElement>selection[0];\n }\n\n return target;\n}\n\n/**\n * Get the Target element.\n * @param target - Target Element.\n * @returns - Returns the HTMLElement or null or string.\n */\nexport function getTargetElement(target: string | HTMLElement | React.Ref<HTMLElement>): HTMLElement | null {\n const targetElement = getTarget(target);\n if (isRef(targetElement)) {\n return (<React.RefObject<HTMLElement>>targetElement).current;\n }\n if (isElement(targetElement)) {\n return <HTMLElement>targetElement;\n }\n\n return null;\n}\n\n/**\n * Transition Timeouts.\n */\nexport const TransitionTimeouts = {\n Fade: 150,\n Collapse: 350,\n Modal: 300,\n Carousel: 600\n};\n\n/**\n * Transition Statuses.\n */\nexport type TransitionStatuses = 'entering' | 'entered' | 'exiting' | 'exited';\n\n/**\n * Focusable Elements.\n */\nexport const focusableElements = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled]):not([type=hidden])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'button:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '[tabindex]:not(.modal)',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])'\n];\n\n/**\n * Extends an object with properties/values from one or more others.\n * @param parameters - The objects to merge together.\n * @returns - The extended object.\n */\n// eslint-disable-next-line complexity, @typescript-eslint/no-explicit-any\nexport function extend(...parameters: any[]): any {\n if (!parameters || !parameters.length) {\n return null;\n }\n\n const recursive = typeof parameters[0] === 'boolean' && parameters[0];\n\n if (parameters.length < 2) {\n return recursive ? null : parameters[0];\n }\n\n if (recursive && parameters.length < 3) {\n return parameters[1];\n }\n\n const target = recursive ? parameters[1] : parameters[0];\n\n for (let paramIndex = recursive ? 2 : 1; paramIndex < parameters.length; paramIndex++) {\n if (parameters[paramIndex] !== undefined) {\n for (const key of Object.keys(parameters[paramIndex])) {\n if (parameters[paramIndex].hasOwnProperty(key)) {\n const source = parameters[paramIndex][key];\n\n if (recursive) {\n let isSourceArray = Array.isArray ? Array.isArray(source) : {}.toString.call(source) === '[object Array]';\n let isTargetArray =\n !!target[key] &&\n (Array.isArray ? Array.isArray(target[key]) : {}.toString.call(target[key]) === '[object Array]');\n let isSourceObject = !isSourceArray && typeof source === 'object';\n let isTargetObject = !isTargetArray && !!target[key] && typeof target[key] === 'object';\n\n if (isSourceArray && isTargetArray) {\n for (const [arrayIndex, element] of source.entries()) {\n isSourceArray = Array.isArray ? Array.isArray(element) : {}.toString.call(element) === '[object Array]';\n isTargetArray =\n !!target[key][arrayIndex] &&\n (Array.isArray\n ? Array.isArray(target[key][arrayIndex])\n : {}.toString.call(target[key][arrayIndex]) === '[object Array]');\n isSourceObject = !isSourceArray && typeof element === 'object';\n isTargetObject = !isTargetArray && !!target[key][arrayIndex] && typeof target[key][arrayIndex] === 'object';\n\n if (isSourceArray) {\n target[key][arrayIndex] = extend(true, isTargetArray ? target[key][arrayIndex] : [], element);\n } else if (isSourceObject) {\n target[key][arrayIndex] = extend(true, isTargetObject ? target[key][arrayIndex] : {}, element);\n } else {\n target[key][arrayIndex] = element;\n }\n }\n continue;\n } else if (isSourceArray) {\n target[key] = extend(true, [], source);\n continue;\n } else if (isSourceObject) {\n target[key] = extend(true, isTargetObject ? target[key] : {}, source);\n continue;\n }\n }\n\n target[key] = source;\n }\n }\n }\n }\n\n return target;\n}\n\n/**\n * Gets the dimension of an element.\n * @param containerElement - The container element.\n * @returns - {IClientDimension} - The client dimension.\n * {IClientDimension.width} - The client width.\n * {IClientDimension.height} - The client height.\n */\nexport function getDimensions(containerElement: HTMLElement): IClientDimension | null {\n if (containerElement === null) {\n return null;\n }\n return {\n width: containerElement.clientWidth,\n height: containerElement.clientHeight\n };\n}\n\n/**\n * Check if the browser is Safari or not.\n * @returns Ture or false.\n */\nexport function isSafari(): boolean {\n if (navigator.vendor && navigator.userAgent) {\n return navigator.vendor.includes('Apple') && !navigator.userAgent.includes('CriOS') && !navigator.userAgent.includes('FxiOS');\n }\n return false;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ISliderProps,\n Slider,\n UncontrolledTooltip\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ActionToggle } from '../action-toggle';\nimport { IPlayerMenu, MenuCategories, VideoPlayerNames } from '../data';\nimport { LocalizationConstants } from '../helper';\nimport { Menu } from '../menu';\nimport { KeyCodes } from '../utilities';\nimport { IVideoControlsProps } from './video-controls.props';\n\n/**\n * Video Control State Interface.\n */\nexport interface IVideoControlState {\n showVolumeSlider: boolean;\n volumeSliderLeftPosition: number;\n volumeSliderTopPosition: number;\n showMenu: boolean;\n menuLeftPosition: number;\n currentMenu?: IPlayerMenu;\n toolTipClass: string;\n}\n\n/**\n * Offset Position Interface.\n */\nexport interface IOffsetPosition {\n offsetLeft: number;\n offsetTop: number;\n}\n\n/**\n * Button Menu Types.\n */\nexport const ButtonMenuTypes = {\n ClosedCaption: 'close-caption',\n Options: 'options'\n};\n\nconst volumeSliderDivOffset: number = 162;\n\n/**\n *\n * VideoControls React component for video player.\n *\n */\nexport default class VideoControls extends React.PureComponent<IVideoControlsProps, IVideoControlState> {\n public static defaultProps: Partial<IVideoControlsProps> = {\n resources: {\n playAriaLabel: LocalizationConstants.playAriaLabel,\n pauseAriaLabel: LocalizationConstants.pauseAriaLabel,\n closeAriaLabel: LocalizationConstants.closeAriaLabel,\n muteAriaLabel: LocalizationConstants.muteAriaLabel,\n unMuteAriaLabel: LocalizationConstants.unMuteAriaLabel,\n fullScreenAriaLabel: LocalizationConstants.fullScreenAriaLabel,\n exitFullScreenAriaLabel: LocalizationConstants.exitFullScreenAriaLabel,\n pausedAriaLabel: LocalizationConstants.pausedAriaLabel,\n playingAriaLabel: LocalizationConstants.playingAriaLabel,\n seekBarLabel: LocalizationConstants.seekBarLabel,\n videoTimeDurationLabel: LocalizationConstants.videoTimeDurationLabel,\n closedCaptionLabel: LocalizationConstants.closedCaptionLabel\n },\n viewportMin: 200\n };\n\n private static readonly videoControlsClassName: string = `${VideoPlayerNames.videoplayerContainer}__controls`;\n\n private static readonly volumeAutoHideTimeout: number = 2000;\n\n private selectedMenuItems: number[] = [];\n\n private volumeAutoHideTimer: number;\n\n private focusedMenuItemIndex: number;\n\n private currentMenu: string;\n\n private readonly volumeButtonDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly playButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly pauseButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly closedCaptionRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly optionButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly fullscreenButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly exitFullScreenButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly videoControlDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly closedCaptionButtonDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly optionButtonDiv: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly menuRef: React.RefObject<Menu> = React.createRef<Menu>();\n\n private readonly muteButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly unMuteButtonRef: React.RefObject<HTMLButtonElement> = React.createRef<HTMLButtonElement>();\n\n private readonly _fullScreenReference: React.RefObject<HTMLDivElement> = React.createRef<HTMLDivElement>();\n\n private readonly payLoad: IPayLoad;\n\n public static getDerivedStateFromProps(props: IVideoControlsProps, state: IVideoControlState): IVideoControlState {\n const nextState = { ...state };\n if (!props.isControlPanelVisible) {\n nextState.showMenu = false;\n }\n return nextState;\n }\n\n public constructor(props: IVideoControlsProps) {\n super(props);\n this.volumeAutoHideTimer = 0;\n this.focusedMenuItemIndex = 0;\n this.currentMenu = '';\n this._hideVolumeControl = this._hideVolumeControl.bind(this);\n this._onMenuItemClick = this._onMenuItemClick.bind(this);\n this._reevaluateWidth = this._reevaluateWidth.bind(this);\n this._onClosedCaptionClick = this._onClosedCaptionClick.bind(this);\n this._onDocumentClick = this._onDocumentClick.bind(this);\n this._onOptionsButtonClick = this._onOptionsButtonClick.bind(this);\n this._onMenuBlur = this._onMenuBlur.bind(this);\n this._onMenuFocus = this._onMenuFocus.bind(this);\n this._onMouseOver = this._onMouseOver.bind(this);\n this._onMouseOut = this._onMouseOut.bind(this);\n this._onMenuKeyDown = this._onMenuKeyDown.bind(this);\n this._onMenuKeyUp = this._onMenuKeyUp.bind(this);\n this.state = {\n showVolumeSlider: false,\n volumeSliderLeftPosition: 0,\n volumeSliderTopPosition: -160,\n showMenu: false,\n menuLeftPosition: 0,\n currentMenu: this.props.closedCaptionMenu,\n toolTipClass: ''\n };\n\n // Construct telemetry attribute to render\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n }\n\n public componentDidUpdate(previousProps: IVideoControlsProps): void {\n // Updating the selected menu as setstate in player takes time to update\n if (\n this.props.currentClosedCaptionLanguage !== previousProps.currentClosedCaptionLanguage ||\n this.props.currentClosedCaptionsSetting !== previousProps.currentClosedCaptionsSetting ||\n this.props.currentAudioTrack !== previousProps.currentAudioTrack\n ) {\n this._updateSelectedMenu();\n }\n }\n\n public render(): JSX.Element {\n const { className, ...props } = this.props;\n\n const currentTime = this._toElapsedTimeString(props.playPosition.currentTime);\n const endTime = this._toElapsedTimeString(props.playPosition.endTime);\n\n const volumeDivStyle = {\n top: this.state.volumeSliderTopPosition,\n left: this.state.volumeSliderLeftPosition\n };\n\n const menuDivStyle = {\n left: this.state.menuLeftPosition\n };\n\n this.payLoad.contentAction.etext = this.props.playing ? LocalizationConstants.pauseAriaLabel : LocalizationConstants.playAriaLabel;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n <div\n className={className}\n ref={this.videoControlDiv}\n role='none'\n onKeyDown={this.props.handleControlsKeyDownHandler}\n onBlur={this.props.onBlur}\n onFocus={this.props.onFocus}\n >\n <div className={`${VideoControls.videoControlsClassName}__wrapper`}>\n <div className={`${VideoControls.videoControlsClassName}__playpausebtn__container`}>\n <ActionToggle\n className={`${VideoControls.videoControlsClassName}__playpausebtn__wrapper`}\n onChange={this.props.onPlayClick}\n toggled={this.props.playing}\n >\n <button\n ref={this.playButtonRef}\n aria-label={this.props.resources.playAriaLabel}\n className={`${VideoControls.videoControlsClassName}__playbtn`}\n {...attribute}\n />\n <button\n ref={this.pauseButtonRef}\n aria-label={this.props.resources.pauseAriaLabel}\n className={`${VideoControls.videoControlsClassName}__pausebtn`}\n {...attribute}\n />\n </ActionToggle>\n <UncontrolledTooltip className={this.state.toolTipClass} trigger='hover focus' target={this.playButtonRef}>\n {' '}\n {this.props.resources.playAriaLabel}\n </UncontrolledTooltip>\n <UncontrolledTooltip trigger='hover focus' target={this.pauseButtonRef}>\n {' '}\n {this.props.resources.pauseAriaLabel}\n </UncontrolledTooltip>\n </div>\n <div className={`${VideoControls.videoControlsClassName}__time`}>\n <div\n className={`${VideoControls.videoControlsClassName}__time__screenreader`}\n aria-hidden={this.props.isMobileDevice}\n aria-live='polite'\n >\n {`${this.props.resources.videoTimeDurationLabel} ${currentTime} / ${endTime}`}\n </div>\n <div className={`${VideoControls.videoControlsClassName}__time__text`} aria-hidden='true'>\n {currentTime} / {endTime}\n </div>\n </div>\n <div className={`${VideoControls.videoControlsClassName}__slider__container`}>{this._renderVideoSlider()}</div>\n {this.props.closedCaptionMenu && this._renderClosedCaptionButton()}\n {this.props.optionMenu && this._renderOptionButton()}\n {this.state.showMenu && (\n <Menu\n ref={this.menuRef}\n className={`${VideoControls.videoControlsClassName}__menu`}\n playerMenu={this.state.currentMenu!}\n style={menuDivStyle}\n onDocumentClick={this._onDocumentClick}\n onMenuItemClick={this._onMenuItemClick}\n onFocus={this._onMenuFocus}\n onBlur={this._onMenuBlur}\n onMouseOver={this._onMouseOver}\n onMouseOut={this._onMouseOut}\n onKeyDown={this._onMenuKeyDown}\n onKeyUp={this._onMenuKeyUp}\n />\n )}\n {!this.props.isMobileDevice && (\n <div className={`${VideoControls.videoControlsClassName}__muteunmutebtn__container`} ref={this.volumeButtonDiv}>\n {this._renderVolumeButton()}\n </div>\n )}\n {!this.props.isMobileDevice && (\n <div\n className={`${VideoControls.videoControlsClassName}__volumeslider__container ${\n this.state.showVolumeSlider ? 'show' : 'hide'\n }`}\n onFocus={this.showVolumeControl()}\n onBlur={this._hideVolumeControl}\n onMouseOver={this.showVolumeControl()}\n onMouseOut={this._hideVolumeControl}\n style={volumeDivStyle}\n role='presentation'\n >\n {this._renderVolumeSlider()}\n </div>\n )}\n {this._renderFullScreenButton()}\n </div>\n </div>\n );\n }\n\n /**\n * Show Volume Control.\n * @param autohide - AutoHide the volume Control.\n * @returns Returns void.\n */\n public showVolumeControl = (autohide?: boolean) => () => {\n const offsetPosition = this._getOffsetPosition(this.volumeButtonDiv);\n window && window.clearTimeout(this.volumeAutoHideTimer);\n\n this.setState({\n showVolumeSlider: true,\n volumeSliderLeftPosition: offsetPosition.offsetLeft,\n volumeSliderTopPosition: offsetPosition.offsetTop - volumeSliderDivOffset + 1\n });\n if (autohide && document.activeElement!.parentElement !== this.volumeButtonDiv.current!.firstChild) {\n this.volumeAutoHideTimer =\n window &&\n window.setTimeout(() => {\n this._hideVolumeControl();\n }, VideoControls.volumeAutoHideTimeout);\n }\n };\n\n public setFocusOnPlay(): void {\n setTimeout(() => {\n if (this.playButtonRef.current) {\n this.playButtonRef.current.focus();\n }\n }, 0);\n }\n\n public setFocusOnPause(): void {\n setTimeout(() => {\n if (this.pauseButtonRef.current) {\n this.pauseButtonRef.current.focus();\n }\n }, 0);\n }\n\n public setFocusOnMenuButton(): void {\n // Don't set focus if control panel is not visible\n if (this.props.isControlPanelVisible) {\n if (this.currentMenu === ButtonMenuTypes.ClosedCaption) {\n this.closedCaptionRef.current!.focus();\n } else {\n this.optionButtonRef.current!.focus();\n }\n }\n }\n\n public componentDidMount(): void {\n window && window.addEventListener('resize', this._reevaluateWidth);\n this._reevaluateWidth();\n if (this._isIPhone()) {\n this._fullScreenReference.current?.setAttribute('hidden', 'true');\n }\n }\n\n public componentWillUnmount(): void {\n window && window.removeEventListener('resize', this._reevaluateWidth);\n }\n\n private _reevaluateWidth(): void {\n const rowDiv = this.videoControlDiv.current!.children[0];\n let controlBarButtonsWidth = 0;\n\n // Not able to use for-of loop as it causes another ts-lint issue because rowDiv.children is a HTMLCollection object and HTMLCollection\n // is not an array type and string type. So I am surpressing the ts-lint error here rather than other error\n for (let i = 0; i < rowDiv.children.length; i++) {\n if (rowDiv.children[i].children[0] !== undefined && rowDiv.children[i].children[0].className.includes('action-toggle')) {\n controlBarButtonsWidth += rowDiv.children[i].clientWidth;\n }\n }\n\n const sliderWidth = controlBarButtonsWidth + 100;\n rowDiv.children[2].setAttribute('style', `${'width: calc(100% - '}${sliderWidth}${'px)'}`);\n if (this.state.showVolumeSlider) {\n this._hideVolumeControl();\n }\n if (!this.props.isMobileDevice) {\n const offsetPosition = this._getOffsetPosition(this.volumeButtonDiv);\n this.setState({\n volumeSliderLeftPosition: offsetPosition.offsetLeft,\n volumeSliderTopPosition: offsetPosition.offsetTop - volumeSliderDivOffset\n });\n }\n if (this.state.showMenu) {\n this.setState({\n showMenu: false\n });\n }\n\n const videoControlWidth = this.videoControlDiv.current!.clientWidth;\n const viewportMax = window && window.innerWidth;\n this._applyTooltipClassOnWidthChange(videoControlWidth, viewportMax);\n }\n\n /**\n * Handles document click.\n * @param e - Event object passed.\n */\n private readonly _onDocumentClick = (e: Event): void => {\n const target = e.target as HTMLElement;\n if (\n !(\n (this.currentMenu === ButtonMenuTypes.ClosedCaption &&\n (target === this.closedCaptionButtonDiv.current!.firstChild ||\n target.parentElement === this.closedCaptionButtonDiv.current!.firstChild)) ||\n (this.currentMenu === ButtonMenuTypes.Options &&\n (target === this.optionButtonDiv.current!.firstChild ||\n target.parentElement === this.optionButtonDiv.current!.firstChild))\n )\n ) {\n this.setState({\n showMenu: !this.state.showMenu\n });\n }\n };\n\n private _onMenuFocus(e: Event): void {\n const button: HTMLButtonElement = e.target as HTMLButtonElement;\n const hasEvents = button.getAttribute('data-has-events');\n if (hasEvents) {\n this.props.onMenuItemFocus({\n category: button.parentElement!.parentElement!.parentElement!.getAttribute('data-category')!,\n id: button.parentElement!.id,\n data: button.getAttribute('data-info')!\n });\n }\n }\n\n private _onMenuBlur(e: Event): void {\n const button: HTMLButtonElement = e.target as HTMLButtonElement;\n const hasEvents = button.getAttribute('data-has-events');\n if (hasEvents) {\n this.props.onMenuItemBlur();\n }\n }\n\n private _onMouseOver(e: Event): void {\n const button: HTMLButtonElement = e.target as HTMLButtonElement;\n const hasEvents = button.getAttribute('data-has-events');\n if (hasEvents) {\n this.props.onMenuItemFocus({\n category: button.parentElement!.parentElement!.parentElement!.getAttribute('data-category')!,\n id: button.parentElement!.id,\n data: button.getAttribute('data-info')!\n });\n }\n }\n\n private _onMouseOut(e: Event): void {\n const button: HTMLButtonElement = e.target as HTMLButtonElement;\n const hasEvents = button.getAttribute('data-has-events');\n if (hasEvents) {\n this.props.onMenuItemBlur();\n }\n }\n\n private _onMenuKeyDown(e: Event): void {\n this._onMenuKeyPressed((e as unknown) as KeyboardEvent);\n }\n\n private _onMenuKeyUp(event: Event): void {\n const e = (event as unknown) as KeyboardEvent;\n const key = e.keyCode;\n\n if (key === KeyCodes.Space) {\n event.preventDefault();\n }\n }\n\n /**\n * Event handler for menu's keyboard events.\n * @param event - The dialog that is allowed to remain open.\n */\n private _onMenuKeyPressed(event: KeyboardEvent): void {\n const key = event.keyCode;\n const target = event.target as HTMLElement;\n const currentMenuItem = this.state.currentMenu!;\n this._resetFocusForCurrentMenu(currentMenuItem);\n\n // eslint-disable-next-line default-case\n switch (key) {\n case KeyCodes.ArrowLeft:\n case KeyCodes.ArrowRight:\n event.stopPropagation();\n event.preventDefault();\n if (key === KeyCodes.ArrowRight && target.getAttribute('data-has-children') === 'true') {\n this._onMenuItemClick(event);\n }\n if (key === KeyCodes.ArrowLeft && target.getAttribute('data-isbackbutton') === 'true') {\n this._onMenuItemClick(event);\n }\n break;\n\n case KeyCodes.Enter:\n case KeyCodes.Space:\n event.preventDefault();\n this._onMenuItemClick(event);\n break;\n\n case KeyCodes.ArrowUp:\n case KeyCodes.ArrowDown:\n event.stopPropagation();\n event.preventDefault();\n\n if (key === KeyCodes.ArrowUp) {\n this.focusedMenuItemIndex -= 1;\n if (this.focusedMenuItemIndex < 0) {\n this.focusedMenuItemIndex = currentMenuItem.items.length - 1;\n }\n } else {\n this.focusedMenuItemIndex = (this.focusedMenuItemIndex + 1) % currentMenuItem.items.length;\n }\n\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState(\n {\n currentMenu: currentMenuItem\n },\n () => {\n if (this.menuRef.current) {\n this.menuRef.current.forceUpdate();\n }\n }\n );\n break;\n\n case KeyCodes.PageUp:\n case KeyCodes.Home:\n event.stopPropagation();\n event.preventDefault();\n this.focusedMenuItemIndex = 0;\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState(\n {\n currentMenu: currentMenuItem\n },\n () => {\n if (this.menuRef.current) {\n this.menuRef.current.forceUpdate();\n }\n }\n );\n break;\n\n case KeyCodes.End:\n case KeyCodes.PageDown:\n event.stopPropagation();\n event.preventDefault();\n this.focusedMenuItemIndex = currentMenuItem.items.length - 1;\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState(\n {\n currentMenu: currentMenuItem\n },\n () => {\n if (this.menuRef.current) {\n this.menuRef.current.forceUpdate();\n }\n }\n );\n break;\n\n case KeyCodes.Escape:\n this.setFocusOnMenuButton();\n this.setState({\n showMenu: false\n });\n break;\n case KeyCodes.Tab:\n if (\n (this.focusedMenuItemIndex < currentMenuItem.items.length - 1 ||\n (this.focusedMenuItemIndex === currentMenuItem.items.length - 1 && event.shiftKey)) &&\n this.focusedMenuItemIndex >= 0 &&\n !(this.focusedMenuItemIndex === 0 && event.shiftKey)\n ) {\n this.focusedMenuItemIndex += event.shiftKey ? -1 : 1;\n\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState({\n currentMenu: currentMenuItem\n });\n } else {\n event.stopPropagation();\n event.preventDefault();\n this.setState({\n showMenu: false\n });\n if (event.shiftKey) {\n this.setFocusOnMenuButton();\n } else if (this.currentMenu === ButtonMenuTypes.ClosedCaption && this.optionButtonRef.current) {\n this.optionButtonRef.current.focus();\n } else {\n this.props.isMuted ? this.unMuteButtonRef.current!.focus() : this.muteButtonRef.current!.focus();\n }\n }\n }\n }\n\n private _onMenuItemClick(e: KeyboardEvent): void {\n const button: HTMLButtonElement = e.currentTarget as HTMLButtonElement;\n if (button.getAttribute('data-has-children')! === 'true') {\n const index: number = Number(button.getAttribute('data-itemindex')!);\n this.selectedMenuItems.push(index);\n const currentMenuItem = this._getSelectedMenuFromList();\n this.focusedMenuItemIndex = 0;\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState({\n currentMenu: currentMenuItem\n });\n } else if (button.getAttribute('data-isbackbutton')! === 'true') {\n this.focusedMenuItemIndex = this.selectedMenuItems.pop()!;\n const currentMenuItem = this._getSelectedMenuFromList();\n currentMenuItem.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState({\n currentMenu: currentMenuItem\n });\n } else {\n const currentMenuItem = this._getSelectedMenuFromList();\n this._resetFocusForCurrentMenu(currentMenuItem);\n const index: number = Number(button.getAttribute('data-itemindex')!);\n this.focusedMenuItemIndex = index;\n const data =\n this.currentMenu === ButtonMenuTypes.ClosedCaption\n ? button.getAttribute('data-info')\n : JSON.stringify({ url: button.getAttribute('data-info')!, lang: button.getAttribute('lang')! });\n this.props.onMenuItemClick({\n category: button.parentElement!.parentElement!.parentElement!.getAttribute('data-category')!,\n id: button.parentElement!.id,\n data: data!\n });\n }\n this._updateSelectedMenu();\n }\n\n private _resetFocusForCurrentMenu(currentMenu: IPlayerMenu): void {\n currentMenu.items.forEach(item => (item.hasFocus = false));\n }\n\n private _getSelectedMenuFromList(): IPlayerMenu {\n let menuItem = this.currentMenu === ButtonMenuTypes.ClosedCaption ? this.props.closedCaptionMenu! : this.props.optionMenu!;\n\n for (let i = 0; i < this.selectedMenuItems.length; i++) {\n menuItem = menuItem.items[this.selectedMenuItems[i]].subMenu!;\n }\n return menuItem;\n }\n\n private _updateSelectedMenu(): void {\n const currentMenuItem = this._getSelectedMenuFromList();\n if (currentMenuItem) {\n // eslint-disable-next-line default-case\n switch (currentMenuItem.category) {\n case MenuCategories.ClosedCaption:\n currentMenuItem.items.forEach(item => {\n if (item.data && item.data === this.props.currentClosedCaptionLanguage) {\n item.selected = true;\n } else {\n item.selected = false;\n }\n });\n break;\n case MenuCategories.ClosedCaptionSettings:\n currentMenuItem.items.forEach(item => {\n // eslint-disable-next-line guard-for-in\n for (const setting in this.props.currentClosedCaptionsSetting) {\n const data = `${setting}:${this.props.currentClosedCaptionsSetting[setting]}`;\n if (item.data && item.data === data) {\n item.selected = true;\n break;\n } else {\n item.selected = false;\n }\n }\n });\n break;\n case MenuCategories.AudioTracks:\n currentMenuItem.items.forEach(item => {\n if (item.language && item.language === this.props.currentAudioTrack) {\n item.selected = true;\n } else {\n item.selected = false;\n }\n });\n }\n\n this.setState(\n {\n currentMenu: currentMenuItem\n },\n () => {\n if (this.menuRef.current) {\n this.menuRef.current.forceUpdate();\n }\n }\n );\n }\n }\n\n /**\n * Render the closed caption button.\n * @returns Returns the closed caption button.\n */\n private readonly _renderClosedCaptionButton = (): JSX.Element => {\n return (\n <div className={`${VideoControls.videoControlsClassName}__closedcaption__container`} ref={this.closedCaptionButtonDiv}>\n <button\n ref={this.closedCaptionRef}\n aria-label={this.props.resources.closedCaptionLabel}\n className={`${VideoControls.videoControlsClassName}__closedcaptionbtn`}\n onClick={this._onClosedCaptionClick}\n />\n <UncontrolledTooltip trigger='hover focus' target={this.closedCaptionRef}>\n {this.props.resources.closedCaptionLabel}\n </UncontrolledTooltip>\n </div>\n );\n };\n\n /**\n * Renders the option button.\n * @returns Returns the render option button.\n */\n private readonly _renderOptionButton = (): JSX.Element => {\n return (\n <div className={`${VideoControls.videoControlsClassName}__moreoptions__container`} ref={this.optionButtonDiv}>\n <button\n ref={this.optionButtonRef}\n aria-label={this.props.resources.optionButtonLabel}\n className={`${VideoControls.videoControlsClassName}__moreoptionsbtn`}\n onClick={this._onOptionsButtonClick}\n />\n <UncontrolledTooltip trigger='hover focus' target={this.optionButtonRef}>\n {this.props.resources.optionButtonLabel}\n </UncontrolledTooltip>\n </div>\n );\n };\n\n /**\n * Renders the full screen button.\n * @returns Returns the full screen button.\n */\n private readonly _renderFullScreenButton = (): JSX.Element => {\n this.payLoad.contentAction.etext = this.props.isInFullScreen\n ? LocalizationConstants.exitFullScreenAriaLabel\n : LocalizationConstants.fullScreenAriaLabel;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n <div ref={this._fullScreenReference} className={`${VideoControls.videoControlsClassName}__fullscreenbtn__container`}>\n <ActionToggle\n onChange={this.props.toggleFullScreen}\n toggled={this.props.isInFullScreen}\n className={`${VideoControls.videoControlsClassName}__fullscreenbtn__wrapper`}\n >\n <button\n ref={this.fullscreenButtonRef}\n aria-label={this.props.resources.fullScreenAriaLabel}\n className={`${VideoControls.videoControlsClassName}__fullscreenbtn`}\n {...attribute}\n />\n <button\n ref={this.exitFullScreenButtonRef}\n aria-label={this.props.resources.exitFullScreenAriaLabel}\n className={`${VideoControls.videoControlsClassName}__exitfullscreenbtn`}\n {...attribute}\n />\n </ActionToggle>\n <UncontrolledTooltip\n className={`${VideoControls.videoControlsClassName}__fullscreenbtn__tooltip`}\n trigger='hover focus'\n target={this.fullscreenButtonRef}\n >\n {' '}\n {this.props.resources.fullScreenAriaLabel}\n </UncontrolledTooltip>\n <UncontrolledTooltip trigger='hover focus' target={this.exitFullScreenButtonRef}>\n {' '}\n {this.props.resources.exitFullScreenAriaLabel}\n </UncontrolledTooltip>\n </div>\n );\n };\n\n /**\n * Renders the Volume button.\n * @returns Returns the volume button.\n */\n private readonly _renderVolumeButton = (): JSX.Element => {\n this.payLoad.contentAction.etext = this.props.isMuted ? LocalizationConstants.unMuteAriaLabel : LocalizationConstants.muteAriaLabel;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n const volumeButtonProps = {\n className: `${VideoControls.videoControlsClassName}__muteunmutebtn__wrapper`,\n onChange: this.props.onMuteClick,\n toggled: this.props.isMuted,\n onFocus: this.showVolumeControl(),\n onBlur: this._hideVolumeControl,\n onMouseOver: this.showVolumeControl(),\n onMouseOut: this._hideVolumeControl\n };\n\n return (\n <ActionToggle {...volumeButtonProps}>\n <button\n aria-label={this.props.resources.muteAriaLabel}\n ref={this.muteButtonRef}\n className={`${VideoControls.videoControlsClassName}__mutebtn`}\n {...attribute}\n />\n <button\n aria-label={this.props.resources.unMuteAriaLabel}\n ref={this.unMuteButtonRef}\n className={`${VideoControls.videoControlsClassName}__unmutebtn`}\n {...attribute}\n />\n </ActionToggle>\n );\n };\n\n /**\n * Renders the video slider.\n * @returns - Returns the video slider div.\n */\n private readonly _renderVideoSlider = (): JSX.Element => {\n const videoProps: ISliderProps = {\n id: 'VideoSlider',\n inForm: false,\n className: `${VideoControls.videoControlsClassName}__slidercontainer`,\n min: this.props.playPosition.startTime,\n max: this.props.playPosition.endTime,\n ariaLabel: this.props.resources.seekBarLabel,\n fillTrackValue: this.props.playPosition.bufferedDuration,\n step: this.props.videoSeekSteps || 1,\n orientation: 'horizontal',\n showProgressBar: true,\n onChange: this.props.onProgressChange,\n showLabels: false,\n showTooltip: true,\n shouldSliderAdjustToRTL: false,\n handleTooltipText: this._handleProgressToolTipText(this.props.playPosition.currentTime),\n sliderThumbs: [\n {\n id: 'VideoSliderThumb',\n value: this.props.playPosition.currentTime,\n ariaValueText: this.props.playPosition.currentTime.toString(),\n ariaLabel: this.props.resources.sliderThumbLabel\n }\n ]\n };\n\n return <Slider {...videoProps} />;\n };\n\n /**\n * Renders the Volume slider.\n * @returns Returns the Volume Slider.\n */\n private readonly _renderVolumeSlider = (): JSX.Element => {\n const volumeSliderProps: ISliderProps = {\n id: 'VolumeSlider',\n inForm: false,\n className: `${VideoControls.videoControlsClassName}__volumeslider`,\n min: 0,\n max: 100,\n step: this.props.volumeSeekSteps || 5,\n orientation: 'vertical',\n showProgressBar: false,\n onChange: this.props.onVolumeChange,\n onFocus: this.showVolumeControl(),\n onBlur: this._hideVolumeControl,\n showLabels: false,\n showTooltip: true,\n shouldSliderAdjustToRTL: false,\n sliderThumbs: [\n {\n id: 'VolumeSliderThumb',\n value: Math.round(this.props.currentVolume),\n ariaValueText: Math.round(this.props.currentVolume).toString(),\n ariaLabel: this.props.resources.volumeThumbLabel\n }\n ]\n };\n return <Slider {...volumeSliderProps} />;\n };\n\n private _getOffsetPosition(refDiv: React.RefObject<HTMLDivElement>): IOffsetPosition {\n const buttonWidth = refDiv.current!.children[0].clientWidth;\n const elementwidth = refDiv.current!.offsetWidth;\n const offsetLeft = refDiv.current!.offsetLeft + (elementwidth - buttonWidth) / 2;\n const offsetTop = refDiv.current!.offsetTop;\n return {\n offsetLeft,\n offsetTop\n };\n }\n\n private _onClosedCaptionClick(): void {\n this.currentMenu = ButtonMenuTypes.ClosedCaption;\n const offsetLeft = this._getOffsetPosition(this.closedCaptionButtonDiv).offsetLeft;\n this.focusedMenuItemIndex = 0;\n this.selectedMenuItems = [];\n const closedCaptionMenu = this.props.closedCaptionMenu!;\n this._resetFocusForCurrentMenu(closedCaptionMenu);\n closedCaptionMenu.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState({\n showMenu: this.currentMenu === ButtonMenuTypes.ClosedCaption && !this.state.showMenu,\n menuLeftPosition: offsetLeft - 120,\n currentMenu: closedCaptionMenu\n });\n this._updateSelectedMenu();\n }\n\n private _onOptionsButtonClick(): void {\n this.currentMenu = ButtonMenuTypes.Options;\n const offsetLeft = this._getOffsetPosition(this.optionButtonDiv).offsetLeft;\n this.focusedMenuItemIndex = 0;\n this.selectedMenuItems = [];\n const optionMenu = this.props.optionMenu!;\n this._resetFocusForCurrentMenu(optionMenu);\n optionMenu.items[this.focusedMenuItemIndex].hasFocus = true;\n this.setState({\n showMenu: this.currentMenu === ButtonMenuTypes.Options && !this.state.showMenu,\n menuLeftPosition: offsetLeft - 120,\n currentMenu: optionMenu\n });\n this._updateSelectedMenu();\n }\n\n private _hideVolumeControl(): void {\n window && window.clearTimeout(this.volumeAutoHideTimer);\n this.setState({\n showVolumeSlider: false\n });\n }\n\n /**\n * Handles the progresss tool tip.\n * @param tooltip - Tooltip number.\n * @returns - The elapsed time.\n */\n private readonly _handleProgressToolTipText = (tooltip: number) => () => {\n return this._toElapsedTimeString(tooltip);\n };\n\n private _toElapsedTimeString(seconds: number): string {\n const negative = seconds < 0;\n if (negative) {\n seconds *= -1;\n }\n\n const hours = Math.floor(seconds / 3600);\n const remainder = seconds % 3600;\n const minutes = Math.floor(remainder / 60);\n\n let elapsedTime = '';\n elapsedTime = hours > 0 ? `${hours}:` : '';\n\n seconds = Math.floor(remainder % 60);\n elapsedTime += `${(minutes < 10 ? '0' : '') + minutes.toString()}`;\n elapsedTime += `:${seconds === 0 ? '00' : (seconds < 10 ? '0' : '') + seconds.toString()}`;\n\n return negative ? `-${elapsedTime}` : elapsedTime;\n }\n\n private _applyTooltipClassOnWidthChange(videoControlWidth: number, viewportMax: number): void {\n if (videoControlWidth) {\n this.setState({\n toolTipClass:\n videoControlWidth > this.props.viewportMin! && videoControlWidth < viewportMax\n ? `${VideoControls.videoControlsClassName}__playpausebtn__tooltip`\n : ''\n });\n }\n }\n\n private _isIPhone(): boolean {\n const useragent = window && window.navigator.userAgent;\n return !!useragent.match(/iphone/i);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\nimport { Button } from '@msdyn365-commerce-modules/utilities';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-action-menu';\nconst toggleMenuButtonClassName = `${componentClassName}__action-toggle`;\nconst actionsContainerClassName = `${componentClassName}__actions-container`;\n\n/**\n * IActionMenuComponent interface.\n */\ninterface IActionMenuComponent extends IComponent<IActionMenuProps> {}\n\n/**\n * IActionMenuProps interface.\n */\nexport interface IActionMenuProps extends IComponentProps<{}> {\n className?: string;\n isVisible?: boolean;\n isDisabled?: boolean;\n label?: string;\n ariaLabel?: string;\n title?: string;\n children?: React.ReactNode | React.ReactNode[];\n telemetryAttributes?: { [key: string]: string };\n onClick?: (showActions: boolean) => void;\n}\n\nlet setShowPreviousActions: React.Dispatch<React.SetStateAction<boolean>> | undefined;\n\n/**\n * Menu function.\n * @param isShowActions - Whether actions should be visible or not.\n * @param setShowActions - Function to change the state.\n */\nconst toggle = (isShowActions: boolean, setShowActions: React.Dispatch<React.SetStateAction<boolean>>) => {\n const shouldShowActions = !isShowActions;\n if (shouldShowActions) {\n if (setShowPreviousActions) {\n setShowPreviousActions(false);\n }\n setShowActions(shouldShowActions);\n setShowPreviousActions = setShowActions;\n } else {\n setShowPreviousActions = undefined;\n setShowActions(shouldShowActions);\n }\n};\n\n/**\n * ActionMenu component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst ActionMenuFunctionalComponent: React.FC<IActionMenuProps> = (props: IActionMenuProps) => {\n const [showActions, setShowActions] = React.useState(false);\n\n let children = props.children ?? [];\n children = Array.isArray(children) ? children : [children];\n\n const onClickHandler = (): void => {\n toggle(showActions, setShowActions);\n props.onClick?.(showActions);\n };\n\n const isVisible = props.isVisible ?? true;\n if (!isVisible) {\n return <></>;\n }\n\n return (\n <div className={classnames(props.className, componentClassName)}>\n <Button\n className={classnames(\n toggleMenuButtonClassName,\n showActions ? `${toggleMenuButtonClassName}-active` : '',\n props.isDisabled ? `${toggleMenuButtonClassName}-disabled` : ''\n )}\n title={props.title ?? ''}\n disabled={!!props.isDisabled}\n aria-label={props.ariaLabel ?? props.label ?? ''}\n aria-disabled={!!props.isDisabled}\n onClick={onClickHandler}\n {...props.telemetryAttributes}\n >\n {props.label}\n </Button>\n {showActions && <div className={classnames(actionsContainerClassName)}>{children}</div>}\n </div>\n );\n};\n\n/**\n * ActionMenu component.\n */\nexport const ActionMenuComponent: React.FunctionComponent<IActionMenuProps> = msdyn365Commerce.createComponent<IActionMenuComponent>(\n 'ActionMenuComponent',\n { component: ActionMenuFunctionalComponent }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport MsDyn365, {\n getCatalogId,\n IComponent,\n IComponentProps,\n IGridSettings,\n IImageSettings,\n msdyn365Commerce,\n TelemetryEvent\n} from '@msdyn365-commerce/core';\nimport { getCartState, ICartActionResult, ICartState } from '@msdyn365-commerce/global-state';\nimport {\n CartLineValidationResults,\n CartsDataActions,\n format,\n ProductAvailableQuantity,\n ProductDimension,\n ProductPrice,\n ProductsDataActions,\n ProductSearchCriteria,\n ProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport { ErrorNotification, NotificationsManager } from '@msdyn365-commerce-modules/notifications-core';\nimport { ArrayExtensions, generateProductImageUrl, ObjectExtensions, validateCatalogId } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IPopupProps, ITelemetryContent, Popup } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\nimport { PriceComponent } from '../price';\nimport { IItemsAddedToCartResources } from './items-added-to-cart';\nimport { ItemsAddedToCartDialogComponent } from './items-added-to-cart-dialog-component';\nimport { ItemSuccessfullyAddedToCartNotification } from './notifications/item-successfully-added-to-cart-notification';\nimport { MultiItemsSuccessfullyAddedToCartNotification } from './notifications/multi-items-successfully-added-to-cart-notification';\nimport { OrderDetailsProduct } from './product-model';\n\n/**\n * Interface for add to cart resources.\n */\nexport interface IAddToCartResources {\n goToCartText: string;\n continueShoppingText: string;\n closeNotificationLabel: string;\n headerItemOneText: string;\n headerItemFormatText: string;\n headerLinesFormatText?: string;\n headerMessageText: string;\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n addedQuantityText: string;\n buyAgainNotificationTitle?: string;\n buyAgainNotificationCloseAriaLabel?: string;\n validationErrorMessage?: string;\n oneErrorText?: string;\n multiErrorsText?: string;\n}\n\n/**\n * Interface for add to cart components props.\n */\nexport interface IAddToCartComponentProps extends IComponentProps<{ product: SimpleProduct; price?: ProductPrice } | undefined> {\n className?: string;\n addToCartText: string;\n outOfStockText?: string;\n disabled?: boolean;\n quantity?: number;\n navigationUrl?: string;\n productAvailability?: ProductAvailableQuantity;\n getSelectedProduct?: Promise<SimpleProduct | null>;\n isNavigationToCartPageDisabled?: boolean;\n shouldSkipSiteSettings?: boolean;\n addToCartArialLabel?: string;\n products?: {\n productId: number;\n quantity: number;\n catalogId?: number;\n }[];\n orderDetailsProducts?: OrderDetailsProduct[];\n hasAvailableProducts?: boolean;\n imageSettings?: IImageSettings;\n gridSettings?: IGridSettings;\n\n isLoading?: boolean;\n isUpdatingDimension?: boolean;\n isLoadingDeliveryOptions?: boolean;\n isUpdatingDeliveryOptions?: boolean;\n isAddServiceItemToCart?: boolean;\n isAddEmailDeliveryItemToCart?: boolean;\n isPriceKeyedIn?: boolean;\n customPriceAmount?: number;\n isOrderQuantityLimitsFeatureEnabled?: boolean;\n\n dialogStrings?: IAddToCartResources;\n\n telemetryContent?: ITelemetryContent;\n\n catalogId?: number;\n\n isCustomPriceSelected?: boolean;\n maximumKeyInPrice?: number;\n minimumKeyInPrice?: number;\n defaultMaximumKeyInPrice?: number;\n defaultMinimumKeyInPrice?: number;\n isProductQuantityLoading?: boolean;\n\n onAdd?(result: ICartActionResult): void;\n onError?(result: IAddToCartFailureResult): void;\n changeUpdatingDimension?(isUpdatingDimension: boolean): void;\n changeUpdatingDeliveryOptions?(isUpdatingDeliveryOptions: boolean): void;\n}\n\n/**\n * Cart action Failure reason type.\n */\nexport declare type ICartActionFailureReason =\n | 'EMPTYINPUT'\n | 'MISSINGDIMENSION'\n | 'OUTOFSTOCK'\n | 'CARTACTIONFAILED'\n | 'INVALIDCUSTOMAMOUNT';\n\n/**\n * Interface for add to cart failure result.\n */\nexport interface IAddToCartFailureResult {\n failureReason: ICartActionFailureReason;\n\n stockLeft?: number;\n cartActionResult?: ICartActionResult;\n missingDimensions?: ProductDimension[];\n}\n\n/**\n * This setting defines the experience when a product is added to cart. Corresponds to the configuration in Fabrikam.\n */\nexport enum AddToCartBehavior {\n /**\n * Navigate to cart page.\n */\n goToCart = 'goToCart',\n\n /**\n * Show item added to cart popup.\n */\n showModal = 'showModal',\n\n /**\n * Show mini cart popup.\n */\n showMiniCart = 'showMiniCart',\n\n /**\n * Show item added to cart notification.\n */\n showNotification = 'showNotification',\n\n /**\n * Do nothing and stay on the page.\n */\n nothing = 'nothing'\n}\n\nconst zero = 0;\nconst defaultQuantity = 1;\n\n/**\n * The propagate result.\n * @param props -- The add to cart component props.\n * @param result -- The cart action result.\n */\nconst propagateResult = (props: IAddToCartComponentProps, result: ICartActionResult): void => {\n if (props.onAdd) {\n props.onAdd(result);\n }\n};\n\n/**\n * The propagate error.\n * @param props -- The add to cart component props.\n * @param result -- The add to cart failure result.\n */\nconst propagateError = (props: IAddToCartComponentProps, result: IAddToCartFailureResult): void => {\n if (props.onError) {\n props.onError(result);\n }\n};\n\n/**\n * Retrieves add to cart input from the component props.\n * @param props - Add to cart component props.\n * @returns Add to cart input.\n */\nconst getAddToCartInputFromProps = async (props: IAddToCartComponentProps) => {\n const products = props.orderDetailsProducts?.filter(product => !ObjectExtensions.isNullOrUndefined(product.simpleProduct));\n const emailDeliveryModeCode = props.context.actionContext.requestContext.channel?.EmailDeliveryModeCode;\n const input = products?.map(product => {\n const deliveryOption = product.salesLine.DeliveryMode;\n return {\n product: product.simpleProduct!,\n count: ObjectExtensions.isNullOrUndefined(product.salesLine.Quantity) ? defaultQuantity : product.salesLine.Quantity,\n catalogId: product.salesLine.CatalogId,\n isAddEmailDeliveryItemToCart: deliveryOption && deliveryOption === emailDeliveryModeCode\n };\n });\n\n if (ArrayExtensions.hasElements(input)) {\n return input;\n }\n\n if (ArrayExtensions.hasElements(props.products)) {\n const actionContext = props.context.actionContext;\n const apiSettings = actionContext.requestContext.apiSettings;\n\n const catalogId = props.catalogId ?? getCatalogId(props.context.actionContext.requestContext);\n validateCatalogId(catalogId);\n\n const searchCriteriaInput: ProductSearchCriteria = {\n Context: {\n ChannelId: apiSettings.channelId,\n CatalogId: catalogId\n },\n IncludeAttributes: false,\n Ids: props.products.map(product => product.productId)\n };\n\n const searchResult = await ProductsDataActions.searchByCriteriaAsync({ callerContext: actionContext }, searchCriteriaInput);\n const productSearchResultsWithImages = searchResult.map(productSearchResult => {\n const newProductSearchResult = { ...productSearchResult };\n const newImageUrl = generateProductImageUrl(newProductSearchResult, apiSettings);\n\n if (newImageUrl) {\n newProductSearchResult.PrimaryImageUrl = newImageUrl;\n }\n\n return newProductSearchResult;\n });\n\n return props.products.map(item => {\n const productData = productSearchResultsWithImages.find(product => product.RecordId === item.productId);\n let simpleProduct: SimpleProduct;\n if (productData) {\n simpleProduct = {\n ...productData,\n ProductTypeValue: ProductType.Variant,\n AdjustedPrice: productData.Price,\n BasePrice: productData.BasePrice ?? productData.Price\n };\n } else {\n // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- Cast to simple product since only record id is available.\n simpleProduct = {\n RecordId: item.productId\n } as SimpleProduct;\n }\n\n return {\n product: simpleProduct,\n count: item.quantity,\n catalogId: item.catalogId\n };\n });\n }\n\n if (props.data?.product) {\n return [\n {\n product: props.data.product,\n count: props.quantity ?? defaultQuantity,\n catalogId: props.catalogId\n }\n ];\n }\n\n return [];\n};\n\n/**\n * Add one item to cart when it is not buy again.\n * @param props -- The props.\n * @param setDisabled -- The set disable call back.\n * @param openModal -- The open modal call back.\n */\nconst addOneItemToCart = async (\n props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n openModal: (opened: boolean) => void\n): Promise<void> => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\n const data = props.data;\n\n const addToCartInput = await getAddToCartInputFromProps(props);\n const product = addToCartInput[0].product;\n const quantity = addToCartInput[0].count;\n\n const cartState = await getCartState(props.context.actionContext);\n const addToCartResult = await cartState.addProductToCart({\n product,\n count: quantity,\n availableQuantity: props.productAvailability?.AvailableQuantity,\n additionalProperties: { validateQuantity: props.isOrderQuantityLimitsFeatureEnabled },\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n enableStockCheck: props.context.app.config.enableStockCheck,\n isPriceKeyedIn: props.isPriceKeyedIn,\n customPrice: props.isPriceKeyedIn ? props.customPriceAmount : undefined,\n isAddEmailDeliveryItemToCart: props.isAddEmailDeliveryItemToCart,\n shouldSkipSiteSettings: props.shouldSkipSiteSettings,\n catalogId: addToCartInput[0].catalogId\n });\n\n if (addToCartResult.status === 'SUCCESS') {\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\n setDisabled(false);\n openModal(true);\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\n setDisabled(false);\n const notification = new ItemSuccessfullyAddedToCartNotification(\n props.context,\n props.dialogStrings,\n props.imageSettings,\n props.gridSettings,\n product,\n data?.price,\n quantity,\n props.navigationUrl,\n props.telemetryContent!,\n props.id,\n props.typeName\n );\n NotificationsManager.instance().addNotification(notification);\n } else if (\n MsDyn365.isBrowser &&\n props.navigationUrl &&\n !props.isNavigationToCartPageDisabled &&\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\n ) {\n window.location.assign(props.navigationUrl);\n } else {\n setDisabled(false);\n }\n propagateResult(props, addToCartResult);\n } else {\n NotificationsManager.instance().addNotification(\n new ErrorNotification(\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\n props.dialogStrings?.closeNotificationLabel ?? ''\n )\n );\n\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\n setDisabled(false);\n }\n};\n\n/**\n * Callback to handle success of adding to cart.\n * @param props - Add to cart component props.\n * @param setDisabled - Callback to update disabled state of the component.\n * @param setItemsAddedToCartDialogOpen - Callback to update disabled state of the component.\n * @param setErrorMessage - Callback to update error message state of the component.\n * @param cartState - Current cart state.\n * @param addToCartInput - Input used for adding to cart.\n * @param addToCartResult - Result of adding to cart.\n */\nconst handleAddItemsToCartSuccess = async (\n props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void,\n cartState: ICartState,\n addToCartInput: {\n product: SimpleProduct;\n count: number;\n }[],\n addToCartResult: ICartActionResult\n) => {\n // Validate cart for line errors.\n const validationResult: CartLineValidationResults = await CartsDataActions.validateForCheckoutAsync(\n { callerContext: props.context.actionContext, bypassCache: 'none' },\n cartState.cart.Id,\n cartState.cart.Version\n );\n const errorCount = (validationResult.ValidationFailuresByCartLines ?? []).length;\n const singleErrorCount = 1;\n const errorText = errorCount === singleErrorCount ? props.dialogStrings?.oneErrorText : props.dialogStrings?.multiErrorsText;\n const errorMessage =\n errorCount > zero ? format(props.dialogStrings?.validationErrorMessage ?? '', errorCount.toString(), errorText) : '';\n\n setErrorMessage(errorMessage);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access -- read config file.\n const addToCartBehavior = props.context.app.config.addToCartBehavior;\n\n if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showModal) {\n setDisabled(false);\n setItemsAddedToCartDialogOpen(true);\n } else if (props.dialogStrings && addToCartBehavior === AddToCartBehavior.showNotification) {\n setDisabled(false);\n const itemsAddedResource: IItemsAddedToCartResources = {\n viewCartButtonText: props.dialogStrings.goToCartText,\n closeButtonLabel: props.dialogStrings.closeNotificationLabel,\n itemsAddedToCartHeaderText: props.dialogStrings.headerMessageText,\n itemsAddedToCartFormatText: props.dialogStrings.headerItemFormatText,\n linesAddedToCartFormatText: props.dialogStrings.headerLinesFormatText ?? '{0}',\n itemsAddedValidationErrorMessage: errorMessage\n };\n\n const notification = new MultiItemsSuccessfullyAddedToCartNotification(\n props.context,\n itemsAddedResource,\n props.imageSettings,\n props.gridSettings,\n addToCartInput,\n props.navigationUrl,\n props.telemetryContent!,\n props.id,\n props.typeName\n );\n NotificationsManager.instance().addNotification(notification);\n } else if (\n MsDyn365.isBrowser &&\n props.navigationUrl &&\n !props.isNavigationToCartPageDisabled &&\n (addToCartBehavior === undefined || addToCartBehavior === AddToCartBehavior.goToCart)\n ) {\n window.location.assign(props.navigationUrl);\n } else {\n setDisabled(false);\n }\n propagateResult(props, addToCartResult);\n};\n\n/**\n * Add one or multi item to cart from buy again.\n * @param props -- The props.\n * @param setDisabled -- The set disable call back.\n * @param setItemsAddedToCartDialogOpen -- The open modal call back.\n * @param setErrorMessage -- The set error message call back.\n */\nconst addItemsToCart = async (\n props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void\n): Promise<void> => {\n const addToCartInput = await getAddToCartInputFromProps(props);\n\n if (!ArrayExtensions.hasElements(addToCartInput)) {\n return;\n }\n\n const cartState = await getCartState(props.context.actionContext);\n const addToCartResult = await cartState.addProductsToCart(addToCartInput);\n\n if (addToCartResult.status === 'SUCCESS') {\n await handleAddItemsToCartSuccess(\n props,\n setDisabled,\n setItemsAddedToCartDialogOpen,\n setErrorMessage,\n cartState,\n addToCartInput,\n addToCartResult\n );\n } else {\n if (props.dialogStrings?.buyAgainNotificationTitle) {\n // For buy again show simple error notification.\n NotificationsManager.instance().addNotification(\n new ErrorNotification(\n props.dialogStrings.buyAgainNotificationTitle,\n props.dialogStrings.buyAgainNotificationCloseAriaLabel ?? ''\n )\n );\n } else {\n NotificationsManager.instance().addNotification(\n new ErrorNotification(\n addToCartResult.errorDetails?.LocalizedMessage ?? 'Add to cart failed',\n props.dialogStrings?.closeNotificationLabel ?? ''\n )\n );\n }\n\n propagateError(props, { failureReason: 'CARTACTIONFAILED', cartActionResult: addToCartResult });\n setDisabled(false);\n }\n};\n\n/**\n * Interface for add to cart component.\n */\nexport interface IAddtoCartComponent extends IComponent<IAddToCartComponentProps> {\n onClick(): (event: React.MouseEvent<HTMLElement>, props: IAddToCartComponentProps) => void;\n}\n\n/**\n * On click function.\n * @param _event - The mouse event.\n * @param props - The props.\n * @param setDisabled - Flag to define whether the element is disabled.\n * @param openModal - Flag to specify if it should open in a modal window.\n * @param setItemsAddedToCartDialogOpen - Sets items added to cart while dialog is open.\n * @param setErrorMessage - Error message.\n */\nconst onClick = async (\n _event: React.MouseEvent<HTMLElement>,\n props: IAddToCartComponentProps,\n setDisabled: (disabled: boolean) => void,\n openModal: (opened: boolean) => void,\n setItemsAddedToCartDialogOpen: (opened: boolean) => void,\n setErrorMessage: (message: string) => void\n): Promise<void> => {\n if (!ArrayExtensions.hasElements(props.products)) {\n const cartError = addToCartError(props);\n\n if (cartError) {\n propagateError(props, cartError);\n return;\n }\n\n setDisabled(true);\n }\n\n const hasOrderDetailsProducts =\n ArrayExtensions.hasElements(props.orderDetailsProducts) && props.orderDetailsProducts.length > defaultQuantity;\n const hasProducts = ArrayExtensions.hasElements(props.products) && props.products.length > defaultQuantity;\n\n const hasMultipleProducts = hasOrderDetailsProducts || hasProducts;\n\n if (props.shouldSkipSiteSettings && hasMultipleProducts) {\n await addItemsToCart(props, setDisabled, setItemsAddedToCartDialogOpen, setErrorMessage);\n } else {\n await addOneItemToCart(props, setDisabled, openModal);\n }\n};\n\n/**\n * Add to cart component action constant.\n */\nconst AddToCartComponentActions = {\n onClick\n};\n\n/**\n * Add to cart component.\n * @param props - The props.\n * @returns - The add to cart component.\n */\nexport const AddToCartFunctionalComponent: React.FC<IAddToCartComponentProps> = (props: IAddToCartComponentProps) => {\n const [disabled, setDisabled] = useState(false);\n const [modalOpen, setModalOpen] = useState(false);\n const [isItemsAddedToCartDialogOpen, setItemsAddedToCartDialogOpen] = useState(false);\n const [errorMessage, setErrorMessage] = useState('');\n const [addToCartInput, setAddToCartInput] = useState<\n {\n product: SimpleProduct;\n count: number;\n }[]\n >([]);\n\n const onClickHandler = async (event: React.MouseEvent<HTMLElement>) => {\n await AddToCartComponentActions.onClick(event, props, setDisabled, setModalOpen, setItemsAddedToCartDialogOpen, setErrorMessage);\n };\n\n /**\n * Close dialog.\n */\n const closeItemsAddedToCartDialog = React.useCallback(() => {\n setItemsAddedToCartDialogOpen(false);\n }, []);\n\n const priceComponent = props.data?.price ? (\n <PriceComponent\n data={{ price: props.data.price }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n freePriceText={props.dialogStrings?.freePriceText}\n originalPriceText={props.dialogStrings?.originalPriceText}\n currentPriceText={props.dialogStrings?.currentPriceText}\n />\n ) : (\n ''\n );\n\n const popupProps: IPopupProps = {\n context: props.context,\n className: 'msc-add-to-cart',\n id: props.id,\n typeName: props.typeName,\n data: { product: addToCartInput[0]?.product, price: props.data?.price }, // addToCartInput[0]?.product?.Price },\n dialogStrings: props.dialogStrings,\n imageSettings: props.imageSettings,\n gridSettings: props.context.request.gridSettings,\n productQuantity: addToCartInput[0]?.count !== undefined ? addToCartInput[0]?.count : defaultQuantity,\n priceComponent,\n navigationUrl: props.navigationUrl,\n modalOpen,\n setModalOpen,\n telemetryContent: props.telemetryContent\n };\n\n const itemsAddedResource: IItemsAddedToCartResources = {\n viewCartButtonText: props.dialogStrings?.goToCartText ?? '',\n closeButtonLabel: props.dialogStrings?.closeNotificationLabel ?? 'Close',\n itemsAddedToCartHeaderText: props.dialogStrings?.headerMessageText ?? '',\n itemsAddedToCartFormatText: props.dialogStrings?.headerItemFormatText ?? '',\n linesAddedToCartFormatText: props.dialogStrings?.headerLinesFormatText ?? '{0}',\n itemsAddedValidationErrorMessage: errorMessage\n };\n\n const renderModalPopup = <Popup {...popupProps} />;\n const label = getLinkText(props);\n const payload = getPayloadObject(TelemetryEvent.AddToCart, props.telemetryContent!, label, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payload);\n const buttonClassName = props.shouldSkipSiteSettings ? '' : 'msc-add-to-cart ';\n\n React.useEffect(() => {\n /**\n * Retrieves add to cart input and updates the state.\n */\n const retrieveAddToCartInput = async () => {\n const retrievedInput = await getAddToCartInputFromProps(props);\n setAddToCartInput(retrievedInput);\n };\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call async method as per the documentation of react useEffect.\n retrieveAddToCartInput();\n }, [props, setAddToCartInput]);\n\n return (\n <>\n {renderModalPopup}\n <button\n className={classnames(buttonClassName, props.className)}\n aria-label={props.addToCartArialLabel ?? label}\n title={props.addToCartArialLabel ?? label}\n {...attributes}\n onClick={onClickHandler}\n disabled={props.disabled || disabled || isIntermediateState(props) || shouldShowOutOfStock(props, false)}\n >\n {label}\n </button>\n <ItemsAddedToCartDialogComponent\n className='msc-lines-added-to-cart-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={itemsAddedResource}\n data={{\n products: addToCartInput\n }}\n isModalOpen={isItemsAddedToCartDialogOpen}\n onClose={closeItemsAddedToCartDialog}\n />\n </>\n );\n};\n\n// Set default props\nAddToCartFunctionalComponent.defaultProps = {\n quantity: defaultQuantity\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @returns Gets the link text.\n */\nconst getLinkText = (props: IAddToCartComponentProps): string => {\n return shouldShowOutOfStock(props, false) && props.outOfStockText ? props.outOfStockText : props.addToCartText;\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @returns The add to cart failure result.\n */\nconst addToCartError = (props: IAddToCartComponentProps): IAddToCartFailureResult | undefined => {\n const {\n data,\n productAvailability,\n isCustomPriceSelected,\n customPriceAmount,\n maximumKeyInPrice,\n minimumKeyInPrice,\n defaultMaximumKeyInPrice = 100,\n defaultMinimumKeyInPrice = 10\n } = props;\n\n if (!data || !data.product.RecordId) {\n // No product exists, won't be able to add to cart\n return { failureReason: 'EMPTYINPUT' };\n }\n\n if (data.product.Dimensions) {\n const missingDimensions = data.product.Dimensions.filter(\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\n );\n\n if (ArrayExtensions.hasElements(missingDimensions)) {\n // At least one dimension with no value exists on the product, won't be able to add to cart\n return { failureReason: 'MISSINGDIMENSION', missingDimensions };\n }\n }\n\n if (shouldShowOutOfStock(props, true)) {\n const defaultAvailableQuantity = 0; // Showing as out of stock if no available products found.\n const availableQuantity = productAvailability?.AvailableQuantity ?? defaultAvailableQuantity;\n const stockLeft = Math.max(availableQuantity, defaultAvailableQuantity);\n\n return { failureReason: 'OUTOFSTOCK', stockLeft };\n }\n\n // When Custom price is selected, if there is no keyed-in price or keyed-in price is out of limit, should return error.\n if (\n isCustomPriceSelected &&\n (!customPriceAmount ||\n customPriceAmount > (maximumKeyInPrice || defaultMaximumKeyInPrice) ||\n customPriceAmount < (minimumKeyInPrice || defaultMinimumKeyInPrice))\n ) {\n return { failureReason: 'INVALIDCUSTOMAMOUNT' };\n }\n\n // Only allow adding to cart if not showing out of stock\n return undefined;\n};\n\n/**\n * Resolves whether product is in stock.\n * @param props - The add to cart component props.\n * @param includeCurrentQuantity - Flag to specify whether current quantity should be included.\n * @returns The dialog element.\n */\nconst shouldShowOutOfStock = (props: IAddToCartComponentProps, includeCurrentQuantity: boolean): boolean => {\n if (props.context.app.config.enableStockCheck === undefined || props.context.app.config.enableStockCheck === false) {\n return false;\n }\n\n // When skip site settings do not need show out of stock on adding to cart\n if (props.shouldSkipSiteSettings) {\n return false;\n }\n\n if (\n props.isLoading ||\n props.isProductQuantityLoading ||\n props.isUpdatingDimension ||\n props.isLoadingDeliveryOptions ||\n props.isUpdatingDeliveryOptions ||\n props.isAddServiceItemToCart\n ) {\n // Out of stock turn off, don't bother showing out of stock\n return false;\n }\n\n if (!props.data || !props.data.product.RecordId) {\n // No product exists, don't bother showing out of stock\n return false;\n }\n\n const hasAvailableProducts = props.hasAvailableProducts ?? true;\n if (!hasAvailableProducts) {\n return true;\n }\n\n if (props.data.product.Dimensions) {\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\n // At least one dimension with no value exists on the product, so also don't show out of stock\n return false;\n }\n }\n\n const includedQuantityNumber = includeCurrentQuantity && props.quantity ? props.quantity : defaultQuantity;\n\n return !(\n props.productAvailability &&\n props.productAvailability.AvailableQuantity !== undefined &&\n props.productAvailability.AvailableQuantity >= includedQuantityNumber\n );\n};\n\nconst isIntermediateState = (props: IAddToCartComponentProps): boolean => {\n if (props.data?.product.Dimensions) {\n if (props.data.product.Dimensions.find(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value))) {\n // At least one dimension with no value exists on the product, so also not in intermediate state\n return false;\n }\n }\n\n if (!props.isLoading && !props.isUpdatingDimension && !props.isLoadingDeliveryOptions && !props.isUpdatingDeliveryOptions) {\n return false;\n }\n\n return true;\n};\n\n// @ts-expect-error\nexport const AddToCartComponent: React.FunctionComponent<IAddToCartComponentProps> = msdyn365Commerce.createComponent<IAddtoCartComponent>(\n 'AddToCart',\n { component: AddToCartFunctionalComponent, ...AddToCartComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\n\n/**\n * Interface for multi items added to cart resource.\n */\nexport interface IItemsAddedToCartResources {\n viewCartButtonText: string;\n closeButtonLabel: string;\n itemsAddedToCartHeaderText: string;\n itemsAddedToCartFormatText: string;\n linesAddedToCartFormatText: string;\n itemsAddedValidationErrorMessage?: string;\n}\n\n/**\n * Interface for add to cart input.\n */\nexport interface IAddToCartInput {\n product: SimpleProduct;\n count?: number;\n}\n\n/**\n * The total number of items.\n * @param addedInput -- The added to cart input.\n * @returns The total number of items.\n */\nexport const getTotalItems = (addedInput: IAddToCartInput[]): number => {\n const defaultQuantity: number = 1;\n let totalCount: number = 0;\n\n for (const item of addedInput) {\n totalCount += item.count ?? defaultQuantity;\n }\n\n return totalCount;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\n/**\n * Items added to cart error message.\n */\nexport interface IItemsAddedErrorProps {\n errorMessage?: string;\n}\n\n/**\n * Items added error.\n * @param errorProps - The error properties.\n * @param errorProps.errorMessage - The error message to show.\n * @returns The alert element showing items added errors.\n */\nexport const ItemsAddedErrorComponent: React.FC<IItemsAddedErrorProps> = ({ errorMessage }) => {\n if (StringExtensions.isNullOrEmpty(errorMessage)) {\n return null;\n }\n\n return (\n <span className='msc-alert-danger msc-alert'>\n <span className='msi-exclamation-triangle' aria-hidden='true' />\n <span>{errorMessage}</span>\n </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 { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { getUrlSync, IComponentProps, IImageSettings } from '@msdyn365-commerce/core';\nimport { format } from '@msdyn365-commerce/retail-proxy';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { OrderTemplateProductsPreviewComponent } from '../order-template/order-templates-list/order-template-products-preview';\nimport { getTotalItems, IAddToCartInput, IItemsAddedToCartResources } from './items-added-to-cart';\nimport { ItemsAddedErrorComponent } from './items-added-to-cart-error-component';\n\n/**\n * Interface for items added to cart data.\n */\nexport interface IItemsAddedToCartDialogData {\n products: IAddToCartInput[];\n}\n\n/**\n * Interface for items added to cart props.\n */\nexport interface IItemsAddedToCartDialogProps extends IComponentProps<IItemsAddedToCartDialogData> {\n className: string;\n dialogStrings: IItemsAddedToCartResources;\n\n imageSettings?: IImageSettings;\n isModalOpen?: boolean;\n\n onClose(): void;\n}\n\n/**\n * Items added to cart dialog.\n * @param dialogProps -- The dialog props.\n * @returns The dialog element.\n */\nexport const ItemsAddedToCartDialogComponent = (dialogProps: IItemsAddedToCartDialogProps): JSX.Element => {\n const {\n dialogStrings,\n className,\n context,\n isModalOpen,\n imageSettings,\n data: { products }\n } = dialogProps;\n\n /**\n * Get cart page URL.\n * @returns The URL of cart page.\n */\n const getCartPageUrl = (): string => {\n return getUrlSync('cart', context.actionContext) ?? '';\n };\n\n const itemsString =\n format(dialogStrings.itemsAddedToCartFormatText, getTotalItems(products).toString()) + dialogStrings.itemsAddedToCartHeaderText;\n const linesString = format(dialogStrings.linesAddedToCartFormatText, products.length.toString());\n\n const fullProducts: FullProduct[] = products.map(item => {\n return { ProductDetails: item.product };\n });\n\n return (\n <Modal isOpen={isModalOpen} className={className} toggle={dialogProps.onClose}>\n <ModalHeader className={`${className}__dialog__header`} toggle={dialogProps.onClose}>\n <b>{linesString}</b>\n <span>{dialogStrings.itemsAddedToCartHeaderText}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <OrderTemplateProductsPreviewComponent\n context={context}\n className={`${className}__dialog`}\n products={fullProducts}\n imageSettings={imageSettings}\n />\n <div className={`${className}__dialog__description`}>\n <div className={`${className}__dialog__order-template-items`}>{itemsString}</div>\n </div>\n <ItemsAddedErrorComponent errorMessage={dialogProps.dialogStrings.itemsAddedValidationErrorMessage} />\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__view-cart-button`}\n title={dialogStrings.viewCartButtonText}\n href={getCartPageUrl()}\n >\n {dialogStrings.viewCartButtonText}\n </Button>\n <Button\n className={`${className}__dialog__continue-shopping`}\n title={dialogStrings.closeButtonLabel}\n onClick={dialogProps.onClose}\n >\n {dialogStrings.closeButtonLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Image } from '@msdyn365-commerce/core';\nimport {\n BaseNotificationComponent,\n ClosableNotificationWrapper,\n DismissibleNotificationWrapper,\n INotificationCloseButtonProps,\n INotificationProps,\n NotificationCloseButton,\n NotificationContent,\n NotificationFooter,\n NotificationHeader,\n NotificationInstance,\n NotificationTitle\n} from '@msdyn365-commerce-modules/notifications-core';\nimport { getFallbackImageUrl, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, getPayloadObject, getTelemetryAttributes, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { PriceComponent } from '../../price/price.components';\nimport { ItemSuccessfullyAddedToCartNotification } from './item-successfully-added-to-cart-notification';\n\nexport interface IItemSuccessfullyAddedToCartNotificationProps\n extends INotificationProps<ItemSuccessfullyAddedToCartNotification>,\n INotificationCloseButtonProps<ItemSuccessfullyAddedToCartNotification> {}\n\nexport class ItemSuccessfullyAddedToCartNotificationComponent extends BaseNotificationComponent<\n ItemSuccessfullyAddedToCartNotification,\n IItemSuccessfullyAddedToCartNotificationProps\n> {\n public static readonly className: string = 'msc-notification-item-successfully-added-to-cart';\n\n public constructor(props: IItemSuccessfullyAddedToCartNotificationProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n const payLoad = getPayloadObject('click', this.props.notification.telemetryContent, TelemetryConstant.ContinueShopping);\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n const shouldDisplayUnitOfMeasure =\n this.props.notification.context.app.config?.unitOfMeasureDisplayType &&\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- app configs are of generic type\n this.props.notification.context.app.config.unitOfMeasureDisplayType !== 'none';\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\n const viewBagAttribute = getTelemetryAttributes(this.props.notification.telemetryContent, payLoad);\n const fallbackImageUrl = getFallbackImageUrl(\n this.props.notification.product.ItemId,\n this.props.notification.context.actionContext.requestContext.apiSettings,\n this.props.notification.context.app?.config?.OmniChannelMedia\n );\n if (this.props.notification.imageSettings) {\n this.props.notification.imageSettings.cropFocalRegion = true;\n }\n\n const reducedDimensions: string = this.props.notification.product.Dimensions\n ? this.props.notification.product.Dimensions.reduce<string>((str, productDimension) => {\n if (productDimension.DimensionValue && productDimension.DimensionValue.Value) {\n if (str) {\n return `${str}, ${productDimension.DimensionValue.Value}`;\n }\n\n return `${productDimension.DimensionValue.Value}`;\n }\n\n return str;\n }, '')\n : '';\n\n const contentClassName = NotificationContent.className;\n const footerClassName = NotificationFooter.className;\n\n return (\n <div role='alert' className={ItemSuccessfullyAddedToCartNotificationComponent.className}>\n <ClosableNotificationWrapper notification={this.props.notification}>\n <DismissibleNotificationWrapper notification={this.props.notification}>\n <NotificationInstance notification={this.props.notification}>\n <NotificationHeader notification={this.props.notification}>\n <NotificationTitle notification={this.props.notification} />\n <NotificationCloseButton notification={this.props.notification} />\n </NotificationHeader>\n <NotificationContent notification={this.props.notification}>\n <Image\n requestContext={this.props.notification.context.actionContext.requestContext}\n className={`${contentClassName}__image`}\n src={this.props.notification.product.PrimaryImageUrl || ''}\n fallBackSrc={fallbackImageUrl}\n altText={this.props.notification.product.Name}\n gridSettings={this.props.notification.gridSettings || {}}\n imageSettings={this.props.notification.imageSettings}\n loadFailureBehavior='empty'\n />\n <div className={`${contentClassName}__product-info`}>\n <div className={`${contentClassName}__product-title`}>{this.props.notification.product.Name}</div>\n {this.props.notification.price ? (\n <div className={`${contentClassName}__product-price`}>\n <PriceComponent\n data={{ price: this.props.notification.price }}\n context={this.props.notification.context}\n id={this.props.notification.id}\n typeName={this.props.notification.typeName}\n freePriceText={this.props.notification.resources.freePriceText}\n originalPriceText={this.props.notification.resources.originalPriceText}\n currentPriceText={this.props.notification.resources.currentPriceText}\n />\n </div>\n ) : (\n ''\n )}\n {this.props.notification.product.DefaultUnitOfMeasure && shouldDisplayUnitOfMeasure ? (\n <div className={`${contentClassName}__product-unit-of-measure`}>\n <span>{this.props.notification.product.DefaultUnitOfMeasure}</span>\n </div>\n ) : (\n ''\n )}\n {StringExtensions.isNullOrWhitespace(reducedDimensions) ? null : (\n <div className={`${contentClassName}__product-variants`}>{reducedDimensions}</div>\n )}\n <div className={`${contentClassName}__product-quantity`}>\n {this.props.notification.resources.addedQuantityText.replace(\n '{0}',\n this.props.notification.productQuantity.toString()\n )}\n </div>\n </div>\n </NotificationContent>\n <NotificationFooter notification={this.props.notification}>\n {this.props.notification.navigationUrl && (\n <Button\n className={`${footerClassName}__go-to-cart`}\n href={this.props.notification.navigationUrl}\n title={this.props.notification.resources.goToCartText}\n {...viewBagAttribute}\n >\n {this.props.notification.resources.goToCartText}\n </Button>\n )}\n </NotificationFooter>\n </NotificationInstance>\n </DismissibleNotificationWrapper>\n </ClosableNotificationWrapper>\n </div>\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 { IAny, ICoreContext, IGeneric, IGridSettings, IImageSettings, RichText } from '@msdyn365-commerce/core';\nimport { format, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n DismissibleNotification,\n IClosableNotification,\n ITitledNotification,\n NotificationEvents,\n withNotificationComponent\n} from '@msdyn365-commerce-modules/notifications-core';\nimport { Event } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\n\nimport { IAddToCartResources } from '../add-to-cart.component';\nimport { ItemSuccessfullyAddedToCartNotificationComponent } from './item-successfully-added-to-cart-notification-component';\n\n/**\n * Notification which will be shown after the user adds an item to the cart.\n */\n@withNotificationComponent(ItemSuccessfullyAddedToCartNotificationComponent)\nexport class ItemSuccessfullyAddedToCartNotification extends DismissibleNotification implements ITitledNotification, IClosableNotification {\n public readonly context: ICoreContext<IGeneric<IAny>>;\n\n public readonly resources: IAddToCartResources;\n\n public readonly imageSettings?: IImageSettings;\n\n public readonly gridSettings?: IGridSettings;\n\n public readonly product: SimpleProduct;\n\n public readonly price?: ProductPrice;\n\n public readonly productQuantity: number;\n\n public readonly navigationUrl?: string;\n\n public readonly telemetryContent: ITelemetryContent;\n\n public readonly closeAriaLabel: string;\n\n public readonly title: RichText;\n\n public readonly componentId: string;\n\n public readonly typeName: string;\n\n public isClosed: boolean;\n\n public constructor(\n context: ICoreContext<IGeneric<IAny>>,\n resources: IAddToCartResources,\n imageSettings: IImageSettings | undefined,\n gridSettings: IGridSettings | undefined,\n product: SimpleProduct,\n price: ProductPrice | undefined,\n productQuantity: number,\n navigationUrl: string | undefined,\n telemetryContent: ITelemetryContent,\n componentId: string,\n typeName: string\n ) {\n super();\n\n const quantityOne = 1;\n const itemsString =\n productQuantity === quantityOne\n ? resources.headerItemOneText\n : format(resources.headerItemFormatText, productQuantity.toString());\n\n this.title = `<b>${itemsString}</b><span>${resources.headerMessageText}</span>`;\n\n this.context = context;\n this.resources = resources;\n this.imageSettings = imageSettings;\n this.gridSettings = gridSettings;\n this.product = product;\n this.price = price;\n this.productQuantity = productQuantity;\n this.navigationUrl = navigationUrl;\n this.telemetryContent = telemetryContent;\n this.componentId = componentId;\n this.typeName = typeName;\n\n this.isClosed = false;\n this.closeAriaLabel = resources.closeNotificationLabel;\n\n this.events.setValue(NotificationEvents.Close, new Event());\n }\n\n public close(): void {\n this.isClosed = true;\n this.events.getValue(NotificationEvents.Close)?.trigger();\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport {\n BaseNotificationComponent,\n ClosableNotificationWrapper,\n DismissibleNotificationWrapper,\n INotificationCloseButtonProps,\n INotificationProps,\n NotificationCloseButton,\n NotificationContent,\n NotificationDescription,\n NotificationFooter,\n NotificationHeader,\n NotificationInstance,\n NotificationTitle\n} from '@msdyn365-commerce-modules/notifications-core';\nimport { Button, getPayloadObject, getTelemetryAttributes, TelemetryConstant } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { OrderTemplateProductsPreviewComponent } from '../../order-template/order-templates-list/order-template-products-preview';\nimport { ItemsAddedErrorComponent } from '../items-added-to-cart-error-component';\nimport { MultiItemsSuccessfullyAddedToCartNotification } from './multi-items-successfully-added-to-cart-notification';\n\n/**\n * Interface of props for multiple items are successfully added to cart notification.\n */\nexport interface IMultiItemsSuccessfullyAddedToCartNotificationProps\n extends INotificationProps<MultiItemsSuccessfullyAddedToCartNotification>,\n INotificationCloseButtonProps<MultiItemsSuccessfullyAddedToCartNotification> {}\n\n/**\n * Multiple items are successfully added to cart notification.\n */\nexport class MultiItemsSuccessfullyAddedToCartNotificationComponent extends BaseNotificationComponent<\n MultiItemsSuccessfullyAddedToCartNotification,\n IMultiItemsSuccessfullyAddedToCartNotificationProps\n> {\n public static readonly className: string = 'msc-notification-items-added-to-cart';\n\n public constructor(props: IMultiItemsSuccessfullyAddedToCartNotificationProps) {\n super(props);\n }\n\n public render(): React.ReactNode {\n const payLoad = getPayloadObject('click', this.props.notification.telemetryContent, TelemetryConstant.ContinueShopping);\n payLoad.contentAction.etext = TelemetryConstant.ViewBagAndCheckout;\n const viewBagAttribute = getTelemetryAttributes(this.props.notification.telemetryContent, payLoad);\n if (this.props.notification.imageSettings) {\n this.props.notification.imageSettings.cropFocalRegion = true;\n }\n\n const fullProducts: FullProduct[] = this.props.notification.products.map(item => {\n return { ProductDetails: item.product };\n });\n\n const className = MultiItemsSuccessfullyAddedToCartNotificationComponent.className;\n const footerClassName = NotificationFooter.className;\n return (\n <div role='alert' className={className}>\n <ClosableNotificationWrapper notification={this.props.notification}>\n <DismissibleNotificationWrapper notification={this.props.notification}>\n <NotificationInstance notification={this.props.notification}>\n <NotificationHeader notification={this.props.notification}>\n <NotificationTitle notification={this.props.notification} />\n <NotificationCloseButton notification={this.props.notification} />\n </NotificationHeader>\n <NotificationContent notification={this.props.notification}>\n <OrderTemplateProductsPreviewComponent\n context={this.props.notification.context}\n className='msc-notification-content__preview'\n products={fullProducts}\n imageSettings={this.props.notification.imageSettings}\n />\n <NotificationDescription notification={this.props.notification} />\n <ItemsAddedErrorComponent\n errorMessage={this.props.notification.resources.itemsAddedValidationErrorMessage}\n />\n </NotificationContent>\n <NotificationFooter notification={this.props.notification}>\n {this.props.notification.navigationUrl && (\n <Button\n className={`${footerClassName}__go-to-cart`}\n href={this.props.notification.navigationUrl}\n title={this.props.notification.resources.viewCartButtonText}\n {...viewBagAttribute}\n >\n {this.props.notification.resources.viewCartButtonText}\n </Button>\n )}\n </NotificationFooter>\n </NotificationInstance>\n </DismissibleNotificationWrapper>\n </ClosableNotificationWrapper>\n </div>\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 { IAny, ICoreContext, IGeneric, IGridSettings, IImageSettings, RichText } from '@msdyn365-commerce/core';\nimport { format } from '@msdyn365-commerce/retail-proxy';\nimport {\n DismissibleNotification,\n IClosableNotification,\n ITitledNotification,\n NotificationEvents,\n withNotificationComponent\n} from '@msdyn365-commerce-modules/notifications-core';\nimport { Event } from '@msdyn365-commerce-modules/retail-actions';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\n\nimport { getTotalItems, IAddToCartInput, IItemsAddedToCartResources } from '../items-added-to-cart';\nimport { MultiItemsSuccessfullyAddedToCartNotificationComponent } from './multi-items-successfully-added-to-cart-notification-component';\n\n/**\n * Notification which will be shown after the user adds multi items to the cart.\n */\n@withNotificationComponent(MultiItemsSuccessfullyAddedToCartNotificationComponent)\nexport class MultiItemsSuccessfullyAddedToCartNotification extends DismissibleNotification\n implements ITitledNotification, IClosableNotification {\n public readonly context: ICoreContext<IGeneric<IAny>>;\n\n public readonly resources: IItemsAddedToCartResources;\n\n public readonly imageSettings?: IImageSettings;\n\n public readonly gridSettings?: IGridSettings;\n\n public readonly products: IAddToCartInput[];\n\n public readonly navigationUrl?: string;\n\n public readonly telemetryContent: ITelemetryContent;\n\n public readonly closeAriaLabel: string;\n\n public readonly title: RichText;\n\n public readonly descriptionLines: RichText[];\n\n public readonly componentId: string;\n\n public readonly typeName: string;\n\n public isClosed: boolean;\n\n public constructor(\n context: ICoreContext<IGeneric<IAny>>,\n resources: IItemsAddedToCartResources,\n imageSettings: IImageSettings | undefined,\n gridSettings: IGridSettings | undefined,\n products: IAddToCartInput[],\n navigationUrl: string | undefined,\n telemetryContent: ITelemetryContent,\n componentId: string,\n typeName: string\n ) {\n super();\n\n const itemsString = format(resources.itemsAddedToCartFormatText, getTotalItems(products).toString());\n const linesString = format(resources.linesAddedToCartFormatText, products.length.toString());\n\n this.title = `<b>${linesString}</b><span>${resources.itemsAddedToCartHeaderText}</span>`;\n this.descriptionLines = [];\n this.descriptionLines.push(`<b>${itemsString}</b><span>${resources.itemsAddedToCartHeaderText}</span>`);\n\n this.context = context;\n this.resources = resources;\n this.imageSettings = imageSettings;\n this.gridSettings = gridSettings;\n this.products = products;\n this.navigationUrl = navigationUrl;\n this.telemetryContent = telemetryContent;\n this.componentId = componentId;\n this.typeName = typeName;\n\n this.isClosed = false;\n this.closeAriaLabel = resources.closeButtonLabel;\n\n this.events.setValue(NotificationEvents.Close, new Event());\n }\n\n public close(): void {\n this.isClosed = true;\n this.events.getValue(NotificationEvents.Close)?.trigger();\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { SalesLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { observable } from 'mobx';\n\n/**\n * Represents a product from order details.\n */\nexport class OrderDetailsProduct {\n @observable\n public isSelected: boolean;\n\n public readonly isProductAvailable: boolean;\n\n public readonly salesLine: SalesLine;\n\n /**\n * Simple product info.\n * May be undefined for the removed/unavailable product.\n */\n public readonly simpleProduct?: SimpleProduct;\n\n public readonly productUrl?: string;\n\n public constructor(salesLine: SalesLine, simpleProduct?: SimpleProduct, productUrl?: string) {\n this.salesLine = salesLine;\n this.simpleProduct = simpleProduct;\n this.isSelected = false;\n this.isProductAvailable = !ObjectExtensions.isNullOrUndefined(simpleProduct);\n this.productUrl = productUrl;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { AsyncResult, CartLine, CommerceList, Customer, ProductDimension, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n addLinesAsync,\n createCommerceListAsync,\n createGetByCustomerInput,\n removeLinesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/CommerceListsDataActions.g';\nimport { buildWishlistLine, getCustomer, GetCustomerInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as Popper from 'popper.js';\nimport React, { useState } from 'react';\n\nexport interface IAddToWishlistComponentProps extends IComponentProps<IAddtoWishlistData> {\n className?: string;\n addToWishlistButtonText: string;\n removeFromWishlistButtonText: string;\n nameOfWishlist: string;\n\n addToWishlistMessage?: string;\n removedFromWishlistMessage?: string;\n addItemToWishlistError?: string;\n removeItemFromWishlistError?: string;\n\n showButtonText?: boolean;\n showButtonTooltip?: boolean;\n tooltipPosition?: Popper.Placement;\n showStatusMessage?: boolean;\n showRemoveButton?: boolean;\n disabled?: boolean;\n cartline?: CartLine;\n canAddMasterProduct?: boolean;\n ariaRole?: string;\n\n getSelectedProduct?: Promise<SimpleProduct | null>;\n\n onSuccess?(result: IWishlistActionSuccessResult, cartline?: CartLine): void;\n onError?(result: IWishlistActionErrorResult): void;\n}\n\nexport interface IWishlistActionSuccessResult {\n status: 'ADDED' | 'REMOVED';\n}\n\nexport interface IWishlistActionErrorResult {\n status: 'FAILED' | 'MISSINGDIMENSION';\n\n missingDimensions?: ProductDimension[];\n}\n\ninterface IAddToWishlistStateManager {\n waiting: boolean;\n canRemove: boolean;\n content: IAddtoWishlistContentState;\n\n setWaiting(newWaiting: boolean): void;\n setContent(newContent: IAddtoWishlistContentState): void;\n setCanRemove(newCanRemove: boolean): void;\n}\n\ninterface IAddtoWishlistContentState {\n showAlert?: boolean;\n wishlistTextMessage?: string;\n color?: string;\n}\n\ninterface IAddtoWishlistData {\n wishlists?: CommerceList[];\n product: SimpleProduct;\n}\n\nexport interface IAddtoWishlistComponent extends IComponent<IAddToWishlistComponentProps> {\n onClick(): (event: React.MouseEvent<HTMLElement>, props: IAddToWishlistComponentProps, state: IAddToWishlistStateManager) => void;\n}\n\nconst onClick = async (\n _event: React.MouseEvent<HTMLElement>,\n props: IAddToWishlistComponentProps,\n state: IAddToWishlistStateManager\n): Promise<void> => {\n const { user } = props.context.request;\n let { product } = props.data;\n\n if (state.waiting) {\n return;\n }\n\n if (!user.isAuthenticated && user.signInUrl && window) {\n window.location.assign(user.signInUrl);\n\n return;\n }\n\n state.setWaiting(true);\n if (!(props.getSelectedProduct === undefined)) {\n product = (await props.getSelectedProduct) || props.data.product;\n }\n\n await (doesProductExistInWishlist(product, props) ? removeFromWishlist(product, props, state) : addToWishlist(product, props, state));\n state.setWaiting(false);\n};\n\nconst onDismiss = (state: IAddToWishlistStateManager): void => {\n state.setContent({ color: 'success', showAlert: false });\n};\n\nconst AddToWishlistComponentActions = {\n onClick,\n onDismiss\n};\n\nconst AddToWishlist: React.FC<IAddToWishlistComponentProps> = (props: IAddToWishlistComponentProps) => {\n const [waiting, setWaiting] = useState(false);\n const [canRemove, setCanRemove] = useState(doesProductExistInWishlist(props.data.product, props));\n const [content, setContent] = useState({});\n const state: IAddToWishlistStateManager = {\n waiting,\n canRemove,\n content,\n\n setWaiting,\n setCanRemove,\n setContent\n };\n\n React.useEffect(() => {\n setCanRemove(doesProductExistInWishlist(props.data.product, props));\n }, [props]);\n\n const {\n removeFromWishlistButtonText,\n addToWishlistButtonText,\n ariaRole,\n showStatusMessage,\n showRemoveButton,\n showButtonText,\n className,\n disabled,\n showButtonTooltip,\n tooltipPosition\n } = props;\n\n const onClickHandler = (event: React.MouseEvent<HTMLElement>) => {\n return AddToWishlistComponentActions.onClick(event, props, state);\n };\n const onDismissHandler = () => {\n AddToWishlistComponentActions.onDismiss(state);\n };\n const ariaLabel = state.canRemove ? removeFromWishlistButtonText : addToWishlistButtonText;\n const addToWishlistRef: React.RefObject<HTMLButtonElement> = React.createRef();\n const removeFromWishlistRef: React.RefObject<HTMLButtonElement> = React.createRef();\n const showMessage = showStatusMessage !== undefined ? showStatusMessage : true;\n const showButton = showRemoveButton !== undefined ? showRemoveButton : true;\n const showTooltip = showButtonTooltip !== undefined ? showButtonTooltip : true;\n const tooltipPos = showButtonTooltip !== undefined ? tooltipPosition : 'right';\n const linkAriaRole = ariaRole !== undefined ? ariaRole : 'link';\n\n if (state.canRemove && !showButton) {\n return null;\n }\n\n return (\n <>\n {showButtonText ? (\n <>\n <button\n className={classnames(\n 'msc-add-to-wishlist',\n className,\n state.waiting ? 'msc-add-to-wishlist__waiting' : '',\n state.canRemove ? 'msc-add-to-wishlist__removing' : ''\n )}\n aria-label={ariaLabel}\n onClick={onClickHandler}\n disabled={disabled}\n ref={addToWishlistRef}\n role={linkAriaRole}\n >\n {ariaLabel}\n </button>\n {showTooltip && (\n <UncontrolledTooltip placement={tooltipPos} trigger='hover focus' target={addToWishlistRef}>\n {ariaLabel}\n </UncontrolledTooltip>\n )}\n </>\n ) : (\n <>\n <button\n className={classnames(\n 'msc-add-to-wishlist',\n className,\n state.waiting ? 'msc-add-to-wishlist__waiting' : '',\n state.canRemove ? 'msc-add-to-wishlist__removing' : ''\n )}\n aria-label={ariaLabel}\n onClick={onClickHandler}\n disabled={disabled}\n ref={removeFromWishlistRef}\n role={linkAriaRole}\n />\n {showTooltip && (\n <UncontrolledTooltip placement={tooltipPos} trigger='hover focus' target={addToWishlistRef}>\n {ariaLabel}\n </UncontrolledTooltip>\n )}\n </>\n )}\n {state.content.showAlert && showMessage ? (\n <div className='ms-wishlist-items__product-status'>\n <Alert color={state.content.color} isOpen={state.content.showAlert} toggle={onDismissHandler}>\n {state.content.wishlistTextMessage}\n </Alert>\n </div>\n ) : (\n ''\n )}\n </>\n );\n};\n\nconst doesProductExistInWishlist = (product: SimpleProduct, props: IAddToWishlistComponentProps): boolean => {\n const { wishlists } = props.data;\n\n if (!wishlists || !wishlists[0]) {\n return false;\n }\n\n const { CommerceListLines } = wishlists[0];\n\n if (!CommerceListLines || CommerceListLines.length === 0) {\n return false;\n }\n\n for (const wishlistItem of CommerceListLines) {\n if (wishlistItem.ProductId === product.RecordId) {\n return true;\n }\n }\n\n return false;\n};\n\nconst propagateSuccess = (props: IAddToWishlistComponentProps, result: IWishlistActionSuccessResult): void => {\n const { onSuccess, cartline } = props;\n\n if (onSuccess) {\n cartline ? onSuccess(result, props.cartline) : onSuccess(result);\n }\n};\n\nconst propagateError = (props: IAddToWishlistComponentProps, result: IWishlistActionErrorResult): void => {\n const { onError } = props;\n\n if (onError) {\n onError(result);\n }\n};\n\nconst addToWishlist = async (\n product: SimpleProduct,\n props: IAddToWishlistComponentProps,\n state: IAddToWishlistStateManager\n): Promise<void> => {\n const { canAddMasterProduct, context } = props;\n\n if (product.Dimensions && !canAddMasterProduct) {\n const missingDimensions = product.Dimensions.filter(dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value));\n\n if (missingDimensions.length > 0) {\n // At least one dimension with no value exists on the product, won't be able to add to cart\n propagateError(props, { status: 'MISSINGDIMENSION', missingDimensions });\n\n return AsyncResult.resolve();\n }\n }\n\n if (context.request.user.isAuthenticated) {\n if (!props.data.wishlists || props.data.wishlists.length === 0) {\n const wishlistName = props.nameOfWishlist;\n const customer = await getCustomerAccount(props);\n if (customer && customer.AccountNumber) {\n const listData: CommerceList = {\n CustomerId: customer.AccountNumber,\n Name: wishlistName,\n\n // This is the type value specifically for a wishlist\n CommerceListTypeValue: 1,\n Id: 0\n };\n\n try {\n const commerceList = await createCommerceListAsync({ callerContext: context.actionContext }, listData);\n return callAddWishlistLine(props, state, commerceList.Id, product.RecordId);\n } catch (error) {\n if (context.telemetry) {\n context.telemetry.warning(error);\n context.telemetry.debug('Unable to create a wishlist');\n }\n propagateError(props, { status: 'FAILED' });\n }\n } else {\n context.telemetry.debug('Customer account number missing');\n }\n } else {\n return callAddWishlistLine(props, state, props.data.wishlists[0].Id, product.RecordId);\n }\n }\n\n return AsyncResult.resolve();\n};\n\nconst callAddWishlistLine = async (\n props: IAddToWishlistComponentProps,\n state: IAddToWishlistStateManager,\n wishlistId: number,\n productId: number\n): Promise<void> => {\n const { context } = props;\n\n try {\n const customer = await getCustomerAccount(props);\n if (customer && customer.AccountNumber) {\n const createdCommerceList = await addLinesAsync({ callerContext: context.actionContext }, wishlistId, [\n buildWishlistLine(productId, customer.AccountNumber, wishlistId)\n ]);\n context.actionContext.update(createGetByCustomerInput({}, null), [createdCommerceList]);\n if (context.telemetry) {\n context.telemetry.debug(`Added item to the wishlist ${createdCommerceList}`);\n }\n state.setCanRemove(true);\n state.setContent({\n color: 'success',\n showAlert: true,\n wishlistTextMessage: props.addToWishlistMessage ? props.addToWishlistMessage : 'Added to your wishlist'\n });\n propagateSuccess(props, { status: 'ADDED' });\n } else {\n context.telemetry.debug('Customer Account number missing');\n }\n } catch (error) {\n if (context.telemetry) {\n context.telemetry.warning(error);\n context.telemetry.debug(`Unable to add item to wishlist ${error}`);\n }\n\n state.setContent({\n color: 'danger',\n showAlert: true,\n wishlistTextMessage: props.addItemToWishlistError\n });\n propagateError(props, { status: 'FAILED' });\n }\n};\n\nconst removeFromWishlist = async (\n product: SimpleProduct,\n props: IAddToWishlistComponentProps,\n state: IAddToWishlistStateManager\n): Promise<void> => {\n const { context, data, removedFromWishlistMessage, removeItemFromWishlistError } = props;\n const { wishlists } = data;\n const { actionContext, telemetry } = context;\n\n // TODO Please fix customeraccount number null once Bug https://msdyneng.visualstudio.com/FinOps/_workitems/edit/481375 gets fixed.\n if (context.request.user.isAuthenticated) {\n if (wishlists && wishlists[0]) {\n const wishlistLine = wishlists[0].CommerceListLines!.find(line => line.ProductId === product.RecordId);\n\n if (wishlistLine) {\n try {\n const customer = await getCustomerAccount(props);\n const commerceList = await removeLinesAsync({ callerContext: actionContext }, wishlists[0].Id, [wishlistLine]);\n if (customer) {\n context.actionContext.update(createGetByCustomerInput({}, null), [commerceList]);\n } else {\n telemetry.debug('Customer Account Number missing');\n }\n\n if (telemetry) {\n telemetry.debug(`[WishlistButton] ${product.RecordId} removed from Wishlist ${commerceList.Id}`);\n }\n state.setCanRemove(false);\n state.setContent({\n color: 'success',\n showAlert: true,\n wishlistTextMessage: removedFromWishlistMessage ? removedFromWishlistMessage : 'Removed item from the wishlist'\n });\n propagateSuccess(props, { status: 'REMOVED' });\n } catch (error) {\n if (telemetry) {\n telemetry.warning(error);\n telemetry.debug('[WishlistButton] Error removing item from the wishlist');\n }\n\n state.setContent({\n color: 'danger',\n wishlistTextMessage: removeItemFromWishlistError\n });\n propagateError(props, { status: 'FAILED' });\n }\n }\n } else if (telemetry) {\n telemetry.debug(\"[WishlistButton] Can't remove from wishlist since no wishlist exisits OR there is no product data\");\n }\n }\n\n return AsyncResult.resolve();\n};\n\nconst getCustomerAccount = (props: IAddToWishlistComponentProps): AsyncResult<Customer> => {\n const { context } = props;\n const customerInput = new GetCustomerInput(context.actionContext.requestContext.apiSettings);\n return getCustomer(customerInput, context.actionContext);\n};\n\nexport const AddToWishlistComponent: React.FunctionComponent<IAddToWishlistComponentProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IAddtoWishlistComponent\n>('AddToWishlist', { component: AddToWishlist, ...AddToWishlistComponentActions });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\ninterface CarouselContext {\n direction?: string;\n}\n\n// Create a context wrapping some shared state\nexport default React.createContext<CarouselContext>({\n direction: 'right'\n});\n","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","export var forceReflow = function forceReflow(node) {\n return node.scrollTop;\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { forceReflow } from './utils/reflow';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * <Transition in={inProp} timeout={duration}>\n * {state => (\n * <div style={{\n * ...defaultStyle,\n * ...transitionStyles[state]\n * }}>\n * I'm a fade Transition!\n * </div>\n * )}\n * </Transition>\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * <div>\n * <Transition in={inProp} timeout={500}>\n * {state => (\n * // ...\n * )}\n * </Transition>\n * <button onClick={() => setInProp(true)}>\n * Click to Enter\n * </button>\n * </div>\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n if (this.props.unmountOnExit || this.props.mountOnEnter) {\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this); // https://github.com/reactjs/react-transition-group/pull/749\n // With unmountOnExit or mountOnEnter, the enter animation should happen at the transition between `exited` and `entering`.\n // To make the animation happen, we have to separate each rendering and avoid being processed as batched.\n\n if (node) forceReflow(node);\n }\n\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * <Transition in={this.state.in} timeout={150}>\n * {state => (\n * <MyComponent className={`fade fade-${state}`} />\n * )}\n * </Transition>\n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `<CSSTransition>` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { mapToCssModules, TransitionStatuses, TransitionTimeouts } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\nimport Transition from 'react-transition-group/Transition';\n\nimport CarouselContext from './CarouselContext';\nimport { ICarouselItemProps } from './CarouselItem.props';\n\nexport interface ICarouselItemState {\n startAnimation: boolean;\n}\n\n/**\n * CarouselItem component.\n */\nexport default class CarouselItem extends React.Component<ICarouselItemProps, ICarouselItemState> {\n public static defaultProps: Partial<ICarouselItemProps> = {\n tag: 'div',\n timeout: TransitionTimeouts.Carousel,\n slide: true\n };\n\n public props: ICarouselItemProps;\n\n public state: ICarouselItemState;\n\n constructor(props: ICarouselItemProps) {\n super(props);\n this.props = props;\n\n this.state = {\n startAnimation: false\n };\n\n this.onEnter = this.onEnter.bind(this);\n this.onEntering = this.onEntering.bind(this);\n this.onExit = this.onExit.bind(this);\n this.onExiting = this.onExiting.bind(this);\n this.onExited = this.onExited.bind(this);\n }\n\n public onEnter = (node: HTMLElement, isAppearing: boolean) => {\n this.setState({ startAnimation: false });\n if (this.props.onEnter) {\n this.props.onEnter(node, isAppearing);\n }\n };\n\n public onEntering = (node: HTMLElement, isAppearing: boolean) => {\n // Getting this variable triggers a reflow\n const offsetHeight = node.offsetHeight;\n this.setState({ startAnimation: true });\n if (this.props.onEntering) {\n this.props.onEntering(node, isAppearing);\n }\n\n return offsetHeight;\n };\n\n public onExit = (node: HTMLElement) => {\n this.setState({ startAnimation: false });\n if (this.props.onExit) {\n this.props.onExit(node);\n }\n };\n\n public onExiting = (node: HTMLElement) => {\n this.setState({ startAnimation: true });\n node.dispatchEvent(new CustomEvent('slide.bs.carousel'));\n if (this.props.onExiting) {\n this.props.onExiting(node);\n }\n };\n\n public onExited = (node: HTMLElement) => {\n node.dispatchEvent(new CustomEvent('slid.bs.carousel'));\n if (this.props.onExited) {\n this.props.onExited(node);\n }\n };\n\n public shouldComponentUpdate(nextProps: ICarouselItemProps): boolean {\n if (nextProps.slide || this.props.slide !== nextProps.slide) {\n return true;\n }\n return false;\n }\n\n public render(): JSX.Element | null {\n const {\n children,\n cssModule,\n slide,\n tag,\n className,\n\n in: collapseIn,\n mountOnEnter,\n unmountOnExit,\n appear,\n enter,\n exit,\n timeout,\n onEnter,\n onEntering,\n onEntered,\n onExit,\n onExiting,\n onExited,\n\n ...otherProps\n } = this.props;\n\n const timeoutOrDefault = timeout || TransitionTimeouts.Carousel;\n const Tag = tag || 'div';\n const transitionProps = {\n in: collapseIn,\n mountOnEnter,\n unmountOnExit,\n appear,\n enter,\n exit,\n timeout: timeoutOrDefault\n };\n\n return (\n <CarouselContext.Consumer>\n {({ direction }) => (\n <Transition\n {...transitionProps}\n enter={slide}\n exit={slide}\n in={collapseIn}\n onEnter={this.onEnter}\n onEntering={this.onEntering}\n onExit={this.onExit}\n onExiting={this.onExiting}\n onExited={this.onExited}\n >\n {(status: TransitionStatuses) => {\n const isActive = status === 'entered' || status === 'exiting';\n const directionClassName =\n (status === 'entering' || status === 'exiting') &&\n this.state.startAnimation &&\n (direction === 'right' ? 'msc-carousel__item__left' : 'msc-carousel__item__right');\n const orderClassName =\n status === 'entering' && (direction === 'right' ? 'msc-carousel__item__next' : 'msc-carousel__item__prev');\n const itemClasses = mapToCssModules(\n classNames(className, 'msc-carousel__item', isActive && 'active', directionClassName, orderClassName),\n cssModule\n );\n\n return (\n <Tag className={itemClasses} {...otherProps}>\n {children}\n </Tag>\n );\n }}\n </Transition>\n )}\n </CarouselContext.Consumer>\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 { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n mapToCssModules,\n UncontrolledTooltip\n} from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport debounce from 'lodash/debounce';\nimport * as React from 'react';\n\nimport { ICarouselProps } from './Carousel.props';\nimport CarouselContext from './CarouselContext';\nimport CarouselItem from './CarouselItem';\n\nexport interface ICarouselState {\n direction: string;\n indicatorClicked: boolean;\n}\n\nexport type carouselTransition = 'slide' | 'fade';\n\n/**\n * Carousel component.\n */\nexport default class Carousel extends React.Component<ICarouselProps, ICarouselState> {\n public static defaultProps: Partial<ICarouselProps> = {\n interval: 5000,\n pause: 'hover',\n keyboard: true,\n slide: true,\n hideIndicator: false\n };\n\n public props: ICarouselProps;\n\n public state: ICarouselState;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public cycleInterval?: any;\n\n private scrollStart: number | undefined;\n\n private readonly payLoad: IPayLoad;\n\n private readonly scrollThreshold: number;\n\n private readonly linkRefPrev: React.RefObject<HTMLAnchorElement>;\n\n private readonly linkRefNext: React.RefObject<HTMLAnchorElement>;\n\n private readonly directionTextPrev: string = 'prev';\n\n private readonly directionTextNext: string = 'next';\n\n private readonly nextHandleInputThrottledEvent: (event: React.MouseEvent) => void;\n\n private readonly previousHandleInputThrottledEvent: (event: React.MouseEvent) => void;\n\n private readonly defaultThrottleThreshold: number = 200;\n\n private readonly throttleThreshold: number;\n\n constructor(props: ICarouselProps) {\n super(props);\n this.props = props;\n this.throttleThreshold = this.props.threshold || this.defaultThrottleThreshold;\n this.handleKeyPress = this.handleKeyPress.bind(this);\n this._handleTouchStart = this._handleTouchStart.bind(this);\n this._handleTouchEnd = this._handleTouchEnd.bind(this);\n this.renderItems = this.renderItems.bind(this);\n this.hoverStart = this.hoverStart.bind(this);\n this.scrollThreshold = this.props.touchScrollThreshold !== undefined ? this.props.touchScrollThreshold : 100;\n this.state = {\n direction: 'right',\n indicatorClicked: false\n };\n this._onClickPrev = this._onClickPrev.bind(this);\n this._onClickNext = this._onClickNext.bind(this);\n this._handleKeyPressPrev = this._handleKeyPressPrev.bind(this);\n this._handleKeyPressNext = this._handleKeyPressNext.bind(this);\n this.linkRefPrev = React.createRef();\n this.linkRefNext = React.createRef();\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, '');\n this.nextHandleInputThrottledEvent = debounce(this._onClickNext, this.throttleThreshold);\n this.previousHandleInputThrottledEvent = debounce(this._onClickPrev, this.throttleThreshold);\n }\n\n public componentDidMount(): void {\n // Set up the cycle\n if (this.props.ride === 'carousel') {\n this.setInterval();\n }\n\n if (this.props.keyboard as boolean) {\n document.addEventListener('keyup', this.handleKeyPress);\n }\n }\n\n // eslint-disable-next-line react/no-deprecated\n public componentWillReceiveProps(nextProps: ICarouselProps): void {\n this.setInterval(nextProps);\n\n const { activeIndex } = this.props;\n\n if (activeIndex !== null) {\n // Calculate the direction to turn\n if (activeIndex < nextProps.activeIndex) {\n this.setState({ direction: 'right' });\n } else if (activeIndex > nextProps.activeIndex) {\n this.setState({ direction: 'left' });\n }\n this.setState({ indicatorClicked: false });\n }\n }\n\n public componentWillUnmount(): void {\n this.clearInterval();\n document.removeEventListener('keyup', this.handleKeyPress);\n }\n\n public setInterval = (props: ICarouselProps = this.props) => {\n // Make sure not to have multiple intervals going...\n this.clearInterval();\n\n const { interval, autoplay } = props;\n if (interval && !(autoplay === false)) {\n this.cycleInterval = setInterval(\n () => {\n props.next();\n },\n\n interval\n );\n }\n };\n\n public clearInterval = () => {\n clearInterval(this.cycleInterval);\n };\n\n public hoverStart = (e: React.MouseEvent) => {\n const { pause, mouseEnter } = this.props;\n\n if (pause === 'hover') {\n this.clearInterval();\n }\n\n if (mouseEnter) {\n mouseEnter(e);\n }\n };\n\n public hoverEnd = (e: React.MouseEvent) => {\n const { pause, mouseLeave } = this.props;\n\n if (pause === 'hover') {\n this.setInterval();\n }\n\n if (mouseLeave) {\n mouseLeave(e);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public handleKeyPress = (e: any) => {\n const { keyboard, previous, next } = this.props;\n\n if (keyboard) {\n if (e.keyCode === 37) {\n previous();\n } else if (e.keyCode === 39) {\n next();\n }\n }\n };\n\n public renderItems = (carouselItems: React.ReactNode[], className: string) => {\n const { slide, handleOnExiting, handleOnExited, activeIndex, keys } = this.props;\n\n const slides = ArrayExtensions.hasElements(carouselItems)\n ? carouselItems.map((slotContent: React.ReactNode, index: number) => {\n return (\n <CarouselItem key={keys ? keys[index] : index} onExiting={handleOnExiting} onExited={handleOnExited}>\n {slotContent}\n </CarouselItem>\n );\n })\n : [];\n\n return (\n <div className={className}>\n {/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}\n {slides.map((item: any, index: any) => {\n const isIn = index === activeIndex;\n\n return React.cloneElement(item, {\n in: isIn,\n slide\n });\n })}\n </div>\n );\n };\n\n public shouldComponentUpdate(nextProps: ICarouselProps, nextState: ICarouselState): boolean {\n const hasCurrentKeys = ArrayExtensions.hasElements(this.props.keys);\n const hasNextKeys = ArrayExtensions.hasElements(nextProps.keys);\n const isKeyDifferent = hasCurrentKeys && hasNextKeys && !ArrayExtensions.equals(this.props.keys!, nextProps.keys!);\n return (\n this.state !== nextState ||\n this.props.next !== nextProps.next ||\n this.props.previous !== nextProps.previous ||\n hasCurrentKeys !== hasNextKeys ||\n isKeyDifferent\n );\n }\n\n public render(): JSX.Element | null {\n const {\n cssModule,\n className,\n transitionType,\n dismissEnabled,\n hideFlipper,\n showPaginationTooltip,\n items,\n hideIndicator,\n isDisabledFunctionality\n } = this.props;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function carouselClass(transitionTypeValue: any): any {\n switch (transitionTypeValue) {\n case 'slide':\n return 'slide';\n case 'fade':\n return 'carousel-fade';\n default:\n return null;\n }\n }\n\n const showTooltip = showPaginationTooltip !== undefined ? showPaginationTooltip : true;\n\n const outerClasses = mapToCssModules(classNames(className, 'msc-carousel', carouselClass(transitionType)), cssModule);\n const innerClasses = mapToCssModules(classNames('msc-carousel__inner'), cssModule);\n const dismiss = dismissEnabled && this._renderDismissCarousel();\n const indicators = !hideIndicator && this._renderIndicators(showTooltip);\n const carouselControls = !hideFlipper && this._renderCarouselControls(showTooltip);\n const direction = { direction: this.state.direction };\n if (items && items.length) {\n // Rendering indicators, slides and controls\n return (\n <CarouselContext.Provider value={direction}>\n <div\n className={outerClasses}\n onMouseEnter={isDisabledFunctionality ? undefined : this.hoverStart}\n onMouseLeave={isDisabledFunctionality ? undefined : this.hoverEnd}\n onTouchStart={isDisabledFunctionality ? undefined : this._handleTouchStart}\n onTouchEnd={isDisabledFunctionality ? undefined : this._handleTouchEnd}\n >\n {items && items.length && this.renderItems(items, innerClasses)}\n {!isDisabledFunctionality && items && items.length > 1 && carouselControls}\n {!isDisabledFunctionality && items && items.length > 1 && indicators}\n {dismiss}\n </div>\n </CarouselContext.Provider>\n );\n }\n return null;\n }\n\n private _handleTouchStart(evt: React.TouchEvent<HTMLDivElement>): void {\n if (evt.touches.length === 0) {\n this.scrollStart = undefined;\n } else {\n this.scrollStart = evt.touches[0].screenX;\n }\n }\n\n private _handleTouchEnd(evt: React.TouchEvent<HTMLDivElement>): void {\n if (evt.changedTouches.length > 0 && this.scrollStart !== undefined) {\n const { previous, next } = this.props;\n const newTarget: number = evt.changedTouches[0].screenX;\n\n const delta = newTarget - this.scrollStart;\n\n if (delta > this.scrollThreshold) {\n previous();\n }\n\n if (delta < -this.scrollThreshold) {\n next();\n }\n }\n\n this.scrollStart = undefined;\n }\n\n private _renderIndicators(showTooltip: boolean): JSX.Element {\n const { items, activeIndex, cssModule, onIndicatorsClickHandler, indicatorAriaText } = this.props;\n\n const listClasses = mapToCssModules('msc-carousel__indicators', cssModule);\n const indicators =\n items &&\n items.length &&\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n items.map((item: any, idx: number) => {\n const indicatorClasses = mapToCssModules(classNames({ active: activeIndex === idx }), cssModule);\n\n const label = indicatorAriaText ? format(indicatorAriaText, idx + 1) : '';\n const indicatorId = 'indicatorSlide' + `${idx + 1}`;\n this.payLoad.contentAction.etext = (idx + 1).toString();\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <>\n <li\n id={indicatorId}\n aria-label={label}\n aria-setsize={items.length}\n aria-posinset={idx + 1}\n aria-selected={activeIndex === idx}\n key={`${item.key || item.src}${item.caption}${item.altText}`}\n role='tab'\n tabIndex={0}\n className={indicatorClasses}\n onClick={e => {\n e.preventDefault();\n onIndicatorsClickHandler(idx);\n this.setState({ indicatorClicked: true });\n }}\n {...attribute}\n />\n {showTooltip && (\n <UncontrolledTooltip trigger='hover focus' target={`${indicatorId}`}>\n {label}\n </UncontrolledTooltip>\n )}\n </>\n );\n });\n\n return (\n <ol className={listClasses} role='tablist'>\n {indicators}\n </ol>\n );\n }\n\n private _renderCarouselControls(showTooltip: boolean): JSX.Element {\n const { cssModule, directionTextPrev, directionTextNext } = this.props;\n\n const anchorClassesPrev = mapToCssModules('msc-carousel__control__prev', cssModule);\n const anchorClassesNext = mapToCssModules('msc-carousel__control__next', cssModule);\n const iconClassesPrev = mapToCssModules('msc-carousel__control__prev__icon', cssModule);\n const iconClassesNext = mapToCssModules('msc-carousel__control__next__icon', cssModule);\n const screenReaderClasses = mapToCssModules('screen-reader-only', cssModule);\n const indexNumber: number = 0;\n this.payLoad.contentAction.etext = this.directionTextPrev;\n const prevAttribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n this.payLoad.contentAction.etext = this.directionTextNext;\n const nextAttribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <>\n <a\n className={anchorClassesPrev}\n role='button'\n tabIndex={indexNumber}\n onClick={this.previousHandleInputThrottledEvent}\n onKeyUp={this._handleKeyPressPrev}\n ref={this.linkRefPrev}\n {...prevAttribute}\n >\n <span className={iconClassesPrev} aria-hidden='true' />\n <span className={screenReaderClasses}>{directionTextPrev || this.directionTextPrev}</span>\n </a>\n {showTooltip && (\n <UncontrolledTooltip trigger='hover focus' target={this.linkRefPrev}>\n {directionTextPrev}\n </UncontrolledTooltip>\n )}\n <a\n className={anchorClassesNext}\n role='button'\n tabIndex={indexNumber}\n onClick={this.nextHandleInputThrottledEvent}\n onKeyUp={this._handleKeyPressNext}\n ref={this.linkRefNext}\n {...nextAttribute}\n >\n <span className={iconClassesNext} aria-hidden='true' />\n <span className={screenReaderClasses}>{directionTextNext || this.directionTextNext}</span>\n </a>\n {showTooltip && (\n <UncontrolledTooltip trigger='hover focus' target={this.linkRefNext}>\n {directionTextNext}\n </UncontrolledTooltip>\n )}\n </>\n );\n }\n\n private _onClickPrev(e: React.MouseEvent): void {\n e.preventDefault();\n this.props.previous();\n }\n\n private _onClickNext(e: React.MouseEvent): void {\n e.preventDefault();\n this.props.next();\n }\n\n private readonly _handleKeyPressPrev = (e: React.KeyboardEvent) => {\n if (e.keyCode === 13) {\n e.preventDefault();\n this.props.previous();\n }\n };\n\n private readonly _handleKeyPressNext = (e: React.KeyboardEvent) => {\n // Handle Enter key\n if (e.keyCode === 13) {\n e.preventDefault();\n this.props.next();\n }\n };\n\n private _renderDismissCarousel(): JSX.Element {\n const { handleDismissCarousel, dismissCarouselAriaText } = this.props;\n return (\n <button className='msc-carousel__dismiss msi msi-times' aria-label={dismissCarouselAriaText} onClick={handleDismissCarousel} />\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 { getUrlSync, IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nexport interface ICartIconData {\n cart?: ICartState;\n}\n\nexport interface ICartIconComponentProps extends IComponentProps<ICartIconData> {\n className?: string;\n cartLabel: string;\n cartQtyLabel: string;\n telemetryContent?: ITelemetryContent;\n}\n\nexport interface ICartIconComponent extends IComponent<ICartIconComponentProps> {}\n\nconst CartIconComponentActions = {};\n\n/**\n *\n * CartIcon component.\n * @extends {React.FC<ICartIconComponentProps>}\n */\nconst CartIcon: React.FC<ICartIconComponentProps> = observer((props: ICartIconComponentProps) => {\n const {\n cartLabel,\n cartQtyLabel,\n data: { cart }\n } = props;\n const cartLink = getUrlSync('cart', props.context.actionContext);\n\n // If there are invoice lines, don't update mini cart item quantity\n const cartItem = cart ? cart.totalItemsInCart : 0;\n const qtyLabel = format(cartQtyLabel, cartItem);\n const label = format(cartLabel, cartItem);\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', props.telemetryContent!, 'cart-icon', '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n const style: React.CSSProperties = {\n visibility: cart ? 'visible' : 'hidden'\n };\n return (\n <a\n title={label}\n className='msc-cart-icon msc-btn'\n href={cartLink}\n aria-label={label}\n {...attributes}\n onClick={onTelemetryClick(props.telemetryContent!, payLoad, 'cart-icon')}\n >\n <div className='msc-cart-icon__count' aria-hidden style={style}>\n {qtyLabel}\n </div>\n </a>\n );\n});\n\n// @ts-expect-error\nexport const CartIconComponent: React.FunctionComponent<ICartIconComponentProps> = msdyn365Commerce.createComponent<ICartIconComponent>(\n 'CartIcon',\n { component: CartIcon, ...CartIconComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { CartLine, SalesLine } from '@msdyn365-commerce/retail-proxy';\nimport { debounce } from 'lodash';\nimport { IPriceEditorResources, PriceEditor } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\n/**\n * Resources for the cart line price editor.\n */\nexport interface ICartLinePriceEditorResources extends IPriceEditorResources {}\n\n/**\n * The props required to render the component.\n */\nexport interface ICartLinePriceEditorProps {\n className: string;\n context: ICoreContext;\n\n resources: ICartLinePriceEditorResources;\n\n cartLine: CartLine | SalesLine;\n cartState: ICartState;\n}\n\n/**\n * The props required to render the component.\n */\nexport interface ICartLinePriceEditorState {\n currentValue: number;\n}\n\n/**\n * Quantity Component - This component is used to allow input of quantity between a\n * range of values.\n */\nexport class CartLinePriceEditor extends React.PureComponent<ICartLinePriceEditorProps, ICartLinePriceEditorState> {\n // @ts-expect-error\n private cancellabelDebounce: debounce;\n private readonly waitTime: number = 500;\n\n public constructor(props: ICartLinePriceEditorProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const minimumPrice = 0.01;\n\n return (\n <PriceEditor\n className={this.props.className}\n resources={this.props.resources}\n defaultAmount={this.props.cartLine.Price!}\n maximumValue={this.props.cartLine.InvoiceAmount}\n minimumValue={minimumPrice}\n handleChange={this._handleChange}\n />\n );\n }\n\n /**\n * Handles updates of the input and updates the cart line amount.\n * @param newValue - New entered price for the cart line.\n */\n private readonly _handleChange = async (newValue: number) => {\n if (this.cancellabelDebounce) {\n this.cancellabelDebounce.cancel();\n }\n\n this.cancellabelDebounce = debounce(async () => {\n await this.props.cartState.setInvoiceLinePrice({ cartLineId: this.props.cartLine.LineId ?? null, price: newValue });\n }, this.waitTime);\n\n setTimeout(() => {\n this.cancellabelDebounce();\n }, 0);\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, {\n IComponentProps,\n IGridSettings,\n IImageSettings,\n Image,\n isChannelTypeB2B,\n msdyn365Commerce\n} 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 {\n ArrayExtensions,\n getFallbackImageUrl,\n ObjectExtensions,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classNames from 'classnames';\nimport * as React from 'react';\n\nimport { PriceComponent } from '../price';\nimport { CartLinePriceEditor, ICartLinePriceEditorResources } from './components';\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 screen reader.\n */\n originalPriceText: string;\n\n /**\n * Current text screen reader.\n */\n currentPriceText: string;\n\n /**\n * Shipping Charges Text.\n */\n shippingChargesText: string;\n\n priceEditorResources?: ICartLinePriceEditorResources;\n\n /**\n * Sales agreement price prompt text.\n */\n salesAgreementPricePrompt?: string;\n\n /**\n * Shipping text.\n */\n shippingText?: string;\n\n /**\n * Shipping text.\n */\n confirmedShipDateLabel?: string;\n\n /**\n * Request Delivery text.\n */\n requestDeliveryDateLabel?: string;\n}\n\n/**\n * The data about the cart line and products.\n */\nexport interface ICartLineData {\n cartLine: CartLine | SalesLine;\n cartState?: ICartState;\n product?: SimpleProduct;\n catalogs?: ProductCatalog[];\n}\n\nexport type CartLineDisplayMode = 'DEFAULT' | 'COMPACT';\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 interactivity 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 * Display mode to use.\n */\n displayMode?: CartLineDisplayMode;\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 * The cart line delivery location.\n */\n deliveryLocation?: string;\n\n /**\n * Quantity onChange callback.\n */\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): void;\n priceCurrency?: string;\n\n /**\n * Sales line confirmed ship date.\n */\n confirmedShipDate?: string;\n\n /**\n * Sales line request delivery date.\n */\n requestDeliveryDate?: string;\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\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?.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?.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?.Value}</span>\n </span>\n </div>\n );\n }\n return null;\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 className='msc-cart-line__product-savings-label'>\n {discountLine.OfferName ? discountLine.OfferName : ''}:{` ${props.resources.discountStringText || 'Discount'} `}\n </span>\n <span className='msc-cart-line__promo-codes'>\n {discountLine.DiscountCost && (\n <>\n <PriceComponent\n data={\n props.isSalesLine\n ? {\n price: {\n CustomerContextualPrice: (props.data.cartLine as SalesLine).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__discount-value'\n currencyCode={props.priceCurrency}\n />\n </>\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 - ICartLineProps props.\n * @returns The node representing markup for unit of measure component.\n */\n renderUnitOfMeasure: (props: ICartLineProps) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\n if (\n props.context.app.config &&\n (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none')\n ) {\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 currencyCode={props.priceCurrency}\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 currencyCode={props.priceCurrency}\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 renderConfirmedShipDate: (props: ICartLineProps) => {\n if (!props.isSalesLine || props.confirmedShipDate === undefined || StringExtensions.isNullOrEmpty(props.confirmedShipDate)) {\n return null;\n }\n const shipDateCssName = 'msc-cart-line__confirmed-ship-date';\n return (\n <>\n <span className={shipDateCssName}>{props.resources.confirmedShipDateLabel}</span>\n <span className={shipDateCssName}>{props.confirmedShipDate}</span>\n </>\n );\n },\n\n renderRequestDeliveryDate: (props: ICartLineProps) => {\n if (!props.isSalesLine || props.requestDeliveryDate === undefined || StringExtensions.isNullOrEmpty(props.requestDeliveryDate)) {\n return null;\n }\n const reqDateCssName = 'msc-cart-line__request-delivery-date';\n return (\n <>\n <span className={reqDateCssName}>{props.resources.requestDeliveryDateLabel}</span>\n <span className={reqDateCssName}>{props.requestDeliveryDate}</span>\n </>\n );\n }\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 validateCatalogId(catalogId);\n\n if (!isChannelTypeB2B(props.context.actionContext.requestContext) || !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\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 const fallbackImageUrl =\n product &&\n getFallbackImageUrl(\n product.ItemId,\n props.context.actionContext.requestContext.apiSettings,\n props.context.app?.config?.OmniChannelMedia\n );\n const imageSettings = props.imageSettings;\n imageSettings.cropFocalRegion = !ObjectExtensions.isNullOrUndefined(imageSettings);\n const { inputQuantityAriaLabel } = props.resources;\n const productDimensions = product && CartLineItemFunctions.renderProductDimensions(product, destructDimensionStrings);\n const renderDiscountLines = 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 renderConfirmedShipDate = CartLineItemFunctions.renderConfirmedShipDate(props);\n const renderSalesAgreementPrompt = CartLineItemFunctions.renderSalesAgreementPrompt(props);\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\n const prodAttribute = 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 _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 _updateQuantity = (event: React.ChangeEvent<HTMLSelectElement>) => {\n if (props.quantityOnChange) {\n props.quantityOnChange(props.data.cartLine, Number.parseInt(event.target.value, 10), props.lineIndex);\n }\n };\n\n const _generateMenu = (quantity: number) => {\n const nodes = [];\n\n for (let i = 1; i <= quantity; i++) {\n nodes.push(\n <option className='msc-cart-line__quantity__select-menu__item' value={i}>\n {i}\n </option>\n );\n }\n\n return nodes;\n };\n\n const _generateSelectMenu = (quantity: number, currentQuantity: number | undefined): JSX.Element => {\n return (\n <select\n className='msc-cart-line__quantity__select-menu'\n aria-label={inputQuantityAriaLabel}\n value={currentQuantity}\n onChange={_updateQuantity}\n >\n {_generateMenu(quantity)}\n </select>\n );\n };\n\n const _generateQuantityAndPrice = (): JSX.Element[] | null => {\n const nodes = [];\n\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.isQuantityEditable && !props.data.product?.IsGiftCard) {\n nodes.push(_generateSelectMenu(props.maxQuantity || 10, props.currentQuantity));\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-price'>\n <PriceComponent\n data={\n isSalesLine\n ? {\n price: {\n CustomerContextualPrice: (props.data.cartLine as SalesLine).NetAmountWithAllInclusiveTax,\n BasePrice: (props.data.cartLine as SalesLine).GrossAmount\n }\n }\n : {\n price: {\n CustomerContextualPrice: (props.data.cartLine as CartLine).ExtendedPrice,\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 originalPriceText={resources.originalPriceText}\n currentPriceText={resources.currentPriceText}\n salesAgreementLineId={props.data.cartLine.SalesAgreementLineRecordId}\n currencyCode={props.priceCurrency}\n />\n </div>\n );\n\n return nodes;\n };\n\n if (props.displayMode === 'COMPACT') {\n const reducedDimensions: string = product?.Dimensions\n ? product.Dimensions.reduce<string>((str, productDimension) => {\n if (productDimension.DimensionValue?.Value) {\n if (str) {\n return `${str}, ${productDimension.DimensionValue.Value}`;\n }\n\n return `${productDimension.DimensionValue.Value}`;\n }\n\n return str;\n }, '')\n : '';\n\n return (\n <div className='msc-cart-line msc-cart-line__compact'>\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 {MsDyn365.isBrowser ? (\n <a className='msc-cart-line__product-title' {...prodAttribute} href={productUrl} key={productUrl}>\n {productName}\n </a>\n ) : null}\n {reducedDimensions !== '' ? <div className='msc-cart-line__product-variants'>{reducedDimensions}</div> : ''}\n {renderUnitOfMeasure}\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 {_generateErrorMessage()}\n </div>\n );\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 ?? ''}\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' {...prodAttribute} 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 {renderDiscountLines}\n {renderInventoryLabel}\n {props.showShippingChargesForLineItems && <div className='msc-cart-line__freight'>{renderShippingLabel}</div>}\n {renderOtherCharges}\n {renderConfirmedShipDate}\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\n// @ts-expect-error\nexport const CartLineItemComponent: React.FunctionComponent<ICartLineProps> = msdyn365Commerce.createComponent<ICartline>('CartLineItem', {\n component: CartLine,\n ...CartLineItemFunctions\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { IComponent, IComponentProps, getCatalogId, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { getCartState } from '@msdyn365-commerce/global-state';\nimport {\n addOrderTemplateToCartAction,\n AddOrderTemplateToCartInput,\n OrderTemplate,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n getPayloadObject,\n getTelemetryAttributes,\n IPopupProductsProps,\n ITelemetryContent,\n PopupProducts,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\nimport {\n ILinesAddedToCartDialogResources,\n LinesAddedToCartDialog\n} from '../lines-added-to-cart-dialog/lines-added-to-cart-dialog.component';\n\nexport interface IAddOrderTemplateToCartComponentData {\n orderTemplate: OrderTemplate;\n}\n\nexport interface IAddOrderTemplateToCartComponentProps extends IComponentProps<IAddOrderTemplateToCartComponentData> {\n className?: string;\n parentElementRef?: React.RefObject<Button>;\n addToCartText: string;\n telemetryContent?: ITelemetryContent;\n dialogStrings: {\n closeWindowButtonText: string;\n addToCartFailureMessage: string;\n addToCartSuccessMessage: string;\n addToCartProcessMessage: string;\n orderTemplateErrorMessage: string;\n linesAddedToCartDialogResources: ILinesAddedToCartDialogResources;\n };\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nexport declare type IAddToCartActionFailureReason = 'EMPTYINPUT' | 'MISSINGDIMENSION' | 'OUTOFSTOCK' | 'CARTACTIONFAILED'; // Rename to used method\n\nexport interface IAddOrderTemplateToCartComponent extends IComponent<IAddOrderTemplateToCartComponentProps> {\n onClick(): (event: React.MouseEvent<HTMLElement>, props: IAddOrderTemplateToCartComponentProps) => void;\n}\n\nconst onClick = async (\n _event: React.MouseEvent<HTMLElement>,\n props: IAddOrderTemplateToCartComponentProps,\n setUploadStatus: (uploadStatus: addOrderTemplateToCartStatus) => void,\n openModal: (opened: boolean) => void,\n setLinesAddedToCartDialogOpen: (opened: boolean) => void,\n setAddedLinesCount: (value: number) => void,\n setErrorMessage: (message: string) => void\n): Promise<void> => {\n openModal(true);\n setUploadStatus('LOADING');\n const { context, dialogStrings } = props;\n // assuming selected catalogId will be passed to component and if not passed then get from context\n const catalogId = props.catalogId ?? getCatalogId(props.context.actionContext.requestContext);\n validateCatalogId(catalogId);\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n const addOrderTemplateToCartInput = isMultipleCatalogFeatureEnabledInHq\n ? new AddOrderTemplateToCartInput(props.data.orderTemplate.productList.Id, isMultipleCatalogFeatureEnabledInHq)\n : new AddOrderTemplateToCartInput(props.data.orderTemplate.productList.Id);\n try {\n const cartState = await getCartState(context.actionContext);\n const cart = cartState.cart;\n const hasInvoiceInCart = cart?.CartLines?.find(cartLine => cartLine.IsInvoiceLine === true);\n if (hasInvoiceInCart) {\n setErrorMessage('Can not add items to a cart containing an invoice.');\n setUploadStatus('FAILED');\n } else {\n const addedCartLines = await addOrderTemplateToCartAction(addOrderTemplateToCartInput, context.actionContext);\n setAddedLinesCount(addedCartLines.length);\n openModal(false);\n setTimeout(() => {\n setLinesAddedToCartDialogOpen(true);\n }, 500);\n setErrorMessage('');\n }\n } catch (error) {\n setErrorMessage(dialogStrings.orderTemplateErrorMessage);\n setUploadStatus('FAILED');\n }\n};\n\nconst AddToCartComponentActions = {\n onClick\n};\n\nexport type addOrderTemplateToCartStatus = 'LOADING' | 'SUCCESS' | 'FAILED' | 'WAITING';\n\nconst _getModalText = (status: addOrderTemplateToCartStatus, props: IAddOrderTemplateToCartComponentProps, errorMsg: string) => {\n const { dialogStrings } = props;\n const { addToCartFailureMessage, addToCartSuccessMessage, addToCartProcessMessage } = dialogStrings;\n\n if (status === 'LOADING') {\n return `${addToCartProcessMessage}...`;\n }\n\n if (status === 'SUCCESS') {\n return addToCartSuccessMessage;\n }\n\n if (status === 'FAILED') {\n return errorMsg !== null ? errorMsg : addToCartFailureMessage;\n }\n\n return '';\n};\n\nlet buttonEventReference: HTMLButtonElement | undefined;\n\nconst AddOrderTemplate: React.FC<IAddOrderTemplateToCartComponentProps> = (props: IAddOrderTemplateToCartComponentProps) => {\n const [uploadStatus, setUploadStatus] = useState<addOrderTemplateToCartStatus>('WAITING');\n const [modalOpen, setModalOpen] = useState(false);\n const [addedLinesCount, setAddedLinesCount] = useState(0);\n const [linesAddedToCartDialogOpen, setLinesAddedToCartDialogOpen] = useState(false);\n const [errorMessage, setErrorMessage] = useState('');\n\n const onClickHandler = async (event: React.MouseEvent<HTMLElement>) => {\n buttonEventReference = event.target as HTMLButtonElement;\n await AddToCartComponentActions.onClick(\n event,\n props,\n setUploadStatus,\n setModalOpen,\n setLinesAddedToCartDialogOpen,\n setAddedLinesCount,\n setErrorMessage\n );\n };\n const closeLinesAddedToCartDialog = () => {\n setLinesAddedToCartDialogOpen(false);\n setErrorMessage('');\n buttonEventReference?.focus();\n };\n\n const modalText = _getModalText(uploadStatus, props, errorMessage);\n const processStatusClass = uploadStatus.toLowerCase();\n const dialogStrings = { closeWindowButtonText: props.dialogStrings.closeWindowButtonText };\n const payLoad = getPayloadObject('click', props.telemetryContent!, TelemetryConstant.AddOrderTemplateToCart);\n const addOrderTemplateAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n const popupProps: IPopupProductsProps = {\n dialogStrings,\n className: 'msc-add-order-template-to-cart',\n processStatusClass,\n text: modalText,\n modalOpen,\n setModalOpen\n };\n\n const renderModalPopup = <PopupProducts {...popupProps} />;\n\n const products = props.data.orderTemplate.orderTemplateLines\n .map(line => line.fullProduct)\n .filter(fullProduct => fullProduct) as FullProduct[];\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n return (\n <>\n {renderModalPopup}\n <button\n className={classnames(\n 'msc-add-order-template-to-cart msc-btn',\n props.className,\n props.data.orderTemplate.totalLines === 0 ? 'disabled' : ''\n )}\n aria-label={props.addToCartText}\n disabled={props.data.orderTemplate.totalLines === 0}\n type='button'\n onClick={onClickHandler}\n {...addOrderTemplateAttribute}\n >\n {props.addToCartText}\n </button>\n <LinesAddedToCartDialog\n className='msc-lines-added-to-cart-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={props.dialogStrings.linesAddedToCartDialogResources}\n data={{\n linesCount: addedLinesCount,\n orderTemplate: props.data.orderTemplate.productList,\n products\n }}\n modalOpen={linesAddedToCartDialogOpen}\n onClose={closeLinesAddedToCartDialog}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq || false}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n </>\n );\n};\n\nexport const AddOrderTemplateToCartComponent: React.FunctionComponent<IAddOrderTemplateToCartComponentProps> =\n // @ts-expect-error -- As per design, custom component\n msdyn365Commerce.createComponent<IAddOrderTemplateToCartComponent>('AddOrderTemplate', {\n component: AddOrderTemplate,\n ...AddToCartComponentActions\n });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport {\n IOrderTemplateNameDialogResources,\n OrderTemplateNameDialog\n} from '../order-template-name-dialog/order-template-name-dialog.component';\n\nexport interface IRenameOrderTemplateComponentProps extends IComponentProps<IRenameOrderTemplateData> {\n className?: string;\n renameOrderTemplateDialogStrings: IOrderTemplateNameDialogResources;\n renameOrderTemplateButtonText: string;\n onRenameTemplate(orderTemplate: ProductList): Promise<void>;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\ninterface IRenameOrderTemplateData {\n orderTemplate: ProductList;\n}\n\nexport interface IRenameOrderTemplateComponent extends IComponent<IRenameOrderTemplateComponentProps> {}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- For backward compatibility\nconst RenameOrderTemplateComponentActions = {};\nlet buttonEventReference: HTMLButtonElement | undefined;\n\nconst RenameOrderTemplate: React.FC<IRenameOrderTemplateComponentProps> = (props: IRenameOrderTemplateComponentProps) => {\n const {\n data: { orderTemplate },\n renameOrderTemplateButtonText,\n renameOrderTemplateDialogStrings,\n context\n } = props;\n const [renameOrderTemplateDialogOpen, setOrderTemplateNameDialogOpen] = React.useState(false);\n const onOrderTemplateNameCancel = () => {\n context.telemetry.debug('Rename of template was canceled.');\n buttonEventReference?.focus();\n };\n\n const onRenameButtonClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n buttonEventReference = event.target as HTMLButtonElement;\n setOrderTemplateNameDialogOpen(true);\n };\n return (\n <>\n <Button className='ms-order-template-action-bar__rename-template-button' onClick={onRenameButtonClick}>\n {renameOrderTemplateButtonText}\n </Button>\n <OrderTemplateNameDialog\n existingOrderTemplate={orderTemplate}\n isUpdateDialog\n className='msc-order-template-name-dialog'\n modalOpen={renameOrderTemplateDialogOpen}\n setModalOpen={setOrderTemplateNameDialogOpen}\n context={context}\n id={props.id}\n data={props.data}\n orderTemplateName={props.data.orderTemplate.Name}\n typeName={props.typeName}\n dialogStrings={renameOrderTemplateDialogStrings}\n onCancel={onOrderTemplateNameCancel}\n onSuccess={props.onRenameTemplate}\n />\n </>\n );\n};\n\nexport const RenameOrderTemplateComponent: React.FunctionComponent<IRenameOrderTemplateComponentProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IRenameOrderTemplateComponent\n>('RenameOrderTemplate', { component: RenameOrderTemplate, ...RenameOrderTemplateComponentActions });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { getUrlSync, IComponentProps, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { OrderTemplateProductsPreviewComponent } from '../order-templates-list/order-template-products-preview';\n\nexport interface ILinesAddedToCartDialogResources {\n viewCartButtonText: string;\n orderTemplateCloseButtonText: string;\n linesAddedToCartHeaderItemsOneText: string;\n linesAddedToCartHeaderLinesOneText: string;\n linesAddedToCartHeaderLinesFormatText: string;\n linesAddedToCartHeaderMessageText: string;\n}\n\nexport interface ILinesAddedToCartDialogData {\n linesCount: number;\n orderTemplate: ProductList;\n products: FullProduct[];\n}\n\nexport interface ILinesAddedToCartDialogProps extends IComponentProps<ILinesAddedToCartDialogData> {\n className: string;\n imageSettings?: IImageSettings;\n\n dialogStrings: ILinesAddedToCartDialogResources;\n\n modalOpen: boolean | undefined;\n onClose(): void;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nexport const LinesAddedToCartDialog = (dialogProps: ILinesAddedToCartDialogProps) => {\n const {\n dialogStrings,\n className,\n context,\n modalOpen,\n imageSettings,\n data: { orderTemplate, products, linesCount }\n } = dialogProps;\n\n const getCartPageUrl = (): string => {\n return getUrlSync('cart', context.actionContext) || '';\n };\n\n const close: () => void = () => {\n dialogProps.onClose();\n };\n\n const lineItemsString =\n linesCount === 1\n ? dialogStrings.linesAddedToCartHeaderLinesOneText\n : dialogStrings.linesAddedToCartHeaderLinesFormatText.replace('{0}', linesCount.toString());\n\n return (\n <Modal isOpen={modalOpen} className={`${className}`} toggle={close}>\n <ModalHeader className={`${className}__dialog__header`} toggle={close}>\n <b>{dialogStrings.linesAddedToCartHeaderItemsOneText}</b>\n <span>{dialogStrings.linesAddedToCartHeaderMessageText}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <OrderTemplateProductsPreviewComponent\n context={context}\n className={`${className}__dialog`}\n products={products}\n imageSettings={imageSettings}\n />\n <div className={`${className}__dialog__description`}>\n <div className={`${className}__dialog__order-template-name`}>{orderTemplate.Name}</div>\n <div className={`${className}__dialog__order-template-items`}>{lineItemsString}</div>\n </div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__view-cart-button`}\n title={dialogStrings.viewCartButtonText}\n href={getCartPageUrl()}\n >\n {dialogStrings.viewCartButtonText}\n </Button>\n <Button\n className={`${className}__dialog__continue-shopping`}\n title={dialogStrings.orderTemplateCloseButtonText}\n onClick={close}\n >\n {dialogStrings.orderTemplateCloseButtonText}\n </Button>\n </ModalFooter>\n </Modal>\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 { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport {\n createOrderTemplate,\n CreateOrderTemplateInput,\n StringExtensions,\n updateOrderTemplateHeader,\n UpdateOrderTemplateHeaderInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nexport interface IOrderTemplateNameDialogResources {\n orderTemplateHeaderLabel: string;\n orderTemplateTitleLabel: string;\n orderTemplateNameAriaLabel: string;\n orderTemplateDescription: string;\n defaultOrderTemplateName: string;\n orderTemplateButtonLabel: string;\n orderTemplateCancelButtonLabel: string;\n orderTemplateModalAriaLabel?: string;\n}\n\nexport interface IOrderTemplateNameDialogProps extends IComponentProps {\n isUpdateDialog: boolean | undefined;\n existingOrderTemplate?: ProductList;\n className: string;\n orderTemplateName?: string;\n dialogStrings: IOrderTemplateNameDialogResources;\n modalOpen: boolean | undefined;\n parentElementRef?: React.RefObject<HTMLButtonElement>;\n setModalOpen(newValue: boolean): void;\n onCancel(): void;\n onSuccess(orderTemplate: ProductList): Promise<void>;\n}\n\nexport const OrderTemplateNameDialog = (dialogProps: IOrderTemplateNameDialogProps) => {\n const {\n isUpdateDialog,\n existingOrderTemplate,\n dialogStrings,\n className,\n modalOpen,\n setModalOpen,\n onCancel,\n onSuccess,\n context,\n parentElementRef\n } = dialogProps;\n\n if (!dialogStrings) {\n return null;\n }\n\n const [orderTemplateName, setOrderTemplateName] = useState(dialogProps.orderTemplateName);\n\n const cancel: () => void = () => {\n setModalOpen(false);\n onCancel();\n setOrderTemplateName('');\n if (parentElementRef) {\n parentElementRef.current?.focus();\n }\n };\n\n const submit: () => Promise<void> = async () => {\n dialogProps.orderTemplateName = orderTemplateName || dialogStrings.defaultOrderTemplateName;\n if (StringExtensions.isNullOrWhitespace(dialogProps.orderTemplateName)) {\n return;\n }\n if (isUpdateDialog) {\n if (existingOrderTemplate) {\n existingOrderTemplate.Name = dialogProps.orderTemplateName;\n const input: UpdateOrderTemplateHeaderInput = new UpdateOrderTemplateHeaderInput(existingOrderTemplate);\n const orderTemplate: ProductList = await updateOrderTemplateHeader(input, context.actionContext);\n setModalOpen(false);\n await onSuccess(orderTemplate);\n } else {\n context.telemetry.error('You need to pass ProductList instance for update.');\n throw new Error('Unexpected error: existing order template was not set.');\n }\n } else {\n const input: CreateOrderTemplateInput = new CreateOrderTemplateInput(dialogProps.orderTemplateName);\n const orderTemplate: ProductList = await createOrderTemplate(input, context.actionContext);\n setModalOpen(false);\n await onSuccess(orderTemplate);\n }\n };\n\n const updateOrderTemplateName = (event: React.ChangeEvent<HTMLInputElement>) => {\n setOrderTemplateName(event.target.value);\n };\n\n return (\n <Modal\n isOpen={modalOpen}\n className={`${className} msc-modal-input-required`}\n toggle={cancel}\n aria-label={dialogStrings.orderTemplateModalAriaLabel}\n >\n <ModalHeader className={`${className}__dialog__header`} toggle={cancel}>\n <span aria-live='assertive'>{dialogStrings.orderTemplateHeaderLabel}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <label\n className={`${className}__dialog__order-template-name-label`}\n htmlFor={`${className}__dialog__order-template-name`}\n >\n {dialogStrings.orderTemplateTitleLabel}\n </label>\n <input\n className={`${className}__dialog__order-template-name`}\n type='text'\n aria-label={dialogStrings.orderTemplateNameAriaLabel}\n placeholder={dialogStrings.defaultOrderTemplateName}\n onChange={updateOrderTemplateName}\n value={orderTemplateName}\n maxLength={250}\n />\n <div className={`${className}__dialog__description`}>{dialogStrings.orderTemplateDescription}</div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__create-order-template-button`}\n title={dialogStrings.orderTemplateButtonLabel}\n aria-label={dialogStrings.orderTemplateButtonLabel}\n onClick={submit}\n >\n {dialogStrings.orderTemplateButtonLabel}\n </Button>\n <Button\n className={`${className}__dialog__cancel-button`}\n title={dialogStrings.orderTemplateCancelButtonLabel}\n aria-label={dialogStrings.orderTemplateCancelButtonLabel}\n onClick={cancel}\n >\n {dialogStrings.orderTemplateCancelButtonLabel}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, format } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { OrderTemplateProductsPreviewComponent } from './order-template-products-preview';\n\nexport interface IOrderTemplateComponentProps {\n className: string;\n orderTemplate: OrderTemplate;\n context: ICoreContext;\n imageSettings?: IImageSettings;\n actionButtonText: string;\n lineItemsText: string;\n orderTemplateAction(orderTemplate: ProductList): Promise<void>;\n}\n\nexport const OrderTemplateComponent = (props: IOrderTemplateComponentProps) => {\n const { orderTemplate, className, imageSettings } = props;\n\n const onActionButtonClick = () => {\n return props.orderTemplateAction(props.orderTemplate.productList);\n };\n\n const products = orderTemplate.orderTemplateLines.map(line => line.fullProduct).filter(fullProduct => fullProduct);\n\n return (\n <div className={`${className}__container`}>\n <div className={`${className}__item_header`}>\n <div className={`${className}__title`}>{orderTemplate.productList.Name}</div>\n <div className={`${className}__count`}>{format(props.lineItemsText, orderTemplate.totalLines)}</div>\n </div>\n <OrderTemplateProductsPreviewComponent\n context={props.context}\n className={className}\n products={products as FullProduct[]}\n imageSettings={imageSettings}\n />\n <div className={`${className}__footer`}>\n <Button className={`${className}__action-button`} title={props.actionButtonText} onClick={onActionButtonClick}>\n {props.actionButtonText}\n </Button>\n </div>\n </div>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getAsset, IComponentProps, Image } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { OrderTemplate } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React, { useState } from 'react';\n\nimport {\n IOrderTemplateNameDialogResources,\n OrderTemplateNameDialog\n} from '../order-template-name-dialog/order-template-name-dialog.component';\nimport { OrderTemplateComponent } from '../order-templates-list/order-template-list';\n\nexport interface IAddToOrderTemplateDialogData {\n orderTemplates: OrderTemplate[];\n}\n\nexport interface IAddToOrderTemplateDialogResources {\n addToOrderTemplateHeader: string;\n\n noOrderTemplatesMessage: string;\n noOrderTemplatesDescription: string;\n\n createAnOrderTemplateButtonText: string;\n createNewOrderTemplateButtonText: string;\n cancelOrderTemplateCreationButtonText: string;\n\n selectTemplatesText: string;\n addToTemplateButtonText: string;\n lineItemsText: string;\n}\n\nexport interface IAddToOrderTemplateDialogProps extends IComponentProps<IAddToOrderTemplateDialogData> {\n className: string;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n\n modalOpen: boolean | undefined;\n setModalOpen(newValue: boolean): void;\n onOrderTemplateSelected(orderTemplate: ProductList): Promise<void>;\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nconst renderAddToOrderTemplatesWhenEmptyOrderTemplatesDialog = (\n dialogProps: IAddToOrderTemplateDialogProps,\n className: string,\n closeDialog: () => void,\n showOrderTemplateNameDialog: () => void\n) => {\n const { addToOrderTemplateDialogResources, modalOpen } = dialogProps;\n\n const createOrderTemplateImageUrl = `${getAsset('images/order-templates/create-order-template.svg', dialogProps.context.request)}`;\n\n return (\n <>\n <Modal isOpen={modalOpen} className={`${className} msc-modal-input-required`} toggle={closeDialog}>\n <ModalHeader className={`${className}__dialog__header`} toggle={closeDialog}>\n <span>{addToOrderTemplateDialogResources.addToOrderTemplateHeader}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <div className={`${className}__dialog__create-order-template-image-container`}>\n <Image\n altText={addToOrderTemplateDialogResources.createNewOrderTemplateButtonText}\n requestContext={dialogProps.context.actionContext.requestContext}\n className={`${className}__dialog__create-order-template-image`}\n src={createOrderTemplateImageUrl}\n gridSettings={dialogProps.context.request.gridSettings!}\n loadFailureBehavior='empty'\n />\n </div>\n <div className={`${className}__dialog__no-order-templates`}>\n {addToOrderTemplateDialogResources.noOrderTemplatesMessage}\n </div>\n <div className={`${className}__dialog__no-order-templates-description`}>\n {addToOrderTemplateDialogResources.noOrderTemplatesDescription}\n </div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__create-order-template-button`}\n title={addToOrderTemplateDialogResources.createAnOrderTemplateButtonText}\n onClick={showOrderTemplateNameDialog}\n >\n {addToOrderTemplateDialogResources.createAnOrderTemplateButtonText}\n </Button>\n <Button\n className={`${className}__dialog__cancel-button`}\n title={addToOrderTemplateDialogResources.cancelOrderTemplateCreationButtonText}\n onClick={closeDialog}\n >\n {addToOrderTemplateDialogResources.cancelOrderTemplateCreationButtonText}\n </Button>\n </ModalFooter>\n </Modal>\n </>\n );\n};\n\nconst formatBold = (text: string, boldText: string) => {\n const patternToFind = '{0}';\n return (\n <>\n {text.slice(0, text.indexOf(patternToFind))}\n <b>{boldText}</b>\n {text.slice(text.indexOf(patternToFind) + patternToFind.length)}\n </>\n );\n};\n\nconst renderAddToOrderTemplatesForExistingOrderTemplatesDialog = (\n dialogProps: IAddToOrderTemplateDialogProps,\n className: string,\n closeDialog: () => void,\n showOrderTemplateNameDialog: () => void,\n onAddToOrderTemplateButtonClick: (orderTemplate: ProductList) => Promise<void>\n) => {\n const {\n addToOrderTemplateDialogResources,\n modalOpen,\n data: { orderTemplates }\n } = dialogProps;\n\n const createOrderTemplateImageUrl = `${getAsset('images/order-templates/create-order-template.svg', dialogProps.context.request)}`;\n\n return (\n <>\n <Modal isOpen={modalOpen} className={`${className} msc-modal-input-required`} toggle={closeDialog}>\n <ModalHeader className={`${className}__dialog__header`} toggle={closeDialog}>\n <span>{addToOrderTemplateDialogResources.addToOrderTemplateHeader}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <div className={`${className}__dialog__order-templates-description`}>\n {formatBold(addToOrderTemplateDialogResources.selectTemplatesText, orderTemplates.length.toString())}\n </div>\n <div className={`${className}__dialog__order-templates-container`}>\n <div\n className={classnames(\n `${className}__dialog__order-templates-line__container`,\n `${className}__dialog__order-templates-line__container__create-new-line`\n )}\n >\n <Image\n altText={addToOrderTemplateDialogResources.createNewOrderTemplateButtonText}\n requestContext={dialogProps.context.actionContext.requestContext}\n className={`${className}__dialog__order-templates-line__container__create-new-line__image`}\n src={createOrderTemplateImageUrl}\n gridSettings={dialogProps.context.request.gridSettings!}\n loadFailureBehavior='empty'\n />\n <Button\n className={`${className}__dialog__order-templates-line__container__create-new-line__button`}\n onClick={showOrderTemplateNameDialog}\n >\n {addToOrderTemplateDialogResources.createNewOrderTemplateButtonText}\n </Button>\n </div>\n {orderTemplates.map((orderTemplate, index) => {\n return (\n <OrderTemplateComponent\n key={index}\n className={`${className}__dialog__order-templates-line`}\n orderTemplate={orderTemplate}\n context={dialogProps.context}\n actionButtonText={addToOrderTemplateDialogResources.addToTemplateButtonText}\n lineItemsText={addToOrderTemplateDialogResources.lineItemsText}\n orderTemplateAction={onAddToOrderTemplateButtonClick}\n />\n );\n })}\n </div>\n </div>\n </ModalBody>\n </Modal>\n </>\n );\n};\n\nexport const AddToOrderTemplateDialog = (dialogProps: IAddToOrderTemplateDialogProps) => {\n const {\n setModalOpen,\n data: { orderTemplates },\n className\n } = dialogProps;\n\n const closeDialog = () => {\n setModalOpen(false);\n };\n\n const [isCreateOrderTemplateDialogOpen, setOrderTemplateNameDialogOpen] = useState(false);\n const showOrderTemplateNameDialog = () => {\n setModalOpen(false);\n setTimeout(() => {\n setOrderTemplateNameDialogOpen(true);\n }, 500);\n };\n const onCreateOrderTemplateCancel = () => {\n setTimeout(() => {\n setModalOpen(true);\n }, 500);\n };\n\n let addToOrderTemplateDialog: JSX.Element;\n if (orderTemplates.length !== 0) {\n addToOrderTemplateDialog = renderAddToOrderTemplatesForExistingOrderTemplatesDialog(\n dialogProps,\n `${className}__existing`,\n closeDialog,\n showOrderTemplateNameDialog,\n dialogProps.onOrderTemplateSelected\n );\n } else {\n addToOrderTemplateDialog = renderAddToOrderTemplatesWhenEmptyOrderTemplatesDialog(\n dialogProps,\n `${className}__empty`,\n closeDialog,\n showOrderTemplateNameDialog\n );\n }\n\n return (\n <>\n {addToOrderTemplateDialog}\n <OrderTemplateNameDialog\n className='msc-order-template-name-dialog'\n modalOpen={isCreateOrderTemplateDialogOpen}\n isUpdateDialog={false}\n setModalOpen={setOrderTemplateNameDialogOpen}\n context={dialogProps.context}\n id={dialogProps.id}\n data={{}}\n typeName={dialogProps.typeName}\n dialogStrings={dialogProps.createOrderTemplateDialogResources}\n onCancel={onCreateOrderTemplateCancel}\n onSuccess={dialogProps.onOrderTemplateSelected}\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 { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { getUrlSync, IComponentProps, IImageSettings } from '@msdyn365-commerce/core';\nimport { ProductList } from '@msdyn365-commerce/retail-proxy';\nimport { ProductDimensionType } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { OrderTemplateProductsPreviewComponent } from '../order-templates-list/order-template-products-preview';\n\nexport interface ILinesAddedToOrderTemplateDialogResources {\n viewOrderTemplateButtonText: string;\n continueShoppingButtonText: string;\n linesAddedToOrderTemplateHeaderItemsOneText: string;\n linesAddedToOrderTemplateHeaderItemsFormatText: string;\n linesAddedToOrderTemplateHeaderLinesOneText: string;\n linesAddedToOrderTemplateHeaderLinesFormatText: string;\n linesAddedToOrderTemplateHeaderMessageText: string;\n linesAddedToOrderTemplateCustomPriceAlertMessageText?: string;\n}\n\nexport interface ILinesAddedToOrderTemplateDialogData {\n itemsCount: number;\n linesCount: number;\n orderTemplate: ProductList;\n products: FullProduct[];\n}\n\nexport interface ILinesAddedToOrderTemplateDialogProps extends IComponentProps<ILinesAddedToOrderTemplateDialogData> {\n className: string;\n imageSettings?: IImageSettings;\n\n dialogStrings: ILinesAddedToOrderTemplateDialogResources;\n\n modalOpen: boolean | undefined;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nexport const LinesAddedToOrderTemplateDialog = (dialogProps: ILinesAddedToOrderTemplateDialogProps) => {\n const {\n dialogStrings,\n className,\n context,\n modalOpen,\n imageSettings,\n data: { orderTemplate, products, itemsCount, linesCount }\n } = dialogProps;\n\n const getOrderTemplatePageUrl = (): string => {\n const url = getUrlSync('ordertemplate', context.actionContext) || '';\n const separator = url.includes('?') ? '&' : '?';\n return `${url}${separator}id=${orderTemplate.Id}`;\n };\n\n const close = React.useCallback(() => {\n window.location.reload(true);\n }, []);\n\n const itemsString =\n itemsCount === 1\n ? dialogStrings.linesAddedToOrderTemplateHeaderItemsOneText\n : dialogStrings.linesAddedToOrderTemplateHeaderItemsFormatText.replace('{0}', itemsCount.toString());\n const lineItemsString =\n linesCount === 1\n ? dialogStrings.linesAddedToOrderTemplateHeaderLinesOneText\n : dialogStrings.linesAddedToOrderTemplateHeaderLinesFormatText.replace('{0}', linesCount.toString());\n\n const addedProducts = products.filter(\n product =>\n !product.ProductDetails.Dimensions?.find(\n dimension => dimension.DimensionTypeValue === ProductDimensionType.Style && dimension.DimensionValue?.Value === 'Custom'\n )\n );\n const filteredProducts = products.filter(product =>\n product.ProductDetails.Dimensions?.find(\n dimension => dimension.DimensionTypeValue === ProductDimensionType.Style && dimension.DimensionValue?.Value === 'Custom'\n )\n );\n\n return (\n <Modal isOpen={modalOpen} className={`${className}`} toggle={close}>\n <ModalHeader className={`${className}__dialog__header`} toggle={close}>\n <b>{lineItemsString}</b>\n <span aria-live='assertive'>{dialogStrings.linesAddedToOrderTemplateHeaderMessageText}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <OrderTemplateProductsPreviewComponent\n context={context}\n className={`${className}__dialog`}\n products={addedProducts}\n imageSettings={imageSettings}\n />\n <div className={`${className}__dialog__description`}>\n <div className={`${className}__dialog__order-template-name`}>{orderTemplate.Name}</div>\n <div className={`${className}__dialog__order-template-items`}>{itemsString}</div>\n </div>\n {ArrayExtensions.hasElements(filteredProducts) ? (\n <>\n <Alert color='danger' assertive aria-label={dialogStrings.linesAddedToOrderTemplateCustomPriceAlertMessageText}>\n <div className='msc-alert__header'>\n <span className='msi-exclamation-triangle' />\n <span>{dialogStrings.linesAddedToOrderTemplateCustomPriceAlertMessageText}</span>\n </div>\n </Alert>\n <OrderTemplateProductsPreviewComponent\n context={context}\n className={`${className}__dialog`}\n products={filteredProducts}\n imageSettings={imageSettings}\n />\n </>\n ) : null}\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__view-order-template-button`}\n title={dialogStrings.viewOrderTemplateButtonText}\n href={getOrderTemplatePageUrl()}\n >\n {dialogStrings.viewOrderTemplateButtonText}\n </Button>\n <Button\n className={`${className}__dialog__continue-shopping`}\n title={dialogStrings.continueShoppingButtonText}\n onClick={close}\n >\n {dialogStrings.continueShoppingButtonText}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, getCatalogId, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { Customer, ProductList, ProductListLine, ProductListsDataActions } from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n FullProductInput,\n getFullProducts,\n getProductDetailsCriteriaFromActionInput,\n OrderTemplate,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport {\n AddToOrderTemplateDialog,\n IAddToOrderTemplateDialogResources\n} from '../add-to-order-template-dialog/add-to-order-template-dialog.component';\nimport {\n ILinesAddedToOrderTemplateDialogResources,\n LinesAddedToOrderTemplateDialog\n} from '../lines-added-to-order-template-dialog/lines-added-to-order-template-dialog.component';\nimport { IOrderTemplateNameDialogResources } from '../order-template-name-dialog/order-template-name-dialog.component';\n\n/**\n * Data for the add products to order template component.\n */\nexport interface IAddProductsToOrderTemplateData {\n orderTemplates: OrderTemplate[];\n products: ProductListLine[];\n\n customerInformation?: Customer;\n}\n\n/**\n * Resources for the add products to order template component.\n */\nexport interface IAddProductsToOrderTemplateResources\n extends IAddToOrderTemplateDialogResources,\n IOrderTemplateNameDialogResources,\n ILinesAddedToOrderTemplateDialogResources {\n addProductsToOrderTemplateButton: string;\n addProductsToOrderTemplateButtonTooltip: string;\n}\n\n/**\n * Props for the add products to order template component.\n */\nexport interface IAddProductsToOrderTemplateProps {\n className: string;\n\n context: ICoreContext;\n\n data: IAddProductsToOrderTemplateData;\n\n resources: IAddProductsToOrderTemplateResources;\n\n isDisabled?: boolean;\n\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nconst modalTimeoutTime = 500;\n\n/**\n * Add products to order template component.\n * @param props - Component props.\n * @returns React node.\n */\nexport const AddProductsToOrderTemplateComponent: React.FC<IAddProductsToOrderTemplateProps> = (\n props: IAddProductsToOrderTemplateProps\n) => {\n const [chosenOrderTemplate, setChosenOrderTemplate] = useState<ProductList | undefined>(undefined);\n const [addedProducts, setAddedProducts] = useState<FullProduct[] | undefined>(undefined);\n const [isAddToOrderTemplateModalOpen, setIsAddToOrderTemplateModalOpen] = useState(false);\n const [isLinesAddedToOrderTemplateDialogOpen, setIsLinesAddedToOrderTemplateDialogOpen] = useState(false);\n const [addedLinesCount, setAddedLinesCount] = useState(0);\n const [addedItemsCount, setAddedItemsCount] = useState(0);\n\n /**\n * Adds product to the selected order template.\n * @param orderTemplate - Order template to use for adding products.\n */\n const onOrderTemplateSelected = React.useCallback(\n async (orderTemplate: ProductList) => {\n setChosenOrderTemplate(orderTemplate);\n // assuming selected catalogId will be passed to component and if not passed then get from context\n const catalogId = props.catalogId ?? getCatalogId(props.context.actionContext.requestContext);\n validateCatalogId(catalogId);\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n const linesToAdd: ProductListLine[] = props.data.products.map(line => {\n return {\n ...line,\n ...(isMultipleCatalogFeatureEnabledInHq && { catalogId: line.CatalogId || catalogId }),\n ProductListId: orderTemplate.Id\n };\n });\n\n const allProductInputs: FullProductInput[] = [];\n for (const listLine of linesToAdd) {\n if (listLine.ProductId) {\n allProductInputs.push(\n new FullProductInput(\n listLine.ProductId,\n props.context.actionContext.requestContext.apiSettings,\n getProductDetailsCriteriaFromActionInput(props.context.actionContext),\n props.context.actionContext.requestContext\n )\n );\n }\n }\n\n const allProducts = await getFullProducts(allProductInputs, props.context.actionContext);\n\n const addedLines = await ProductListsDataActions.addProductListLinesAsync(\n { callerContext: props.context.actionContext },\n orderTemplate.Id,\n linesToAdd\n );\n\n const quantities = addedLines.map(line => line.Quantity ?? 0);\n setAddedLinesCount(addedLines.length);\n setAddedItemsCount(ArrayExtensions.hasElements(quantities) ? ArrayExtensions.calculateSum(quantities) : 0);\n setAddedProducts(allProducts);\n\n setIsAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setIsLinesAddedToOrderTemplateDialogOpen(true);\n }, modalTimeoutTime);\n },\n [props.context.actionContext, props.data.products]\n );\n\n const onAddProductsToOrderTemplateClick = React.useCallback(() => {\n setIsAddToOrderTemplateModalOpen(true);\n }, []);\n\n if (!isChannelTypeB2B(props.context.actionContext.requestContext)) {\n return null;\n }\n\n const addToOrderTemplateReference: React.RefObject<HTMLButtonElement> = React.createRef();\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n return (\n <div className={props.className}>\n <AddToOrderTemplateDialog\n className='msc-add-to-order-template-dialog'\n id=''\n typeName=''\n modalOpen={isAddToOrderTemplateModalOpen}\n setModalOpen={setIsAddToOrderTemplateModalOpen}\n context={props.context}\n data={{ orderTemplates: props.data.orderTemplates }}\n addToOrderTemplateDialogResources={props.resources}\n createOrderTemplateDialogResources={props.resources}\n onOrderTemplateSelected={onOrderTemplateSelected}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n {chosenOrderTemplate && addedProducts && (\n <LinesAddedToOrderTemplateDialog\n className='msc-lines-added-to-order-template-dialog'\n id=''\n typeName=''\n context={props.context}\n dialogStrings={props.resources}\n data={{\n linesCount: addedLinesCount,\n itemsCount: addedItemsCount,\n orderTemplate: chosenOrderTemplate,\n products: addedProducts\n }}\n modalOpen={isLinesAddedToOrderTemplateDialogOpen}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n )}\n <Button\n className={`${props.className}__add-button`}\n onClick={onAddProductsToOrderTemplateClick}\n title={props.resources.addProductsToOrderTemplateButton}\n innerRef={addToOrderTemplateReference}\n disabled={props.isDisabled}\n >\n {props.resources.addProductsToOrderTemplateButton}\n </Button>\n </div>\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, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nexport interface IDuplicateItemsWhenAddingToOrderTemplateDialogResources {\n duplicatedProductsHeader: string;\n\n duplicatedProductsDescription: string;\n\n updateQuantityButtonText: string;\n cancelDuplicateItemsButtonText: string;\n}\n\nexport interface IDuplicateItemsWhenAddingToOrderTemplateDialogProps extends IComponentProps {\n className: string;\n\n dialogStrings?: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n modalOpen: boolean | undefined;\n\n executeOverrideQuantity(): Promise<void>;\n onCancel(): void;\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n}\n\nexport const DuplicateItemsWhenAddingToOrderTemplateDialog = (dialogProps: IDuplicateItemsWhenAddingToOrderTemplateDialogProps) => {\n const { dialogStrings, className, modalOpen, executeOverrideQuantity } = dialogProps;\n\n return (\n <Modal isOpen={modalOpen} className={`${className}`} toggle={dialogProps.onCancel}>\n <ModalHeader className={`${className}__dialog__header`} toggle={dialogProps.onCancel}>\n <span>{dialogStrings?.duplicatedProductsHeader}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n <div className={`${className}__dialog__description`}>{dialogStrings?.duplicatedProductsDescription}</div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__update-quantity-button`}\n title={dialogStrings?.updateQuantityButtonText}\n onClick={executeOverrideQuantity}\n >\n {dialogStrings?.updateQuantityButtonText}\n </Button>\n <Button\n className={`${className}__dialog__cancel-button`}\n title={dialogStrings?.cancelDuplicateItemsButtonText}\n onClick={dialogProps.onCancel}\n >\n {dialogStrings?.cancelDuplicateItemsButtonText}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { PriceComponent } from '../../price/price.components';\n\nexport interface IItemAddedToOrderTemplateDialogResources {\n viewOrderTemplateButtonText: string;\n continueShoppingButtonText: string;\n itemAddedToOrderTemplateHeaderItemOneText: string;\n itemAddedToOrderTemplateHeaderItemFormatText: string;\n itemAddedToOrderTemplateHeaderMessageText: string;\n\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n}\n\nexport interface IItemAddedToOrderTemplateDialogData {\n product: SimpleProduct;\n productPrice: ProductPrice;\n quantity: number;\n orderTemplateId: string;\n}\n\nexport interface IItemAddedToOrderTemplateDialogProps extends IComponentProps<IItemAddedToOrderTemplateDialogData> {\n className: string;\n\n dialogStrings: IItemAddedToOrderTemplateDialogResources;\n\n modalOpen: boolean | undefined;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n imageSettings?: IImageSettings;\n}\n\nconst renderOrderTemplateImage = (context: ICoreContext, className: string, product: SimpleProduct, imageSettings?: IImageSettings) => {\n const fallbackImageUrl = getFallbackImageUrl(\n product.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n );\n if (imageSettings) {\n imageSettings.cropFocalRegion = true;\n }\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n lg: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n xl: { q: 'w=140&h=140&m=6', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n return (\n <Image\n requestContext={context.actionContext.requestContext}\n className={`${className}__image-props`}\n src={product.PrimaryImageUrl || ''}\n altText={product.Name}\n fallBackSrc={fallbackImageUrl}\n gridSettings={context.request.gridSettings!}\n imageSettings={imageSettings || defaultImageSettings}\n loadFailureBehavior='empty'\n />\n );\n};\n\nexport const ItemAddedToOrderTemplateDialog = (dialogProps: IItemAddedToOrderTemplateDialogProps) => {\n const {\n dialogStrings,\n className,\n context,\n modalOpen,\n imageSettings,\n data: { orderTemplateId, product, productPrice, quantity }\n } = dialogProps;\n\n const getOrderTemplatePageUrl = (): string => {\n const url = getUrlSync('ordertemplate', context.actionContext) || '';\n const separator = url.includes('?') ? '&' : '?';\n return `${url}${separator}id=${orderTemplateId}`;\n };\n\n const close: () => void = () => {\n window.location.reload(true);\n };\n\n const itemsString =\n quantity === 1\n ? dialogStrings.itemAddedToOrderTemplateHeaderItemOneText\n : dialogStrings.itemAddedToOrderTemplateHeaderItemFormatText.replace('{0}', quantity.toString());\n\n return (\n <Modal isOpen={modalOpen} className={`${className}`} toggle={close}>\n <ModalHeader className={`${className}__dialog__header`} toggle={close}>\n <b>{itemsString}</b>\n <span>{dialogStrings.itemAddedToOrderTemplateHeaderMessageText}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n {renderOrderTemplateImage(context, `${className}__dialog`, product, imageSettings)}\n <div className={`${className}__dialog__description`}>\n <div className={`${className}__dialog__product-name`}>{product.Name}</div>\n <div className={`${className}__dialog__product-price`}>\n {productPrice && (\n <PriceComponent\n data={{ price: productPrice }}\n context={dialogProps.context}\n id={dialogProps.id}\n typeName={dialogProps.typeName}\n freePriceText={dialogProps.dialogStrings.freePriceText}\n originalPriceText={dialogProps.dialogStrings.originalPriceText}\n currentPriceText={dialogProps.dialogStrings.currentPriceText}\n />\n )}\n </div>\n {product.Dimensions && (\n <div className={`${className}__dialog__product-dimensions`}>\n {product.Dimensions.map(dimension => dimension.DimensionValue?.Value)\n .filter(value => value)\n .join(', ')}\n </div>\n )}\n </div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__view-order-template-button`}\n title={dialogStrings.viewOrderTemplateButtonText}\n href={getOrderTemplatePageUrl()}\n >\n {dialogStrings.viewOrderTemplateButtonText}\n </Button>\n <Button\n className={`${className}__dialog__continue-shopping`}\n title={dialogStrings.continueShoppingButtonText}\n onClick={close}\n >\n {dialogStrings.continueShoppingButtonText}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce, isChannelTypeB2B, IImageSettings } from '@msdyn365-commerce/core';\nimport { AsyncResult, Customer, ProductDimension, ProductList, ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport {\n addItemToOrderTemplate,\n AddItemToOrderTemplateInput,\n getPriceForSelectedVariant,\n OrderTemplate,\n PriceForSelectedVariantInput,\n updateOrderTemplateAction,\n UpdateOrderTemplateInput,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as Popper from 'popper.js';\nimport React, { useState } from 'react';\n\nimport {\n AddToOrderTemplateDialog,\n IAddToOrderTemplateDialogData,\n IAddToOrderTemplateDialogResources\n} from '../add-to-order-template-dialog/add-to-order-template-dialog.component';\nimport {\n DuplicateItemsWhenAddingToOrderTemplateDialog,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources\n} from '../duplicate-items-when-adding-to-order-template-dialog/duplicate-items-when-adding-to-order-template-dialog.component';\nimport {\n IItemAddedToOrderTemplateDialogResources,\n ItemAddedToOrderTemplateDialog\n} from '../item-added-to-order-template-dialog/item-added-to-order-template-dialog.component';\nimport { IOrderTemplateNameDialogResources } from '../order-template-name-dialog/order-template-name-dialog.component';\n\nexport interface IAddToOrderTemplateComponentProps extends IComponentProps<IAddToOrderTemplateData> {\n className?: string;\n\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n itemAddedToOrderTemplateDialogResources: IItemAddedToOrderTemplateDialogResources;\n duplicateItemsWhenAddingToOrderTemplateDialogResources: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n\n addToOrderTemplateButtonText: string;\n addToOrderTemplateButtonTooltip: string;\n\n addToOrderTemplateMessage?: string;\n addItemToOrderTemplateError?: string;\n\n showButtonText?: boolean;\n showButtonTooltip?: boolean;\n shouldShowButtonFailedTooltip?: boolean;\n disableButton?: boolean;\n tooltipPosition?: Popper.Placement;\n showStatusMessage?: boolean;\n disabled?: boolean;\n canAddMasterProduct?: boolean;\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n\n imageSettings?: IImageSettings;\n\n onSuccess?(): void;\n onError?(result: IOrderTemplateActionErrorResult): void;\n}\n\nexport interface IOrderTemplateActionErrorResult {\n status: 'FAILED' | 'MISSING_DIMENSION';\n\n missingDimensions?: ProductDimension[];\n}\n\ninterface IAddToOrderTemplateStateManager {\n waiting: boolean;\n content: IAddToOrderTemplateContentState;\n\n setWaiting(newWaiting: boolean): void;\n setContent(newContent: IAddToOrderTemplateContentState): void;\n}\n\ninterface IAddToOrderTemplateContentState {\n showAlert?: boolean;\n orderTemplateTextMessage?: string;\n color?: string;\n}\n\ninterface IAddToOrderTemplateData {\n orderTemplates: OrderTemplate[];\n\n product: SimpleProduct;\n quantity: number;\n\n customerInformation?: Customer;\n isChannelTypeB2B?: boolean;\n}\n\nexport interface IAddToOrderTemplateComponent extends IComponent<IAddToOrderTemplateComponentProps> {\n onClick(): (\n event: React.MouseEvent<HTMLElement>,\n props: IAddToOrderTemplateComponentProps,\n state: IAddToOrderTemplateStateManager\n ) => void;\n}\n\nconst onClick = async (\n _event: React.MouseEvent<HTMLElement>,\n props: IAddToOrderTemplateComponentProps,\n state: IAddToOrderTemplateStateManager,\n openModal: (opened: boolean) => void\n): Promise<void> => {\n const { user } = props.context.request;\n\n if (state.waiting) {\n return;\n }\n\n if (!user.isAuthenticated && user.signInUrl && window) {\n window.location.assign(user.signInUrl);\n return;\n }\n\n addToOrderTemplate(props, openModal);\n state.setWaiting(false);\n};\n\nconst onDismiss = (state: IAddToOrderTemplateStateManager): void => {\n state.setContent({ color: 'success', showAlert: false });\n};\n\nconst AddToOrderTemplateComponentActions = {\n onClick,\n onDismiss\n};\n\nconst hasProductInOrderTemplates = (productToFind: SimpleProduct) => {\n /*\n TODO: Currently API does not support filtering by products.\n await getProductListLinesAsync(context, '',)\n return orderTemplates.filter(orderTemplate =>\n orderTemplate.orderTemplateLines.filter(\n product => product.productListLine.ProductId === productToFind.RecordId).length !== 0).length !== 0;\n */\n return false;\n};\n\nconst AddToOrderTemplate: React.FC<IAddToOrderTemplateComponentProps> = (props: IAddToOrderTemplateComponentProps) => {\n if (!isChannelTypeB2B(props.context.actionContext.requestContext)) {\n return null;\n }\n\n const [waiting, setWaiting] = useState(false);\n const [content, setContent] = useState({});\n const state: IAddToOrderTemplateStateManager = {\n waiting,\n content,\n\n setWaiting,\n setContent\n };\n\n const [addToOrderTemplateModalOpen, setAddToOrderTemplateModalOpen] = useState(false);\n\n const [chosenOrderTemplateId, setChosenOrderTemplateId] = useState<string | undefined>(undefined);\n const [productPrice, setProductPrice] = useState<ProductPrice | null>(null);\n const [itemAddedToOrderTemplateDialogOpen, setItemAddedToOrderTemplateDialogOpen] = useState(false);\n const [duplicateItemsWhenAddingToOrderTemplateDialogOpen, setDuplicateItemsWhenAddingToOrderTemplateDialogOpen] = useState(false);\n const catalogId = props.catalogId;\n validateCatalogId(catalogId);\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n const executeAddItemToOrderTemplate = async (orderTemplate: ProductList) => {\n setChosenOrderTemplateId(orderTemplate.Id);\n const input = isMultipleCatalogFeatureEnabledInHq\n ? new AddItemToOrderTemplateInput(\n orderTemplate.Id,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea',\n isMultipleCatalogFeatureEnabledInHq,\n catalogId\n )\n : new AddItemToOrderTemplateInput(\n orderTemplate.Id,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea'\n );\n await addItemToOrderTemplate(input, props.context.actionContext)\n .then(async result => {\n const retrievedProductPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n props.data.product.RecordId,\n props.context.actionContext.requestContext.apiSettings.channelId,\n props.data.product\n ),\n props.context.actionContext\n );\n setProductPrice(retrievedProductPrice);\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setItemAddedToOrderTemplateDialogOpen(true);\n }, 500);\n })\n .catch(error => {\n if (error.error?.name !== 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n return AsyncResult.reject(error);\n }\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(true);\n }, 500);\n return AsyncResult.resolve();\n });\n };\n\n const onDuplicateDialogCancel = () => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setAddToOrderTemplateModalOpen(true);\n }, 500);\n };\n\n const overrideQuantity = async () => {\n const input = isMultipleCatalogFeatureEnabledInHq\n ? new UpdateOrderTemplateInput(\n chosenOrderTemplateId!,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea',\n isMultipleCatalogFeatureEnabledInHq,\n catalogId\n )\n : new UpdateOrderTemplateInput(\n chosenOrderTemplateId!,\n props.data.product.RecordId,\n props.data.quantity,\n props.data.product.DefaultUnitOfMeasure || 'ea'\n );\n await updateOrderTemplateAction(input, props.context.actionContext);\n\n const retrievedProductPrice = await getPriceForSelectedVariant(\n new PriceForSelectedVariantInput(\n props.data.product.RecordId,\n props.context.actionContext.requestContext.apiSettings.channelId,\n props.data.product\n ),\n props.context.actionContext\n );\n setProductPrice(retrievedProductPrice);\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setItemAddedToOrderTemplateDialogOpen(true);\n }, 500);\n };\n\n const {\n addToOrderTemplateButtonText,\n showStatusMessage,\n showButtonText,\n className,\n disabled,\n showButtonTooltip,\n shouldShowButtonFailedTooltip,\n disableButton,\n tooltipPosition,\n addToOrderTemplateButtonTooltip,\n addToOrderTemplateDialogResources,\n createOrderTemplateDialogResources\n } = props;\n\n const onDismissHandler = () => {\n AddToOrderTemplateComponentActions.onDismiss(state);\n };\n const ariaLabel = addToOrderTemplateButtonText;\n const addToOrderTemplateRef: React.RefObject<HTMLButtonElement> = React.createRef();\n const showMessage = showStatusMessage !== undefined ? showStatusMessage : true;\n const showTooltip = showButtonTooltip !== undefined ? showButtonTooltip : true;\n const tooltipPos = showButtonTooltip !== undefined ? tooltipPosition : 'top-end';\n\n const dialogData: IAddToOrderTemplateDialogData = {\n orderTemplates: props.data.orderTemplates\n };\n\n const onClickHandler = (event: React.MouseEvent<HTMLElement>) => {\n return AddToOrderTemplateComponentActions.onClick(event, props, state, setAddToOrderTemplateModalOpen);\n };\n\n return (\n <>\n <>\n <button\n className={classnames(\n className,\n hasProductInOrderTemplates(props.data.product)\n ? 'msc-add-to-order-template-icon__added'\n : 'msc-add-to-order-template-icon',\n state.waiting ? 'msc-add-to-order-template-icon__waiting' : ''\n )}\n aria-label={ariaLabel}\n onClick={disableButton ? undefined : onClickHandler}\n disabled={disabled}\n ref={addToOrderTemplateRef}\n >\n {showButtonText ? ariaLabel : ''}\n </button>\n {showTooltip && (\n <UncontrolledTooltip placement={tooltipPos} trigger='hover focus' target={addToOrderTemplateRef}>\n {shouldShowButtonFailedTooltip ? addToOrderTemplateButtonTooltip : ariaLabel}\n </UncontrolledTooltip>\n )}\n </>\n {state.content.showAlert && showMessage ? (\n <div className='ms-order-template-items__product-status'>\n <Alert color={state.content.color} isOpen={state.content.showAlert} toggle={onDismissHandler}>\n {state.content.orderTemplateTextMessage}\n </Alert>\n </div>\n ) : (\n ''\n )}\n <AddToOrderTemplateDialog\n className='msc-add-to-order-template-dialog'\n modalOpen={addToOrderTemplateModalOpen}\n setModalOpen={setAddToOrderTemplateModalOpen}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n data={dialogData}\n addToOrderTemplateDialogResources={addToOrderTemplateDialogResources}\n createOrderTemplateDialogResources={createOrderTemplateDialogResources}\n onOrderTemplateSelected={executeAddItemToOrderTemplate}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n {chosenOrderTemplateId && productPrice && (\n <ItemAddedToOrderTemplateDialog\n className='msc-item-added-to-order-template-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={props.itemAddedToOrderTemplateDialogResources}\n imageSettings={props.imageSettings !== undefined ? props.imageSettings : undefined}\n data={{\n product: props.data.product,\n quantity: props.data.quantity,\n orderTemplateId: chosenOrderTemplateId,\n productPrice\n }}\n modalOpen={itemAddedToOrderTemplateDialogOpen}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n )}\n <DuplicateItemsWhenAddingToOrderTemplateDialog\n className='msc-duplicate-items-when-adding-to-order-template-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={props.duplicateItemsWhenAddingToOrderTemplateDialogResources}\n data={{}}\n modalOpen={duplicateItemsWhenAddingToOrderTemplateDialogOpen}\n executeOverrideQuantity={overrideQuantity}\n onCancel={onDuplicateDialogCancel}\n // isMultipleCatalogFeatureEnabledInHq={props.isMultipleCatalogFeatureEnabledInHq}\n // {...(props.isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n </>\n );\n};\n\nconst addToOrderTemplate = (props: IAddToOrderTemplateComponentProps, openModal: (opened: boolean) => void): void => {\n const { canAddMasterProduct } = props;\n\n if (props.data.product.Dimensions && !canAddMasterProduct) {\n const missingDimensions = props.data.product.Dimensions.filter(\n dimension => !(dimension.DimensionValue && dimension.DimensionValue.Value)\n );\n\n if (missingDimensions.length > 0) {\n // At least one dimension with no value exists on the product, won't be able to proceed.\n propagateError(props, { status: 'MISSING_DIMENSION', missingDimensions });\n return;\n }\n }\n\n openModal(true);\n};\n\nconst propagateError = (props: IAddToOrderTemplateComponentProps, result: IOrderTemplateActionErrorResult): void => {\n const { onError } = props;\n\n if (onError) {\n onError(result);\n }\n};\n\nexport const AddToOrderTemplateComponent: React.FunctionComponent<IAddToOrderTemplateComponentProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IAddToOrderTemplateComponent\n>('AddToOrderTemplate', { component: AddToOrderTemplate, ...AddToOrderTemplateComponentActions });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IComponentProps, ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { ProductPrice, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { PriceComponent } from '../../price/price.components';\n\nexport interface IItemAddedToCartDialogResources {\n viewCartButtonText: string;\n orderTemplateCloseButtonText: string;\n itemAddedToCartHeaderItemOneText: string;\n itemAddedToCartHeaderItemFormatText: string;\n itemAddedToCartHeaderMessageText: string;\n\n freePriceText: string;\n originalPriceText: string;\n currentPriceText: string;\n}\n\nexport interface IItemAddedToCartDialogData {\n product: SimpleProduct;\n productPrice: ProductPrice;\n quantity: number;\n}\n\nexport interface IItemAddedToCartDialogProps extends IComponentProps<IItemAddedToCartDialogData> {\n className: string;\n\n dialogStrings: IItemAddedToCartDialogResources;\n\n modalOpen: boolean | undefined;\n\n // as required passing in components for later user\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n onClose(): void;\n}\n\nconst renderImage = (context: ICoreContext, className: string, product: SimpleProduct, imageSettings?: IImageSettings) => {\n const fallbackImageUrl = getFallbackImageUrl(\n product.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n );\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n lg: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n xl: { q: 'w=140&h=140&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n return (\n <Image\n requestContext={context.actionContext.requestContext}\n className={`${className}__image-props`}\n src={product.PrimaryImageUrl || ''}\n altText={product.Name}\n fallBackSrc={fallbackImageUrl}\n gridSettings={context.request.gridSettings!}\n imageSettings={imageSettings || defaultImageSettings}\n loadFailureBehavior='empty'\n />\n );\n};\n\nexport const ItemAddedToCartDialog = (dialogProps: IItemAddedToCartDialogProps) => {\n const {\n dialogStrings,\n className,\n context,\n modalOpen,\n data: { product, productPrice, quantity }\n } = dialogProps;\n\n const getCartPageUrl = (): string => {\n return getUrlSync('cart', context.actionContext) || '';\n };\n\n const close: () => void = () => {\n dialogProps.onClose();\n };\n\n const itemsString =\n quantity === 1\n ? dialogStrings.itemAddedToCartHeaderItemOneText\n : dialogStrings.itemAddedToCartHeaderItemFormatText.replace('{0}', quantity.toString());\n\n return (\n <Modal isOpen={modalOpen} className={`${className}`} toggle={close}>\n <ModalHeader className={`${className}__dialog__header`} toggle={close}>\n <b>{itemsString}</b>\n <span>{dialogStrings.itemAddedToCartHeaderMessageText}</span>\n </ModalHeader>\n <ModalBody className={`${className}__dialog__body`}>\n <div className={`${className}__dialog__content`}>\n {renderImage(context, `${className}__dialog`, product)}\n <div className={`${className}__dialog__description`}>\n <div className={`${className}__dialog__product-name`}>{product.Name}</div>\n <div className={`${className}__dialog__product-price`}>\n {productPrice && (\n <PriceComponent\n data={{ price: productPrice }}\n context={dialogProps.context}\n id={dialogProps.id}\n typeName={dialogProps.typeName}\n freePriceText={dialogProps.dialogStrings.freePriceText}\n originalPriceText={dialogProps.dialogStrings.originalPriceText}\n currentPriceText={dialogProps.dialogStrings.currentPriceText}\n />\n )}\n </div>\n {product.Dimensions && (\n <div className={`${className}__dialog__product-dimensions`}>\n {product.Dimensions.map(dimension => dimension.DimensionValue?.Value)\n .filter(value => value)\n .join(', ')}\n </div>\n )}\n </div>\n </div>\n </ModalBody>\n <ModalFooter className={`${className}__dialog__footer`}>\n <Button\n className={`${className}__dialog__view-cart-button`}\n title={dialogStrings.viewCartButtonText}\n href={getCartPageUrl()}\n >\n {dialogStrings.viewCartButtonText}\n </Button>\n <Button\n className={`${className}__dialog__continue-shopping`}\n title={dialogStrings.orderTemplateCloseButtonText}\n onClick={close}\n >\n {dialogStrings.orderTemplateCloseButtonText}\n </Button>\n </ModalFooter>\n </Modal>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { IComponent, IComponentProps, msdyn365Commerce, isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { AsyncResult, CartLine, Customer, ProductList, ProductListLine } from '@msdyn365-commerce/retail-proxy';\nimport {\n addProductListLinesAsync,\n updateProductListLinesAsync\n} from '@msdyn365-commerce/retail-proxy/dist/DataActions/ProductListsDataActions.g';\nimport {\n FullProductInput,\n getFullProducts,\n getProductDetailsCriteriaFromActionInput,\n getProductListLines,\n GetProductListLinesInput,\n OrderTemplate\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, UncontrolledTooltip } from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport {\n AddToOrderTemplateDialog,\n IAddToOrderTemplateDialogResources\n} from '../add-to-order-template-dialog/add-to-order-template-dialog.component';\nimport {\n ILinesAddedToOrderTemplateDialogResources,\n LinesAddedToOrderTemplateDialog\n} from '../lines-added-to-order-template-dialog/lines-added-to-order-template-dialog.component';\nimport { IOrderTemplateNameDialogResources } from '../order-template-name-dialog/order-template-name-dialog.component';\nimport {\n DuplicateItemsWhenAddingToOrderTemplateDialog,\n IDuplicateItemsWhenAddingToOrderTemplateDialogResources\n} from '../duplicate-items-when-adding-to-order-template-dialog/duplicate-items-when-adding-to-order-template-dialog.component';\nexport interface ISaveCartToOrderTemplateComponentProps extends IComponentProps<ISaveCartToOrderTemplateData> {\n className?: string;\n isMultipleCatalogFeatureEnabledInHq?: boolean;\n catalogId?: number;\n addToOrderTemplateDialogResources: IAddToOrderTemplateDialogResources;\n createOrderTemplateDialogResources: IOrderTemplateNameDialogResources;\n linesAddedToOrderTemplateDialogResources: ILinesAddedToOrderTemplateDialogResources;\n\n createOrderTemplateFromCartButton: string;\n createOrderTemplateFromCartButtonTooltip: string;\n\n duplicateItemsWhenAddingToOrderTemplateDialogResources?: IDuplicateItemsWhenAddingToOrderTemplateDialogResources;\n}\n\ninterface ISaveCartToOrderTemplateData {\n orderTemplates: OrderTemplate[];\n cartLines: CartLine[];\n customerInformation?: Customer;\n isChannelTypeB2B?: boolean;\n}\n\ninterface ISaveCartToOrderTemplateContentState {\n showAlert?: boolean;\n orderTemplateTextMessage?: string;\n color?: string;\n}\n\ninterface ISaveCartToOrderTemplateStateManager {\n waiting: boolean;\n content: ISaveCartToOrderTemplateContentState;\n\n setWaiting(newWaiting: boolean): void;\n setContent(newContent: ISaveCartToOrderTemplateContentState): void;\n}\n\nexport interface ISaveCartToOrderTemplateComponent extends IComponent<ISaveCartToOrderTemplateComponentProps> {\n onClick(): (\n event: React.MouseEvent<HTMLElement>,\n props: ISaveCartToOrderTemplateComponentProps,\n state: ISaveCartToOrderTemplateStateManager\n ) => void;\n}\n\nconst onDismiss = (state: ISaveCartToOrderTemplateStateManager): void => {\n state.setContent({ color: 'success', showAlert: false });\n};\n\nconst SaveCartToOrderTemplateActions = {\n onDismiss\n};\n\nconst SaveCartToOrderTemplate: React.FC<ISaveCartToOrderTemplateComponentProps> = (props: ISaveCartToOrderTemplateComponentProps) => {\n if (!isChannelTypeB2B(props.context.actionContext.requestContext)) {\n return null;\n }\n\n const [chosenOrderTemplate, setChosenOrderTemplate] = useState<ProductList | undefined>(undefined);\n const [addedProducts, setAddedProducts] = useState<FullProduct[] | undefined>(undefined);\n const [addToOrderTemplateModalOpen, setAddToOrderTemplateModalOpen] = useState(false);\n const [linesAddedToOrderTemplateDialogOpen, setLinesAddedToOrderTemplateDialogOpen] = useState(false);\n const [duplicateItemsWhenAddingToOrderTemplateDialogOpen, setDuplicateItemsWhenAddingToOrderTemplateDialogOpen] = useState(false);\n const [addedLinesCount, setAddedLinesCount] = useState(0);\n const [addedItemsCount, setAddedItemsCount] = useState(0);\n\n const {\n addToOrderTemplateDialogResources,\n createOrderTemplateDialogResources,\n createOrderTemplateFromCartButton,\n createOrderTemplateFromCartButtonTooltip\n } = props;\n\n const onDuplicateDialogCancel = () => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setAddToOrderTemplateModalOpen(true);\n }, 500);\n };\n const isMultipleCatalogFeatureEnabledInHq = props.isMultipleCatalogFeatureEnabledInHq || false;\n const overrideQuantity = async () => {\n const newLinesToupdate: ProductListLine[] = [];\n\n for (const cartLine of props.data.cartLines) {\n const getLinesInput = new GetProductListLinesInput(chosenOrderTemplate?.Id!, cartLine.ProductId!.toString());\n const linesState = await getProductListLines(getLinesInput, props.context.actionContext);\n const length = 1;\n const linesToUpdate = linesState.lines.filter(line => line.productListLine.ProductId === cartLine.ProductId);\n if (linesToUpdate.length !== length) {\n // skip new line if not exist already top update\n continue;\n }\n const lineToUpdate = linesToUpdate[0].productListLine;\n lineToUpdate.UnitOfMeasure = cartLine.UnitOfMeasureSymbol || 'ea';\n lineToUpdate.Quantity = cartLine.Quantity!;\n if (isMultipleCatalogFeatureEnabledInHq) {\n lineToUpdate.CatalogId = cartLine.CatalogId;\n }\n newLinesToupdate.push(lineToUpdate);\n }\n\n await updateProductListLinesAsync(\n {\n callerContext: props.context.actionContext\n },\n chosenOrderTemplate!.Id,\n newLinesToupdate\n ).then(async updatedLines => {\n updateLinesCounts(updatedLines);\n const allProductInputs: FullProductInput[] = getFullProductsDetails(updatedLines);\n const allProducts = await getFullProducts(allProductInputs, props.context.actionContext);\n setAddedProducts(allProducts);\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(false);\n setTimeout(() => {\n setLinesAddedToOrderTemplateDialogOpen(true);\n }, 500);\n });\n };\n const getFullProductsDetails = (productLines: ProductListLine[]) => {\n const allProdInputs: FullProductInput[] = [];\n productLines.forEach(lines => {\n if (lines.ProductId) {\n allProdInputs.push(\n new FullProductInput(\n lines.ProductId,\n props.context.actionContext.requestContext.apiSettings,\n getProductDetailsCriteriaFromActionInput(props.context.actionContext),\n props.context.actionContext.requestContext\n )\n );\n }\n });\n return allProdInputs;\n };\n\n const onOrderTemplateSelected = async (orderTemplate: ProductList) => {\n setChosenOrderTemplate(orderTemplate);\n const allProductListLines = props.data.cartLines?.map(cartLine => {\n const productListLineToAdd: ProductListLine = {\n ProductListId: orderTemplate.Id,\n ProductId: cartLine.ProductId,\n Quantity: cartLine.Quantity,\n UnitOfMeasure: cartLine.UnitOfMeasureSymbol\n };\n return productListLineToAdd;\n });\n\n const allProductInputs: FullProductInput[] = getFullProductsDetails(allProductListLines);\n const allProducts = await getFullProducts(allProductInputs, props.context.actionContext);\n\n // Filter out products with keyed in price\n const filteredProductListLines = props.data.cartLines\n .filter(cartline => !cartline.IsPriceKeyedIn)\n .map(cartLine => {\n const productListLineToAdd: ProductListLine = {\n ProductListId: orderTemplate.Id,\n ProductId: cartLine.ProductId,\n Quantity: cartLine.Quantity,\n UnitOfMeasure: cartLine.UnitOfMeasureSymbol,\n ...(isMultipleCatalogFeatureEnabledInHq && { catalogId: cartLine.CatalogId })\n };\n\n return productListLineToAdd;\n });\n\n await addProductListLinesAsync({ callerContext: props.context.actionContext }, orderTemplate.Id, filteredProductListLines)\n .then(filteredAddedLines => {\n updateLinesCounts(filteredAddedLines);\n setAddedProducts(allProducts);\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setLinesAddedToOrderTemplateDialogOpen(true);\n }, 500);\n })\n .catch(error => {\n if (error.name !== 'Microsoft_Dynamics_Commerce_Runtime_DuplicateObject') {\n return AsyncResult.reject(error);\n }\n setAddToOrderTemplateModalOpen(false);\n setTimeout(() => {\n setDuplicateItemsWhenAddingToOrderTemplateDialogOpen(true);\n }, 500);\n return AsyncResult.resolve();\n });\n };\n const updateLinesCounts = (lines: ProductListLine[]) => {\n setAddedLinesCount(lines.length);\n setAddedItemsCount(lines.map(line => line.Quantity || 1).reduce((firstQuantity, secondQuantity) => firstQuantity + secondQuantity));\n };\n const onSaveCartToOrderTemplateClick = () => {\n setAddToOrderTemplateModalOpen(true);\n };\n\n const areAllCartlinesPriceKeyedIn = props.data.cartLines.filter(cartline => !cartline.IsPriceKeyedIn).length === 0;\n\n const addToOrderTemplateRef: React.RefObject<HTMLButtonElement> = React.createRef();\n\n return (\n <>\n <AddToOrderTemplateDialog\n className='msc-add-to-order-template-dialog'\n modalOpen={addToOrderTemplateModalOpen}\n setModalOpen={setAddToOrderTemplateModalOpen}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n data={{ orderTemplates: props.data.orderTemplates }}\n addToOrderTemplateDialogResources={addToOrderTemplateDialogResources}\n createOrderTemplateDialogResources={createOrderTemplateDialogResources}\n onOrderTemplateSelected={onOrderTemplateSelected}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n {chosenOrderTemplate && addedProducts && (\n <LinesAddedToOrderTemplateDialog\n className='msc-lines-added-to-order-template-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={props.linesAddedToOrderTemplateDialogResources}\n data={{\n linesCount: addedLinesCount,\n itemsCount: addedItemsCount,\n orderTemplate: chosenOrderTemplate,\n products: addedProducts\n }}\n modalOpen={linesAddedToOrderTemplateDialogOpen}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n )}\n <DuplicateItemsWhenAddingToOrderTemplateDialog\n className='msc-duplicate-items-when-adding-to-order-template-dialog'\n id={props.id}\n typeName={props.typeName}\n context={props.context}\n dialogStrings={props.duplicateItemsWhenAddingToOrderTemplateDialogResources}\n data={{}}\n modalOpen={duplicateItemsWhenAddingToOrderTemplateDialogOpen}\n executeOverrideQuantity={overrideQuantity}\n onCancel={onDuplicateDialogCancel}\n isMultipleCatalogFeatureEnabledInHq={isMultipleCatalogFeatureEnabledInHq}\n {...(isMultipleCatalogFeatureEnabledInHq && { catalogId: props.catalogId })}\n />\n <Button\n className={`msc-cart__btn-addcarttotemplate${areAllCartlinesPriceKeyedIn ? ' disabled' : ''}`}\n onClick={areAllCartlinesPriceKeyedIn ? undefined : onSaveCartToOrderTemplateClick}\n title={createOrderTemplateFromCartButton}\n innerRef={addToOrderTemplateRef}\n >\n {createOrderTemplateFromCartButton}\n </Button>\n {areAllCartlinesPriceKeyedIn && (\n <UncontrolledTooltip\n className='msc-cart__btn-addcarttotemplate-tooltip'\n placement='top-start'\n trigger='hover focus'\n target={addToOrderTemplateRef}\n >\n {createOrderTemplateFromCartButtonTooltip}\n </UncontrolledTooltip>\n )}\n </>\n );\n};\n\nexport const SaveCartToOrderTemplateComponent: React.FunctionComponent<ISaveCartToOrderTemplateComponentProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error\n ISaveCartToOrderTemplateComponent\n>('SaveCartToOrderTemplate', { component: SaveCartToOrderTemplate, ...SaveCartToOrderTemplateActions });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { FullProduct } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\nexport interface IOrderTemplateProductsPreviewComponentProps {\n className: string;\n products: FullProduct[];\n context: ICoreContext;\n imageSettings?: IImageSettings;\n}\n\nexport const OrderTemplateProductsPreviewComponent = (props: IOrderTemplateProductsPreviewComponentProps) => {\n const { products, className, imageSettings } = props;\n\n return (\n <div className={`${className}__products`}>\n {renderOrderTemplateImages(props.context, `${className}__products`, products, imageSettings)}\n </div>\n );\n};\n\nconst renderOrderTemplateImage = (context: ICoreContext, className: string, product: FullProduct, imageSettings?: IImageSettings) => {\n const defaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n lg: { q: 'w=140&h=140&m=6', w: 0, h: 0 },\n xl: { q: 'w=140&h=140&m=6', w: 0, h: 0 }\n },\n lazyload: true\n };\n return (\n <div className={`${className}__image-props`}>\n <Image\n requestContext={context.actionContext.requestContext}\n src={product.ProductDetails.PrimaryImageUrl ?? ''}\n fallBackSrc={\n getFallbackImageUrl(\n product.ProductDetails.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n ) ?? ''\n }\n gridSettings={context.request.gridSettings!}\n imageSettings={imageSettings ?? defaultImageSettings}\n loadFailureBehavior='empty'\n altText={product.ProductDetails.Name ?? 'image'}\n />\n </div>\n );\n};\n\nconst renderOrderTemplateImages = (\n context: ICoreContext,\n className: string,\n products: FullProduct[],\n imageSettings?: IImageSettings\n): JSX.Element | null => {\n return (\n <div className={`${className}__image-container`}>\n <div className='row'>\n <div className='column'>\n {products.length > 0 && renderOrderTemplateImage(context, className, products[0], imageSettings)}\n </div>\n <div className='column'>\n {products.length > 1 && renderOrderTemplateImage(context, className, products[1], imageSettings)}\n </div>\n </div>\n <div className='row'>\n <div className='column'>\n {products.length > 2 && renderOrderTemplateImage(context, className, products[2], imageSettings)}\n </div>\n <div className='column'>\n {products.length > 3 && renderOrderTemplateImage(context, className, products[3], imageSettings)}\n </div>\n </div>\n </div>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ProductPrice, ProductType, SalesAgreementPriceLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { Button, format, ICollapseProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nconst defaultPrice: number = 0;\nconst freePrice: number = 0;\n\n/**\n * Interface for price component resources.\n * @param {string} priceRangeSeparator - The price range separator.\n */\nexport interface IPriceComponentResources {\n priceRangeSeparator?: string;\n salesAgreementPricePrompt?: string;\n salesAgreementExpirationDatePrompt?: string;\n salesAgreementCommittedQuantityPrompt?: string;\n salesAgreementRemainingQuantityPrompt?: string;\n}\n\n/**\n * Interface for price component props.\n * @param {boolean} isPriceMinMaxEnabled - Whether the price range feature is enabled or not.\n * @param {IPriceComponentResources} priceResources - The price range resources.\n */\nexport interface IPriceComponentProps extends IComponentProps<{ price: ProductPrice }> {\n className?: string;\n product?: SimpleProduct;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n isPriceMinMaxEnabled?: boolean;\n isSalesAgreementPriceFeatureEnabled?: boolean;\n salesAgreementLineId?: number;\n priceResources?: IPriceComponentResources;\n salesAgreementDetailCollapseProps?: ICollapseProps;\n currencyCode?: string;\n salesAgreementDetailOnClick?(event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>): void;\n}\n\n/**\n * The interface of price component.\n */\nexport interface IPriceComponent extends IComponent<IPriceComponentProps> {}\n\nconst priceComponentActions = {};\n\n/**\n * Get the original price from price component props.\n * @param props - The IPriceComponentProps.\n * @returns The original price.\n */\nconst getOriginalPrice = (props: IPriceComponentProps): number => {\n return props.data.price.AdjustedPrice ?? props.data.price.TradeAgreementPrice ?? props.data.price.BasePrice ?? defaultPrice;\n};\n\nconst getActivePrice = (props: IPriceComponentProps): number => {\n if (showPriceRangeForMasterProduct(props) && props.data.price.MinVariantPrice !== undefined) {\n return props.data.price.MinVariantPrice;\n }\n\n if (props.data.price.CustomerContextualPrice !== undefined) {\n return props.data.price.CustomerContextualPrice;\n }\n\n return getOriginalPrice(props);\n};\n\n/**\n * Get the formatted currency.\n * @param props - The props.\n * @param price - The price.\n * @param shouldUseFreePriceText - The shouldUseFreePriceText.\n * @returns The formatted currency.\n */\nconst formatCurrency = (\n props: IPriceComponentProps,\n price: number | undefined,\n shouldUseFreePriceText: boolean | undefined,\n currencyCode?: string | undefined\n): string => {\n if (price === undefined) {\n return '';\n }\n\n if (shouldUseFreePriceText && price === freePrice && props.freePriceText) {\n return props.freePriceText;\n }\n\n return props.context.cultureFormatter.formatCurrency(price, currencyCode);\n};\n\nconst showPriceRangeForMasterProduct = (props: IPriceComponentProps): boolean => {\n return (\n (props.isPriceMinMaxEnabled ?? false) &&\n (props.product?.ProductTypeValue === ProductType.Master || props.product?.ProductTypeValue === ProductType.KitMaster) &&\n props.data.price.MinVariantPrice !== undefined &&\n props.data.price.MaxVariantPrice !== undefined\n );\n};\n\n/**\n * ShowStrikethroughPricing.\n * @param props - The props.\n * @returns True if showStrikethroughPricing, false otherwise.\n */\nconst showStrikethroughPricing = (props: IPriceComponentProps): boolean => {\n const originalSalesPrice = getOriginalPrice(props);\n const activeSalesPrice = showPriceRangeForMasterProduct(props)\n ? props.data.price.MinVariantPrice\n : props.data.price.CustomerContextualPrice;\n\n if (activeSalesPrice && originalSalesPrice) {\n return activeSalesPrice < originalSalesPrice;\n }\n\n return false;\n};\n\n/**\n * Render current price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst renderCurrentPrice = (props: IPriceComponentProps): JSX.Element => {\n const maxVariantPrice: string = formatCurrency(props, props.data.price.MaxVariantPrice, false, props.currencyCode);\n const minVariantPrice: string = formatCurrency(props, props.data.price.MinVariantPrice, false, props.currencyCode);\n if (\n props.isPriceMinMaxEnabled &&\n props.data.price.MaxVariantPrice &&\n props.data.price.MinVariantPrice &&\n props.data.price.MaxVariantPrice > props.data.price.MinVariantPrice\n ) {\n return (\n <span className='msc-price__pricerange' itemProp='price'>\n <span className='msc-price__minprice' itemProp='price'>\n {minVariantPrice}\n </span>\n <span className='msc-price__separator' itemProp='price'>\n {props.priceResources?.priceRangeSeparator}\n </span>\n <span className='msc-price__maxprice' itemProp='price'>\n {maxVariantPrice}\n </span>\n </span>\n );\n }\n\n return (\n <span className='msc-price__actual' itemProp='price'>\n {formatCurrency(props, getActivePrice(props), true, props.currencyCode)}\n </span>\n );\n};\n\n/**\n * Render active sales price with original sales price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst renderCurrentPriceWithOriginalPrice = (props: IPriceComponentProps): JSX.Element => {\n const initialPrice: string = formatCurrency(props, getOriginalPrice(props), true);\n\n return (\n <>\n <span className='sr-only'>\n {` `}\n {props.originalPriceText}\n {` `}\n {initialPrice}\n {` `}\n {props.currentPriceText}\n {` `}\n {renderCurrentPrice(props)}\n </span>\n <span className='msc-price__strikethrough' aria-hidden='true'>\n {initialPrice}\n {` `}\n </span>\n <span aria-hidden='true'>{renderCurrentPrice(props)}</span>\n {props.savingsText && <span className='msc-price__savings'>{props.savingsText}</span>}\n </>\n );\n};\n\nconst renderSalesAgreementDetail = (props: IPriceComponentProps): JSX.Element => {\n // In most cases there should be only one sales agreement line.\n // If there are more than one, only the first one will be shown.\n const firstPriceLine: SalesAgreementPriceLine = (props.data.price.AttainablePriceLines ?? [])[0] as SalesAgreementPriceLine;\n return (\n <p className={classnames('msc-price__salesagreementdetail', props.className)}>\n <p>\n {/* Available date */}\n {` · ${format(\n props.priceResources?.salesAgreementExpirationDatePrompt ?? '',\n props.context.cultureFormatter.formatDate(firstPriceLine.EffectiveDate as Date),\n props.context.cultureFormatter.formatDate(firstPriceLine.ExpirationDate as Date)\n )}`}\n </p>\n <p>\n {/* Quantity commitment */}\n {` · ${format(props.priceResources?.salesAgreementCommittedQuantityPrompt ?? '', firstPriceLine.CommittedQuantity)}`}\n </p>\n <p>\n {/* Remaining quantity to qualify */}\n {` · ${format(props.priceResources?.salesAgreementRemainingQuantityPrompt ?? '', firstPriceLine.RemainingQuantity)}`}\n </p>\n </p>\n );\n};\n\n/**\n * Price.\n * @param props - The props.\n * @returns The JSX.Element.\n */\nconst Price: React.FC<IPriceComponentProps> = (props: IPriceComponentProps): JSX.Element | null => {\n // CustomerContextualPrice could be zero\n if (props.data.price.CustomerContextualPrice === undefined) {\n return null;\n }\n\n // Determine if contract price is avaiable/applied by:\n // isFeatureEnabled and SA price != 0, for PDP.\n // SA line id != 0, for cart line.\n if (props.isSalesAgreementPriceFeatureEnabled && props.data.price.SalesAgreementPrice !== 0) {\n const [isExpanded, setIsExpanded] = React.useState<boolean>(false);\n const toggle = () => {\n setIsExpanded(!isExpanded);\n };\n return (\n <span className={classnames('msc-price', props.className)}>\n <span className={classnames('msc-price__salesagreementprice', props.className)}>\n <p className='msc-price__actual' itemProp='price'>\n {formatCurrency(props, props.data.price.SalesAgreementPrice ?? props.data.price.CustomerContextualPrice, true)}\n </p>\n <Button\n className={isExpanded ? 'msc-price__salesagreementprompt_expanded' : 'msc-price__salesagreementprompt_collapsed'}\n aria-label={props.priceResources?.salesAgreementPricePrompt}\n onClick={toggle}\n aria-expanded={isExpanded}\n tabIndex={0}\n >\n {props.priceResources?.salesAgreementPricePrompt}\n </Button>\n {isExpanded && renderSalesAgreementDetail(props)}\n </span>\n </span>\n );\n }\n\n return (\n <span className={classnames('msc-price', props.className)}>\n {showStrikethroughPricing(props) ? renderCurrentPriceWithOriginalPrice(props) : renderCurrentPrice(props)}\n </span>\n );\n};\n\n/**\n * The PriceComponent.\n */\nexport const PriceComponent: React.FunctionComponent<IPriceComponentProps> = msdyn365Commerce.createComponent<IPriceComponent>('Price', {\n component: Price,\n ...priceComponentActions\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\nimport { ISwatchItem, SwatchComponent } from '../../product-dimension';\n\n/**\n * Props for product component swatch.\n */\nexport interface IProductComponentV2SwatchProps {\n context: ICoreContext;\n swatches: ISwatchItem[];\n dimensionType?: string;\n onSelectDimension(coreContext: ICoreContext, swatchItem: ISwatchItem, dimensionType?: string): void;\n}\n\n/**\n * Swatch for the product component.\n * @param props - Swatch props.\n * @returns React element.\n */\nexport const ProductComponentV2SwatchComponent: React.FC<IProductComponentV2SwatchProps> = (props: IProductComponentV2SwatchProps) => {\n const { context, dimensionType, swatches, onSelectDimension } = props;\n\n const onSelectItem = React.useCallback(\n (item: ISwatchItem) => {\n onSelectDimension(context, item, dimensionType);\n },\n [onSelectDimension, context, dimensionType]\n );\n\n if (ArrayExtensions.hasElements(swatches)) {\n return <SwatchComponent apiSettings={context.request.apiSettings} list={swatches} onSelectItem={onSelectItem} />;\n }\n\n return <div className='msc-swatch-empty' />;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport {\n getCatalogId,\n IComponent,\n IComponentProps,\n ICoreContext,\n IGridSettings,\n IImageData,\n IImageProps,\n IImageSettings,\n Image,\n IRequestContext,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport {\n ArrayExtensions,\n checkIfShouldDisplayAsSwatch,\n convertDimensionTypeToProductDimensionType,\n Dictionary,\n DimensionSwatchDisplayTypes,\n DimensionTypes,\n generateImageUrl,\n getProductPageUrlSync,\n IDimensionsApp,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { IPriceComponentResources, PriceComponent } from '../price/price.components';\nimport { ISwatchItem } from '../product-dimension';\nimport { RatingComponent } from '../rating/rating.component';\nimport { ProductComponentV2SwatchComponent } from './components';\nimport { IAttributeSwatch, IProductDimension, IProductSearchResult } from './interface';\n\n/**\n * Product component props interface.\n */\nexport interface IProductComponentV2Props extends IComponentProps<{ product?: IProductSearchResult }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n ratingCountAriaLabel?: string;\n isAllowBack?: boolean;\n telemetryContent?: ITelemetryContent;\n quickViewButton?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n inventoryLabel?: string;\n isPriceMinMaxEnabled?: boolean;\n priceResources?: IPriceComponentResources;\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\n swatchItemAriaLabel?: string;\n}\n\n/**\n * Product component interface.\n */\nexport interface IProductComponentV2 extends IComponent<IProductComponentV2Props> {}\n\nconst priceComponentActions = {};\n\n/**\n * Renders product comparison button similar to the quick view button.\n * @param productComparisonButton - React element of the button.\n * @param product - Current product info.\n * @param catalogId - Current catalog.\n * @returns React element for the specific product.\n */\nfunction renderProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: IProductSearchResult,\n catalogId: number\n): JSX.Element | undefined {\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\n/**\n * Product for the product component.\n * @param props - Product props.\n * @returns React element.\n */\nconst ProductCardV2: React.FC<IProductComponentV2Props> = (props: IProductComponentV2Props) => {\n const {\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n ratingAriaLabel,\n ratingCountAriaLabel,\n isAllowBack,\n typeName,\n id,\n telemetryContent,\n quickViewButton,\n productComparisonButton,\n inventoryLabel,\n isPriceMinMaxEnabled,\n priceResources,\n dimensionAvailabilities,\n swatchItemAriaLabel\n } = props;\n const product = data.product;\n\n /**\n * Updates the product url link to product details page.\n * @param productDetailsPageUrl - Product page url.\n * @param coreContext - Context of the module using the component.\n * @param queryString - Querystring to be added to the URL.\n * @returns The update product page url.\n */\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\n if (sourceUrl.search) {\n sourceUrl.search += `&${queryString}`;\n } else {\n sourceUrl.search += queryString;\n }\n\n const updatedUrl = new URL(sourceUrl.href);\n return updatedUrl.pathname + sourceUrl.search;\n }\n\n /**\n * Gets the product page url from the default swatch selected.\n * @param productData - Product card to be rendered.\n * @returns The default color swatch selected if any.\n */\n function getDefaultColorSwatchSelected(productData?: IProductSearchResult): IAttributeSwatch | null {\n if (!productData || !productData.attributeValues) {\n return null;\n }\n\n const colorAttribute = productData.attributeValues.find(\n attributeValue => attributeValue.keyName?.toLocaleLowerCase() === DimensionTypes.color\n );\n if (!ArrayExtensions.hasElements(colorAttribute?.swatches)) {\n return null;\n }\n\n const defaultSwatch = colorAttribute!.swatches.find(item => item.isDefault === true) ?? colorAttribute!.swatches[0];\n return defaultSwatch;\n }\n\n /**\n * Gets the product image from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\n function getProductImageUrlFromDefaultColorSwatch(coreContext: ICoreContext, productData?: IProductSearchResult): string | undefined {\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productData?.primaryImageUrl;\n }\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n return defaultSwatch && ArrayExtensions.hasElements(defaultSwatch.productImageUrls)\n ? generateImageUrl(defaultSwatch.productImageUrls[0], coreContext.request.apiSettings)\n : productData?.primaryImageUrl;\n }\n\n /**\n * Gets the product page url from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productUrl - Product page url for the product card.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\n function getProductPageUrlFromDefaultSwatch(\n coreContext: ICoreContext,\n productUrl: string,\n productData?: IProductSearchResult\n ): string | undefined {\n const siteContext = coreContext as ICoreContext<IDimensionsApp>;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n if (dimensionToPreSelectInProductCard === DimensionTypes.none) {\n return productUrl;\n }\n const defaultSwatch = getDefaultColorSwatchSelected(productData);\n if (!defaultSwatch || !defaultSwatch.swatchValue) {\n return productUrl;\n }\n\n const queryString = `color=${defaultSwatch.swatchValue}`;\n return updateProductUrl(productUrl, coreContext, queryString);\n }\n\n let productUrl = product ? getProductPageUrlSync(product.name ?? '', product.recordId, context.actionContext, undefined) : '';\n if (isAllowBack && productUrl) {\n productUrl = updateProductUrl(productUrl, context, 'back=true');\n }\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultColorSwatch(context, product) ?? product?.primaryImageUrl;\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\n const [productPageUrl, setProductPageUrl] = useState<string>(productPageUrlFromSwatch);\n const [productImageUrl, setProductImageUrl] = useState<string | undefined>(productImageUrlFromSwatch);\n const [selectedSwatchItems] = useState(new Dictionary<DimensionTypes, ISwatchItem>());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = context.app.config.enableStockCheck;\n\n /**\n * Updates the product page and Image url based on swatch selected.\n * @param coreContext - Context of the caller.\n * @param swatchItem - Dimension swatch selected.\n */\n const updatePageAndImageUrl = React.useCallback(\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\n const dimensionType = swatchItem.dimensionType;\n selectedSwatchItems.setValue(dimensionType, swatchItem);\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\n return;\n }\n const queryString = `${dimensionType}=${swatchItem.value}`;\n let productPageUrlWithSwatch = '';\n if (productPageUrl.includes(dimensionType)) {\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\n newUrl.searchParams.delete(dimensionType);\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\n } else {\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\n }\n setProductPageUrl(productPageUrlWithSwatch);\n if (dimensionType === DimensionTypes.color) {\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\n ? swatchItem.productImageUrls[0]\n : undefined;\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\n setProductImageUrl(newImageUrl);\n }\n },\n [selectedSwatchItems, context, productPageUrl]\n );\n\n if (!product) {\n return null;\n }\n\n const swatchItems = ArrayExtensions.validValues(\n product.attributeValues?.map(item => {\n const dimensionTypeValue = item.keyName?.toLocaleLowerCase() ?? '';\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(\n dimensionTypeValue as DimensionTypes,\n context as ICoreContext<IDimensionsApp>,\n DimensionSwatchDisplayTypes.productCard\n );\n if (!shouldDisplayAsSwatch) {\n return null;\n }\n\n const siteContext = context as ICoreContext<IDimensionsApp>;\n const dimensionToPreSelectInProductCard = siteContext.app.config.dimensionToPreSelectInProductCard;\n const dimensionType = dimensionTypeValue as DimensionTypes;\n const swatches =\n item.swatches?.map<ISwatchItem>(swatchItem => {\n return {\n itemId: `${item.recordId ?? ''}-${dimensionTypeValue}-${swatchItem.swatchValue ?? ''}`,\n value: swatchItem.swatchValue ?? '',\n dimensionType,\n colorHexCode: swatchItem.swatchColorHexCode,\n imageUrl: swatchItem.swatchImageUrl,\n productImageUrls: swatchItem.productImageUrls,\n isDefault: swatchItem.isDefault,\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\n isDisabled:\n enableStockCheck &&\n dimensionAvailabilities?.find(\n dimensionAvailability => dimensionAvailability.value === (swatchItem.swatchValue ?? '')\n )?.isDisabled\n };\n }) ?? [];\n if (\n dimensionToPreSelectInProductCard !== DimensionTypes.none &&\n ArrayExtensions.hasElements(swatches) &&\n !swatches.some(swatch => swatch.isDefault) &&\n dimensionType === DimensionTypes.color\n ) {\n swatches[0].isDefault = true;\n }\n return { recordId: item.recordId, swatches };\n })\n );\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.recordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\n\n /**\n * Gets the react node for product unit of measure display.\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\n if (!unitOfMeasure) {\n return null;\n }\n return (\n <div className='msc-product__unit-of-measure'>\n <span>{unitOfMeasure}</span>\n </div>\n );\n }\n\n /**\n * Gets the react node for product availability.\n * @param inventoryAvailabilityLabel - The product information.\n * @returns The node representing markup for product availability.\n */\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\n return null;\n }\n\n return (\n <div className='msc-product__availability'>\n <span>{inventoryAvailabilityLabel}</span>\n </div>\n );\n }\n\n /**\n * Gets the react node for product dimension as swatch.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductDimensions(): JSX.Element | null {\n if (!ArrayExtensions.hasElements(swatchItems)) {\n return null;\n }\n\n return (\n <div className='msc-product__dimensions'>\n {swatchItems.map(item => {\n return (\n <ProductComponentV2SwatchComponent\n key={item.recordId}\n context={context}\n onSelectDimension={updatePageAndImageUrl}\n swatches={item.swatches}\n />\n );\n })}\n </div>\n );\n }\n\n /**\n * Gets the react node for product description.\n * @param quickview - Quick view node.\n * @param item - Product id to de displayed in quickview.\n * @returns The product quickview component.\n */\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\n if (quickview === null) {\n return undefined;\n }\n const selectedDimensions: IProductDimension[] = selectedSwatchItems.getValues().map<IProductDimension>(swatches => {\n return {\n dimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\n DimensionValue: {\n RecordId: 0,\n Value: swatches.value\n }\n };\n });\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\n }\n\n /**\n * Gets the aria label for rating.\n * @param rating - Product rating.\n * @param ratingAriaLabelText - Aria label format for rating.\n * @returns The product rating aria label string.\n */\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\n if (rating && ratingAriaLabelText) {\n const roundedRating = rating.toFixed(2);\n return format(ratingAriaLabelText || '', roundedRating, '5');\n }\n return '';\n }\n\n /**\n * Gets the aria label for review count.\n * @param reviewCount - Product review count.\n * @param ratingCountAriaLabelText - Aria label format for review.\n * @returns The product review count aria label string.\n */\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\n if (reviewCount && ratingCountAriaLabelText) {\n return format(ratingCountAriaLabelText || '', reviewCount);\n }\n return '';\n }\n\n /**\n * Gets the aria label string for product that includes product name with its price and rating.\n * @param name - Product name.\n * @param price - Product price.\n * @param rating - Product rating.\n * @param ratingAriaLabelText - Rating aria label text.\n * @param reviewCount - Product review count.\n * @param ratingCountAriaLabelText - Number of ratings.\n * @returns The aria label string for the product card.\n */\n function renderLabel(\n name?: string,\n price?: string,\n rating?: number,\n ratingAriaLabelText?: string,\n reviewCount?: number,\n ratingCountAriaLabelText?: string,\n availability?: string\n ): string {\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\n } ${availability ?? ''}`;\n }\n\n /**\n * Gets the react component for product rating.\n * @param productCardimageSettings - Module image settings for product card.\n * @param gridSettings - Grid settings defined in theme.\n * @param imageUrl - Image url.\n * @param fallbackImageUrl - Fallback url for imge.\n * @param altText - Image Alt text.\n * @param requestContext - Request context using the component.\n * @returns React component for product image.\n */\n function renderProductPlacementImage(\n productCardimageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n fallbackImageUrl?: string,\n altText?: string,\n requestContext?: IRequestContext\n ): JSX.Element | null {\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = context.app.config.placeholderImageName as string;\n let fallbackImageSource = fallbackImageUrl;\n if (emptyPlaceHolderImage && fallbackImageUrl) {\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\n }\n const image: IImageData = {\n src: imageUrl,\n altText: altText ? altText : '',\n fallBackSrc: fallbackImageSource\n };\n const imageProps: IImageProps = { gridSettings };\n\n imageProps.gridSettings = gridSettings;\n imageProps.imageSettings = productCardimageSettings;\n imageProps.imageSettings.cropFocalRegion = true;\n return <Image {...image} {...imageProps} loadFailureBehavior='empty' requestContext={requestContext} bypassHideOnFailure />;\n }\n\n /**\n * Gets the react component for product rating.\n * @param coreContext - Context of the module using the component.\n * @param moduleTypeName - Module type name.\n * @param moduleId - Module id using the component.\n * @param productBasePrice - Product base price.\n * @param adjustedProductPrice - Product adjusted price.\n * @param maxVariantProductPrice - Product variant max price.\n * @param minVariantPrice - Product variant min price.\n * @param savingsPriceResourceText - Product price saving text.\n * @param freePriceResourceText - Product price free text.\n * @param originalPriceResourceText - Product price original text.\n * @param currentPriceResourceText - Product price current text.\n * @returns React component for Product price.\n */\n function renderPrice(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n productBasePrice?: number,\n adjustedProductPrice?: number,\n maxVariantProductPrice?: number,\n minVariantPrice?: number,\n savingsPriceResourceText?: string,\n freePriceResourceText?: string,\n originalPriceResourceText?: string,\n currentPriceResourceText?: string\n ): JSX.Element | null {\n const price = {\n BasePrice: productBasePrice,\n AdjustedPrice: adjustedProductPrice,\n CustomerContextualPrice: adjustedProductPrice,\n MaxVariantPrice: maxVariantProductPrice ? maxVariantProductPrice : adjustedProductPrice,\n MinVariantPrice: minVariantPrice ? minVariantPrice : adjustedProductPrice\n };\n\n const channelConfig = coreContext.request.channel;\n return (\n <PriceComponent\n context={coreContext}\n id={moduleId}\n typeName={moduleTypeName}\n data={{ price }}\n savingsText={savingsPriceResourceText}\n freePriceText={freePriceResourceText}\n originalPriceText={originalPriceResourceText}\n currentPriceText={currentPriceResourceText}\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\n priceResources={priceResources}\n currencyCode={channelConfig?.Currency}\n />\n );\n }\n\n /**\n * Gets the react node for product description.\n * @param description - Product description.\n * @returns The product description component.\n */\n function renderDescription(description?: string): JSX.Element | null {\n return <p className='msc-product__text'>{description}</p>;\n }\n\n /**\n * Gets the react component for product rating.\n * @param coreContext - Context of the module using the component.\n * @param moduleTypeName - Module type name.\n * @param moduleId - Module id using the component.\n * @param avgRating - Average rating.\n * @param totalRatings - Total rating.\n * @param ariaLabel - Aria label for rating.\n * @returns React component for Product rating.\n */\n function renderRating(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string\n ): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() ?? undefined;\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\n\n return (\n <RatingComponent\n context={coreContext}\n id={moduleId}\n typeName={moduleTypeName}\n avgRating={avgRating}\n ratingCount={numberRatings}\n readOnly\n ariaLabel={ratingAriaLabelText}\n ratingCountAriaLabel={ratingCountAriaLabelText}\n data={{}}\n />\n );\n }\n\n return (\n <>\n <a\n href={productPageUrl}\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.name!)}\n aria-label={renderLabel(\n product.name,\n context.cultureFormatter.formatCurrency(product.price),\n product.averageRating,\n ratingAriaLabel,\n product.totalRatings,\n ratingCountAriaLabel,\n inventoryLabel\n )}\n className='msc-product'\n {...attribute}\n >\n <div className='msc-product__image'>\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.primaryImageUrl,\n product.name,\n context.actionContext.requestContext\n )}\n </div>\n <div className='msc-product__title'>{product.name}</div>\n </a>\n {renderProductDimensions()}\n <div className='msc-product__details'>\n {renderPrice(\n context,\n typeName,\n id,\n product.basePrice,\n product.price,\n product.maxVariantPrice,\n product.minVariantPrice,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText\n )}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.defaultUnitOfMeasure)}\n {renderDescription(product.description)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.averageRating, product.totalRatings, ratingAriaLabel)}\n {renderProductAvailability(inventoryLabel)}\n </div>\n {quickViewButton && renderQuickView(quickViewButton, product.recordId)}\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\n </>\n );\n};\n\n/**\n * Export product component interface.\n */\nexport const ProductComponentV2: React.FunctionComponent<IProductComponentV2Props> = msdyn365Commerce.createComponent<IProductComponentV2>(\n 'ProductV2',\n { component: ProductCardV2, ...priceComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core-internal';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\nimport { ISwatchItem, SwatchComponent } from '../../product-dimension';\n\n/**\n * Props for product component swatch.\n */\nexport interface IProductComponentSwatchProps {\n context: ICoreContext;\n swatches: ISwatchItem[];\n dimensionType?: string;\n onSelectDimension(coreContext: ICoreContext, swatchItem: ISwatchItem, dimensionType?: string): void;\n}\n\n/**\n * Swatch for the product component.\n * @param props - Swatch props.\n * @returns React element.\n */\nexport const ProductComponentSwatchComponent: React.FC<IProductComponentSwatchProps> = (props: IProductComponentSwatchProps) => {\n const { context, dimensionType, swatches, onSelectDimension } = props;\n\n const onSelectItem = React.useCallback(\n (item: ISwatchItem) => {\n onSelectDimension(context, item, dimensionType);\n },\n [onSelectDimension, context, dimensionType]\n );\n if (ArrayExtensions.hasElements(swatches)) {\n return <SwatchComponent apiSettings={context.request.apiSettings} list={swatches} onSelectItem={onSelectItem} />;\n }\n\n return <div className='msc-swatch-empty' />;\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductsDimensionsAvailabilities } from '@msdyn365-commerce/commerce-entities';\nimport {\n getCatalogId,\n IComponent,\n IComponentProps,\n ICoreContext,\n IGridSettings,\n IImageData,\n IImageProps,\n IImageSettings,\n Image,\n IRequestContext,\n msdyn365Commerce\n} from '@msdyn365-commerce/core';\nimport {\n AttributeSwatch,\n ProductDimension,\n ProductPrice,\n ProductSearchResult,\n ProductType,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n checkIfShouldDisplayAsSwatch,\n convertDimensionTypeToProductDimensionType,\n Dictionary,\n DimensionSwatchDisplayTypes,\n DimensionTypes,\n generateImageUrl,\n getProductPageUrlSync,\n IDimensionsApp,\n StringExtensions,\n validateCatalogId\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick\n} from '@msdyn365-commerce-modules/utilities';\nimport React, { useState } from 'react';\n\nimport { IPriceComponentResources, PriceComponent } from '../price/price.components';\nimport { ISwatchItem } from '../product-dimension';\nimport { RatingComponent } from '../rating/rating.component';\nimport { ProductComponentSwatchComponent } from './components';\n\nexport interface IProductComponentProps extends IComponentProps<{ product?: ProductSearchResult; productPrice?: ProductPrice }> {\n className?: string;\n imageSettings?: IImageSettings;\n savingsText?: string;\n freePriceText?: string;\n originalPriceText?: string;\n currentPriceText?: string;\n ratingAriaLabel?: string;\n ratingCountAriaLabel?: string;\n allowBack?: boolean;\n telemetryContent?: ITelemetryContent;\n quickViewButton?: React.ReactNode;\n productComparisonButton?: React.ReactNode;\n inventoryLabel?: string;\n isPriceMinMaxEnabled?: boolean;\n priceResources?: IPriceComponentResources;\n dimensionAvailabilities?: IProductsDimensionsAvailabilities[];\n swatchItemAriaLabel?: string;\n}\n\nexport interface IProductComponent extends IComponent<IProductComponentProps> {}\n\nconst PriceComponentActions = {};\n\n/**\n * Renders product comparison button similar to the quick view button.\n * @param productComparisonButton - React element of the button.\n * @param product - Current product info.\n * @param catalogId - Current catalog.\n * @returns React element for the specific product.\n */\nfunction renderProductComparisonButton(\n productComparisonButton: React.ReactNode,\n product: ProductSearchResult,\n catalogId: number\n): JSX.Element | undefined {\n validateCatalogId(catalogId);\n return React.cloneElement(productComparisonButton as React.ReactElement, { product, catalogId });\n}\n\nconst ProductCard: React.FC<IProductComponentProps> = ({\n data,\n context,\n imageSettings,\n savingsText,\n freePriceText,\n originalPriceText,\n currentPriceText,\n ratingAriaLabel,\n ratingCountAriaLabel,\n allowBack,\n typeName,\n id,\n telemetryContent,\n quickViewButton,\n productComparisonButton,\n inventoryLabel,\n isPriceMinMaxEnabled,\n priceResources,\n dimensionAvailabilities,\n swatchItemAriaLabel\n}) => {\n const product = data.product;\n const productPrice = data.productPrice;\n const dimensionContext = context as ICoreContext<IDimensionsApp>;\n const dimensionToPreSelectInProductCard = dimensionContext.app.config.dimensionToPreSelectInProductCard;\n\n /**\n * Updates the product url link to product details page.\n * @param productDetailsPageUrl - Product page url.\n * @param coreContext - Context of the module using the component.\n * @param queryString - Querystring to be added to the URL.\n * @returns The update product page url.\n */\n function updateProductUrl(productDetailsPageUrl: string, coreContext: ICoreContext, queryString: string): string {\n const sourceUrl = new URL(productDetailsPageUrl, coreContext.request.apiSettings.baseUrl);\n if (sourceUrl.search) {\n sourceUrl.search += `&${queryString}`;\n } else {\n sourceUrl.search += queryString;\n }\n\n const updatedUrl = new URL(sourceUrl.href);\n return updatedUrl.pathname + sourceUrl.search;\n }\n\n /**\n * Gets the product page url from the default swatch selected.\n * @param productData - Product card to be rendered.\n * @returns The default swatch selected if any.\n */\n function getDefaultSwatchSelected(productData?: ProductSearchResult): AttributeSwatch | null {\n if (!productData || !productData.AttributeValues) {\n return null;\n }\n\n const attributeSwatches = productData.AttributeValues.find(\n attributeValue => attributeValue.KeyName?.toLocaleLowerCase() === dimensionToPreSelectInProductCard\n )?.Swatches;\n\n if (!ArrayExtensions.hasElements(attributeSwatches)) {\n return null;\n }\n\n const defaultSwatch = attributeSwatches.find(item => item.IsDefault === true) ?? attributeSwatches[0];\n return defaultSwatch;\n }\n\n /**\n * Gets the product image from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\n function getProductImageUrlFromDefaultSwatch(coreContext: ICoreContext, productData?: ProductSearchResult): string | undefined {\n const defaultSwatch = getDefaultSwatchSelected(productData);\n const swatchProductImageUrls = defaultSwatch?.ProductImageUrls;\n if (!ArrayExtensions.hasElements(swatchProductImageUrls)) {\n return productData?.PrimaryImageUrl;\n }\n\n return generateImageUrl(swatchProductImageUrls[0], coreContext.request.apiSettings);\n }\n\n /**\n * Gets the product page url from the default swatch selected.\n * @param coreContext - Context of the module using the component.\n * @param productUrl - Product page url for the product card.\n * @param productData - Product card to be rendered.\n * @returns The product card image url.\n */\n function getProductPageUrlFromDefaultSwatch(\n coreContext: ICoreContext,\n productUrl: string,\n productData?: ProductSearchResult\n ): string | undefined {\n const defaultSwatch = getDefaultSwatchSelected(productData);\n if (!defaultSwatch?.SwatchValue) {\n return productUrl;\n }\n\n const queryStringEncoded = encodeURIComponent(defaultSwatch.SwatchValue);\n const queryString = `${dimensionToPreSelectInProductCard}=${queryStringEncoded}`;\n return updateProductUrl(productUrl, coreContext, queryString);\n }\n\n let productUrl = product ? getProductPageUrlSync(product.Name ?? '', product.RecordId, context.actionContext, undefined) : '';\n if (allowBack && productUrl) {\n productUrl = updateProductUrl(productUrl, context, 'back=true');\n }\n\n const productImageUrlFromSwatch = getProductImageUrlFromDefaultSwatch(context, product) ?? product?.PrimaryImageUrl;\n const productPageUrlFromSwatch = getProductPageUrlFromDefaultSwatch(context, productUrl, product) ?? productUrl;\n\n const [productPageUrl, setProductPageUrl] = useState<string>(productPageUrlFromSwatch);\n const [productImageUrl, setProductImageUrl] = useState<string | undefined>(productImageUrlFromSwatch);\n const [selectedSwatchItems] = useState(new Dictionary<DimensionTypes, ISwatchItem>());\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access -- app context is generic\n const enableStockCheck = context.app.config.enableStockCheck;\n\n /**\n * Updates the product page and Image url based on swatch selected.\n * @param coreContext - Context of the caller.\n * @param swatchItem - Dimension swatch selected.\n */\n const updatePageAndImageUrl = React.useCallback(\n (coreContext: ICoreContext, swatchItem: ISwatchItem) => {\n const dimensionType = swatchItem.dimensionType;\n selectedSwatchItems.setValue(dimensionType, swatchItem);\n if (StringExtensions.isNullOrWhitespace(swatchItem.value)) {\n return;\n }\n const queryString = `${dimensionType}=${swatchItem.value}`;\n let productPageUrlWithSwatch = '';\n if (productPageUrl.includes(dimensionType)) {\n const newUrl = new URL(productPageUrl, coreContext.request.apiSettings.baseUrl);\n newUrl.searchParams.delete(dimensionType);\n productPageUrlWithSwatch = updateProductUrl(newUrl.toString(), context, queryString);\n } else {\n productPageUrlWithSwatch = updateProductUrl(productPageUrl, context, queryString);\n }\n setProductPageUrl(productPageUrlWithSwatch);\n if (dimensionType === dimensionToPreSelectInProductCard) {\n const swatchProductImageUrl = ArrayExtensions.hasElements(swatchItem.productImageUrls)\n ? swatchItem.productImageUrls[0]\n : undefined;\n const newImageUrl = generateImageUrl(swatchProductImageUrl, coreContext.request.apiSettings);\n setProductImageUrl(newImageUrl);\n }\n },\n [selectedSwatchItems, context, productPageUrl]\n );\n\n if (!product) {\n return null;\n }\n\n const swatchItems = ArrayExtensions.validValues(\n product.AttributeValues?.map(item => {\n const dimensionTypeValue = item.KeyName?.toLocaleLowerCase() ?? '';\n const shouldDisplayAsSwatch = checkIfShouldDisplayAsSwatch(\n dimensionTypeValue as DimensionTypes,\n context as ICoreContext<IDimensionsApp>,\n DimensionSwatchDisplayTypes.productCard\n );\n if (!shouldDisplayAsSwatch) {\n return null;\n }\n\n const dimensionType = dimensionTypeValue as DimensionTypes;\n const swatches =\n item.Swatches?.map<ISwatchItem>(swatchItem => {\n return {\n itemId: `${item.RecordId ?? ''}-${dimensionTypeValue}-${swatchItem.SwatchValue ?? ''}`,\n value: swatchItem.SwatchValue ?? '',\n dimensionType,\n colorHexCode: swatchItem.SwatchColorHexCode,\n imageUrl: swatchItem.SwatchImageUrl,\n productImageUrls: swatchItem.ProductImageUrls,\n isDefault: swatchItem.IsDefault,\n swatchItemAriaLabel: swatchItemAriaLabel ? format(swatchItemAriaLabel, dimensionType) : '',\n isDisabled:\n enableStockCheck &&\n dimensionAvailabilities?.find(\n dimensionAvailability => dimensionAvailability.value === (swatchItem.SwatchValue ?? '')\n )?.isDisabled\n };\n }) ?? [];\n if (\n dimensionType === dimensionToPreSelectInProductCard &&\n ArrayExtensions.hasElements(swatches) &&\n !swatches.some(swatch => swatch.isDefault)\n ) {\n swatches[0].isDefault = true;\n }\n return { recordId: item.RecordId, swatches };\n })\n );\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', telemetryContent!, '', product.RecordId.toString());\n\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- -- Do not need type check for appsettings\n const isUnitOfMeasureEnabled = context.app.config && context.app.config.unitOfMeasureDisplayType === 'buyboxAndBrowse';\n\n /**\n * Gets the react node for product unit of measure display.\n * @param unitOfMeasure - DefaultUnitOfMeasure property from product.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductUnitOfMeasure(unitOfMeasure?: string): JSX.Element | null {\n if (!unitOfMeasure) {\n return null;\n }\n return (\n <div className='msc-product__unit-of-measure'>\n <span>{unitOfMeasure}</span>\n </div>\n );\n }\n\n /**\n * Gets the react node for product availability.\n * @param inventoryAvailabilityLabel - The product information.\n * @returns The node representing markup for product availability.\n */\n function renderProductAvailability(inventoryAvailabilityLabel: string | undefined): JSX.Element | null {\n if (!inventoryAvailabilityLabel || inventoryAvailabilityLabel === '') {\n return null;\n }\n\n return (\n <div className='msc-product__availability'>\n <span>{inventoryAvailabilityLabel}</span>\n </div>\n );\n }\n\n /**\n * Gets the react node for product dimension as swatch.\n * @returns The node representing markup for unit of measure component.\n */\n function renderProductDimensions(): JSX.Element | null {\n if (!ArrayExtensions.hasElements(swatchItems)) {\n return null;\n }\n\n return (\n <div className='msc-product__dimensions'>\n {swatchItems.map(item => {\n return (\n <ProductComponentSwatchComponent\n key={item.recordId}\n context={context}\n onSelectDimension={updatePageAndImageUrl}\n swatches={item.swatches}\n />\n );\n })}\n </div>\n );\n }\n\n /**\n * Gets the react node for product description.\n * @param quickview - Quick view node.\n * @param item - Product id to de displayed in quickview.\n * @returns The product quickview component.\n */\n function renderQuickView(quickview: React.ReactNode, item?: number): JSX.Element | undefined {\n if (quickview === null) {\n return undefined;\n }\n const selectedDimensions: ProductDimension[] = selectedSwatchItems.getValues().map<ProductDimension>(swatches => {\n return {\n DimensionTypeValue: convertDimensionTypeToProductDimensionType(swatches.dimensionType),\n DimensionValue: {\n RecordId: 0,\n Value: swatches.value\n }\n };\n });\n return React.cloneElement(quickview as React.ReactElement, { selectedProductId: item, selectedDimensions });\n }\n\n /**\n * Gets the aria label for rating.\n * @param rating - Product rating.\n * @param ratingAriaLabelText - Aria label format for rating.\n * @returns The product rating aria label string.\n */\n function getRatingAriaLabel(rating?: number, ratingAriaLabelText?: string): string {\n if (rating && ratingAriaLabelText) {\n const roundedRating = rating.toFixed(2);\n return format(ratingAriaLabelText || '', roundedRating, '5');\n }\n return '';\n }\n\n /**\n * Gets the aria label for review count.\n * @param reviewCount - Product review count.\n * @param ratingCountAriaLabelText - Aria label format for review.\n * @returns The product review count aria label string.\n */\n function getReviewAriaLabel(reviewCount?: number, ratingCountAriaLabelText?: string): string {\n if (reviewCount && ratingCountAriaLabelText) {\n return format(ratingCountAriaLabelText || '', reviewCount);\n }\n return '';\n }\n\n /**\n * Gets the aria label string for product that includes product name with its price and rating.\n * @param name - Product name.\n * @param price - Product price.\n * @param rating - Product rating.\n * @param ratingAriaLabelText - Rating aria label text.\n * @param reviewCount - Product review count.\n * @param ratingCountAriaLabelText - Number of ratings.\n * @returns The aria label string for the product card.\n */\n function renderLabel(\n name?: string,\n price?: string,\n rating?: number,\n ratingAriaLabelText?: string,\n reviewCount?: number,\n ratingCountAriaLabelText?: string,\n availability?: string\n ): string {\n const reviewCountArialableText = getReviewAriaLabel(reviewCount, ratingCountAriaLabelText ?? '');\n return `${name ?? ''} ${price ?? ''} ${getRatingAriaLabel(rating, ratingAriaLabelText)}${\n reviewCountArialableText ? ` ${reviewCountArialableText}` : ''\n } ${availability ?? ''}`;\n }\n\n /**\n * Gets the react component for product rating.\n * @param productCardimageSettings - Module image settings for product card.\n * @param gridSettings - Grid settings defined in theme.\n * @param imageUrl - Image url.\n * @param fallbackImageUrl - Fallback url for imge.\n * @param altText - Image Alt text.\n * @param requestContext - Request context using the component.\n * @returns React component for product image.\n */\n function renderProductPlacementImage(\n productCardimageSettings?: IImageSettings,\n gridSettings?: IGridSettings,\n imageUrl?: string,\n fallbackImageUrl?: string,\n altText?: string,\n requestContext?: IRequestContext\n ): JSX.Element | null {\n if (!imageUrl || !gridSettings || !productCardimageSettings) {\n return null;\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = context.app.config.placeholderImageName as string;\n let fallbackImageSource = fallbackImageUrl;\n if (emptyPlaceHolderImage && fallbackImageUrl) {\n fallbackImageSource = `${fallbackImageUrl},${emptyPlaceHolderImage}`;\n }\n const image: IImageData = {\n src: imageUrl,\n altText: altText ? altText : '',\n fallBackSrc: fallbackImageSource\n };\n const imageProps: IImageProps = { gridSettings };\n\n imageProps.gridSettings = gridSettings;\n imageProps.imageSettings = productCardimageSettings;\n imageProps.imageSettings.cropFocalRegion = true;\n return <Image {...image} {...imageProps} loadFailureBehavior='empty' requestContext={requestContext} bypassHideOnFailure />;\n }\n\n /**\n * Gets the react component for product rating.\n * @param coreContext - Context of the module using the component.\n * @param moduleTypeName - Module type name.\n * @param moduleId - Module id using the component.\n * @param productSearchResult - Product search result.\n * @param savingsPriceResourceText - Product price saving text.\n * @param freePriceResourceText - Product price free text.\n * @param originalPriceResourceText - Product price original text.\n * @param currentPriceResourceText - Product price current text.\n * @param productPrice - Product Price.\n * @returns React component for Product price.\n */\n function renderPrice(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n productSearchResult: ProductSearchResult,\n savingsPriceResourceText?: string,\n freePriceResourceText?: string,\n originalPriceResourceText?: string,\n currentPriceResourceText?: string,\n productPrice?: ProductPrice\n ): JSX.Element {\n const product: SimpleProduct = {\n // This is a fake product. The product type is only used for price component to determine if it should show price range or not.\n ProductTypeValue: productSearchResult.IsMasterProduct ? ProductType.Master : ProductType.Standalone\n } as SimpleProduct;\n\n const price: ProductPrice =\n productPrice ??\n ({\n BasePrice: productSearchResult.BasePrice,\n AdjustedPrice: productSearchResult.Price,\n CustomerContextualPrice: productSearchResult.Price,\n // TODO from [gaweiche]: We should not put productSearchResult.Price into min/max price.\n // To minimize the change in a backport PR, I'll keep it as is for now.\n MaxVariantPrice: productSearchResult.MaxVariantPrice ? productSearchResult.MaxVariantPrice : productSearchResult.Price,\n MinVariantPrice: productSearchResult.MinVariantPrice ? productSearchResult.MinVariantPrice : productSearchResult.Price\n } as ProductPrice);\n\n return (\n <PriceComponent\n context={coreContext}\n id={moduleId}\n typeName={moduleTypeName}\n product={product}\n data={{ price }}\n savingsText={savingsPriceResourceText}\n freePriceText={freePriceResourceText}\n originalPriceText={originalPriceResourceText}\n currentPriceText={currentPriceResourceText}\n isPriceMinMaxEnabled={isPriceMinMaxEnabled}\n priceResources={priceResources}\n />\n );\n }\n\n /**\n * Gets the react node for product description.\n * @param description - Product description.\n * @returns The product description component.\n */\n function renderDescription(description?: string): JSX.Element | null {\n return <p className='msc-product__text'>{description}</p>;\n }\n\n /**\n * Gets the react component for product rating.\n * @param coreContext - Context of the module using the component.\n * @param moduleTypeName - Module type name.\n * @param moduleId - Module id using the component.\n * @param avgRating - Average rating.\n * @param totalRatings - Total rating.\n * @param ariaLabel - Aria label for rating.\n * @returns React component for Product rating.\n */\n function renderRating(\n coreContext: ICoreContext,\n moduleTypeName: string,\n moduleId: string,\n avgRating?: number,\n totalRatings?: number,\n ariaLabel?: string\n ): JSX.Element | null {\n if (!avgRating) {\n return null;\n }\n\n const numberRatings = totalRatings?.toString() || undefined;\n const ratingAriaLabelText = getRatingAriaLabel(avgRating, ariaLabel);\n const ratingCountAriaLabelText = getReviewAriaLabel(Number(numberRatings), ratingCountAriaLabel);\n\n return (\n <RatingComponent\n context={coreContext}\n id={moduleId}\n typeName={moduleTypeName}\n avgRating={avgRating}\n ratingCount={numberRatings}\n readOnly\n ariaLabel={ratingAriaLabelText}\n ratingCountAriaLabel={ratingCountAriaLabelText}\n data={{}}\n />\n );\n }\n\n return (\n <>\n <a\n href={productPageUrl}\n onClick={onTelemetryClick(telemetryContent!, payLoad, product.Name!)}\n aria-label={renderLabel(\n product.Name,\n context.cultureFormatter.formatCurrency(product.Price),\n product.AverageRating,\n ratingAriaLabel,\n product.TotalRatings,\n ratingCountAriaLabel,\n inventoryLabel\n )}\n className='msc-product'\n {...attribute}\n >\n <div className='msc-product__image'>\n {renderProductPlacementImage(\n imageSettings,\n context.request.gridSettings,\n productImageUrl,\n product.PrimaryImageUrl,\n product.Name,\n context.actionContext.requestContext\n )}\n </div>\n <h2 className='msc-product__title'>{product.Name}</h2>\n </a>\n {renderProductDimensions()}\n <div className='msc-product__details'>\n {renderPrice(context, typeName, id, product, savingsText, freePriceText, originalPriceText, currentPriceText, productPrice)}\n {isUnitOfMeasureEnabled && renderProductUnitOfMeasure(product.DefaultUnitOfMeasure)}\n {renderDescription(product.Description)}\n {!context.app.config.hideRating &&\n renderRating(context, typeName, id, product.AverageRating, product.TotalRatings, ratingAriaLabel)}\n {renderProductAvailability(inventoryLabel)}\n </div>\n {quickViewButton && renderQuickView(quickViewButton, product.RecordId)}\n {productComparisonButton && renderProductComparisonButton(productComparisonButton, product, getCatalogId(context.request))}\n </>\n );\n};\n\nexport const ProductComponent: React.FunctionComponent<IProductComponentProps> = msdyn365Commerce.createComponent<IProductComponent>(\n 'Product',\n { component: ProductCard, ...PriceComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IDropdownItemProps, IDropdownProps } from './dropdown.props';\n\ninterface IDropdownState {\n /**\n * @friendlyName selectedIndex\n * @description selected index\n */\n selectedIndex: string;\n}\n\n/**\n *\n * DropDown component\n * @extends {React.PureComponent<IDropdownProps, IDropdownState>}\n */\nexport class Dropdown extends React.PureComponent<IDropdownProps, IDropdownState> {\n private readonly selectMenu: React.RefObject<HTMLSelectElement> = React.createRef<HTMLSelectElement>();\n\n private readonly payLoad: IPayLoad;\n\n public constructor(props: IDropdownProps) {\n super(props);\n\n if (this.props.onInitialize) {\n this.props.onInitialize({\n initializedDimension: this.props.dropdownId\n });\n }\n\n const selectedItem = this.props.dropdownList.find(item => item.isDefault);\n if (selectedItem) {\n this.state = {\n selectedIndex: selectedItem.id.toString()\n };\n if (this.props.onChange) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Update for default.\n this.props.onChange({\n dropdownId: this.props.dropdownId,\n selectId: selectedItem.id,\n selectedValue: selectedItem.value\n });\n }\n } else {\n this.state = {\n selectedIndex: ''\n };\n }\n this.payLoad = getPayloadObject('click', props.telemetryContent!, this.props.dropdownName);\n }\n\n public render(): JSX.Element {\n const { dropdownId, dropdownList, dropdownName, dropdownToggleName } = this.props;\n const attribute = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n return (\n <select\n id={`msc-dropdown__entry-${dropdownId}`}\n ref={this.selectMenu}\n aria-label={dropdownName}\n className='msc-dropdown__select'\n onChange={this._onChanged}\n {...attribute}\n >\n <option value='' aria-selected={this.state.selectedIndex === ''} selected={this.state.selectedIndex === ''} hidden disabled>\n {dropdownToggleName}\n </option>\n {dropdownList.map((item: IDropdownItemProps) => (\n <option\n value={item.id}\n key={item.id}\n selected={this.state.selectedIndex === item.id.toString()}\n aria-selected={this.state.selectedIndex === item.id.toString()}\n className={item.isDisabled ? 'msc-dropdown__select__disabled' : undefined}\n >\n {item.value}\n </option>\n ))}\n </select>\n );\n }\n\n private readonly _onChanged = async (event: React.ChangeEvent<HTMLSelectElement>) => {\n this.setState({ selectedIndex: event.target.value });\n\n if (this.props.onChange) {\n await this.props.onChange({\n dropdownId: this.props.dropdownId,\n selectId: event.target.value,\n selectedValue: event.target.innerText\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 { ProductDimensionFull } from '@msdyn365-commerce/commerce-entities';\nimport { ICoreContext, ITelemetry } from '@msdyn365-commerce/core';\nimport { SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { Dropdown, IDropdownItemProps, IDropdownOnInitializeNotification, IDropdownOnSelectionChangeNotification } from './dropdown';\nimport {\n IErrorState,\n IProductDimensionCallbacks,\n IProductDimensionConfigureDropdownViewProps,\n IProductDimensionConfigureResources,\n IProductDimensionConfigureViewProps\n} from './product-dimension-interface';\n\nlet telemetryContent: ITelemetryContent;\n\n// Quantity on change.\nconst onChange = async (\n notification: IDropdownOnSelectionChangeNotification,\n dimensionChanged: (newValue: number, selectedDimensionValue: string) => Promise<void>\n): Promise<void> => {\n await dimensionChanged(+notification.dropdownId, notification.selectId);\n};\n\nconst _onInitializedDimension = (\n notification: IDropdownOnInitializeNotification,\n initializeDimension?: (initializedDimension: string) => void\n): void => {\n if (initializeDimension) {\n initializeDimension(notification.initializedDimension);\n }\n};\n\n// This method will map all product dimension to correct value and returns respective dropdown.\nconst mapProductDimensionFullToDropdownViewProps = (\n productDimensionFull: ProductDimensionFull,\n moduleName: string,\n selectDimensionFormatString: string,\n resources: IProductDimensionConfigureResources,\n getDropdownName: (dimensionType: number, resources: IProductDimensionConfigureResources) => string,\n dropdownCallback: (notification: IDropdownOnSelectionChangeNotification) => Promise<void>,\n onInitializedDimension: (notification: IDropdownOnInitializeNotification) => void,\n configureErrors?: { [configureId: string]: string | undefined }\n): IProductDimensionConfigureDropdownViewProps => {\n const dropdownName = getDropdownName(productDimensionFull.DimensionTypeValue, resources);\n const dropdownId = productDimensionFull.DimensionTypeValue.toString();\n const dropdownToggleName = selectDimensionFormatString.replace('{0}', dropdownName.toLocaleLowerCase());\n const dropdownList: IDropdownItemProps[] = productDimensionFull.DimensionValues\n ? productDimensionFull.DimensionValues.map<IDropdownItemProps>(dM => {\n return { value: dM.Value || '', id: dM.RecordId.toString() };\n })\n : [];\n const errorMessage = configureErrors ? configureErrors[dropdownId] : '';\n\n return {\n containerProps: {\n className: `${moduleName}__dropdown`\n },\n labelContainerProps: {\n tag: 'label',\n className: `${moduleName}__dropdown-quantity-label`,\n htmlFor: `${moduleName}__dropown-quantity-input-${dropdownId}`\n },\n errors: errorMessage && (\n <span className='msc-alert msc-alert-noborder msc-alert-danger'>\n <span className='msi-exclamation-triangle' aria-hidden='true' />\n <span>{errorMessage}</span>\n </span>\n ),\n heading: <div>{dropdownName}</div>,\n select: (\n <Dropdown\n dropdownId={dropdownId}\n dropdownName={dropdownName}\n dropdownToggleName={dropdownToggleName}\n dropdownList={dropdownList}\n onChange={dropdownCallback}\n onInitialize={onInitializedDimension}\n telemetryContent={telemetryContent}\n />\n )\n };\n};\n\nexport const getProductConfigure = (\n moduleName: string,\n context: ICoreContext,\n pageName: string,\n telemetry: ITelemetry,\n selectDimensionFormatString: string,\n resources: IProductDimensionConfigureResources,\n callbacks: IProductDimensionCallbacks,\n product?: SimpleProduct,\n productDimensions?: ProductDimensionFull[],\n configureErrors?: IErrorState\n): IProductDimensionConfigureViewProps | undefined => {\n const { getDropdownName } = callbacks;\n\n if (!product || !productDimensions) {\n return undefined;\n }\n\n const onChanged = async (notification: IDropdownOnSelectionChangeNotification) =>\n onChange(notification, callbacks.dimensionSelectedAsync);\n\n const onInitializedDimension = async (notification: IDropdownOnInitializeNotification) =>\n _onInitializedDimension(notification, callbacks.initializeDimension);\n\n telemetryContent = getTelemetryObject(context.request.telemetryPageName!, pageName, telemetry);\n\n if (!ArrayExtensions.hasElements(productDimensions)) {\n return undefined;\n }\n\n const dropdowns = productDimensions.map((productDimensionFull: ProductDimensionFull) =>\n mapProductDimensionFullToDropdownViewProps(\n productDimensionFull,\n moduleName,\n selectDimensionFormatString,\n resources,\n getDropdownName,\n onChanged,\n onInitializedDimension,\n configureErrors?.configureErrors\n )\n );\n\n return {\n containerProps: {\n className: `${moduleName}__configure`\n },\n dropdowns\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { DimensionTypes, generateSwatchImageUrl, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { format } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\n/**\n * Swatch item data.\n */\nexport interface ISwatchItem {\n value: string;\n itemId: string;\n dimensionType: DimensionTypes;\n colorHexCode?: string;\n imageUrl?: string;\n productImageUrls?: string[];\n isDisabled?: boolean;\n isDefault?: boolean;\n swatchItemAriaLabel?: string;\n}\n\n/**\n * Swatch item configuration.\n */\nexport interface ISwatchItemProps {\n className: string;\n apiSettings: ICommerceApiSettings;\n\n isSelected: boolean;\n isSelectionEnabled?: boolean;\n\n item: ISwatchItem;\n isRefineItem?: boolean;\n\n onSelectItem(item: ISwatchItem): void;\n}\n\n/**\n * Represents a single item for swatch.\n * @param props - Item configuration.\n * @returns React node.\n */\nexport const SwatchItemComponent: React.FC<ISwatchItemProps> = (props: ISwatchItemProps) => {\n const { isSelected, className, onSelectItem, item } = props;\n const { itemId, value, colorHexCode, imageUrl, swatchItemAriaLabel, dimensionType } = item;\n\n const style: React.CSSProperties = {};\n\n let isColored = false;\n\n const hasColor = !StringExtensions.isNullOrWhitespace(colorHexCode);\n const hasImage = !StringExtensions.isNullOrWhitespace(imageUrl);\n\n const selectItem = React.useCallback(() => {\n onSelectItem(item);\n }, [onSelectItem, item]);\n\n const selectionHandler = props.isSelectionEnabled ? selectItem : undefined;\n\n if (hasImage) {\n const fullImageUrl = generateSwatchImageUrl(imageUrl!, props.apiSettings);\n return (\n <img\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\n src={fullImageUrl}\n className={classnames(\n className,\n `${className}-${itemId}`,\n `${className}__image`,\n isSelected ? `${className}__selected` : `${className}__unselected`,\n item.isDisabled ? `${className}__disabled` : undefined\n )}\n style={style}\n onClick={selectionHandler}\n onKeyPress={selectionHandler}\n title={value}\n aria-label={value}\n alt={value}\n />\n );\n } else if (hasColor) {\n style.backgroundColor = colorHexCode;\n isColored = true;\n }\n\n const shouldDisplayText = !isColored;\n\n return (\n <button\n role='radio'\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\n className={classnames(\n className,\n `${className}-${itemId}`,\n isSelected ? `${className}__selected` : `${className}__unselected`,\n isColored ? `${className}__colored` : `${className}__uncolored`,\n item.isDisabled ? `${className}__disabled` : undefined\n )}\n style={style}\n onClick={selectionHandler}\n onKeyPress={selectionHandler}\n title={value}\n {...(swatchItemAriaLabel ? { 'aria-label': format(swatchItemAriaLabel, dimensionType, value) } : null)}\n {...(props.isRefineItem ? { tabIndex: 0 } : null)}\n aria-checked={isSelected}\n >\n {shouldDisplayText && value}\n </button>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ISwatchItem, SwatchItemComponent } from './swatch-item';\n\n/**\n * Swatch item configuration.\n */\nexport interface ISwatchProps {\n className?: string;\n apiSettings: ICommerceApiSettings;\n\n list: ISwatchItem[];\n isSelectionEnabled?: boolean;\n isRefineItem?: boolean;\n\n onSelectItem?(item: ISwatchItem): void;\n}\n\n/**\n * Represents a single item for swatch.\n * @param props - Item configuration.\n * @returns React node.\n */\nexport const SwatchComponent: React.FC<ISwatchProps> = (props: ISwatchProps) => {\n const containerClassName = 'msc-swatch-container';\n\n const [selectedItemId, setSelectedItemId] = React.useState<string | undefined>(undefined);\n const [didUserSetAnyItem, setDidUserSetAnyItem] = React.useState<boolean>(false);\n\n const isSelectionEnabled = props.isSelectionEnabled ?? true;\n\n const onSelectItemCallback = props.onSelectItem;\n\n const onSelectItem = React.useCallback(\n (item: ISwatchItem) => {\n setSelectedItemId(item.itemId);\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\n onSelectItemCallback(item);\n }\n setDidUserSetAnyItem(true);\n },\n [setSelectedItemId, onSelectItemCallback]\n );\n\n if (!didUserSetAnyItem) {\n const defaultItem = props.list.find(item => item.isDefault);\n if (defaultItem && defaultItem.itemId !== selectedItemId) {\n setSelectedItemId(defaultItem.itemId);\n if (!ObjectExtensions.isNullOrUndefined(onSelectItemCallback)) {\n onSelectItemCallback(defaultItem);\n }\n }\n }\n return (\n <div\n role='radiogroup'\n className={classnames(containerClassName, props.className)}\n {...(props.isRefineItem ? { 'aria-hidden': true } : null)}\n >\n {props.list.map(item => {\n const itemId = item.itemId;\n const isSelected = selectedItemId === itemId;\n\n return (\n <SwatchItemComponent\n key={`${itemId}-${item.isDisabled ? 'disabled' : 'enabled'}`}\n className={`${containerClassName}__item`}\n item={item}\n onSelectItem={onSelectItem}\n isSelected={isSelected}\n apiSettings={props.apiSettings}\n isSelectionEnabled={isSelectionEnabled}\n isRefineItem={props.isRefineItem}\n />\n );\n })}\n </div>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICommerceApiSettings } from '@msdyn365-commerce/core-internal';\nimport { generateSwatchImageUrl, StringExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\n/**\n * Dimension item data.\n */\nexport interface IProductDimensionsMatrixDimensionItemData {\n value: string;\n itemId: string;\n colorHexCode?: string;\n imageUrl?: string;\n}\n\n/**\n * Swatch item configuration.\n */\nexport interface IProductDimensionsMatrixDimensionItemProps {\n className: string;\n apiSettings: ICommerceApiSettings;\n\n item: IProductDimensionsMatrixDimensionItemData;\n}\n\n/**\n * Represents a single item for the dimension.\n * @param props - Item configuration.\n * @returns React node.\n */\nexport const ProductDimensionsMatrixDimensionItemComponent: React.FC<IProductDimensionsMatrixDimensionItemProps> = (\n props: IProductDimensionsMatrixDimensionItemProps\n) => {\n const { className, item } = props;\n const { itemId, value, colorHexCode, imageUrl } = item;\n\n const style: React.CSSProperties = {};\n\n const hasColor = !StringExtensions.isNullOrWhitespace(colorHexCode);\n const hasImage = !StringExtensions.isNullOrWhitespace(imageUrl);\n\n let swatchContent: React.ReactElement | undefined;\n const swatchContainerClassName = 'msc-swatch-container';\n const swatchContentClassName = `${swatchContainerClassName}__item`;\n if (hasColor) {\n style.backgroundColor = colorHexCode;\n swatchContent = (\n <span\n key={itemId}\n className={classnames(swatchContentClassName, `${swatchContentClassName}__colored`)}\n style={style}\n title={value}\n aria-label={value}\n />\n );\n } else if (hasImage) {\n const fullImageUrl = generateSwatchImageUrl(imageUrl!, props.apiSettings);\n swatchContent = (\n <img\n key={itemId}\n src={fullImageUrl}\n className={classnames(swatchContentClassName, `${swatchContentClassName}__image`)}\n style={style}\n title={value}\n aria-label={value}\n alt={value}\n />\n );\n }\n\n return (\n <span className={classnames(className, `${className}-${itemId}`)}>\n {swatchContent && <span className={swatchContainerClassName}>{swatchContent}</span>}\n <span className={`${className}__value`}>{value}</span>\n </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 { ProductDimensionType } from '@msdyn365-commerce/retail-proxy';\nimport { Button, Popover } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Resources for the product dimensions matrix dimension selection component.\n */\nexport interface IProductDimensionsMatrixDimensionSelectionResources {\n productDimensionTypeColor: string;\n productDimensionTypeConfiguration: string;\n productDimensionTypeSize: string;\n productDimensionTypeStyle: string;\n}\n\n/**\n * Props for the product dimensions matrix dimension selection component.\n */\nexport interface IProductDimensionsMatrixDimensionSelectionProps {\n className: string;\n\n resources: IProductDimensionsMatrixDimensionSelectionResources;\n\n dimensionTypes: number[];\n currentDimensionType: number;\n\n onDimensionTypeChange(previousDimensionType: number, newDimensionType: number): void;\n}\n\n/**\n * Retrieves dimension localized name.\n * @param dimensionType - Dimension type.\n * @param resources - Resources to use to retrieve localized text.\n * @returns Localized dimension name.\n */\nexport const getDimensionName = (dimensionType: number, resources: IProductDimensionsMatrixDimensionSelectionResources): string => {\n switch (dimensionType) {\n case ProductDimensionType.Color:\n return resources.productDimensionTypeColor;\n case ProductDimensionType.Configuration:\n return resources.productDimensionTypeConfiguration;\n case ProductDimensionType.Size:\n return resources.productDimensionTypeSize;\n case ProductDimensionType.Style:\n return resources.productDimensionTypeStyle;\n default:\n return '';\n }\n};\n\n/**\n * Props for the dimension item component.\n */\ninterface IProductDimensionsMatrixDimensionItemProps {\n className: string;\n\n resources: IProductDimensionsMatrixDimensionSelectionResources;\n\n dimensionType: number;\n\n onDimensionTypeSelect(dimensionType: number): void;\n}\n\n/**\n * Dimension item component which represents a single dimension from the list of dimensions.\n * @param props - Component props.\n * @returns React node.\n */\nconst ProductDimensionsMatrixDimensionItemComponent: React.FC<IProductDimensionsMatrixDimensionItemProps> = (\n props: IProductDimensionsMatrixDimensionItemProps\n) => {\n const changeCurrentDimension = React.useCallback(() => {\n props.onDimensionTypeSelect(props.dimensionType);\n }, [props]);\n\n const title = getDimensionName(props.dimensionType, props.resources);\n return (\n <Button key={props.dimensionType} className={props.className} title={title} onClick={changeCurrentDimension}>\n {title}\n </Button>\n );\n};\n\n/**\n * Dimension selection component for product dimensions matrix.\n * @param props - Component props.\n * @returns React node.\n */\nexport const ProductDimensionsMatrixDimensionSelectionComponent: React.FC<IProductDimensionsMatrixDimensionSelectionProps> = (\n props: IProductDimensionsMatrixDimensionSelectionProps\n) => {\n const buttonTogglingReference = React.createRef<HTMLButtonElement>();\n const [isPopoverShown, setIsPopoverShown] = React.useState(false);\n const [currentDimensionType, setCurrentDimensionType] = React.useState(props.currentDimensionType);\n const [currentDimensionTypeLabel, setCurrentDimensionTypeLabel] = React.useState(\n getDimensionName(props.currentDimensionType, props.resources)\n );\n\n const popoverClassName = `${props.className}__popover`;\n\n const togglePopoverHandler = React.useCallback(() => {\n setIsPopoverShown(!isPopoverShown);\n }, [isPopoverShown]);\n\n const changeCurrentDimension = React.useCallback(\n (dimensionType: number) => {\n props.onDimensionTypeChange(currentDimensionType, dimensionType);\n setCurrentDimensionType(dimensionType);\n setCurrentDimensionTypeLabel(getDimensionName(dimensionType, props.resources));\n },\n [currentDimensionType, props]\n );\n\n return (\n <div className={props.className}>\n <Button\n className={`${props.className}__toggle-button`}\n title={currentDimensionTypeLabel}\n innerRef={buttonTogglingReference}\n aria-expanded={isPopoverShown}\n aria-describedby={props.className}\n onClick={togglePopoverHandler}\n >\n {currentDimensionTypeLabel}\n </Button>\n <Popover\n className={popoverClassName}\n placement='bottom-start'\n isOpen={isPopoverShown}\n target={buttonTogglingReference}\n toggle={togglePopoverHandler}\n >\n <div className={`${popoverClassName}__content`}>\n {props.dimensionTypes.map(dimensionType => {\n return (\n <ProductDimensionsMatrixDimensionItemComponent\n key={dimensionType}\n className={`${popoverClassName}__content__item`}\n resources={props.resources}\n dimensionType={dimensionType}\n onDimensionTypeSelect={changeCurrentDimension}\n />\n );\n })}\n </div>\n </Popover>\n </div>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, IncrementalQuantity, Popover } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\n/**\n * Resources for the enter all quantities component.\n */\nexport interface IProductDimensionsMatrixEnterAllQuantitiesResources {\n productDimensionsMatrixInputQuantityAriaLabel: string;\n productDimensionsMatrixEnterAllQuantitiesButtonText: string;\n productDimensionsMatrixEnterAllQuantitiesDecrementButtonAriaLabel: string;\n productDimensionsMatrixEnterAllQuantitiesIncrementButtonAriaLabel: string;\n productDimensionsMatrixEnterAllQuantitiesQuantityText: string;\n productDimensionsMatrixEnterAllQuantitiesEachText: string;\n productDimensionsMatrixEnterAllQuantitiesApplyToAllText: string;\n}\n\n/**\n * Props for the enter all quantities component.\n */\nexport interface IProductDimensionsMatrixEnterAllQuantitiesProps {\n className: string;\n\n resources: IProductDimensionsMatrixEnterAllQuantitiesResources;\n\n defaultQuantity: number;\n minQuantityValue: number;\n maxQuantityValue: number;\n\n onApplyToAll(newQuantity: number): void;\n}\n\n/**\n * Popover content for the enter all quantities component.\n * @param props - Enter all quantities component props.\n * @returns React node with the content to be used in the popover.\n */\nconst ProductDimensionsMatrixEnterAllQuantitiesPopoverContentComponent: React.FC<IProductDimensionsMatrixEnterAllQuantitiesProps> = (\n props: IProductDimensionsMatrixEnterAllQuantitiesProps\n) => {\n const [currentQuantity, setCurrentQuantity] = React.useState(props.defaultQuantity);\n\n const handleQuantityChange = React.useCallback(\n (newQuantity?: number) => {\n setCurrentQuantity(newQuantity ?? props.defaultQuantity);\n return true;\n },\n [props.defaultQuantity]\n );\n\n const handleApplyAll = React.useCallback(() => {\n props.onApplyToAll(currentQuantity);\n return true;\n }, [props, currentQuantity]);\n\n return (\n <div className={props.className}>\n <div className={`${props.className}__quantity-label`}>\n {props.resources.productDimensionsMatrixEnterAllQuantitiesQuantityText}\n </div>\n <IncrementalQuantity\n currentCount={props.defaultQuantity}\n onChange={handleQuantityChange}\n inputQuantityAriaLabel={props.resources.productDimensionsMatrixInputQuantityAriaLabel}\n min={props.minQuantityValue}\n max={props.maxQuantityValue}\n decrementButtonAriaLabel={props.resources.productDimensionsMatrixEnterAllQuantitiesDecrementButtonAriaLabel}\n incrementButtonAriaLabel={props.resources.productDimensionsMatrixEnterAllQuantitiesIncrementButtonAriaLabel}\n />\n <div className={`${props.className}__button-label`}>{props.resources.productDimensionsMatrixEnterAllQuantitiesEachText}</div>\n <div className={`${props.className}__apply-to-all-container`}>\n <Button\n className={`${props.className}__apply-to-all-container__button`}\n title={props.resources.productDimensionsMatrixEnterAllQuantitiesApplyToAllText}\n onClick={handleApplyAll}\n >\n {props.resources.productDimensionsMatrixEnterAllQuantitiesApplyToAllText}\n </Button>\n </div>\n </div>\n );\n};\n\n/**\n * Enter all quantities component to update all quantities in the product dimensions matrix.\n * @param props - Enter all quantities component props.\n * @returns React node.\n */\nexport const ProductDimensionsMatrixEnterAllQuantitiesComponent: React.FC<IProductDimensionsMatrixEnterAllQuantitiesProps> = (\n props: IProductDimensionsMatrixEnterAllQuantitiesProps\n) => {\n const buttonTogglingReference = React.createRef<HTMLButtonElement>();\n const [isPopoverShown, setIsPopoverShown] = React.useState(false);\n\n const popoverClassName = `${props.className}__popover`;\n\n const togglePopoverHandler = React.useCallback(() => {\n setIsPopoverShown(!isPopoverShown);\n }, [isPopoverShown]);\n\n const handleApplyAll = React.useCallback(\n (currentQuantity: number) => {\n setIsPopoverShown(false);\n props.onApplyToAll(currentQuantity);\n },\n [props]\n );\n\n return (\n <div className={props.className}>\n <Button\n className={`${props.className}__toggle-button`}\n title={props.resources.productDimensionsMatrixEnterAllQuantitiesButtonText}\n innerRef={buttonTogglingReference}\n aria-expanded={isPopoverShown}\n aria-describedby={props.className}\n onClick={togglePopoverHandler}\n >\n {props.resources.productDimensionsMatrixEnterAllQuantitiesButtonText}\n </Button>\n <Popover\n className={popoverClassName}\n placement='bottom-start'\n isOpen={isPopoverShown}\n target={buttonTogglingReference}\n toggle={togglePopoverHandler}\n >\n <ProductDimensionsMatrixEnterAllQuantitiesPopoverContentComponent\n {...props}\n className={`${popoverClassName}__content`}\n onApplyToAll={handleApplyAll}\n />\n </Popover>\n </div>\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IProductDimensionsWithAvailabilitiesFull } from '@msdyn365-commerce/commerce-entities';\nimport msdyn365Commerce, { getUrlSync, ICoreContext } from '@msdyn365-commerce/core-internal';\nimport {\n Customer,\n InventoryAvailabilitySearchCriteria,\n ProductDimensionValueInventoryAvailability,\n ProductInventoryAvailability,\n ProductsDataActions\n} from '@msdyn365-commerce/retail-proxy';\nimport {\n ArrayExtensions,\n DeliveryMode,\n Dictionary,\n getInventoryLevelCodeFromDimensionValue,\n getInventoryLevelCodeFromProductAvailability,\n IDimensionsApp,\n IDimensionsConfig,\n InventoryLevels,\n InventoryLevelValues,\n ObjectExtensions,\n OrderTemplate\n} from '@msdyn365-commerce-modules/retail-actions';\nimport {\n Button,\n Collapse,\n ILabeledDropdownOnChangeNotification,\n isMobile,\n LabeledDropdown,\n Quantity,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { AddToCartFunctionalComponent, IAddToCartResources } from '../add-to-cart';\nimport { AddProductsToOrderTemplateComponent, IAddProductsToOrderTemplateResources } from '../order-template';\nimport {\n getDimensionName,\n IProductDimensionsMatrixDimensionSelectionResources,\n IProductDimensionsMatrixEnterAllQuantitiesResources,\n ProductDimensionsMatrixDimensionItemComponent,\n ProductDimensionsMatrixDimensionSelectionComponent,\n ProductDimensionsMatrixEnterAllQuantitiesComponent\n} from './components';\n\n/**\n * Resources for the product dimensions matrix component.\n */\nexport interface IProductDimensionsMatrixResources\n extends IProductDimensionsMatrixEnterAllQuantitiesResources,\n IProductDimensionsMatrixDimensionSelectionResources,\n IAddProductsToOrderTemplateResources,\n IAddToCartResources {\n productDimensionsMatrixInputQuantityAriaLabel: string;\n productDimensionsMatrixTotalItemsLabel: string;\n productDimensionsMatrixOutOfStockLabel: string;\n productDimensionsMatrixClearAllText: string;\n productDimensionsMatrixAddItemsToCartButtonText: string;\n\n productDimensionsMatrixDisplayOrderLabel: string;\n productDimensionsMatrixDisplayOrderSeparator: string;\n}\n\n/**\n * Data for the product dimensions matrix component.\n */\nexport interface IProductDimensionsMatrixData {\n dimensions: IProductDimensionsWithAvailabilitiesFull[];\n orderTemplates?: OrderTemplate[];\n customerInformation?: Customer;\n}\n\n/**\n * Props for the product dimensions matrix component.\n */\nexport interface IProductDimensionsMatrixProps {\n className?: string;\n context: ICoreContext<IDimensionsApp>;\n\n data: IProductDimensionsMatrixData;\n\n resources: IProductDimensionsMatrixResources;\n\n onErrorMessage(result: string): void;\n dimensionOnChange?(): void;\n isMultipleCatalogFeatureEnabledInHq: boolean;\n catalogId?: number | undefined;\n}\n\n/**\n * Represents a single node (cell data) in the matrix.\n */\nexport interface IProductDimensionsMatrixNode {\n dimensionIds: string[];\n\n isAvailable: boolean;\n\n quantity: number;\n\n productId?: number;\n}\n\n/**\n * State of the matrix.\n */\nexport interface IProductDimensionsMatrixState {\n dimensionsOrder: IProductDimensionsWithAvailabilitiesFull[];\n nodes: IProductDimensionsMatrixNode[];\n\n lastChangeAllDate: number;\n\n totalQuantity: number;\n\n dimensionsExpandState: Dictionary<string, boolean>;\n dimensionsExpandStateDate: number;\n}\n\n/**\n * Retrieves unique dimension id from the dimension data.\n * @param dimension - Dimension data.\n * @returns Unique id that represents the given dimension.\n */\nconst getDimensionId = (dimension: ProductDimensionValueInventoryAvailability) => {\n return `${dimension.DimensionTypeValue ?? ''}-${dimension.DimensionValue?.RecordId ?? ''}-${dimension.DimensionValue?.Value ?? ''}`;\n};\n\n/**\n * Retrieves dimension inventory level code.\n * @param dimensionId - Dimension id for which the code needs to be retrieved.\n * @param dimensions - List of the dimensions with the data.\n * @param inventoryLevel - Inventory level configuration.\n * @returns Inventory level code, for instance, available or out of stock.\n */\nconst retrieveDimensionInventoryLevelCode = (\n dimensionId: string,\n dimensions: ProductDimensionValueInventoryAvailability[],\n inventoryLevel?: InventoryLevels\n) => {\n const dimension = dimensions.find(item => getDimensionId(item) === dimensionId)!;\n return getInventoryLevelCodeFromDimensionValue(dimension, inventoryLevel);\n};\n\n/**\n * Checks whether the given dimension is available for purchase or not.\n * @param dimensionId - Dimension id for which the availability needs to be retrieved.\n * @param dimensions - List of the dimensions with the data.\n * @param config - Inventory configuration.\n * @returns True if the dimension is available, false otherwise.\n */\nexport const isDimensionAvailable = (\n dimensionId: string,\n dimensions: ProductDimensionValueInventoryAvailability[],\n config: IDimensionsConfig\n) => {\n const enableStockCheck = config.enableStockCheck;\n if (!enableStockCheck) {\n return true;\n }\n return retrieveDimensionInventoryLevelCode(dimensionId, dimensions, config.inventoryLevel) !== InventoryLevelValues.outOfStock;\n};\n\n/**\n * Checks whether the given product is available for purchase or not.\n * @param productAvailability - Product availability information.\n * @param inventoryLevel - Inventory level configuration.\n * @returns True if the product is available, false otherwise.\n */\nconst isProductAvailable = (productAvailability: ProductInventoryAvailability, inventoryLevel?: InventoryLevels) => {\n return getInventoryLevelCodeFromProductAvailability(productAvailability, inventoryLevel) !== InventoryLevelValues.outOfStock;\n};\n\n/**\n * Recursively builds matrix nodes based on the given dimensions data.\n * @param dimensionIds - Matrix of dimension ids for each dimension type.\n * @param dimensions - List of the dimensions with the data.\n * @param config - Inventory configuration.\n * @param defaultQuantity - Default quantity to use.\n * @returns List of created nodes.\n */\nconst retrieveEndDimensionsNode = (\n dimensionIds: string[][],\n dimensions: ProductDimensionValueInventoryAvailability[],\n config: IDimensionsConfig,\n defaultQuantity: number\n): IProductDimensionsMatrixNode[] => {\n if (!ArrayExtensions.hasElements(dimensionIds)) {\n return [];\n }\n\n if (dimensionIds.length === 1) {\n return dimensionIds[0].map(dimensionId => {\n const isAvailable = isDimensionAvailable(dimensionId, dimensions, config);\n return {\n dimensionIds: [dimensionId],\n isAvailable,\n quantity: isAvailable ? defaultQuantity : 0\n };\n });\n }\n\n const nodes = retrieveEndDimensionsNode(dimensionIds.slice(1), dimensions, config, defaultQuantity);\n let endNodes: IProductDimensionsMatrixNode[] = [];\n for (const node of nodes) {\n endNodes = endNodes.concat(\n dimensionIds[0].map(dimension => {\n const isNodeAvailable = node.isAvailable && isDimensionAvailable(dimension, dimensions, config);\n const nodeCopy: IProductDimensionsMatrixNode = {\n dimensionIds: node.dimensionIds.concat(dimension),\n isAvailable: isNodeAvailable,\n quantity: isNodeAvailable ? node.quantity : 0\n };\n\n return nodeCopy;\n })\n );\n }\n\n return endNodes;\n};\n\n/**\n * Generates a list of display orders.\n * @param dimensions - List of dimensions.\n * @param usedDimensions - List of used dimensions.\n * @returns List of display orders.\n */\nconst createDisplayOrders = (\n dimensions: ProductDimensionValueInventoryAvailability[],\n usedDimensions?: ProductDimensionValueInventoryAvailability[]\n) => {\n if (usedDimensions?.length === dimensions.length) {\n return [\n {\n dimensionTypes: usedDimensions.map(dimension => dimension.DimensionTypeValue!)\n }\n ];\n }\n\n let result: {\n dimensionTypes: number[];\n }[] = [];\n\n for (const dimension of dimensions) {\n if (usedDimensions?.includes(dimension)) {\n continue;\n }\n const currentDimensions = usedDimensions ? usedDimensions.concat(dimension) : [dimension];\n const currentResult = createDisplayOrders(dimensions, currentDimensions);\n result = result.concat(currentResult);\n }\n\n return result;\n};\n\n/**\n * Represents dimension matrix row data for the react view.\n */\ninterface IProductDimensionsMatrixRow {\n rows: React.ReactElement[][];\n newNodeIndex: number;\n}\n\n/**\n * Product dimensions matrix component which allows to purchase multiple product variants at the same time.\n */\nexport class ProductDimensionsMatrix extends React.PureComponent<IProductDimensionsMatrixProps, IProductDimensionsMatrixState> {\n private static readonly _className: string = 'msc-product-dimensions-matrix';\n\n private static readonly _defaultQuantityProps = {\n defaultQuantity: 0,\n minQuantity: 0,\n maxQuantity: 10_000_000\n };\n\n private readonly _displayOrderList: {\n dimensionTypes: number[];\n }[];\n\n public constructor(props: IProductDimensionsMatrixProps) {\n super(props);\n\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n const dimensions = props.data.dimensions;\n const nodes = ProductDimensionsMatrix._retrieveNodes(isMobileDevice ? ArrayExtensions.reverse(dimensions) : dimensions, props);\n const quantities = nodes.map(node => node.quantity);\n this.state = {\n dimensionsOrder: dimensions,\n nodes,\n totalQuantity: ArrayExtensions.hasElements(quantities) ? ArrayExtensions.calculateSum(quantities) : 0,\n lastChangeAllDate: Date.now(),\n dimensionsExpandState: new Dictionary(),\n\n // The state needs to be updated in order to make collapsing work for inner dimensions.\n // Probably some react bug that makes the state not change which in turn, doesn't update expand state of the dimensions on the page.\n // Needs to be updated in order to update expand/collapse states and not to reset the whole component (which resets scroll position).\n // eslint-disable-next-line react/no-unused-state -- See the reason above.\n dimensionsExpandStateDate: Date.now()\n };\n\n this._displayOrderList = createDisplayOrders(dimensions);\n\n if (msdyn365Commerce.isBrowser) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises -- Call api to retrieve the availabilities data without blocking the UI.\n this.retrieveAvailabilitiesInformation();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/member-ordering\n private static _retrieveNodes(dimensions: IProductDimensionsWithAvailabilitiesFull[], props: IProductDimensionsMatrixProps) {\n const dimensionIds = ArrayExtensions.validValues(\n dimensions.map(dimension => ArrayExtensions.validValues(dimension.dimensionValuesWithInventory?.map(getDimensionId)))\n );\n\n const dimensionsList = ArrayExtensions.flatten(dimensions.map(dimension => dimension.dimensionValuesWithInventory));\n\n const nodes = retrieveEndDimensionsNode(\n dimensionIds,\n dimensionsList,\n props.context.app.config,\n ProductDimensionsMatrix._defaultQuantityProps.defaultQuantity\n );\n\n for (const node of nodes) {\n const nodeDimensions = dimensionsList.filter(dimension => node.dimensionIds.includes(getDimensionId(dimension)));\n\n let productIds: number[] | undefined;\n for (const dimension of nodeDimensions) {\n const dimensionProductIds = dimension.ProductIds;\n if (!ArrayExtensions.hasElements(dimensionProductIds)) {\n continue;\n }\n if (productIds === undefined) {\n productIds = dimensionProductIds;\n continue;\n }\n productIds = productIds.filter(productId => dimensionProductIds.includes(productId));\n }\n if (productIds?.length === 1) {\n node.productId = productIds[0];\n }\n }\n\n return nodes;\n }\n\n // eslint-disable-next-line @typescript-eslint/member-ordering\n private static _renderMatrixEmptyCell(className: string): React.ReactElement {\n return <div key='empty-placeholder' className={className} />;\n }\n\n public render(): React.ReactElement | null {\n if (!ArrayExtensions.hasElements(this.state.nodes)) {\n return null;\n }\n\n return (\n <div className={classnames(this.props.className, ProductDimensionsMatrix._className)}>\n {this._renderHeader(`${ProductDimensionsMatrix._className}__header`)}\n {this._renderMatrix(`${ProductDimensionsMatrix._className}__matrix`)}\n {this._renderFooter(`${ProductDimensionsMatrix._className}__footer`)}\n </div>\n );\n }\n\n public async retrieveAvailabilitiesInformation() {\n const productIds = this.state.nodes.map(node => node.productId!);\n const actionContext = this.props.context.actionContext;\n const enableStockCheck = this.props.context.app.config.enableStockCheck;\n const warehouseAggregation = this.props.context.app.config.warehouseAggregation;\n\n if (!enableStockCheck) {\n for (const node of this.state.nodes) {\n node.isAvailable = true;\n }\n } else {\n const availabilitiesSearchCriteria: InventoryAvailabilitySearchCriteria = {\n ProductIds: productIds,\n QuantityUnitTypeValue: 2,\n FilterByChannelFulfillmentGroup: true,\n DeliveryModeTypeFilterValue: DeliveryMode.shipping,\n DefaultWarehouseOnly: warehouseAggregation === 'individual'\n };\n\n const availabilities = await ProductsDataActions.getEstimatedAvailabilityAsync(\n { callerContext: actionContext },\n availabilitiesSearchCriteria\n );\n\n for (const node of this.state.nodes) {\n const availability = availabilities.AggregatedProductInventoryAvailabilities?.find(\n item => item.ProductId === node.productId\n );\n node.isAvailable =\n availability !== undefined && isProductAvailable(availability, this.props.context.app.config.inventoryLevel);\n }\n }\n\n this.setState({\n lastChangeAllDate: Date.now()\n });\n }\n\n private _renderHeader(className: string): React.ReactElement {\n return (\n <div className={className}>\n {this._renderDisplayOrderContainer(`${className}__display-order`)}\n {this._renderActions(`${className}__actions`)}\n </div>\n );\n }\n\n /**\n * Handles change of dimension.\n * @param selectedDimensions - Selected dimension order.\n */\n private readonly _handleDisplayOrderChange = (selectedDimensions: ILabeledDropdownOnChangeNotification) => {\n this.setState(state => {\n const displayOrder = this._displayOrderList.find(value => {\n return value.dimensionTypes.join('-') === selectedDimensions.selectedOption.key;\n })!;\n const newDimensions = displayOrder.dimensionTypes.map(\n dimensionType => state.dimensionsOrder.find(item => item.DimensionTypeValue === dimensionType)!\n );\n\n const newNodes = this._generateNodesByNewDimensions(ArrayExtensions.reverse(newDimensions), state.nodes);\n\n return {\n dimensionsOrder: newDimensions,\n nodes: newNodes,\n lastChangeAllDate: Date.now()\n };\n });\n };\n\n private _renderDisplayOrderContainer(className: string) {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n if (!isMobileDevice) {\n return null;\n }\n\n const dropdowns = this._displayOrderList.map(value => {\n return {\n key: value.dimensionTypes.join('-'),\n value: value.dimensionTypes\n .map(dimension => getDimensionName(dimension, this.props.resources))\n .join(this.props.resources.productDimensionsMatrixDisplayOrderSeparator)\n };\n });\n\n return (\n <div className={className}>\n <LabeledDropdown\n labelClassname={`${className}__label`}\n labelText={this.props.resources.productDimensionsMatrixDisplayOrderLabel}\n dropdownOptions={dropdowns}\n selectedOption={dropdowns[0]}\n dropdownClassname={`${className}__dropdown`}\n onSelectOption={this._handleDisplayOrderChange}\n />\n </div>\n );\n }\n\n /**\n * Updates all quantities for each cell with the new given quantity, overrides any existing quantities.\n * @param newQuantity - Quantity to use for the cells.\n */\n private readonly _updateAllQuantities = (newQuantity: number) => {\n this.setState(state => {\n const nodes = state.nodes.map(node => {\n return {\n ...node,\n quantity: node.isAvailable ? newQuantity : 0\n };\n });\n const quantities = nodes.map(node => node.quantity);\n return {\n nodes,\n totalQuantity: ArrayExtensions.hasElements(quantities) ? ArrayExtensions.calculateSum(quantities) : 0,\n lastChangeAllDate: Date.now()\n };\n });\n };\n\n /**\n * Clears all quantities by setting all nodes to use the default quantity.\n */\n private readonly _clearAllQuantities = () => {\n this._updateAllQuantities(ProductDimensionsMatrix._defaultQuantityProps.defaultQuantity);\n };\n\n private _renderActions(className: string): React.ReactElement {\n return (\n <div className={className}>\n {this._renderEnterAllQuantities(`${className}__enter-all-quantities-container`)}\n {this._renderClearAllQuantities(`${className}__clear-all-quantities-container`)}\n </div>\n );\n }\n\n private _renderEnterAllQuantities(className: string): React.ReactElement {\n const maxQuantityForCartLineItem = this.props.context.app.config.maxQuantityForCartLineItem;\n return (\n <ProductDimensionsMatrixEnterAllQuantitiesComponent\n className={className}\n resources={this.props.resources}\n defaultQuantity={ProductDimensionsMatrix._defaultQuantityProps.defaultQuantity}\n minQuantityValue={ProductDimensionsMatrix._defaultQuantityProps.minQuantity}\n maxQuantityValue={maxQuantityForCartLineItem || ProductDimensionsMatrix._defaultQuantityProps.maxQuantity}\n onApplyToAll={this._updateAllQuantities}\n />\n );\n }\n\n private _renderClearAllQuantities(className: string): React.ReactElement {\n return (\n <div className={className}>\n <Button\n className={`${className}__button`}\n title={this.props.resources.productDimensionsMatrixClearAllText}\n onClick={this._clearAllQuantities}\n >\n {this.props.resources.productDimensionsMatrixClearAllText}\n </Button>\n </div>\n );\n }\n\n private _renderMatrixDesktop(className: string): React.ReactElement {\n const rowClassName = `${className}__row`;\n const cellClassName = `${rowClassName}__cell`;\n const dimensionsList = ArrayExtensions.flatten(this.state.dimensionsOrder.map(dimension => dimension.dimensionValuesWithInventory));\n const rows = this._renderMatrixRowsDesktop(rowClassName, dimensionsList, [], 0).rows;\n\n const reversedDimensions = ArrayExtensions.reverse(this.state.dimensionsOrder);\n\n return (\n <div className={className} key={JSON.stringify(this.state.dimensionsOrder)}>\n {this._renderMatrixDimensionsHeader(`${className}__dimensions-header`, reversedDimensions)}\n <div className={`${className}__content`}>\n <div className={rowClassName}>\n {reversedDimensions.map((dimension, index) => {\n if (index === reversedDimensions.length - 1) {\n return dimension.dimensionValuesWithInventory?.map(item =>\n this._renderMatrixDimensionCell(cellClassName, item)\n );\n }\n return ProductDimensionsMatrix._renderMatrixEmptyCell(cellClassName);\n })}\n </div>\n {rows.map(cells => {\n return (\n <div className={rowClassName} key='cells'>\n {cells}\n </div>\n );\n })}\n </div>\n </div>\n );\n }\n\n /**\n * Handle collapse dimension.\n * @param dimensionId - Selected dimension id.\n * @returns Callback for collapse dimension button.\n */\n private readonly _handleCollapseDimension = (dimensionId: string) => () => {\n this.setState(state => {\n const isExpanded = state.dimensionsExpandState.getValueWithDefaultValue(dimensionId, false);\n state.dimensionsExpandState.setValue(dimensionId, !isExpanded);\n\n return {\n dimensionsExpandState: state.dimensionsExpandState,\n dimensionsExpandStateDate: Date.now()\n };\n });\n };\n\n private _renderMatrixMobile(className: string): React.ReactElement {\n const allDimensions = ArrayExtensions.flatten(this.state.dimensionsOrder.map(dimension => dimension.dimensionValuesWithInventory));\n\n const singleDimensionClassName = `${className}__single-dimension`;\n const cellClassName = `${className}__cell`;\n const dimensionsContainerClassName = `${cellClassName}__dimension-container`;\n\n return (\n <div\n className={classnames(className, this.state.dimensionsOrder.length === 1 ? singleDimensionClassName : '')}\n key={`${JSON.stringify(this.state.dimensionsOrder)}-${this.state.lastChangeAllDate}`}\n >\n {this._renderMatrixRowsMobile(dimensionsContainerClassName, allDimensions, [], 0).rows}\n </div>\n );\n }\n\n private _renderMatrix(className: string): React.ReactElement {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n if (!isMobileDevice) {\n return this._renderMatrixDesktop(className);\n }\n\n return this._renderMatrixMobile(`${className}__mobile`);\n }\n\n private _generateNodesByNewDimensions(\n newDimensions: IProductDimensionsWithAvailabilitiesFull[],\n nodes: IProductDimensionsMatrixNode[]\n ) {\n return ProductDimensionsMatrix._retrieveNodes(newDimensions, this.props).map(node => {\n const previousNode = nodes.find(pastNode => ArrayExtensions.haveSameItems(node.dimensionIds, pastNode.dimensionIds))!;\n node.quantity = previousNode.quantity;\n node.isAvailable = previousNode.isAvailable;\n return node;\n });\n }\n\n /**\n * Handles change of dimension for a column by swapping previous and new dimension columns with each other.\n * @param previousDimensionType - Previous dimension used in the column.\n * @param newDimensionType - New dimension to display instead of the previous dimension.\n */\n private readonly _handleDimensionTypeChange = (previousDimensionType: number, newDimensionType: number) => {\n this.setState(\n state => {\n const previousDimension = state.dimensionsOrder.find(item => item.DimensionTypeValue === previousDimensionType)!;\n const newDimension = state.dimensionsOrder.find(item => item.DimensionTypeValue === newDimensionType)!;\n\n const newDimensions = state.dimensionsOrder.map(item => {\n if (item === previousDimension) {\n return newDimension;\n }\n if (item === newDimension) {\n return previousDimension;\n }\n return item;\n });\n\n const newNodes = this._generateNodesByNewDimensions(newDimensions, state.nodes);\n\n return {\n dimensionsOrder: newDimensions,\n nodes: newNodes,\n lastChangeAllDate: Date.now()\n };\n },\n () => {\n this.props.dimensionOnChange && this.props.dimensionOnChange();\n }\n );\n };\n\n private _renderMatrixDimensionsHeader(className: string, dimensions: IProductDimensionsWithAvailabilitiesFull[]): React.ReactElement {\n const cellClassName = `${className}__cell`;\n const dimensionsList = dimensions.map(dimension => dimension.DimensionTypeValue);\n\n return (\n <div className={className}>\n {dimensionsList.map(dimensionType => {\n return (\n <ProductDimensionsMatrixDimensionSelectionComponent\n key={dimensionType}\n className={cellClassName}\n resources={this.props.resources}\n dimensionTypes={dimensionsList}\n currentDimensionType={dimensionType}\n onDimensionTypeChange={this._handleDimensionTypeChange}\n />\n );\n })}\n </div>\n );\n }\n\n private _renderMatrixMainDimensionMobile(\n className: string,\n dimension: ProductDimensionValueInventoryAvailability,\n content: React.ReactElement\n ): React.ReactElement {\n const dimensionId = getDimensionId(dimension);\n const isExpanded = this.state.dimensionsExpandState.getValueWithDefaultValue(dimensionId, false);\n\n const expandButtonClassName = `${className}__expand-button`;\n const collapseClassName = `${className}__collapse`;\n const collapseItemClassName = `${collapseClassName}__item`;\n\n return (\n <div className={className} key={`${dimensionId}-${isExpanded ? 'expanded' : 'collapsed'}-${this.state.lastChangeAllDate}`}>\n <Button className={expandButtonClassName} onClick={this._handleCollapseDimension(dimensionId)} aria-expanded={isExpanded}>\n {this._renderMatrixDimensionCell(`${expandButtonClassName}__dimension`, dimension)}\n </Button>\n <Collapse className={collapseClassName} isOpen={isExpanded}>\n <div className={collapseItemClassName}>{content}</div>\n </Collapse>\n </div>\n );\n }\n\n private _renderMatrixRowsMobile(\n className: string,\n dimensions: ProductDimensionValueInventoryAvailability[],\n partialDimensions: string[],\n nodeIndex: number\n ): IProductDimensionsMatrixRow {\n const result: IProductDimensionsMatrixRow = {\n rows: [],\n newNodeIndex: nodeIndex\n };\n\n if (nodeIndex >= this.state.nodes.length) {\n return result;\n }\n\n const node = this.state.nodes[result.newNodeIndex];\n const nodeDimensionIdsLength = node.dimensionIds.length;\n const partialDimensionIdsLength = partialDimensions.length;\n const currentDimensionId = node.dimensionIds[partialDimensionIdsLength];\n const currentDimension = dimensions.find(dimension => getDimensionId(dimension) === currentDimensionId)!;\n\n const cellClassName = `${className}__cell`;\n\n if (nodeDimensionIdsLength === partialDimensionIdsLength + 1) {\n result.rows.push([]);\n\n if (node.dimensionIds.length === 1) {\n while (result.newNodeIndex < this.state.nodes.length) {\n const dimensionId = this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength];\n const lastDimension = dimensions.find(dimension => getDimensionId(dimension) === dimensionId)!;\n\n result.rows[0].push(\n <div className={cellClassName}>\n {this._renderMatrixDimensionCell(`${cellClassName}__dimension-label`, lastDimension)}\n {this._renderMatrixCell(`${cellClassName}__content`, result.newNodeIndex++)}\n </div>\n );\n }\n return result;\n }\n\n result.rows[0].push(\n <div className={cellClassName}>\n {this._renderMatrixDimensionCell(`${cellClassName}__dimension-label`, currentDimension)}\n {this._renderMatrixCell(`${cellClassName}__content`, result.newNodeIndex++)}\n </div>\n );\n\n if (partialDimensionIdsLength > 0) {\n const previousDimension = partialDimensions[partialDimensionIdsLength - 1];\n\n while (\n result.newNodeIndex < this.state.nodes.length &&\n previousDimension === this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength - 1]\n ) {\n const dimensionId = this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength];\n const lastDimension = dimensions.find(dimension => getDimensionId(dimension) === dimensionId)!;\n result.rows[0].push(\n <div className={cellClassName}>\n {this._renderMatrixDimensionCell(`${cellClassName}__dimension-label`, lastDimension)}\n {this._renderMatrixCell(`${cellClassName}__content`, result.newNodeIndex++)}\n </div>\n );\n }\n }\n\n return result;\n }\n\n const rows = this._renderMatrixRowsMobile(className, dimensions, partialDimensions.concat(currentDimensionId), result.newNodeIndex);\n result.newNodeIndex = rows.newNodeIndex;\n if (partialDimensionIdsLength === 0) {\n result.rows.push([this._renderMatrixMainDimensionMobile(`${className}__main-dimension`, currentDimension, <>{rows.rows}</>)]);\n } else {\n result.rows.push([\n <div className={`${className}__container`} key={currentDimensionId}>\n {this._renderMatrixDimensionCell(`${className}__container__dimension`, currentDimension)}\n <div className={`${className}__container__items`}>{rows.rows}</div>\n </div>\n ]);\n }\n\n if (partialDimensionIdsLength > 0) {\n const previousDimension = partialDimensions[partialDimensionIdsLength - 1];\n while (\n result.newNodeIndex < this.state.nodes.length &&\n previousDimension === this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength - 1]\n ) {\n const nextRows = this._renderMatrixRowsMobile(className, dimensions, partialDimensions, result.newNodeIndex);\n result.rows = result.rows.concat(nextRows.rows);\n result.newNodeIndex = nextRows.newNodeIndex;\n }\n } else {\n while (result.newNodeIndex < this.state.nodes.length) {\n const nextRows = this._renderMatrixRowsMobile(className, dimensions, partialDimensions, result.newNodeIndex);\n result.rows = result.rows.concat(nextRows.rows);\n result.newNodeIndex = nextRows.newNodeIndex;\n }\n }\n\n return result;\n }\n\n private _renderMatrixRowsDesktop(\n className: string,\n dimensions: ProductDimensionValueInventoryAvailability[],\n partialDimensions: string[],\n nodeIndex: number\n ): IProductDimensionsMatrixRow {\n const result: IProductDimensionsMatrixRow = {\n rows: [],\n newNodeIndex: nodeIndex\n };\n\n if (nodeIndex >= this.state.nodes.length) {\n return result;\n }\n\n const node = this.state.nodes[result.newNodeIndex];\n const nodeDimensionIdsLength = node.dimensionIds.length;\n const partialDimensionIdsLength = partialDimensions.length;\n const currentDimensionId = node.dimensionIds[partialDimensionIdsLength];\n const currentDimension = dimensions.find(dimension => getDimensionId(dimension) === currentDimensionId)!;\n\n const cellClassName = `${className}__cell`;\n\n if (nodeDimensionIdsLength === partialDimensionIdsLength + 1) {\n result.rows.push([]);\n\n if (node.dimensionIds.length === 1) {\n while (result.newNodeIndex < this.state.nodes.length) {\n result.rows[0].push(this._renderMatrixCell(cellClassName, result.newNodeIndex++));\n }\n return result;\n }\n\n result.rows[0].push(this._renderMatrixCell(cellClassName, result.newNodeIndex++));\n\n if (partialDimensionIdsLength > 0) {\n const previousDimension = partialDimensions[partialDimensionIdsLength - 1];\n\n while (\n result.newNodeIndex < this.state.nodes.length &&\n previousDimension === this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength - 1]\n ) {\n result.rows[0].push(this._renderMatrixCell(cellClassName, result.newNodeIndex++));\n }\n }\n\n return result;\n }\n\n const rows = this._renderMatrixRowsDesktop(\n className,\n dimensions,\n partialDimensions.concat(currentDimensionId),\n result.newNodeIndex\n );\n result.rows = result.rows.concat(\n rows.rows.map((cells, index) => {\n if (index === 0) {\n return [this._renderMatrixDimensionCell(cellClassName, currentDimension)].concat(cells);\n }\n return [ProductDimensionsMatrix._renderMatrixEmptyCell(cellClassName)].concat(cells);\n })\n );\n result.newNodeIndex = rows.newNodeIndex;\n\n if (partialDimensionIdsLength > 0) {\n const previousDimension = partialDimensions[partialDimensionIdsLength - 1];\n while (\n result.newNodeIndex < this.state.nodes.length &&\n previousDimension === this.state.nodes[result.newNodeIndex].dimensionIds[partialDimensionIdsLength - 1]\n ) {\n const nextRows = this._renderMatrixRowsDesktop(className, dimensions, partialDimensions, result.newNodeIndex);\n result.rows = result.rows.concat(nextRows.rows);\n result.newNodeIndex = nextRows.newNodeIndex;\n }\n } else {\n while (result.newNodeIndex < this.state.nodes.length) {\n const nextRows = this._renderMatrixRowsDesktop(className, dimensions, partialDimensions, result.newNodeIndex);\n result.rows = result.rows.concat(nextRows.rows);\n result.newNodeIndex = nextRows.newNodeIndex;\n }\n }\n\n return result;\n }\n\n private _renderMatrixDimensionCell(className: string, dimension: ProductDimensionValueInventoryAvailability): React.ReactElement {\n const dimensionId = getDimensionId(dimension);\n\n return (\n <div className={className} key={dimensionId}>\n <ProductDimensionsMatrixDimensionItemComponent\n className={`${className}__dimension-item`}\n apiSettings={this.props.context.request.apiSettings}\n item={{\n itemId: dimensionId,\n value: dimension.DimensionValue?.Value ?? '',\n colorHexCode: dimension.DimensionValue?.ColorHexCode,\n imageUrl: dimension.DimensionValue?.ImageUrl\n }}\n />\n </div>\n );\n }\n\n private _renderMatrixCell(className: string, nodeIndex: number): React.ReactElement {\n const node = this.state.nodes[nodeIndex];\n\n return (\n <div\n key={`${JSON.stringify(node.dimensionIds)}-${this.state.lastChangeAllDate}`}\n className={classnames(className, node.isAvailable ? `${className}__available` : `${className}__unavailable`)}\n >\n {node.isAvailable ? this._renderMatrixQuantityCell(node) : this._renderMatrixOutOfStockCell(`${className}__out-of-stock`)}\n </div>\n );\n }\n\n private _renderMatrixOutOfStockCell(className: string): React.ReactElement {\n return (\n <div className={className} key='out-of-stock'>\n {this.props.resources.productDimensionsMatrixOutOfStockLabel}\n </div>\n );\n }\n\n private _renderMatrixQuantityCell(node: IProductDimensionsMatrixNode): React.ReactElement {\n const maxQuantityForCartLineItem = this.props.context.app.config.maxQuantityForCartLineItem;\n return (\n <Quantity\n key={`${JSON.stringify(node.dimensionIds)}-${this.state.lastChangeAllDate}`}\n currentCount={node.quantity}\n onChange={this._handleQuantityChange(node)}\n inputQuantityAriaLabel={this.props.resources.productDimensionsMatrixInputQuantityAriaLabel}\n min={ProductDimensionsMatrix._defaultQuantityProps.minQuantity}\n max={maxQuantityForCartLineItem || ProductDimensionsMatrix._defaultQuantityProps.maxQuantity}\n />\n );\n }\n\n private _renderTotalSummary(className: string): React.ReactElement {\n return (\n <div className={className}>\n <div className={`${className}__total-quantity`}>{this.state.totalQuantity}</div>\n <div className={`${className}__total-quantity-label`}>{this.props.resources.productDimensionsMatrixTotalItemsLabel}</div>\n </div>\n );\n }\n\n private _retrieveProducts(): { productId: number; quantity: number }[] {\n return this.state.nodes\n .filter(node => node.productId && node.quantity !== 0)\n .map(node => {\n return {\n productId: node.productId!,\n quantity: node.quantity\n };\n });\n }\n\n private _renderAddToOrderTemplate(className: string): React.ReactElement | null {\n if (ObjectExtensions.isNullOrUndefined(this.props.data.orderTemplates)) {\n return null;\n }\n\n return (\n <AddProductsToOrderTemplateComponent\n className={className}\n context={this.props.context}\n data={{\n orderTemplates: this.props.data.orderTemplates,\n products: this._retrieveProducts().map(item => {\n return {\n ProductId: item.productId,\n Quantity: item.quantity,\n UnitOfMeasure: ''\n };\n }),\n customerInformation: this.props.data.customerInformation\n }}\n resources={this.props.resources}\n isDisabled={this.state.totalQuantity === 0}\n isMultipleCatalogFeatureEnabledInHq={this.props.isMultipleCatalogFeatureEnabledInHq}\n catalogId={this.props.catalogId}\n />\n );\n }\n\n private _renderAddToCart(className: string): React.ReactElement {\n return (\n <AddToCartFunctionalComponent\n key={`${JSON.stringify(this.state.nodes)}`}\n addToCartText={this.props.resources.productDimensionsMatrixAddItemsToCartButtonText}\n addToCartArialLabel={this.props.resources.productDimensionsMatrixAddItemsToCartButtonText}\n id=''\n typeName=''\n className={className}\n navigationUrl={getUrlSync('cart', this.props.context.actionContext)}\n context={this.props.context}\n dialogStrings={this.props.resources}\n shouldSkipSiteSettings\n data={undefined}\n products={this._retrieveProducts()}\n disabled={this.state.totalQuantity === 0}\n onError={(result): void => {\n if (result.cartActionResult?.errorDetails?.LocalizedMessage) {\n this.props.onErrorMessage(result.cartActionResult.errorDetails.LocalizedMessage);\n }\n }}\n />\n );\n }\n\n private _renderFooter(className: string): React.ReactElement {\n return (\n <div className={className}>\n {this._renderTotalSummary(`${className}__total-summary`)}\n {this._renderFooterActions(`${className}__actions`)}\n </div>\n );\n }\n\n private _renderFooterActions(className: string): React.ReactElement {\n return (\n <div className={className}>\n {this._renderAddToOrderTemplate(`${className}__add-to-order-template`)}\n {this._renderAddToCart(`${className}__add-to-cart`)}\n </div>\n );\n }\n\n /**\n * Handles quantity change.\n * @param node - Node which needs to be updated.\n * @returns Handler method.\n */\n private readonly _handleQuantityChange = (node: IProductDimensionsMatrixNode) => (newValue: number = 0) => {\n if (!node.isAvailable) {\n return;\n }\n\n const difference = newValue - node.quantity;\n node.quantity = newValue;\n this.setState(state => {\n return {\n totalQuantity: state.totalQuantity + difference\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 { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ICartState } from '@msdyn365-commerce/global-state';\nimport { Coupon } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n IPayLoad,\n ITelemetryContent,\n TelemetryConstant\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { PriceComponent } from '..';\n\nexport interface IPromoCodeProps extends IComponentProps<{}> {\n cart: ICartState | undefined;\n promoCodeHeadingText: string;\n appliedPromoCodeHeadingText: string;\n removePromoAriaLabelFormat: string;\n promoPlaceholderText: string;\n promoCodeApplyButtonText: string;\n collapseTimeOut: number;\n removePromoText: string;\n invalidPromoCodeErrorText: string;\n failedToAddPromoCodeErrorText: string;\n duplicatePromoCodeErrorText: string;\n failedToRemovePromoCodeErrorText: string;\n\n /**\n * The telemetry content\n */\n telemetryContent?: ITelemetryContent;\n promoCodeApplyCallback?(): void;\n}\n\nexport interface IPromoCodeComponent extends IComponent<IPromoCodeProps> {}\n\nconst PromoCodeComponentActions = {};\n\ninterface IPromoCodeState {\n isCollapseOpen: boolean;\n promoCodeInputValue: string;\n error: string;\n canApply: boolean;\n}\n\n/**\n *\n * The PromoCode component renders the promocode section.\n * @extends {React.PureComponent<IRefineSubmenuProps>}\n */\nclass PromoCode extends React.Component<IPromoCodeProps, IPromoCodeState> {\n private readonly payLoad: IPayLoad;\n\n constructor(props: IPromoCodeProps, state: IPromoCodeState) {\n super(props);\n this.payLoad = getPayloadObject('click', this.props.telemetryContent!, TelemetryConstant.ApplyPromoCode);\n this.state = {\n isCollapseOpen: false,\n promoCodeInputValue: '',\n error: '',\n canApply: false\n };\n }\n\n public shouldComponentUpdate(nextProps: IPromoCodeProps): boolean {\n if (this.props.appliedPromoCodeHeadingText !== nextProps.appliedPromoCodeHeadingText) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n return (\n <div>\n <div className='msc-promo-code-heading'>{this.props.promoCodeHeadingText}</div>\n {this._renderForm(this.props.promoPlaceholderText, this.props.promoCodeApplyButtonText, this.props.cart)}\n <p className={this.state.error ? 'msc-alert-danger' : ''} aria-live='assertive'>\n {this.state.error}\n </p>\n {this._renderAppliedPromoCode(this.props)}\n </div>\n );\n }\n\n private readonly _onInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const error = e.target.value === '' ? '' : this.state.error;\n this.setState({\n promoCodeInputValue: e.target.value.trim(),\n error,\n canApply: !!e.target.value\n });\n };\n\n private readonly _applyPromotion = (cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart) {\n return;\n }\n const appliedPromo = this.state.promoCodeInputValue;\n\n cartState\n .addPromoCode({ promoCode: appliedPromo })\n .then(result => {\n if (result.status === 'SUCCESS') {\n // Show success text\n this.setState({ promoCodeInputValue: '', error: '', canApply: false });\n } else if (result.substatus === 'ALREADYADDED') {\n this.setState({ error: this.props.duplicatePromoCodeErrorText });\n } else {\n this.setState({ error: this.props.invalidPromoCodeErrorText });\n }\n })\n .catch(error => {\n this.setState({ error: this.props.failedToAddPromoCodeErrorText });\n });\n };\n\n private readonly _renderForm = (promoPlaceholderText: string, promoCodeApplyButtonText: string, cartState: ICartState | undefined) => {\n const _onSubmit = (event: React.FormEvent<HTMLFormElement>) => {\n event.preventDefault();\n this._applyPromotion(cartState);\n };\n const _applyPromotion = (event: React.MouseEvent<HTMLElement>) => {\n this._applyPromotion(cartState);\n };\n const attributes = getTelemetryAttributes(this.props.telemetryContent!, this.payLoad);\n\n return (\n <form onSubmit={_onSubmit} className='msc-promo-code__form-container'>\n <div className='msc-promo-code__group'>\n <input\n className='msc-promo-code__input-box'\n aria-label={promoPlaceholderText}\n onChange={this._onInputChange}\n value={this.state.promoCodeInputValue}\n placeholder={promoPlaceholderText}\n />\n <Button\n title={promoCodeApplyButtonText}\n className='msc-promo-code__apply-btn btn'\n onClick={_applyPromotion}\n disabled={!this.state.canApply}\n {...attributes}\n >\n {promoCodeApplyButtonText}\n </Button>\n </div>\n </form>\n );\n };\n\n private readonly _removePromotion = (cartState: ICartState | undefined, event: React.MouseEvent) => {\n if (!cartState) {\n return;\n }\n const code = event.currentTarget.getAttribute('data-value') || '';\n cartState\n .removePromoCodes({\n promoCodes: [code]\n })\n .then(result => {\n if (result.status === 'SUCCESS') {\n this.setState({ error: '' });\n }\n })\n .catch(() => {\n this.setState({ error: this.props.failedToRemovePromoCodeErrorText });\n });\n };\n\n private readonly _calculateDiscount = (code: string, cartState: ICartState | undefined) => {\n if (!cartState || !cartState.cart || !cartState.cart.CartLines || cartState.cart.CartLines.length === 0 || !code) {\n return;\n }\n let discountAmount = 0;\n for (const line of cartState.cart.CartLines) {\n if (line.DiscountLines) {\n for (const discountLine of line.DiscountLines) {\n if (discountLine.DiscountCode === code) {\n discountAmount += discountLine.DiscountCost!;\n }\n }\n }\n }\n return discountAmount * -1;\n };\n\n private readonly _renderAppliedPromoCode = (props: IPromoCodeProps) => {\n if (!props.cart || !props.cart.cart || !props.cart.cart.Coupons || !(props.cart.cart.Coupons.length > 0)) {\n return;\n }\n\n const _removePromotion = (event: React.MouseEvent<HTMLElement>) => {\n this._removePromotion(props.cart, event);\n };\n let totalCouponDiscountAmount = 0;\n for (const coupon of props.cart.cart.Coupons) {\n const discountAmount = this._calculateDiscount(coupon.Code ?? '', props.cart);\n if (discountAmount) {\n totalCouponDiscountAmount += discountAmount;\n }\n }\n\n return (\n <>\n <div className='msc-promo-code__discount'>\n <div className='msc-promo-code__discount-heading'>{this.props.appliedPromoCodeHeadingText}</div>\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: totalCouponDiscountAmount\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-promo-code__discount-value'\n />\n </div>\n {props.cart.cart.Coupons.map((coupon: Coupon) => {\n const ariaLabel = props.removePromoAriaLabelFormat\n ? format(props.removePromoAriaLabelFormat, props.removePromoText, coupon.Code)\n : '';\n\n return (\n <div key={coupon.Code} className='msc-promo-code__line-container'>\n <div className='msc-promo-code__line-value'>\n {coupon.Code}\n {` `}\n <PriceComponent\n data={{\n price: {\n CustomerContextualPrice: this._calculateDiscount(coupon.Code || '', props.cart)\n }\n }}\n context={props.context}\n id={props.id}\n typeName={props.typeName}\n className='msc-promo-code__line-discount-value'\n />\n </div>\n <Button\n title={props.removePromoText}\n className='msc-promo-code__line__btn-remove'\n onClick={_removePromotion}\n data-value={coupon.Code}\n aria-label={ariaLabel}\n >\n {props.removePromoText}\n </Button>\n </div>\n );\n })}\n </>\n );\n };\n}\n\n// @ts-expect-error\nexport const PromoCodeComponent: React.FunctionComponent<IPromoCodeProps> = msdyn365Commerce.createComponent<IPromoCodeComponent>(\n 'PromoCode',\n { component: PromoCode, ...PromoCodeComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport React, { useEffect, useState } from 'react';\n\nexport interface IRatingComponentProps extends IComponentProps<{}> {\n readOnly: boolean;\n ariaLabel: string;\n avgRating: number;\n ratingCount?: string;\n initialRating?: number;\n hideCount?: boolean;\n shouldShowFullRatingDescription?: boolean;\n className?: string;\n ratingCountAriaLabel?: string;\n onChange?(value: number): void;\n}\nexport interface IRatingComponent extends IComponent<IRatingComponentProps> {\n onSliderChanged(): (\n event: React.ChangeEvent<HTMLInputElement>,\n props: IRatingComponentProps,\n setRating: (rating: IRatingState) => void\n ) => void;\n onMouseOver(): (event: React.MouseEvent<HTMLElement>, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\n onClick(): (event: React.MouseEvent<HTMLElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void) => void;\n onMouseLeave(): (event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void) => void;\n}\n\ninterface IRatingState {\n rating: number;\n lastSelectedRating: number;\n}\n\nconst roundUpMin: number = 0.75;\nconst roundMidMin: number = 0.25;\nconst maxRating: number = 5;\n\nconst RatingComponentActions = {\n onSliderChanged(\n event: React.ChangeEvent<HTMLInputElement>,\n props: IRatingComponentProps,\n setRating: (rating: IRatingState) => void\n ): void {\n const value = Number.parseInt(event.target.value, 10);\n setRating({ rating: value, lastSelectedRating: value });\n\n if (props.onChange) {\n props.onChange(value);\n }\n },\n onMouseLeave(_event: React.MouseEvent, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\n setRating({ rating: rating.lastSelectedRating, lastSelectedRating: rating.lastSelectedRating });\n },\n onMouseOver(event: React.MouseEvent<HTMLElement>, rating: IRatingState, setRating: (rating: IRatingState) => void): void {\n setRating({ rating: getIndex(event), lastSelectedRating: rating.lastSelectedRating });\n },\n onClick(event: React.MouseEvent<HTMLElement>, props: IRatingComponentProps, setRating: (rating: IRatingState) => void): void {\n if (!props.readOnly) {\n const index = getIndex(event);\n setRating({ rating: index, lastSelectedRating: index });\n\n if (props.onChange) {\n props.onChange(index);\n }\n }\n }\n};\n\nconst Rating: React.FC<IRatingComponentProps> = (props: IRatingComponentProps) => {\n const initialRating = props.readOnly ? props.avgRating : props.initialRating || 0;\n const [rating, setRating] = useState({ rating: initialRating, lastSelectedRating: initialRating });\n useEffect(() => {\n const newRating = props.readOnly ? props.avgRating : props.initialRating || 0;\n setRating({ rating: newRating, lastSelectedRating: newRating });\n }, [props]);\n const onChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n RatingComponentActions.onSliderChanged(event, props, setRating);\n };\n const onMouseLeave = (event: React.MouseEvent) => {\n RatingComponentActions.onMouseLeave(event, rating, setRating);\n };\n const onMouseOver = (event: React.MouseEvent<HTMLElement>) => {\n RatingComponentActions.onMouseOver(event, rating, setRating);\n };\n const onClick = (event: React.MouseEvent<HTMLElement>) => {\n RatingComponentActions.onClick(event, props, setRating);\n };\n\n const shouldShowFullRatingDescriptionConfiguration = props.shouldShowFullRatingDescription ?? false;\n const shouldShowDescription = shouldShowFullRatingDescriptionConfiguration || props.typeName === 'reviews-list';\n\n return (\n <div className={`msc-rating ${rating.rating > 0 ? 'msc-no-ratings' : ''} ${props.className ? props.className : ''}`}>\n {starControl(props.readOnly, rating.rating, props.ariaLabel, props.ratingCountAriaLabel, onChange)}\n <div aria-hidden onMouseLeave={props.readOnly ? undefined : onMouseLeave} className='msc-rating__group'>\n {renderStars(rating.rating, props, onMouseOver, onClick)}\n </div>\n {props.ratingCount && (\n <output aria-hidden className='msc-rating__count'>\n {` `}\n {shouldShowDescription ? `${props.avgRating} / 5 (${props.ratingCount})` : props.ratingCount}\n {` `}\n </output>\n )}\n </div>\n );\n};\n\n// Set default props\nRating.defaultProps = {\n avgRating: 0\n} as Partial<IRatingComponentProps>;\n\n/**\n * Rating Review ariaLabel.\n * @param readOnly - Boolean.\n * @param currentRating - Current rating number.\n * @param ariaLabel - Rating AriaLabel.\n * @param reviewCountAriaLabel - Product review count.\n * @param onChange - On Change function.\n * @returns Jsx element.\n */\nconst starControl = (\n readOnly: boolean,\n currentRating: number,\n ariaLabel: string,\n reviewCountAriaLabel: string | undefined,\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void\n): JSX.Element => {\n if (readOnly) {\n return <div className='msc-rating__range sr-only'>{`${ariaLabel}${reviewCountAriaLabel ? ` ${reviewCountAriaLabel}` : ''}`}</div>;\n }\n\n return (\n <input\n type='range'\n className='msc-rating__range'\n min={0}\n max={5}\n step={1}\n value={currentRating}\n aria-valuemax={5}\n aria-valuemin={0}\n aria-valuenow={currentRating}\n onChange={onChange}\n aria-label={ariaLabel}\n />\n );\n};\n\nconst renderStars = (\n rating: number,\n props: IRatingComponentProps,\n mouseOver: (event: React.MouseEvent<HTMLElement>) => void,\n onClick: (event: React.MouseEvent<HTMLElement>) => void\n): JSX.Element[] => {\n const floor = Math.floor(rating);\n const remainder = rating - floor;\n const filled = remainder < roundUpMin ? floor : floor + 1;\n const half = roundMidMin <= remainder && remainder < roundUpMin ? filled + 1 : 0;\n const stars = [];\n\n for (let i = 1; i <= maxRating; i++) {\n const glyphClass = filled >= i ? 'msc-rating__star' : half === i ? 'msc-rating__half-star' : 'msc-rating__empty-star'!;\n stars.push(\n <span\n className={glyphClass}\n data-index={i}\n key={i}\n onMouseOver={props.readOnly ? undefined : mouseOver}\n onClick={onClick}\n role='presentation'\n />\n );\n }\n\n return stars;\n};\n\nconst getIndex = (event: React.MouseEvent<HTMLElement>): number => {\n const target = event.target as HTMLElement;\n return Number.parseInt(target.getAttribute('data-index')!, 10);\n};\n\n// @ts-expect-error\nexport const RatingComponent: React.FunctionComponent<IRatingComponentProps> = msdyn365Commerce.createComponent<IRatingComponent>(\n 'Rating',\n { component: Rating, ...RatingComponentActions }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/**\n * Refiner options type.\n */\nexport enum RefinerOptionsType {\n SingleSelect = 0,\n MultiSelect = 1\n}\n\n/**\n * Refiner item type.\n */\nexport enum RefinerItemType {\n Check = 0,\n DateRange = 1\n}\n\n/**\n * IRefinerItemData interface.\n */\nexport interface IRefinerItemData {\n refinerItemId: number; // must be unique within the refiner group (sourceTypeValue)\n sourceTypeValue: number;\n itemType: RefinerItemType;\n label: string;\n value?: string;\n isChecked?: boolean;\n minLabel?: string;\n maxLabel?: string;\n minValue?: string;\n maxValue?: string;\n}\n\n/**\n * IRefinerOptionsData interface.\n */\nexport interface IRefinerOptionsData {\n refinerOptionsId: number; // must be unique within the refiner (sourceTypeValue)\n sourceTypeValue: number;\n name?: string;\n typeValue: RefinerOptionsType;\n isExpanded?: boolean;\n refinerItems: IRefinerItemData[];\n selectedRefinerItems: IRefinerItemData[];\n}\n\n/**\n * IRefinerData interface.\n */\nexport interface IRefinerData {\n refinerOptions: IRefinerOptionsData[];\n}\n\n/**\n * IRefinerItemToggleNotification interface.\n */\nexport interface IRefinerItemToggleNotification {\n refinerOptionsData: IRefinerOptionsData;\n refinerItemData: IRefinerItemData;\n isSelecting: boolean;\n rangeStart?: string;\n rangeEnd?: string;\n}\n\n/**\n * Get updated refinement criteria.\n * @param itemToggleNotification - RefineItemToggleNotification object.\n * @param currentRefinementCriteria - Array of IRefineItemData.\n * @returns - Array of IRefineItemData.\n */\nexport function getUpdatedRefinementCriteria(\n itemToggleNotification: IRefinerItemToggleNotification,\n currentRefinementCriteria: IRefinerItemData[]\n): IRefinerItemData[] {\n const updatedRefinementCriteria: IRefinerItemData[] = [];\n let isToggledItemFound = false;\n\n // Keep all the existing refinement criteria, except the given item toggle notification if it is not selected.\n for (const selectedCriterion of currentRefinementCriteria) {\n if (isMatchingRefinementCriterion(itemToggleNotification.refinerItemData, selectedCriterion)) {\n isToggledItemFound = true;\n if (itemToggleNotification.isSelecting) {\n const next = {\n ...selectedCriterion,\n minValue:\n itemToggleNotification.rangeStart !== undefined\n ? `${itemToggleNotification.rangeStart}`\n : selectedCriterion.minValue,\n maxValue:\n itemToggleNotification.rangeEnd !== undefined ? `${itemToggleNotification.rangeEnd}` : selectedCriterion.maxValue\n };\n updatedRefinementCriteria.push(next);\n } // Else the item is being de-selected, so omit it from the refinement criteria\n } else {\n // Keep existing criterion because it is not in the item toggle notification\n updatedRefinementCriteria.push(selectedCriterion);\n }\n }\n\n if (!isToggledItemFound) {\n const next = {\n ...itemToggleNotification.refinerItemData\n };\n\n updatedRefinementCriteria.push(next);\n\n // If single select, then deselect any others in the parent refiner group\n if (itemToggleNotification.refinerOptionsData.typeValue === RefinerOptionsType.SingleSelect) {\n for (const child of itemToggleNotification.refinerOptionsData.refinerItems) {\n if (!(child.refinerItemId === next.refinerItemId && child.label === next.label)) {\n const matchingIndex = updatedRefinementCriteria.findIndex(criterion => isMatchingRefinementCriterion(child, criterion));\n // eslint-disable-next-line max-depth -- Condition required.\n if (matchingIndex > -1) {\n updatedRefinementCriteria.splice(matchingIndex, 1);\n }\n }\n }\n }\n }\n\n return updatedRefinementCriteria;\n}\n\n/**\n * Find the refinement criterion associated with this given refiner value.\n * @param refinerValue - Refiner value to match.\n * @param refinementCriterion - Selected refinement criteria.\n * @returns - Boolean.\n */\nexport function isMatchingRefinementCriterion(refinerValue: IRefinerItemData, refinementCriterion: IRefinerItemData): boolean {\n return (\n refinementCriterion.refinerItemId === refinerValue.refinerItemId &&\n refinementCriterion.label === refinerValue.label &&\n refinerValue.sourceTypeValue === refinementCriterion.sourceTypeValue\n );\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport {\n Button,\n ITelemetryContent,\n TelemetryConstant,\n getPayloadObject,\n getTelemetryAttributes\n} from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\n/**\n * Class names used in component.\n */\nconst componentClassName: string = 'msc-refiner-apply';\n\n/**\n * IRefinerApplyComponent interface.\n */\ninterface IRefinerApplyComponent extends IComponent<IRefinerApplyProps> {}\n\n/**\n * IRefinerApplyProps interface.\n */\nexport interface IRefinerApplyProps extends IComponentProps<{}> {\n className?: string;\n text?: string;\n ariaLabel?: string;\n isDisabled?: boolean;\n telemetryContent?: ITelemetryContent;\n onClick?(): void;\n}\n\n/**\n * RefinerApply component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerApplyFunctionalComponent: React.FC<IRefinerApplyProps> = (props: IRefinerApplyProps) => {\n const { className, text, ariaLabel, isDisabled, telemetryContent, onClick } = props;\n\n // define telemetry attributes\n const applyRefinerAttributes = getTelemetryAttributes(\n props.telemetryContent!,\n getPayloadObject('click', telemetryContent!, TelemetryConstant.ApplyRefiner)\n );\n\n return (\n <Button\n className={classnames(className, componentClassName)}\n disabled={isDisabled}\n aria-label={ariaLabel ?? text}\n aria-disabled={isDisabled}\n onClick={onClick}\n {...applyRefinerAttributes}\n >\n {text}\n </Button>\n );\n};\n\n/**\n * RefinerApply component.\n */\nexport const RefinerApplyComponent: React.FunctionComponent<IRefinerApplyProps> = msdyn365Commerce.createComponent<IRefinerApplyComponent>(\n 'Refiner-Apply',\n {\n component: React.memo(RefinerApplyFunctionalComponent)\n }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\nimport { IRefinerItemData, RefinerItemType } from './common';\n\n/**\n * Class names used in component.\n */\nconst componentClassName: string = 'msc-refiner-choice-summary';\nconst labelClassName: string = `${componentClassName}__label`;\nconst listClassName: string = `${componentClassName}__list`;\nconst listItemClassName: string = `${componentClassName}__list-item`;\nconst itemClassName: string = `${componentClassName}__item`;\nconst closeButtonGlyphClassName: string = `${componentClassName}__close-btn`;\nconst buttonGlyphClassName: string = `${componentClassName}__glyph`;\nconst clearAllButtonClassName: string = `${componentClassName}__clear-all`;\n\n/**\n * IRefinerChoiceSummaryClickNotification interface.\n */\nexport interface IRefinerChoiceSummaryClickNotification {\n selectedRefinerItem: IRefinerItemData | undefined;\n shouldClearAll: boolean;\n nextItemToFocus: HTMLElement | undefined;\n}\n\n/**\n * IRefinerChoiceSummaryComponent interface.\n */\ninterface IRefinerChoiceSummaryComponent extends IComponent<IRefinerChoiceSummaryProps> {}\n\n/**\n * IRefinerChoiceSummaryData interface.\n */\nexport interface IRefinerChoiceSummaryData {\n selectedChoices: IRefinerItemData[];\n}\n\n/**\n * IRefinerChoiceSummaryProps interface.\n */\nexport interface IRefinerChoiceSummaryProps extends IComponentProps<IRefinerChoiceSummaryData> {\n className?: string;\n clearAllText?: string;\n label?: string;\n choiceAriaLabel?: string;\n choiceFormat?: string;\n closeAriaLabel?: string;\n telemetryContent?: ITelemetryContent;\n onClickChoice(notification: IRefinerChoiceSummaryClickNotification): void;\n onClickClearAll(notification: IRefinerChoiceSummaryClickNotification): void;\n}\n\n/**\n * RefinerChoiceSummary component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerChoiceSummaryFunctionalComponent: React.FC<IRefinerChoiceSummaryProps> = (props: IRefinerChoiceSummaryProps) => {\n const {\n className,\n clearAllText,\n label,\n choiceAriaLabel,\n choiceFormat,\n closeAriaLabel,\n data: { selectedChoices },\n onClickChoice,\n onClickClearAll\n } = props;\n\n /**\n * Get choice summary name.\n * @param activeRefinerItem - Active refine Item data.\n * @returns - Returns the tag name.\n */\n const getTagName = (activeRefinerItem: IRefinerItemData): string => {\n /* eslint-disable @typescript-eslint/prefer-nullish-coalescing -- Required for string. */\n const overallFormat = choiceFormat ?? '{0}';\n\n const refinerLabel: string = activeRefinerItem.label;\n let refinerValue: string = activeRefinerItem.value ?? '';\n if (activeRefinerItem.itemType === RefinerItemType.DateRange) {\n const refinerMinValue: string = activeRefinerItem.minValue ?? '';\n const refinerMaxValue: string = activeRefinerItem.maxValue ?? '';\n refinerValue = '{0} - {1}'.replace('{0}', refinerMinValue).replace('{1}', refinerMaxValue);\n }\n\n return overallFormat.replace('{0}', refinerLabel).replace('{1}', refinerValue);\n /* eslint-enable @typescript-eslint/prefer-nullish-coalescing -- Required for string. */\n };\n\n const onClickChoiceHandler = React.useCallback(\n (selectedRefinerItem: IRefinerItemData) => (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>): void => {\n event.preventDefault();\n event.stopPropagation();\n\n const targetChoiceItem = event.currentTarget as HTMLElement;\n\n onClickChoice({\n selectedRefinerItem,\n shouldClearAll: false,\n nextItemToFocus: targetChoiceItem.nextSibling as HTMLElement\n });\n },\n [onClickChoice]\n );\n\n const onClickClearAllHandler = React.useCallback(\n () => (event: React.MouseEvent<HTMLAnchorElement, MouseEvent>): void => {\n event.preventDefault();\n event.stopPropagation();\n\n const targetChoiceItem = event.currentTarget as HTMLElement;\n\n onClickClearAll({\n selectedRefinerItem: undefined,\n shouldClearAll: true,\n nextItemToFocus: targetChoiceItem.nextSibling as HTMLElement\n });\n },\n [onClickClearAll]\n );\n\n // define telemetry attributes\n const payLoad: IPayLoad = getPayloadObject('click', props.telemetryContent!, '');\n payLoad.contentAction.etext = clearAllText;\n const clearAllAttributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n <div className={componentClassName}>\n {ArrayExtensions.hasElements(selectedChoices) && label && <span className={labelClassName}>{label}</span>}\n <ul className={classnames(className, listClassName, 'list-unstyled')}>\n {ArrayExtensions.hasElements(selectedChoices) &&\n selectedChoices.map((choiceItem, index) => {\n const choiceItemName = getTagName(choiceItem);\n\n // define telemetry attributes\n payLoad.contentAction.etext = choiceItemName;\n const choiceItemAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n <li className={listItemClassName} key={index}>\n <a\n key={choiceItem.refinerItemId}\n className={itemClassName}\n role='button'\n aria-label={`${choiceItemName} ${choiceAriaLabel ?? ''}`}\n onClick={onClickChoiceHandler(choiceItem)}\n {...choiceItemAttribute}\n >\n {choiceItemName}\n <span\n className={classnames(closeButtonGlyphClassName, buttonGlyphClassName)}\n role='button'\n aria-label={closeAriaLabel}\n />\n </a>\n </li>\n );\n })}\n </ul>\n {ArrayExtensions.hasElements(selectedChoices) && clearAllText && (\n <a\n className={clearAllButtonClassName}\n aria-label={closeAriaLabel}\n onClick={onClickClearAllHandler()}\n {...clearAllAttributes}\n >\n {clearAllText}\n </a>\n )}\n </div>\n );\n};\n\n/**\n * RefinerChoiceSummary component.\n */\nexport const RefinerChoiceSummaryComponent: React.FunctionComponent<IRefinerChoiceSummaryProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error -- Required for this signature.\n IRefinerChoiceSummaryComponent\n>('Refiner-Choice-Summary', { component: React.memo(RefinerChoiceSummaryFunctionalComponent) });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\nimport { IRefinerApplyProps, RefinerApplyComponent } from './refiner-apply.component';\n\n/**\n * Class names used in component.\n */\nconst componentClassName: string = 'msc-refiner-footer';\nconst actionsWrapperClassName: string = `${componentClassName}__actions`;\nconst extraActionsWrapperClassName: string = `${componentClassName}__extra-actions`;\n\n/**\n * IRefinerFooterComponent interface.\n */\ninterface IRefinerFooterComponent extends IComponent<IRefinerFooterProps> {}\n\n/**\n * IRefinerFooterProps interface.\n */\nexport interface IRefinerFooterProps extends IComponentProps<{}> {\n className?: string;\n refinerApplyProps?: IRefinerApplyProps;\n extraActions?: React.ReactNode;\n}\n\n/**\n * RefinerFooter component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerFooterFunctionalComponent: React.FC<IRefinerFooterProps> = (props: IRefinerFooterProps) => {\n const { className, refinerApplyProps, extraActions } = props;\n\n return (\n <div className={classnames(className, componentClassName)}>\n <div className={actionsWrapperClassName}>\n {extraActions && <div className={extraActionsWrapperClassName}>{extraActions}</div>}\n {refinerApplyProps && <RefinerApplyComponent {...refinerApplyProps} />}\n </div>\n </div>\n );\n};\n\n/**\n * RefinerFooter component.\n */\nexport const RefinerFooterComponent: React.FunctionComponent<IRefinerFooterProps> = msdyn365Commerce.createComponent<\n IRefinerFooterComponent\n>('Refiner-Footer', {\n component: React.memo(RefinerFooterFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Button } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-toggle';\nconst expandedComponentClassName = `${componentClassName}__toggle_expanded`;\nconst collapsedComponentClassName = `${componentClassName}__toggle_collapsed`;\n\n/**\n * IRefinerToggleComponent interface.\n */\ninterface IRefinerToggleComponent extends IComponent<IRefinerToggleProps> {}\n\n/**\n * IRefinerToggleProps interface.\n */\nexport interface IRefinerToggleProps extends IComponentProps<{}> {\n className?: string;\n text?: string;\n ariaLabel?: string;\n isDisabled?: boolean;\n isExpanded?: boolean;\n onClick?(): void;\n}\n\n/**\n * RefinerToggle component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerToggleFunctionalComponent: React.FC<IRefinerToggleProps> = (props: IRefinerToggleProps) => {\n const { className, text, ariaLabel, isDisabled, isExpanded, onClick } = props;\n\n return (\n <Button\n className={classnames(className, isExpanded ? expandedComponentClassName : collapsedComponentClassName)}\n disabled={isDisabled}\n aria-label={ariaLabel ?? text}\n aria-expanded={!!isExpanded}\n aria-disabled={isDisabled}\n onClick={onClick}\n >\n {text}\n </Button>\n );\n};\n\n/**\n * RefinerToggle component.\n */\nexport const RefinerToggleComponent: React.FunctionComponent<IRefinerToggleProps> = msdyn365Commerce.createComponent<\n IRefinerToggleComponent\n>('Refiner-Toggle', {\n component: React.memo(RefinerToggleFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport React from 'react';\n\nimport classnames from 'classnames';\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\nlet selectHtmlElement: React.RefObject<HTMLSelectElement>;\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-sort';\nconst sortOptionsClassName = `${componentClassName}__sort-options`;\nconst sortOptionClassName = `${componentClassName}__sort-option`;\nconst sortOptionSelectedClassName = `${componentClassName}__sort-option-selected`;\nconst labelId = `${componentClassName}__label`;\nconst selectLabelId = `${componentClassName}__select`;\nconst labelClassName = `${componentClassName}__label`;\n\n/**\n * IRefinerSortComponent interface.\n */\ninterface IRefinerSortComponent extends IComponent<IRefinerSortProps> {}\n\n/**\n * IRefinerSortData interface.\n */\nexport interface IRefinerSortData {\n options: IRefinerSortOption[];\n}\n\n/**\n * IRefinerSortOption interface.\n */\nexport interface IRefinerSortOption {\n label: string;\n value: string;\n}\n\n/**\n * IRefinerSortProps interface.\n */\nexport interface IRefinerSortProps extends IComponentProps<IRefinerSortData> {\n className?: string;\n currentSortOption?: IRefinerSortOption;\n label?: string;\n ariaLabel?: string;\n isDisabled?: boolean;\n telemetryContent?: ITelemetryContent;\n onSelectOption?(newSortOption?: IRefinerSortOption): void;\n}\n\n/**\n * RefinerSort component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerSortFunctionalComponent: React.FC<IRefinerSortProps> = (props: IRefinerSortProps) => {\n const [sortOptionState, setSortOptionState] = React.useState(props.currentSortOption);\n\n const onSelectOptionHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n const value = event.target.value;\n const sortOption = props.data.options?.find((option: IRefinerSortOption) => option.value === value);\n setSortOptionState(sortOption);\n props.onSelectOption?.(sortOption);\n };\n\n // TODO: define telemetry attributes\n // const attributes = getTelemetryAttributes(\n // props.telemetryContent!,\n // getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Sort)\n // );\n\n return (\n <div className={classnames(props.className, componentClassName)}>\n {ArrayExtensions.hasElements(props.data.options) && (\n <label id={labelId} htmlFor={selectLabelId} className={labelClassName}>\n {props.label}\n <select\n id={selectLabelId}\n ref={selectHtmlElement}\n className={sortOptionsClassName}\n value={sortOptionState?.value}\n title={props.ariaLabel ?? ''}\n disabled={props.isDisabled}\n aria-label={props.ariaLabel ?? ''}\n aria-disabled={props.isDisabled}\n onChange={onSelectOptionHandler}\n >\n {props.data.options?.map((option: IRefinerSortOption) => {\n return (\n <option\n key={option.value}\n value={option.value}\n aria-label={option.label}\n aria-selected={option.value === sortOptionState?.value}\n className={classnames(\n sortOptionClassName,\n option.value === sortOptionState?.value ? sortOptionSelectedClassName : ''\n )}\n >\n {option.label}\n </option>\n );\n })}\n </select>\n </label>\n )}\n </div>\n );\n};\n\n/**\n * RefinerSort component.\n */\nexport const RefinerSortComponent: React.FunctionComponent<IRefinerSortProps> = msdyn365Commerce.createComponent<IRefinerSortComponent>(\n 'Refiner-Sort',\n { component: React.memo(RefinerSortFunctionalComponent) }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\nimport { IRefinerToggleProps, RefinerToggleComponent } from './refiner-toggle.component';\nimport { IRefinerChoiceSummaryProps, RefinerChoiceSummaryComponent } from './refiner-choice-summary.component';\nimport { IRefinerSortProps, RefinerSortComponent } from './refiner-sort.component';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-header';\nconst choiceSummaryWrapperClassName = `${componentClassName}__wrapper-choice-summary`;\nconst moreActionsWrapperClassName = `${componentClassName}__wrapper-more-actions`;\nconst extraActionsWrapperClassName = `${componentClassName}__wrapper-extra-actions`;\n\n/**\n * IRefinerHeaderComponent interface.\n */\ninterface IRefinerHeaderComponent extends IComponent<IRefinerHeaderProps> {}\n\n/**\n * IRefinerHeaderProps interface.\n */\nexport interface IRefinerHeaderProps extends IComponentProps<{}> {\n className?: string;\n refinerToggleProps?: IRefinerToggleProps;\n refinerChoiceSummaryProps?: IRefinerChoiceSummaryProps;\n refinerSortProps?: IRefinerSortProps;\n extraActions?: React.ReactNode;\n}\n\n/**\n * RefinerHeader component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerHeaderFunctionalComponent: React.FC<IRefinerHeaderProps> = (props: IRefinerHeaderProps) => {\n const { className, extraActions } = props;\n\n return (\n <Node className={classnames(className, componentClassName)}>\n {props.refinerToggleProps && <RefinerToggleComponent {...props.refinerToggleProps} />}\n {props.refinerChoiceSummaryProps && (\n <div className={choiceSummaryWrapperClassName}>\n <RefinerChoiceSummaryComponent {...props.refinerChoiceSummaryProps} />\n </div>\n )}\n <div className={moreActionsWrapperClassName}>\n {props.refinerSortProps && <RefinerSortComponent {...props.refinerSortProps} />}\n {extraActions && <div className={extraActionsWrapperClassName}>{extraActions}</div>}\n </div>\n </Node>\n );\n};\n\n/**\n * RefinerHeader component.\n */\nexport const RefinerHeaderComponent: React.FunctionComponent<IRefinerHeaderProps> = msdyn365Commerce.createComponent<\n IRefinerHeaderComponent\n>('Refiner-Header', {\n component: React.memo(RefinerHeaderFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { getPayloadObject, getTelemetryAttributes, IPayLoad, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-item-check';\nconst labelClassName = `${componentClassName}__label`;\n\n/**\n * IRefinerItemCheckComponent interface.\n */\ninterface IRefinerItemCheckComponent extends IComponent<IRefinerItemCheckProps> {}\n\n/**\n * IRefinerItemCheckProps interface.\n */\nexport interface IRefinerItemCheckProps extends IComponentProps<{}> {\n className?: string;\n label: string;\n ariaLabel?: string;\n isDisabled?: boolean;\n isSingleSelect: boolean;\n isChecked?: boolean;\n telemetryContent?: ITelemetryContent;\n onClick(): void;\n}\n\n/**\n * RefinerItemCheck component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerItemCheckFunctionalComponent: React.FC<IRefinerItemCheckProps> = (props: IRefinerItemCheckProps) => {\n const { className, isDisabled, label, ariaLabel, isSingleSelect, isChecked, onClick, telemetryContent } = props;\n\n let itemTypeClassName = isSingleSelect ? 'single-select' : 'multi-select';\n itemTypeClassName = isChecked ? `${itemTypeClassName}-checked` : itemTypeClassName;\n\n // define telemetry attributes\n const payLoad: IPayLoad = getPayloadObject('click', telemetryContent!, '');\n payLoad.contentAction.etext = label;\n const refinerItemAttributes = getTelemetryAttributes(telemetryContent!, payLoad);\n\n const onClickHandler = (event: React.MouseEvent<HTMLAnchorElement | HTMLInputElement>): void => {\n event.preventDefault();\n event.stopPropagation();\n\n !props.isDisabled && onClick();\n };\n\n return (\n <a\n tabIndex={0}\n className={classnames(className, componentClassName, itemTypeClassName, isDisabled ? 'disabled' : '')}\n role={isSingleSelect ? 'radio' : 'checkbox'}\n aria-label={ariaLabel ?? label}\n aria-checked={isChecked}\n aria-disabled={isDisabled}\n onClick={onClickHandler}\n {...refinerItemAttributes}\n >\n <span className={labelClassName} aria-hidden='true'>\n {label}\n </span>\n </a>\n );\n};\n\n/**\n * RefinerItemCheck component.\n */\nexport const RefinerItemCheckComponent: React.FunctionComponent<IRefinerItemCheckProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error -- Required for this signature.\n IRefinerItemCheckComponent\n>('Refiner-Item-Check', {\n component: React.memo(RefinerItemCheckFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\nlet minInput: React.RefObject<HTMLInputElement>;\n\nlet maxInput: React.RefObject<HTMLInputElement>;\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-item-daterange';\nconst minLabelClassName = `${componentClassName}__label-min`;\nconst maxLabelClassName = `${componentClassName}__label-max`;\nconst minInputClassName = `${componentClassName}__input-min`;\nconst maxInputClassName = `${componentClassName}__input-max`;\nconst minLabelId = `${componentClassName}__label-min`;\nconst maxLabelId = `${componentClassName}__label-max`;\nconst minInputLabelId = `${componentClassName}__input-min`;\nconst maxInputLabelId = `${componentClassName}__input-max`;\nconst validationErrorMessageClassName = `${componentClassName}__error`;\n\n/**\n * IRefinerItemDateRangeComponent interface.\n */\ninterface IRefinerItemDateRangeComponent extends IComponent<IRefinerItemDateRangeProps> {}\n\n/**\n * IRefinerItemDateRangeProps interface.\n */\nexport interface IRefinerItemDateRangeProps extends IComponentProps<{}> {\n className?: string;\n minInputLabel?: string;\n maxInputLabel?: string;\n minInputAriaLabel?: string;\n maxInputAriaLabel?: string;\n isDisabled?: boolean;\n minRangeValue?: string;\n maxRangeValue?: string;\n validationErrorForRange?: string;\n fallbackPattern?: string;\n onChangeMinValue?(minValue: string): void;\n onChangeMaxValue?(maxValue: string): void;\n onBlurMinInput?(minValue: string): void;\n onBlurMaxInput?(maxValue: string): void;\n}\n\n/**\n * RefinerItemDateRange component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerItemDateRangeFunctionalComponent: React.FC<IRefinerItemDateRangeProps> = (props: IRefinerItemDateRangeProps) => {\n const {\n className,\n minInputLabel,\n maxInputLabel,\n minInputAriaLabel,\n maxInputAriaLabel,\n isDisabled,\n minRangeValue,\n maxRangeValue,\n validationErrorForRange,\n fallbackPattern,\n onChangeMinValue,\n onChangeMaxValue,\n onBlurMinInput,\n onBlurMaxInput\n } = props;\n const [selectedMinValue, setSelectedMinValue] = React.useState(minRangeValue);\n const [selectedMaxValue, setSelectedMaxValue] = React.useState(maxRangeValue);\n const [validationErrorMessageForRange, setValidationErrorMessageForRange] = React.useState('');\n\n const onChangeMinValueHandler = (event: React.FocusEvent<HTMLInputElement>): void => {\n const selectedFormattedValue = event.target.value;\n setSelectedMinValue(selectedFormattedValue);\n onChangeMinValue?.(selectedFormattedValue);\n };\n\n const onChangeMaxValueHandler = (event: React.FocusEvent<HTMLInputElement>): void => {\n const selectedFormattedValue = event.target.value;\n setSelectedMaxValue(selectedFormattedValue);\n onChangeMaxValue?.(selectedFormattedValue);\n };\n\n function validateRange(minimum?: string, maximum?: string): boolean {\n if (validationErrorForRange && minimum && maximum && minimum > maximum) {\n setValidationErrorMessageForRange(validationErrorForRange);\n return false;\n }\n setValidationErrorMessageForRange('');\n return true;\n }\n\n const onBlurMinValueHandler = (event: React.FocusEvent<HTMLInputElement>) => {\n const userSelectedMinValue = event.target.value;\n setSelectedMinValue(userSelectedMinValue);\n const updatedMinInput = userSelectedMinValue;\n if (validateRange(updatedMinInput, selectedMaxValue)) {\n onBlurMinInput?.(updatedMinInput);\n }\n };\n\n const onBlurMaxValueHandler = (event: React.FocusEvent<HTMLInputElement>) => {\n const userSelectedMaxValue = event.target.value;\n setSelectedMaxValue(userSelectedMaxValue);\n const updatedMaxInput = userSelectedMaxValue;\n if (validateRange(selectedMinValue, updatedMaxInput)) {\n onBlurMaxInput?.(updatedMaxInput);\n }\n };\n\n return (\n <form\n className={classnames(className, componentClassName)}\n aria-disabled={isDisabled}\n data-testid='range-refine-input-item-container'\n >\n <label id={minLabelId} htmlFor={minInputLabelId} className={minLabelClassName}>\n {minInputLabel}\n <input\n className={minInputClassName}\n type='date'\n onChange={onChangeMinValueHandler}\n onBlur={onBlurMinValueHandler}\n value={selectedMinValue}\n id={minInputLabelId}\n ref={minInput}\n aria-label={minInputAriaLabel ?? minInputLabel}\n aria-disabled={isDisabled}\n pattern={fallbackPattern}\n />\n </label>\n <label id={maxLabelId} htmlFor={maxInputLabelId} className={maxLabelClassName}>\n {maxInputLabel}\n <input\n className={maxInputClassName}\n type='date'\n onChange={onChangeMaxValueHandler}\n onBlur={onBlurMaxValueHandler}\n value={selectedMaxValue}\n id={maxInputLabelId}\n ref={maxInput}\n aria-label={maxInputAriaLabel ?? maxInputLabel}\n aria-disabled={isDisabled}\n pattern={fallbackPattern}\n />\n </label>\n {validationErrorMessageForRange && validationErrorMessageForRange !== '' && (\n <span className={validationErrorMessageClassName}>{validationErrorMessageForRange}</span>\n )}\n </form>\n );\n};\n\n/**\n * RefinerItemDateRange component.\n */\nexport const RefinerItemDateRangeComponent: React.FunctionComponent<IRefinerItemDateRangeProps> = msdyn365Commerce.createComponent<\n IRefinerItemDateRangeComponent\n>('Refiner-Item-DateRange', { component: React.memo(RefinerItemDateRangeFunctionalComponent) });\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\nimport { IRefinerSortProps, RefinerSortComponent } from './refiner-sort.component';\n\n/**\n * Class names used in component\n */\nconst componentModalClassName = 'msc-refiner-modal';\nconst closeModalClassName = `${componentModalClassName}__close`;\nconst modalContentClassName = `${componentModalClassName}__content`;\nconst modalContentWrapperClassName = `${componentModalClassName}__wrapper`;\nconst modalContentWrapper2ClassName = `${componentModalClassName}__wrapper-internal`;\nconst componentModalToggleClassName = `${componentModalClassName}-toggle`;\n\n/**\n * IRefinerModalToggleComponent interface.\n */\ninterface IRefinerModalToggleComponent extends IComponent<IRefinerModalToggleProps> {}\n\n/**\n * IRefinerModalComponent interface.\n */\ninterface IRefinerModalComponent extends IComponent<IRefinerModalProps> {}\n\n/**\n * IRefinerModalToggleProps interface.\n */\nexport interface IRefinerModalToggleProps extends IComponentProps<{}> {\n innerRef: React.RefObject<HTMLButtonElement> | undefined;\n id: string;\n text: string;\n ariaLabel: string;\n onClick(): void;\n}\n\n/**\n * IRefinerModalProps interface.\n */\nexport interface IRefinerModalProps extends IComponentProps<{}> {\n modalTitle?: string;\n modalCloseButtonText?: string;\n isOpen?: boolean;\n returnRef?: React.RefObject<HTMLButtonElement> | undefined;\n refinerSortProps?: IRefinerSortProps;\n refinerOptions?: React.ReactNode[];\n onToggle?(): void;\n}\n\n/**\n * Returns the modal.\n * @param props - IRefinerModalProps.\n * @returns Modal node.\n */\nconst modalNode = (props: IRefinerModalProps) => {\n return (\n <Modal\n autoFocus\n applicationNode='renderPage'\n returnFocusRef={props.returnRef}\n isOpen={props.isOpen}\n toggle={props.onToggle}\n className={componentModalClassName}\n zIndex={1050}\n />\n );\n};\n\n/**\n * Returns the modal header.\n * @param props - IRefinerModalProps.\n * @returns ModalHeader node.\n */\nconst modalHeaderNode = (props: IRefinerModalProps) => {\n return <ModalHeader toggle={props.onToggle}>{props.modalTitle}</ModalHeader>;\n};\n\n/**\n * Returns the modal footer.\n * @param props - IRefinerModalProps.\n * @returns ModalFooter node.\n */\nconst modalFooterNode = (props: IRefinerModalProps) => {\n return (\n <ModalFooter>\n <Button onClick={props.onToggle} className={closeModalClassName}>\n {props.modalCloseButtonText}\n </Button>\n </ModalFooter>\n );\n};\n\n/**\n * RefinerToggle component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nexport const RefinerModalToggleFunctionalComponent: React.FC<IRefinerModalToggleProps> = (props: IRefinerModalToggleProps) => {\n const { text, onClick, ariaLabel, innerRef, id } = props;\n return (\n <button id={id} className={componentModalToggleClassName} aria-label={ariaLabel} onClick={onClick} ref={innerRef}>\n {text}\n </button>\n );\n};\n\n/**\n * RefinerModal component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerModalFunctionalComponent: React.FC<IRefinerModalProps> = (props: IRefinerModalProps) => {\n return (\n <>\n {React.cloneElement(\n modalNode(props),\n {},\n modalHeaderNode(props),\n <ModalBody className={modalContentClassName}>\n <div className={modalContentWrapperClassName}>\n <div className={modalContentWrapper2ClassName}>\n {props.refinerSortProps && <RefinerSortComponent {...props.refinerSortProps} />}\n {props.refinerOptions &&\n props.refinerOptions.map((item, index) => <React.Fragment key={index}>{item}</React.Fragment>)}\n </div>\n </div>\n </ModalBody>,\n modalFooterNode(props)\n )}\n </>\n );\n};\n\n/**\n * RefinerModalToggle component.\n */\nexport const RefinerModalToggleComponent: React.FunctionComponent<IRefinerModalToggleProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error -- Required for this signature.\n IRefinerModalToggleComponent\n>('Refiner-Modal-Toggle', {\n component: React.memo(RefinerModalToggleFunctionalComponent)\n});\n\n/**\n * RefinerModal component.\n */\nexport const RefinerModalComponent: React.FunctionComponent<IRefinerModalProps> = msdyn365Commerce.createComponent<IRefinerModalComponent>(\n 'Refiner-Modal',\n {\n component: React.memo(RefinerModalFunctionalComponent)\n }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IAny, IComponent, IComponentProps, ICoreContext, IGeneric, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Button, ITelemetryContent, Collapse } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\nimport { IRefinerItemDateRangeProps, RefinerItemDateRangeComponent } from './refiner-item-daterange.component';\nimport { IRefinerItemCheckProps, RefinerItemCheckComponent } from './refiner-item-check.component';\nimport {\n IRefinerItemData,\n IRefinerItemToggleNotification,\n IRefinerOptionsData,\n RefinerItemType,\n RefinerOptionsType,\n isMatchingRefinementCriterion\n} from './common';\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- This is the standard rule for naming a constant.\nconst DEFAULT_REFINER_OPTIONS_EXPAND_TIMEOUT = 350;\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-refiner-options';\nconst expandedClassName = `${componentClassName}__toggle_expanded`;\nconst collapsedClassName = `${componentClassName}__toggle_collapsed`;\nconst listClassName = `${componentClassName}__list`;\nconst listItemClassName = `${componentClassName}__list-item`;\n\n/**\n * IRefinerOptionsComponent interface.\n */\ninterface IRefinerOptionsComponent extends IComponent<IRefinerOptionsProps> {}\n\n/**\n * IRefinerOptionsProps interface.\n */\nexport interface IRefinerOptionsProps extends IComponentProps<IRefinerOptionsData> {\n context: ICoreContext<IGeneric<IAny>>;\n className: string;\n isDisabled: boolean;\n isExpandedOnInitialLoad: boolean;\n expandTimeout?: number;\n telemetryContent?: ITelemetryContent;\n onUpdateRefiners(notification: IRefinerItemToggleNotification): void;\n}\n\n/**\n * RefinerOptions component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerOptionsFunctionalComponent: React.FC<IRefinerOptionsProps> = (props: IRefinerOptionsProps) => {\n const {\n className,\n context,\n id: moduleId,\n typeName,\n data,\n isDisabled,\n isExpandedOnInitialLoad,\n expandTimeout,\n telemetryContent,\n onUpdateRefiners\n } = props;\n\n const [shouldRefinerExpand, setShouldRefinerExpand] = React.useState(isExpandedOnInitialLoad);\n const [isRefinerExpanded, setIsRefinerExpanded] = React.useState(false);\n\n const onEntering = React.useCallback(() => {\n setIsRefinerExpanded(!isRefinerExpanded);\n }, [isRefinerExpanded]);\n\n const onToggleRefinerOptions = React.useCallback(() => {\n setShouldRefinerExpand(!shouldRefinerExpand);\n }, [shouldRefinerExpand]);\n\n const onClickRefinerItem = React.useCallback(\n (selectedRefinerItem: IRefinerItemData) => () => {\n onUpdateRefiners({\n refinerOptionsData: data,\n refinerItemData: selectedRefinerItem,\n isSelecting: !selectedRefinerItem.isChecked\n });\n },\n [onUpdateRefiners, data]\n );\n\n const onMinValueUpdate = React.useCallback(\n (selectedRefinerItem: IRefinerItemData) => (updatedMin: string) => {\n onUpdateRefiners({\n refinerOptionsData: data,\n refinerItemData: selectedRefinerItem,\n isSelecting: true,\n rangeStart: updatedMin\n });\n },\n [onUpdateRefiners, data]\n );\n\n const onMaxValueUpdate = React.useCallback(\n (selectedRefinerItem: IRefinerItemData) => (updatedMax: string) => {\n onUpdateRefiners({\n refinerOptionsData: data,\n refinerItemData: selectedRefinerItem,\n isSelecting: true,\n rangeEnd: updatedMax\n });\n },\n [onUpdateRefiners, data]\n );\n\n /**\n * Renders RefinerItem components.\n * @param refineItems - Contains the refiner items.\n * @returns - Refiner item components.\n */\n const renderRefinerItems = (refinerItems: IRefinerItemData[]) => {\n return refinerItems.map((refinerItem, index) => {\n const isSingleSelectValue = data.typeValue === RefinerOptionsType.SingleSelect;\n const selectedItem = data.selectedRefinerItems.find((selectedItem: IRefinerItemData) =>\n isMatchingRefinementCriterion(refinerItem, selectedItem)\n );\n\n refinerItem.isChecked = !!selectedItem;\n refinerItem.minValue = selectedItem?.minValue;\n refinerItem.maxValue = selectedItem?.maxValue;\n\n const refinerItemCheckProps = {\n context: context,\n id: moduleId,\n typeName: typeName,\n data: refinerItem,\n label: refinerItem.label ?? '',\n ariaLabel: refinerItem.label ?? '',\n isChecked: refinerItem.isChecked,\n isSingleSelect: isSingleSelectValue,\n isDisabled: isDisabled,\n telemetryContent: telemetryContent,\n onClick: onClickRefinerItem(refinerItem)\n } as IRefinerItemCheckProps;\n\n switch (refinerItem.itemType) {\n case RefinerItemType.DateRange:\n const refinerDataRangeProps = {\n context: context,\n id: moduleId,\n typeName: typeName,\n data: refinerItem,\n minInputLabel: refinerItem.minLabel ?? '',\n maxInputLabel: refinerItem.maxLabel ?? '',\n minInputAriaLabel: refinerItem.minLabel ?? '',\n maxInputAriaLabel: refinerItem.maxLabel ?? '',\n minRangeValue: refinerItem.minValue,\n maxRangeValue: refinerItem.maxValue,\n isDisabled: isDisabled,\n onBlurMinInput: onMinValueUpdate(refinerItem),\n onBlurMaxInput: onMaxValueUpdate(refinerItem)\n } as IRefinerItemDateRangeProps;\n\n return (\n <li className={listItemClassName} id={`${refinerItem.label}_${index}`} key={refinerItem.refinerItemId}>\n <RefinerItemCheckComponent {...refinerItemCheckProps} />\n {refinerItem.isChecked && <RefinerItemDateRangeComponent {...refinerDataRangeProps} />}\n </li>\n );\n default:\n return (\n <li className={listItemClassName} id={`${refinerItem.label}_${index}`} key={refinerItem.refinerItemId}>\n <RefinerItemCheckComponent {...refinerItemCheckProps} />\n </li>\n );\n }\n });\n };\n\n return (\n <div className={classnames(className, componentClassName, 'list-group', data.name ?? '')} key={data.name}>\n <Button\n className={shouldRefinerExpand ? expandedClassName : collapsedClassName}\n aria-label={data.name}\n aria-expanded={shouldRefinerExpand}\n onClick={onToggleRefinerOptions}\n >\n {data.name}\n </Button>\n <Collapse\n isOpen={shouldRefinerExpand}\n onEntering={onEntering}\n timeout={expandTimeout ?? DEFAULT_REFINER_OPTIONS_EXPAND_TIMEOUT}\n >\n <ul className={classnames(listClassName, data.name ?? '')} aria-label={data.name}>\n {renderRefinerItems(data.refinerItems)}\n </ul>\n </Collapse>\n </div>\n );\n};\n\n/**\n * RefinerOptions component.\n */\nexport const RefinerOptionsComponent: React.FunctionComponent<IRefinerOptionsProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error -- Required for this signature.\n IRefinerOptionsComponent\n>('Refiner-Options', {\n component: React.memo(RefinerOptionsFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport { Node } from '@msdyn365-commerce-modules/utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport * as React from 'react';\n\nimport classnames from 'classnames';\n\nimport { IRefinerHeaderProps, RefinerHeaderComponent } from './refiner-header.component';\nimport { RefinerChoiceSummaryComponent } from './refiner-choice-summary.component';\nimport { IRefinerFooterProps, RefinerFooterComponent } from './refiner-footer.component';\nimport {\n IRefinerModalProps,\n IRefinerModalToggleProps,\n RefinerModalComponent,\n RefinerModalToggleComponent\n} from './refiner-modal.component';\n\n/**\n * Class names used in component\n */\nconst componentClassName: string = 'msc-refiner';\nconst refinerContentWrapperClassName: string = `${componentClassName}__wrapper`;\nconst refinerOptionsWrapperClassName: string = `${componentClassName}__wrapper-internal`;\nconst modalToggleWrapperClassName: string = `${componentClassName}__wrapper-refiner-modal-toggle`;\nconst modalToggleMoreActionsWrapperClassName = `${modalToggleWrapperClassName}__wrapper-more-actions`;\nconst modalToggleExtraActionsWrapperClassName = `${modalToggleWrapperClassName}__wrapper-extra-actions`;\n\n/**\n * IRefinerComponent interface.\n */\ninterface IRefinerComponent extends IComponent<IRefinerProps> {}\n\n/**\n * IRefinerProps interface.\n */\nexport interface IRefinerProps extends IComponentProps<{}> {\n className?: string;\n refinerModalToggleProps?: IRefinerModalToggleProps;\n refinerModalProps?: IRefinerModalProps;\n refinerHeaderProps?: IRefinerHeaderProps;\n refinerFooterProps?: IRefinerFooterProps;\n refinerOptions?: React.ReactNode[];\n isMobileView?: boolean;\n isExpanded?: boolean;\n}\n\nfunction createComponentInMobileView(props: IRefinerProps): React.ReactNode {\n const refinerChoiceSummaryProps = props.refinerHeaderProps?.refinerChoiceSummaryProps;\n\n return (\n <>\n {refinerChoiceSummaryProps && <RefinerChoiceSummaryComponent {...refinerChoiceSummaryProps} />}\n {props.refinerModalToggleProps && (\n <div className={modalToggleWrapperClassName}>\n <RefinerModalToggleComponent {...props.refinerModalToggleProps} />\n <div className={modalToggleMoreActionsWrapperClassName}>\n {props.refinerHeaderProps?.extraActions && (\n <div className={modalToggleExtraActionsWrapperClassName}>{props.refinerHeaderProps.extraActions}</div>\n )}\n </div>\n </div>\n )}\n {props.refinerModalProps && <RefinerModalComponent {...props.refinerModalProps} />}\n </>\n );\n}\n\nfunction createComponentInDesktopView(props: IRefinerProps): React.ReactNode {\n const { refinerOptions, isExpanded } = props;\n\n return (\n <>\n {props.refinerHeaderProps && <RefinerHeaderComponent {...props.refinerHeaderProps} />}\n\n {refinerOptions && ArrayExtensions.hasElements(refinerOptions) && isExpanded && (\n <Node className={refinerContentWrapperClassName}>\n <Node className={refinerOptionsWrapperClassName}>\n {refinerOptions.map((item, index) => (\n <React.Fragment key={index}>{item}</React.Fragment>\n ))}\n </Node>\n\n {props.refinerFooterProps && refinerOptions && ArrayExtensions.hasElements(refinerOptions) && isExpanded && (\n <RefinerFooterComponent {...props.refinerFooterProps} />\n )}\n </Node>\n )}\n </>\n );\n}\n\n/**\n * Refiner component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst RefinerFunctionalComponent: React.FC<IRefinerProps> = (props: IRefinerProps) => {\n const renderMobile = props.isMobileView && props.refinerModalProps;\n\n return (\n <Node className={classnames(props.className, componentClassName)}>\n {renderMobile && createComponentInMobileView(props)}\n {!renderMobile && createComponentInDesktopView(props)}\n </Node>\n );\n};\n\n/**\n * Refiner component.\n */\nexport const RefinerComponent: React.FunctionComponent<IRefinerProps> = msdyn365Commerce.createComponent<IRefinerComponent>('Refiner', {\n component: React.memo(RefinerFunctionalComponent)\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport {\n Button,\n ITelemetryContent,\n TelemetryConstant,\n getPayloadObject,\n getTelemetryAttributes\n} from '@msdyn365-commerce-modules/utilities';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React from 'react';\n\nimport classnames from 'classnames';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-search-bar';\nconst filterOptionsClassName = `${componentClassName}__search-options`;\nconst filterOptionClassName = `${componentClassName}__search-option`;\nconst filterOptionSelectedClassName = `${componentClassName}__search-option-selected`;\nconst searchBarClassName = `${componentClassName}__search-text`;\nconst buttonClassName = `${componentClassName}__search-button`;\n\n/**\n * ISearchBarComponent interface.\n */\ninterface ISearchBarComponent extends IComponent<ISearchBarProps> {}\n\n/**\n * ISearchBarResources interface.\n */\nexport interface ISearchBarResources {\n searchOptionsAriaLabel?: string;\n searchBarPlaceholder?: string;\n searchBarAriaLabel?: string;\n searchButtonLabel?: string;\n searchButtonAriaLabel?: string;\n}\n\n/**\n * ISearchBarData interface.\n */\nexport interface ISearchBarData {\n options: ISearchBarOption[];\n}\n\n/**\n * ISearchBarOption interface.\n */\nexport interface ISearchBarOption {\n label: string;\n value: string;\n}\n\n/**\n * ISearchBarProps interface.\n */\nexport interface ISearchBarProps extends IComponentProps<ISearchBarData> {\n className?: string;\n resources?: ISearchBarResources;\n currentSearchOption?: ISearchBarOption;\n currentSearchText?: string;\n telemetryContent?: ITelemetryContent;\n clearSearchTextOnOptionChange?: boolean;\n onSelectOption?(newSearchOption?: ISearchBarOption): void;\n onChange?(searchOption?: ISearchBarOption, searchText?: string): void;\n onBlur?(searchOption?: ISearchBarOption, searchText?: string): void;\n onClick?(searchOption?: ISearchBarOption, searchText?: string): void;\n}\n\n/**\n * SearchBar component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst SearchBarFunctionalComponent: React.FC<ISearchBarProps> = (props: ISearchBarProps) => {\n const [searchOptionState, setSearchOptionState] = React.useState(props.currentSearchOption);\n const [searchTextState, setSearchTextState] = React.useState(props.currentSearchText);\n\n const onSelectOptionHandler = (event: React.ChangeEvent<HTMLSelectElement>) => {\n const value = event.currentTarget.value;\n const searchOption = props.data.options?.find((option: ISearchBarOption) => option.value === value);\n setSearchOptionState(searchOption);\n if (props.clearSearchTextOnOptionChange) {\n setSearchTextState('');\n }\n props.onSelectOption?.(searchOption);\n };\n\n const onChangeHandler = (event: React.FocusEvent<HTMLInputElement>): void => {\n const value = event.currentTarget.value;\n setSearchTextState(value);\n props.onChange?.(searchOptionState, value);\n };\n\n const onBlurHandler = (event: React.FocusEvent<HTMLInputElement>) => {\n const value = event.currentTarget.value;\n setSearchTextState(value);\n props.onBlur?.(searchOptionState, value);\n };\n\n const onClickHandler = () => {\n props.onClick?.(searchOptionState, searchTextState);\n };\n\n // define telemetry attributes\n const searchButtonAttributes = getTelemetryAttributes(\n props.telemetryContent!,\n getPayloadObject('click', props.telemetryContent!, TelemetryConstant.Search)\n );\n\n return (\n <div className={classnames(props.className, componentClassName)}>\n {ArrayExtensions.hasElements(props.data.options) && (\n <select\n className={filterOptionsClassName}\n title={props.resources?.searchOptionsAriaLabel}\n aria-label={props.resources?.searchOptionsAriaLabel}\n onChange={onSelectOptionHandler}\n >\n {props.data.options?.map((option: ISearchBarOption) => {\n return (\n <option\n key={option.value}\n value={option.value}\n aria-label={option.label}\n aria-selected={option.value === searchOptionState?.value}\n className={classnames(\n filterOptionClassName,\n option.value === searchOptionState?.value ? filterOptionSelectedClassName : ''\n )}\n >\n {option.label}\n </option>\n );\n })}\n </select>\n )}\n <input\n type='text'\n className={classnames(searchBarClassName, ArrayExtensions.hasElements(props.data.options) ? '' : 'full-width')}\n placeholder={props.resources?.searchBarPlaceholder}\n title={props.resources?.searchBarAriaLabel}\n aria-label={props.resources?.searchBarAriaLabel}\n value={searchTextState}\n onChange={onChangeHandler}\n onBlur={onBlurHandler}\n />\n <Button\n className={buttonClassName}\n aria-label={props.resources?.searchButtonAriaLabel ?? props.resources?.searchButtonLabel}\n title={props.resources?.searchButtonAriaLabel ?? props.resources?.searchButtonLabel}\n onClick={onClickHandler}\n {...searchButtonAttributes}\n >\n {props.resources?.searchButtonLabel}\n </Button>\n </div>\n );\n};\n\n/**\n * SearchBar component.\n */\nexport const SearchBarComponent: React.FunctionComponent<ISearchBarProps> = msdyn365Commerce.createComponent<ISearchBarComponent>(\n 'SearchBarComponent',\n { component: SearchBarFunctionalComponent }\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, IImageData } from '@msdyn365-commerce/core';\nimport * as React from 'react';\n\nexport enum SocialMedia {\n Facebook = 'facebook',\n Twitter = 'twitter',\n Pinterest = 'pinterest',\n Mail = 'mail',\n Linkedin = 'linkedin',\n Customization = 'customization'\n}\n\nexport interface ISocialMediaProps extends IComponentProps<{}> {\n src?: IImageData;\n postUrl: string;\n postTitle?: string;\n socialMedia: SocialMedia;\n socialShareURL?: string;\n socialMediaName?: string;\n}\n\nexport interface ISocialMediaComponent extends IComponent<ISocialMediaProps> {}\n\n/**\n *\n * SocialMedia component.\n * @extends {React.FC<ISocialMediaProps>}\n */\n\nexport const SocialMediaComponent: React.FC<ISocialMediaProps> = props => {\n const openWindowFunc = (event: React.MouseEvent<HTMLElement>) => {\n setShareLinks(props);\n };\n const src = props.src && props.src.src;\n return (\n <img\n onClick={openWindowFunc}\n src={src}\n alt={props.socialMediaName || props.socialMedia}\n title={props.socialMediaName || props.socialMedia}\n />\n );\n};\n\nconst setShareLinks = (props: React.PropsWithChildren<ISocialMediaProps>): void => {\n const pageUrl = encodeURIComponent(props.postUrl);\n const mediaImage = document.getElementsByName('twitter:image')[0].getAttribute('content');\n let url: string | undefined;\n switch (props.socialMedia) {\n case SocialMedia.Facebook:\n url = `https://www.facebook.com/sharer.php?u=${pageUrl}`;\n break;\n case SocialMedia.Twitter:\n url = `https://twitter.com/share?url=${pageUrl}${props.postTitle ? `&text=${props.postTitle}` : ''}`;\n break;\n case SocialMedia.Pinterest:\n url = `https://www.pinterest.com/pin/create/button/?url=${pageUrl}${mediaImage ? `&media=${mediaImage}` : ''}${\n props.postTitle ? `&description=${props.postTitle}` : ''\n }`;\n break;\n case SocialMedia.Mail:\n url = `mailto:?body=Check%20out%20this%20site:${pageUrl}${props.postTitle ? `&subject=${props.postTitle}` : ''}`;\n break;\n case SocialMedia.Linkedin:\n url = `https://www.linkedin.com/shareArticle?mini=true&url=${pageUrl}${props.postTitle ? `&title=${props.postTitle}` : ''}`;\n break;\n case SocialMedia.Customization:\n url = props.socialShareURL && `${props.socialShareURL}${pageUrl}`;\n break;\n default:\n }\n\n url && openWindow(url);\n};\n\nfunction openWindow(url: string): void {\n const left = (screen.width - 570) / 2;\n const top = (screen.height - 570) / 2;\n const params = `menubar=no,toolbar=no,status=no,width=570,height=570,top='${top}',left='${left}`;\n\n // Setting 'params' to an empty string will launch\n // content in a new tab or window rather than a pop-up.\n // params = \"\";\n window.open(url, 'NewWindow', params);\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport React, { ReactElement } from 'react';\n\nimport classnames from 'classnames';\n\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\n\n/**\n * Class names used in component.\n */\nconst componentClassName = 'msc-table';\nconst headerClassName = `${componentClassName}__header`;\nconst headerRowClassName = `${componentClassName}__header-row`;\nconst headerCellClassName = `${componentClassName}__header-cell`;\nconst rowClassName = `${componentClassName}__row`;\nconst rowCellClassName = `${componentClassName}__row-cell`;\n\n/**\n * Table cell content type.\n */\nexport enum TableCellContentType {\n Text = 'text',\n Number = 'number',\n Amount = 'amount',\n Date = 'date'\n}\n\n/**\n * ITableComponent interface.\n */\ninterface ITableComponent extends IComponent<ITableProps> {}\n\n/**\n * ITableHeaderComponent interface.\n */\ninterface ITableHeaderComponent extends IComponent<ITableHeaderProps> {}\n\n/**\n * ITableRowComponent interface.\n */\ninterface ITableRowComponent extends IComponent<ITableRowProps> {}\n\n/**\n * ITableProps interface.\n */\nexport interface ITableProps extends IComponentProps<{}> {\n className?: string;\n children?: React.ReactNode | React.ReactNode[];\n}\n\n/**\n * ITableHeaderProps interface.\n */\nexport interface ITableHeaderProps extends IComponentProps<{}> {\n className?: string;\n isVisible?: boolean;\n children?: ReactElement<ITableCellProps> | ReactElement<ITableCellProps>[];\n}\n\n/**\n * ITableRowProps interface.\n */\nexport interface ITableRowProps extends IComponentProps<{}> {\n className?: string;\n isVisible?: boolean;\n children?: ReactElement<ITableCellProps> | ReactElement<ITableCellProps>[];\n}\n\n/**\n * ITableCellProps interface.\n */\nexport interface ITableCellProps extends IComponentProps<{}> {\n className?: string;\n isVisible?: boolean;\n children?: React.ReactNode;\n contentType: TableCellContentType;\n}\n\n/**\n * TableHeader component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst TableHeaderFunctionalComponent: React.FC<ITableHeaderProps> = (props: ITableHeaderProps) => {\n const isVisible = props.isVisible ?? true;\n if (!isVisible) {\n return <></>;\n }\n\n let children = props.children ?? [];\n children = Array.isArray(children) ? children : [children];\n\n return (\n <thead className={classnames(props.className, headerClassName)}>\n <tr className={headerRowClassName}>\n {ArrayExtensions.hasElements(children) &&\n children.map((child, index) => {\n const childIsVisible = child.props.isVisible ?? true;\n return (\n childIsVisible && (\n <th key={index} className={classnames(child.props.className, headerCellClassName, child.props.contentType)}>\n {child.props.children}\n </th>\n )\n );\n })}\n </tr>\n </thead>\n );\n};\n\n/**\n * TableHeader component.\n */\nexport const TableHeaderComponent: React.FunctionComponent<ITableHeaderProps> = msdyn365Commerce.createComponent<ITableHeaderComponent>(\n 'TableHeaderComponent',\n { component: TableHeaderFunctionalComponent }\n);\n\n/**\n * TableRow component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst TableRowFunctionalComponent: React.FC<ITableRowProps> = (props: ITableRowProps) => {\n const isVisible = props.isVisible ?? true;\n if (!isVisible) {\n return <></>;\n }\n\n let children = props.children ?? [];\n children = Array.isArray(children) ? children : [children];\n\n return (\n <tr className={classnames(props.className, rowClassName)}>\n {ArrayExtensions.hasElements(children) &&\n children.map((child, index) => {\n const childIsVisible = child.props.isVisible ?? true;\n return (\n childIsVisible && (\n <td key={index} className={classnames(child.props.className, rowCellClassName, child.props.contentType)}>\n {child.props.children}\n </td>\n )\n );\n })}\n </tr>\n );\n};\n\n/**\n * TableRow component.\n */\nexport const TableRowComponent: React.FunctionComponent<ITableRowProps> = msdyn365Commerce.createComponent<ITableRowComponent>(\n 'TableRowComponent',\n { component: TableRowFunctionalComponent }\n);\n\n/**\n * TableCell component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst TableCellFunctionalComponent: React.FC<ITableCellProps> = (props: ITableCellProps) => {\n return <>{props.children}</>;\n};\n\n/**\n * TableCell component.\n */\nexport const TableCellComponent: React.FunctionComponent<ITableCellProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error -- Required for this signature.\n ITableCellComponent\n>('TableCellComponent', { component: TableCellFunctionalComponent });\n\n/**\n * Table component.\n * @param props - Configuration of the component.\n * @returns React node.\n */\nconst TableFunctionalComponent: React.FC<ITableProps> = (props: ITableProps) => {\n return <table className={classnames(props.className, componentClassName)}>{props.children}</table>;\n};\n\n/**\n * Table component.\n */\nexport const TableComponent: React.FunctionComponent<ITableProps> = msdyn365Commerce.createComponent<ITableComponent>('TableComponent', {\n component: TableFunctionalComponent\n});\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getUrlSync, IComponent, IComponentProps, msdyn365Commerce } from '@msdyn365-commerce/core';\nimport {\n Button,\n format,\n getPayloadObject,\n getTelemetryAttributes,\n ITelemetryContent,\n onTelemetryClick,\n UncontrolledTooltip\n} from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport * as React from 'react';\n\nexport interface IWishlistIconComponentProps extends IComponentProps<{}> {\n className?: string;\n wishlistTooltipText: string;\n showButtonTooltip?: boolean;\n telemetryContent?: ITelemetryContent;\n wishlistCountLabel?: string;\n wishlistCount?: number;\n isDispayWishlistCount?: boolean;\n}\n\nexport interface IWishlistIconComponent extends IComponent<IWishlistIconComponentProps> {}\n\nconst WishlistIconComponentActions = {};\n\n/**\n * WishlistIcon component.\n * @param props\n * @extends {React.PureComponent<IWishlistIconProps>}\n */\nconst WishlistIcon: React.FC<IWishlistIconComponentProps> = (props: IWishlistIconComponentProps) => {\n const wishlistIconRef: React.RefObject<HTMLButtonElement> = React.createRef();\n const text = props.wishlistTooltipText;\n const showButtonIconTooltip = props.showButtonTooltip;\n const wishlistUrl = getUrlSync('wishlist', props.context.actionContext);\n const signInUrl = `${props.context.request.user.signInUrl}?ru=${wishlistUrl}`;\n const url = props.context.request.user.isAuthenticated ? wishlistUrl : signInUrl;\n const showTooltip = showButtonIconTooltip !== undefined ? showButtonIconTooltip : true;\n const shouldShowCount = props.isDispayWishlistCount !== undefined ? props.isDispayWishlistCount : false;\n const wishlistCountlbl = props.wishlistCountLabel !== undefined ? props.wishlistCountLabel : '';\n const wishlistItemCount = props.wishlistCount !== undefined ? props.wishlistCount : '';\n const countLabel = format(wishlistCountlbl, wishlistItemCount);\n\n // Construct telemetry attribute to render\n const payLoad = getPayloadObject('click', props.telemetryContent!, text, '');\n const attributes = getTelemetryAttributes(props.telemetryContent!, payLoad);\n\n return (\n <>\n <Button\n className={classname('msc-wishlist-icon', props.className)}\n href={url}\n aria-label={text}\n innerRef={wishlistIconRef}\n {...attributes}\n onClick={onTelemetryClick(props.telemetryContent!, payLoad, text)}\n >\n {shouldShowCount && <div className='msc-wishlist-icon__count'>{countLabel}</div>}\n <span className='msc-wishlist-icon__text'>{text}</span>\n </Button>\n {showTooltip && (\n <UncontrolledTooltip trigger='hover focus' target={wishlistIconRef}>\n {text}\n </UncontrolledTooltip>\n )}\n </>\n );\n};\n\nexport const WishListIconComponent: React.FunctionComponent<IWishlistIconComponentProps> = msdyn365Commerce.createComponent<\n // @ts-expect-error\n IWishlistIconComponent\n>('WishListIcon', { component: WishlistIcon, ...WishlistIconComponentActions });\n","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n","'use strict';\nvar call = require('../internals/function-call');\nvar uncurryThis = require('../internals/function-uncurry-this');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar speciesConstructor = require('../internals/species-constructor');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar getMethod = require('../internals/get-method');\nvar regExpExec = require('../internals/regexp-exec-abstract');\nvar stickyHelpers = require('../internals/regexp-sticky-helpers');\nvar fails = require('../internals/fails');\n\nvar UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;\nvar MAX_UINT32 = 0xFFFFFFFF;\nvar min = Math.min;\nvar push = uncurryThis([].push);\nvar stringSlice = uncurryThis(''.slice);\n\n// Chrome 51 has a buggy \"split\" implementation when RegExp#exec !== nativeExec\n// Weex JS has frozen built-in prototypes, so use try / catch wrapper\nvar SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n var re = /(?:)/;\n var originalExec = re.exec;\n re.exec = function () { return originalExec.apply(this, arguments); };\n var result = 'ab'.split(re);\n return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';\n});\n\nvar BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||\n // eslint-disable-next-line regexp/no-empty-group -- required for testing\n 'test'.split(/(?:)/, -1).length !== 4 ||\n 'ab'.split(/(?:ab)*/).length !== 2 ||\n '.'.split(/(.?)(.?)/).length !== 4 ||\n // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing\n '.'.split(/()()/).length > 1 ||\n ''.split(/.?/).length;\n\n// @@split logic\nfixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {\n var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);\n } : nativeSplit;\n\n return [\n // `String.prototype.split` method\n // https://tc39.es/ecma262/#sec-string.prototype.split\n function split(separator, limit) {\n var O = requireObjectCoercible(this);\n var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);\n return splitter\n ? call(splitter, separator, O, limit)\n : call(internalSplit, toString(O), separator, limit);\n },\n // `RegExp.prototype[@@split]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@split\n //\n // NOTE: This cannot be properly polyfilled in engines that don't support\n // the 'y' flag.\n function (string, limit) {\n var rx = anObject(this);\n var S = toString(string);\n\n if (!BUGGY) {\n var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);\n if (res.done) return res.value;\n }\n\n var C = speciesConstructor(rx, RegExp);\n var unicodeMatching = rx.unicode;\n var flags = (rx.ignoreCase ? 'i' : '') +\n (rx.multiline ? 'm' : '') +\n (rx.unicode ? 'u' : '') +\n (UNSUPPORTED_Y ? 'g' : 'y');\n // ^(? + rx + ) is needed, in combination with some S slicing, to\n // simulate the 'y' flag.\n var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);\n var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;\n if (lim === 0) return [];\n if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];\n var p = 0;\n var q = 0;\n var A = [];\n while (q < S.length) {\n splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;\n var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);\n var e;\n if (\n z === null ||\n (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p\n ) {\n q = advanceStringIndex(S, q, unicodeMatching);\n } else {\n push(A, stringSlice(S, p, q));\n if (A.length === lim) return A;\n for (var i = 1; i <= z.length - 1; i++) {\n push(A, z[i]);\n if (A.length === lim) return A;\n }\n q = p = e;\n }\n }\n push(A, stringSlice(S, p));\n return A;\n }\n ];\n}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);\n"],"names":["Player","React","constructor","props","super","controlPanelTimer","player","audio","playerContainer","videoControl","ClosedCaptions","ageGateContainer","videoUrl","posterFrameUrl","seekFrom","closedCaptionHelper","closedCaptionMenu","optionsMenu","selectedClosedCaptionsLocale","isPlayerManuallyPaused","isPlayerLoaded","_renderClosedCaptions","ref","this","className","VideoPlayerNames","videoplayerContainer","showClosedCaptions","state","currentTime","playPosition","ccLanguage","closedCaptionLanguage","ccURL","closedCaptionsURL","errorCallback","playerHelper","onErrorCallback","isVideoControlVisible","isControlPanelVisible","doControlsHaveFocus","currentClosedCaptionsSettings","tempClosedCaptionsSettings","onClosedCaptionClick","_onTriggerClicked","_renderPlayPauseTrigger","playAriaLabel","maskLevelStyle","playerData","options","autoplay","shouldAutoPlay","playPauseTrigger","isPlayPauseTrigger","controls","isControlsEnabled","shouldDisableAutoPlayOnMobile","MsDyn365","isBrowser","isTriggerEnabled","isAgegateEnabled","PlayPauseTrigger","style","onChange","toggled","playing","mouseHovered","pauseAriaLabel","localizationHelper","getLocalizedValue","onFocus","_onTriggerFocus","onBlur","_onTriggerBlur","telemetryContent","_renderVideoControls","VideoControls","onPlayClick","optionMenu","videoSeekSteps","PlayerConstants","defaultVideoSliderSteps","volumeSeekSteps","defaultVolumeSliderSteps","isMuted","onMuteClick","_setMuted","onVolumeChange","_onVolumeChange","onProgressChange","_onProgressChange","currentClosedCaptionLanguage","currentVolume","isInFullScreen","toggleFullScreen","_toggleFullScreen","handleControlsKeyDownHandler","_handleControlsKeyDownEvent","_onVideoControlsFocus","_onVideoControlsBlur","onMenuItemClick","_onPlayerMenuItemClick","onMenuItemFocus","_onPlayerMenuItemFocus","onMenuItemBlur","_onPlayerMenuItemBlur","currentAudioTrack","currentAudioTrackURL","currentClosedCaptionsSetting","isMobileDevice","resources","muteAriaLabel","unMuteAriaLabel","fullScreenAriaLabel","exitFullScreenAriaLabel","seekBarLabel","videoTimeDurationLabel","closedCaptionLabel","optionButtonLabel","sliderThumbLabel","volumeThumbLabel","_renderAgeGate","AgeGate","onSubmitClick","_validateAgeSubmitHandler","minmumAge","playerMetaData","minimumAge","isAutoPlay","ageGate","isAgeGateEnabled","mute","lazyLoad","isLazyLoaded","_isMobile","_shouldAutoPlay","defaultVolume","previousVolume","showSpinner","showErrorMessage","screenReaderText","mounted","preset","closedCaptionsSettingDefaults","text_font","text_color","text_opacity","text_size","text_edge_style","text_background_color","text_background_opacity","window_color","window_opacity","videoErrorMessage","title","message","startTime","endTime","bufferedDuration","undefined","playerState","bind","_onMouseEvent","_onPlay","_onPause","_triggerEvents","_triggerAudioEvents","_onFullScreenChanged","_showControlBar","_onFullscreenError","_onPlayerKeyDown","_onContextMenuClicked","LocalizationHelper","playerResources","PlayerHelper","playerId","isEmptyOrUndefined","getMetadata","getPosterFrameUrl","payLoad","getPayloadObject","getVideoFileToPlay","url","doc","document","fullscreenEnabled","mozFullScreenEnabled","webkitFullscreenEnabled","webkitSupportsFullscreen","msFullscreenEnabled","fullscreenElement","mozFullScreenElement","webkitFullscreenElement","msFullscreenElement","shouldComponentUpdate","nextProps","nextState","render","loop","isLoop","backgroundColor","_getMaskLevelStyle","isEditor","updatePlayerProps","_loadPlayer","loadMetaData","LocalizationConstants","playVideoAriaLabel","role","onKeyDown","onMouseEnter","onMouseLeave","preload","src","muted","autoPlay","onPlay","onPause","onClick","onContextMenu","poster","playsInline","Waiting","play","current","catch","_onVideoError","_onAudioError","pause","componentDidMount","_onVideoLoadedData","addEventListener","componentWillUnmount","mediaEvent","MediaEvents","removeEventListener","volume","load","ClosedCaptionHelper","getClosedCaptionMenu","getOptionMenu","ccFiles","length","autoCaptionsLang","autoCaptions","autoCaptionsLocale","ccFile","locale","includes","isNullOrWhiteSpace","setState","getClosedCaptionURLFromLocale","getCalculatedAge","_displayErrorMessage","notification","data","indexOf","split","videoClosedCaptionsConstant","presetKey","showSampleCaptions","_setCCSettings","category","MenuCategories","ClosedCaptionSettings","id","ClosedCaption","_setCC","AudioTracks","_setAudioTracks","ccLanguageId","selectedOption","removeIdPrefix","ccType","ClosedCaptionTypes","TTML","updatePreferences","applySettings","resetCaptions","updateCaptions","dataSplit","settingKey","optionKey","currentSetting","getUpdatedClosedCaptionSetting","JSON","parse","lang","paused","event","type","toLowerCase","_updateState","seeking","currentPlayer","_onTimeUpdate","_stop","setTimeout","error","_getError","errorMessage","errorCode","VideoErrorCodes","MediaErrorAborted","MediaErrorNetwork","MediaErrorDecode","MediaErrorSourceNotSupported","_stopMedia","msgToDisplay","contentErrorCode","code","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MediaErrorUnknown","e","keycode","keyCode","KeyCodes","Home","stopPropagation","preventDefault","End","ArrowLeft","ArrowRight","jumpToTime","Math","min","max","ArrowUp","ArrowDown","showVolumeControl","call","round","firstThumbValue","newVolume","_updateScreenReaderElement","onTelemetryClick","Tab","_showControlsBasedOnState","autoHide","arguments","window","clearTimeout","_hideControlBar","defaultControlPanelTimeout","_onFullscreenExit","_onFullscreenEnter","_exitFullScreen","_enterFullScreen","_isNativeFullscreenEnabled","elementInFullScreen","_getElementInFullScreen","requestFullscreen","msRequestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","webkitEnterFullScreen","cancelFullScreen","msExitFullscreen","mozCancelFullScreen","webkitCancelFullScreen","position","_getPlayPosition","_getBufferedDuration","buffered","end","duration","time","abs","defaultPositionUpdateThreshold","setFocusOnPause","setFocusOnPlay","playFullScreen","isSafari","_seek","result","maskLevel","defaultMaskLevel","format","Number","newState","_showSpinnerBasedOnState","_hideSpinner","_showSpinner","text","userAgent","navigator","isIphone","match","isSilk","isWindowsPhone","isAndroid","defaultProps","hidePosterFrame","metaData","playerName","videoId","description","posterframeUrl","shareUrl","videoFiles","externalPlayerUrl","externalSourceId","videoBinaryReferences","closeAriaLabel","pausedAriaLabel","playingAriaLabel","ActionToggle","_divRef","_focusElement","_onClick","getSnapshotBeforeUpdate","_this$_divRef$current","contains","activeElement","_this$props","children","_objectWithoutProperties","_excluded","classes","count","Object","assign","map","child","index","hidden","actionToggle","focusTarget","focus","ageGateDiv","day","dayValue","month","monthValue","year","yearValue","today","Date","age","getFullYear","birthdayMonthHasNotHappenedYet","getMonth","birthdayDayHasNotHappenedYet","getDate","renderSelectMonth","allMonth","push","monthList","key","value","toFixed","_filterDateMonthYear","name","renderSelectDay","allDay","dayList","renderSelectYear","thisYear","allYear","yearList","enabled","regxForAgeGateInputValidation","test","disabled","target","closedCaptionsSettingsMap","option","closedCaptionsPresetMap","preset1","preset2","preset3","preset4","preset5","closedCaptionsSettingsOptions","font","pre","casual","cursive","monospacedsansserif","monospacedserif","proportionalsansserif","proportionalserif","smallcapitals","percent","0","50","75","100","small","default","large","extralarge","maximum","color","white","black","blue","cyan","green","grey","magenta","red","yellow","none","depressed","dropshadow","raised","uniform","xmlNS","TtmlSettings","settingsOverrides","ttmlNamespace","ttmlStyleNamespace","ttmlParameterNamespace","ttmlMetaNamespace","idPrefix","mediaFrameRate","mediaFrameRateMultiplier","mediaSubFrameRate","mediaTickRate","supportedTimeBase","rootContainerRegionDimensions","relatedMediaObjectRegion","cellResolution","rows","columns","defaultRegionStyle","direction","display","displayAlign","extent","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","opacity","origin","overflow","padding","showBackground","textAlign","textDecoration","textOutline","unicodeBidi","visibility","wrapOption","writingMode","fontMap","monospaceSerif","proportionalSerif","monospaceSansSerif","proportionalSansSerif","smallCaps","monospace","sansSerif","serif","extend","TtmlContext","translateToHtml","element","applicableStyleSet","preserveSpace","translation","innerNode","_getTagNameEquivalent","htmlName","htmlClass","TtmlParser","getAttributeNS","settings","agent","_defaultStyle","ownerDocument","createElement","addClass","trim","setAttribute","appendChild","css","_translateStyle","outerNode","ttmlTextDecoration","parts","mappedColor","startsWith","rgbaRegEx","exec","alpha","parseInt","substr","TtmlNamedColorMap","transparent","setOwnerDocument","updateRelatedMediaObjectRegion","dimensions","width","height","hasEvents","events","resetCurrentEvents","currentEvents","updateCurrentEvents","timeEvents","_getTemporallyActiveEvents","currentEventsLength","currentEventsTime","getCues","cues","root","regions","layout","getElementsByTagNameNS","region","regionId","anonymousId","getAttribute","_translate","_isInRegion","pruneResult","_prune","inheritableStyleSet","cueBody","prunedElement","hasPreservedContent","getText","showAlways","removeAttribute","rcr","rootContainerRegion","cue","filter","_isTemporallyActive","inheritedStyleSet","translator","computedStyleSet","tag","_getComputedStyleSet","_getApplicableStyleSet","_getInheritableStyleSet","tagName","_applyStyle","ignoreAncestors","nodeListToArray","childNodes","nodeType","Node","COMMENT_NODE","TEXT_NODE","createTextNode","childPreserveSpace","spaceAttr","pruneRecord","ancestor","parentNode","ELEMENT_NODE","body","styleSetCache","sets","set","applyInlineStyles","fontSizes","_appendSpanFontSizes","_isStyleApplicable","hasOwnProperty","elemRegion","_getRegionId","node","getElementsByTagName","namespaceURI","getLocalTagName","nameSpace","mappedValue","_ttmlToCssColor","coords","_ttmlToCssUnits","toString","size","_ttmlToCssFontSize","values","parseFloat","isNaN","contextRect","getDimensions","first","second","third","forth","_ttmlToCssTextDecoration","defaultColor","_ttmlToCssTextOutline","ttmlUnits","cssUnits","unit","charAt","container","containerSize","scaleFactor","isRegion","floor","textShadow","thickness","blur","firstChar","lengthRegEx","units","x","y","silver","gray","maroon","purple","fuchsia","lime","olive","navy","teal","aqua","TtmlTimeParser","_mediaFrameRate","_mediaTickRate","ttmlTime","absoluteTime","absoluteTimeRegex","hours","minutes","seconds","subseconds","_getTimeUnitMultiplier","relativeTime","relativeTimeRegex","timeUnit","localName","baseName","namespace","attribute","attributes","lookupNamespaceURI","prefix","ttmlDocument","_parseXml","ttmlContext","_verifyRoot","_getFirstElementByTagNameNS","_parseTtAttrs","head","_ensureRegions","timeBase","_processAnonymousSpans","timeParser","_applyTiming","start","mediaStart","mediaEnd","_applyStyling","sort","event1","event2","styleSet","nodeValue","xmlString","xml","DOMParser","parseFromString","domParser","ActiveXObject","async","loadXML","candidate","documentElement","cellRes","cellGrid","createElementNS","extents","setAttributeNS","anonymousRegion","_isTagNS","textNodeGroups","prevNodeType","group","anonSpan","replaceChild","bound","isParallelContext","beginAttribute","durationAttribute","endAttribute","minEnd","styling","styles","querySelectorAll","_applyStylesheet","empty","styleAttribute","ids","styleId","context","matches","userPreferences","closedCaptionDiv","lastPlayPosition","clicked","closedCaptionDivStyle","bottom","transition","_setCcLanguage","shouldRender","componentDidUpdate","prevProps","mockCaptions","_onClosedCaptionsLoaded","output","tick","removeInnerHtml","_applyUserPreferencesOverrides","outerHTML","innerHTML","prefs","currentSettings","optionValue","_getOptionValue","_getPrefsCss","_loadClosedCaptions","href","PlayerUtility","ajax","errorType","errorDesc","selectElements","property","winElement","selectFirstElement","setting","prefsCss","pref","propVal","pVal","colorValue","opacityValue","_formatAsRgba","cssColor","colorStart","fullColorString","colorLenght","defaultPlayGlyphIcon","defaultPauseGlyphIcon","defaultMuteGlyphIcon","defaultUnMuteGlyphIcon","defaultFullScreenGlyphIcon","defaultExitFullScreenGlyphIcon","closedCaptionGlyphClassName","thumbnailFullWidth","thumbnailFullHeight","ccLangPrefKey","mutePrefKey","volumePrefKey","mediaType","PlaybackSpeed","Quality","Share","Download","Options","MediaTypes","MediaQuality","DownloadableMediaTypes","MobileVideoQuality","ccCultureLocStrings","ccLanguageCodes","PlayerLocKeys","optionAriaLabel","audio_tracks","descriptive_audio","closecaption_off","audio_tracks_default","cc_customize","cc_text_font","cc_text_color","cc_color_black","cc_color_blue","cc_color_cyan","cc_color_green","cc_color_grey","cc_color_magenta","cc_color_red","cc_color_white","cc_color_yellow","cc_font_name_casual","cc_font_name_cursive","cc_font_name_monospacedsansserif","cc_font_name_monospacedserif","cc_font_name_proportionalserif","cc_font_name_proportionalsansserif","cc_font_name_smallcapitals","cc_text_size","cc_text_size_default","cc_text_size_extralarge","cc_text_size_large","cc_text_size_maximum","cc_text_size_small","cc_appearance","cc_preset1","cc_preset2","cc_preset3","cc_preset4","cc_preset5","cc_presettings","cc_text_background_color","cc_text_background_opacity","cc_text_opacity","cc_percent_0","cc_percent_100","cc_percent_25","cc_percent_50","cc_percent_75","cc_text_edge_color","cc_text_edge_style","cc_text_edge_style_depressed","cc_text_edge_style_dropshadow","cc_text_edge_style_none","cc_text_edge_style_raised","cc_text_edge_style_uniform","cc_window_color","cc_window_opacity","cc_reset","getLanguageCodeFromLocale","getLanguageNameFromLocale","checkClosedCaptionsFiles","ccMenuItems","ccMenuItem","addIdPrefix","label","language","selected","selectable","persistOnClick","ariaLabel","subMenu","_getClosedCaptionsSettingsMenu","unshift","items","presetValue","settingsMenuItems","keys","optionMenuItem","_getCCMenuItemId","isBackButton","_getCCSettingsMenuId","settingsMenu","presetItems","presetSetting","ariaLabelValue","hasMouseHoverEvents","settingId","optionId","console","log","playerProps","_isMobileDevice","_mapVideoFiles","_setCCFiles","_clearVideoPlayerMetaData","audioTracks","_getAudioTracksMenu","optionMenuItems","_removeProtocolFromUrl","videoFile","MP4","quality","LO","videoMetaData","mpVideoFiles","_getVideoFileByType","mobileVideoQuality","mobileVideoFile","_getVideoFileByQuality","toUpperCase","hdVideoFile","HDX","hqVideoFile","HQ","sdVideoFile","SD","loVideoFile","childId","substring","audioTracksMenuItems","descriptiveAudioTrackCount","track","isDescriptiveAudio","trackIndex","audioTrack","languageCode","descriptiveAudioLabel","audioMenuItem","binaryRef","extension","$type","sourceHref","audioType","bitrate","alias","clientHref","videoBinaryFiles","mediaTypeAndQuality","_getMediaTypeAndQuality","urlRef","formatCode","mType","mQuality","HD","SMOOTH","HLS","DASH","replace","file","MenuItem","menuItem","_onFocus","_onMouseOver","_onMouseOut","_onKeyDown","_onKeyUp","_onBlur","_objectDestructuringEmpty","hasChildren","itemCount","itemIndex","onMouseOver","onMouseOut","onKeyUp","image","alt","imageAlt","hasFocus","Menu","handleDocumentClick","forEach","getMenuWidth","offsetWidth","playerMenu","menuItems","glyph","onDocumentClick","playRef","pauseRef","contentAction","etext","getTelemetryAttributes","UncontrolledTooltip","trigger","formatSpecifier","_len","parameters","Array","_key","ignoreCase","toLocaleLowerCase","textContent","cssClass","classList","hasClass","add","nodeList","elements","n","selector","selectElementsT","currentContext","getElementsByClassName","slice","querySelector","getComputedStyle","parentElement","elementsSelected","done","failed","ajaxRequest","XDomainRequest","responseText","_removeFromPendingAjaxRequests","pendingAjaxRequests","XMLHttpRequest","onreadystatechange","readyState","status","ontimeout","open","send","obj","i","splice","recursive","paramIndex","source","isSourceArray","isArray","isTargetArray","isSourceObject","isTargetObject","arrayIndex","entries","containerElement","clientWidth","clientHeight","vendor","ButtonMenuTypes","selectedMenuItems","volumeButtonDiv","playButtonRef","pauseButtonRef","closedCaptionRef","optionButtonRef","fullscreenButtonRef","exitFullScreenButtonRef","videoControlDiv","closedCaptionButtonDiv","optionButtonDiv","menuRef","muteButtonRef","unMuteButtonRef","_fullScreenReference","autohide","offsetPosition","_getOffsetPosition","volumeAutoHideTimer","showVolumeSlider","volumeSliderLeftPosition","offsetLeft","volumeSliderTopPosition","offsetTop","firstChild","_hideVolumeControl","volumeAutoHideTimeout","_onDocumentClick","currentMenu","showMenu","_renderClosedCaptionButton","videoControlsClassName","_onClosedCaptionClick","_renderOptionButton","_onOptionsButtonClick","_renderFullScreenButton","_renderVolumeButton","volumeButtonProps","_renderVideoSlider","videoProps","inForm","fillTrackValue","step","orientation","showProgressBar","showLabels","showTooltip","shouldSliderAdjustToRTL","handleTooltipText","_handleProgressToolTipText","sliderThumbs","ariaValueText","Slider","_renderVolumeSlider","volumeSliderProps","tooltip","_toElapsedTimeString","focusedMenuItemIndex","_onMenuItemClick","_reevaluateWidth","_onMenuBlur","_onMenuFocus","_onMenuKeyDown","_onMenuKeyUp","menuLeftPosition","toolTipClass","_objectSpread","previousProps","_updateSelectedMenu","volumeDivStyle","top","left","menuDivStyle","setFocusOnMenuButton","_this$_fullScreenRefe","_isIPhone","rowDiv","controlBarButtonsWidth","sliderWidth","videoControlWidth","viewportMax","innerWidth","_applyTooltipClassOnWidthChange","button","_onMenuKeyPressed","Space","currentMenuItem","_resetFocusForCurrentMenu","Enter","forceUpdate","PageUp","PageDown","Escape","shiftKey","currentTarget","_getSelectedMenuFromList","pop","stringify","item","refDiv","buttonWidth","elementwidth","negative","remainder","elapsedTime","viewportMin","setShowPreviousActions","componentClassName","toggleMenuButtonClassName","ActionMenuComponent","msdyn365Commerce","createComponent","component","_f","__read","showActions","setShowActions","_a","_b","isVisible","classnames","Button","__assign","isDisabled","_c","_e","_d","isShowActions","shouldShowActions","toggle","telemetryAttributes","AddToCartBehavior","getTotalItems","addedInput","totalCount","addedInput_1","__values","addedInput_1_1","next","ItemsAddedErrorComponent","StringExtensions","isNullOrEmpty","ItemsAddedToCartDialogComponent","dialogProps","dialogStrings","isModalOpen","imageSettings","products","itemsString","itemsAddedToCartFormatText","itemsAddedToCartHeaderText","linesString","linesAddedToCartFormatText","fullProducts","ProductDetails","product","Modal","isOpen","onClose","ModalHeader","ModalBody","OrderTemplateProductsPreviewComponent","itemsAddedValidationErrorMessage","ModalFooter","viewCartButtonText","getUrlSync","actionContext","closeButtonLabel","ItemSuccessfullyAddedToCartNotificationComponent","_super","__extends","prototype","TelemetryConstant","ContinueShopping","shouldDisplayUnitOfMeasure","app","config","unitOfMeasureDisplayType","ViewBagAndCheckout","viewBagAttribute","fallbackImageUrl","getFallbackImageUrl","ItemId","requestContext","apiSettings","OmniChannelMedia","cropFocalRegion","reducedDimensions","Dimensions","reduce","str","productDimension","DimensionValue","Value","contentClassName","NotificationContent","footerClassName","NotificationFooter","ClosableNotificationWrapper","DismissibleNotificationWrapper","NotificationInstance","NotificationHeader","NotificationTitle","NotificationCloseButton","Image","PrimaryImageUrl","fallBackSrc","altText","Name","gridSettings","loadFailureBehavior","price","PriceComponent","typeName","freePriceText","originalPriceText","currentPriceText","DefaultUnitOfMeasure","isNullOrWhitespace","addedQuantityText","productQuantity","navigationUrl","goToCartText","BaseNotificationComponent","ItemSuccessfullyAddedToCartNotification","componentId","_this","headerItemOneText","headerItemFormatText","headerMessageText","isClosed","closeNotificationLabel","setValue","NotificationEvents","Close","Event","close","getValue","__decorate","withNotificationComponent","DismissibleNotification","MultiItemsSuccessfullyAddedToCartNotificationComponent","NotificationDescription","MultiItemsSuccessfullyAddedToCartNotification","descriptionLines","propagateResult","onAdd","propagateError","onError","getAddToCartInputFromProps","__awaiter","orderDetailsProducts","ObjectExtensions","isNullOrUndefined","simpleProduct","emailDeliveryModeCode","channel","EmailDeliveryModeCode","input","deliveryOption","salesLine","DeliveryMode","Quantity","catalogId","CatalogId","isAddEmailDeliveryItemToCart","ArrayExtensions","hasElements","apiSettings_1","getCatalogId","validateCatalogId","searchCriteriaInput","Context","ChannelId","channelId","IncludeAttributes","Ids","productId","ProductsDataActions","callerContext","searchResult","sent","productSearchResultsWithImages_1","productSearchResult","newProductSearchResult","newImageUrl","generateProductImageUrl","productData","find","RecordId","ProductTypeValue","ProductType","Variant","AdjustedPrice","Price","BasePrice","quantity","addOneItemToCart","setDisabled","openModal","addToCartBehavior","addToCartInput","getCartState","addProductToCart","availableQuantity","productAvailability","AvailableQuantity","additionalProperties","validateQuantity","isOrderQuantityLimitsFeatureEnabled","enableStockCheck","isPriceKeyedIn","customPrice","customPriceAmount","shouldSkipSiteSettings","addToCartResult","showModal","showNotification","NotificationsManager","instance","addNotification","isNavigationToCartPageDisabled","goToCart","location","ErrorNotification","errorDetails","LocalizedMessage","failureReason","cartActionResult","handleAddItemsToCartSuccess","setItemsAddedToCartDialogOpen","setErrorMessage","cartState","CartsDataActions","bypassCache","cart","Id","Version","validationResult","_g","errorCount","ValidationFailuresByCartLines","errorText","oneErrorText","multiErrorsText","validationErrorMessage","itemsAddedResource","headerLinesFormatText","addItemsToCart","addProductsToCart","buyAgainNotificationTitle","buyAgainNotificationCloseAriaLabel","AddToCartComponentActions","_event","cartError","addToCartError","hasOrderDetailsProducts","hasProducts","hasMultipleProducts","AddToCartFunctionalComponent","_w","useState","_x","modalOpen","setModalOpen","_y","isItemsAddedToCartDialogOpen","_z","_0","setAddToCartInput","closeItemsAddedToCartDialog","priceComponent","popupProps","request","_h","_k","_j","_m","_l","_p","_o","_r","_q","_t","_s","renderModalPopup","Popup","getLinkText","payload","TelemetryEvent","AddToCart","buttonClassName","retrievedInput","_u","addToCartArialLabel","_v","isIntermediateState","shouldShowOutOfStock","outOfStockText","addToCartText","isCustomPriceSelected","maximumKeyInPrice","minimumKeyInPrice","defaultMaximumKeyInPrice","defaultMinimumKeyInPrice","missingDimensions","dimension","stockLeft","includeCurrentQuantity","isLoading","isProductQuantityLoading","isUpdatingDimension","isLoadingDeliveryOptions","isUpdatingDeliveryOptions","isAddServiceItemToCart","hasAvailableProducts","includedQuantityNumber","AddToCartComponent","OrderDetailsProduct","productUrl","isSelected","isProductAvailable","observable","AddToWishlistComponentActions","user","waiting","isAuthenticated","signInUrl","setWaiting","getSelectedProduct","doesProductExistInWishlist","removeFromWishlist","addToWishlist","onDismiss","setContent","showAlert","wishlists","CommerceListLines","CommerceListLines_1","CommerceListLines_1_1","ProductId","propagateSuccess","onSuccess","cartline","canAddMasterProduct","AsyncResult","resolve","wishlistName","nameOfWishlist","getCustomerAccount","customer","AccountNumber","listData","CustomerId","CommerceListTypeValue","createCommerceListAsync","commerceList","callAddWishlistLine","telemetry","warning","error_1","debug","wishlistId","addLinesAsync","buildWishlistLine","createdCommerceList","update","createGetByCustomerInput","setCanRemove","wishlistTextMessage","addToWishlistMessage","error_2","addItemToWishlistError","removedFromWishlistMessage","removeItemFromWishlistError","wishlistLine","line","removeLinesAsync","error_3","customerInput","GetCustomerInput","getCustomer","AddToWishlistComponent","canRemove","content","removeFromWishlistButtonText","addToWishlistButtonText","ariaRole","showStatusMessage","showRemoveButton","showButtonText","showButtonTooltip","tooltipPosition","onClickHandler","addToWishlistRef","removeFromWishlistRef","showMessage","tooltipPos","linkAriaRole","placement","Alert","UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","Transition","_React$Component","initialStatus","appear","isMounting","enter","appearStatus","in","unmountOnExit","mountOnEnter","nextCallback","getDerivedStateFromProps","_ref","prevState","_proto","updateStatus","nextStatus","cancelNextCallback","getTimeouts","exit","timeout","mounting","nodeRef","scrollTop","forceReflow","performEnter","performExit","_this2","appearing","_ref2","maybeNode","maybeAppearing","timeouts","enterTimeout","safeSetState","onEntered","onEnter","onEntering","onTransitionEnd","_this3","onExit","onExiting","onExited","cancel","callback","setNextCallback","_this4","active","handler","doesNotHaveTimeoutOrListener","addEndListener","_ref3","maybeNextCallback","childProps","TransitionGroupContext","Provider","only","noop","contextType","propTypes","CarouselItem","isAppearing","startAnimation","offsetHeight","dispatchEvent","CustomEvent","slide","cssModule","collapseIn","otherProps","__rest","timeoutOrDefault","TransitionTimeouts","Carousel","Tag","transitionProps","CarouselContext","Consumer","isActive","directionClassName","orderClassName","itemClasses","mapToCssModules","classNames","directionTextPrev","directionTextNext","defaultThrottleThreshold","setInterval","clearInterval","interval","cycleInterval","hoverStart","mouseEnter","hoverEnd","mouseLeave","handleKeyPress","keyboard","previous","renderItems","carouselItems","handleOnExiting","handleOnExited","activeIndex","slides","slotContent","isIn","_handleKeyPressPrev","_handleKeyPressNext","throttleThreshold","threshold","_handleTouchStart","_handleTouchEnd","scrollThreshold","touchScrollThreshold","indicatorClicked","_onClickPrev","_onClickNext","linkRefPrev","linkRefNext","nextHandleInputThrottledEvent","debounce","previousHandleInputThrottledEvent","ride","componentWillReceiveProps","hasCurrentKeys","hasNextKeys","isKeyDifferent","equals","transitionType","dismissEnabled","hideFlipper","showPaginationTooltip","hideIndicator","isDisabledFunctionality","outerClasses","transitionTypeValue","carouselClass","innerClasses","dismiss","_renderDismissCarousel","indicators","_renderIndicators","carouselControls","_renderCarouselControls","onTouchStart","onTouchEnd","evt","touches","scrollStart","screenX","changedTouches","delta","onIndicatorsClickHandler","indicatorAriaText","listClasses","idx","indicatorClasses","indicatorId","caption","tabIndex","anchorClassesPrev","anchorClassesNext","iconClassesPrev","iconClassesNext","screenReaderClasses","prevAttribute","nextAttribute","handleDismissCarousel","dismissCarouselAriaText","CartIcon","observer","cartLabel","cartQtyLabel","cartLink","cartItem","totalItemsInCart","qtyLabel","CartIconComponent","CartLinePriceEditor","waitTime","_handleChange","newValue","cancellabelDebounce","_debounce","setInvoiceLinePrice","cartLineId","cartLine","LineId","PriceEditor","defaultAmount","maximumValue","InvoiceAmount","minimumValue","handleChange","CartLineItemFunctions","renderProductDimensions","Product","DimensionStrings","DimensionTypeValue","colorString","configString","sizeString","IsGiftCard","amountString","styleString","renderDiscountLines","DiscountLines","discountLine","OfferId","OfferName","discountStringText","DiscountCost","isSalesLine","CustomerContextualPrice","PeriodicDiscount","DiscountAmount","currencyCode","priceCurrency","EffectivePercentage","renderInventoryLabel","inventoryInformationLabel","inventoryCssName","inventoryLabelClassName","renderUnitOfMeasure","renderShippingLabel","pickupDeliveryModeCode","PickupDeliveryModeCode","channelDeliveryOptionConfig","PickupDeliveryModeCodes","some","deliveryMode","shippingChargeLines","ChargeLines","chargeLine","IsShipping","freightFee","chargeTotal","CalculatedAmount","shippingChargesText","renderOtherCharges","otherCharges","chargeline","otherCharge","Description","renderSalesAgreementPrompt","SalesAgreementLineRecordId","salesAgreementPricePrompt","renderConfirmedShipDate","confirmedShipDate","shipDateCssName","confirmedShipDateLabel","renderRequestDeliveryDate","requestDeliveryDate","reqDateCssName","requestDeliveryDateLabel","CatalogLabelComponent","isChannelTypeB2B","catalogs","catalog","CartLineItemComponent","destructDimensionStrings","inputQuantityAriaLabel","productDimensions","prodAttribute","productName","imgeClassName","IsInvoiceLine","_generateErrorMessage","_updateQuantity","quantityOnChange","lineIndex","_generateSelectMenu","currentQuantity","nodes","_generateMenu","_generateQuantityAndPrice","isOutOfStock","isQuantityEditable","maxQuantity","quantityDisplayString","NetAmountWithAllInclusiveTax","GrossAmount","ExtendedPrice","NetPrice","salesAgreementLineId","displayMode","primaryImageUrl","priceEditorResources","showShippingChargesForLineItems","buttonEventReference","LinesAddedToCartDialog","orderTemplate","linesCount","lineItemsString","linesAddedToCartHeaderLinesOneText","linesAddedToCartHeaderLinesFormatText","linesAddedToCartHeaderItemsOneText","linesAddedToCartHeaderMessageText","orderTemplateCloseButtonText","setUploadStatus","setLinesAddedToCartDialogOpen","setAddedLinesCount","isMultipleCatalogFeatureEnabledInHq","addOrderTemplateToCartInput","AddOrderTemplateToCartInput","productList","CartLines","addOrderTemplateToCartAction","addedCartLines","orderTemplateErrorMessage","AddOrderTemplateToCartComponent","uploadStatus","addedLinesCount","linesAddedToCartDialogOpen","modalText","errorMsg","addToCartFailureMessage","addToCartSuccessMessage","addToCartProcessMessage","_getModalText","processStatusClass","closeWindowButtonText","AddOrderTemplateToCart","addOrderTemplateAttribute","PopupProducts","orderTemplateLines","fullProduct","totalLines","linesAddedToCartDialogResources","OrderTemplateNameDialog","isUpdateDialog","existingOrderTemplate","onCancel","parentElementRef","orderTemplateName","setOrderTemplateName","orderTemplateModalAriaLabel","orderTemplateHeaderLabel","htmlFor","orderTemplateTitleLabel","orderTemplateNameAriaLabel","placeholder","defaultOrderTemplateName","maxLength","orderTemplateDescription","orderTemplateButtonLabel","UpdateOrderTemplateHeaderInput","updateOrderTemplateHeader","Error","CreateOrderTemplateInput","createOrderTemplate","orderTemplateCancelButtonLabel","OrderTemplateComponent","lineItemsText","actionButtonText","orderTemplateAction","renderAddToOrderTemplatesForExistingOrderTemplatesDialog","closeDialog","showOrderTemplateNameDialog","onAddToOrderTemplateButtonClick","boldText","patternToFind","addToOrderTemplateDialogResources","orderTemplates","createOrderTemplateImageUrl","getAsset","addToOrderTemplateHeader","selectTemplatesText","createNewOrderTemplateButtonText","addToTemplateButtonText","AddToOrderTemplateDialog","addToOrderTemplateDialog","isCreateOrderTemplateDialogOpen","setOrderTemplateNameDialogOpen","onOrderTemplateSelected","noOrderTemplatesMessage","noOrderTemplatesDescription","createAnOrderTemplateButtonText","cancelOrderTemplateCreationButtonText","renderAddToOrderTemplatesWhenEmptyOrderTemplatesDialog","createOrderTemplateDialogResources","LinesAddedToOrderTemplateDialog","separator","itemsCount","reload","linesAddedToOrderTemplateHeaderItemsOneText","linesAddedToOrderTemplateHeaderItemsFormatText","linesAddedToOrderTemplateHeaderLinesOneText","linesAddedToOrderTemplateHeaderLinesFormatText","addedProducts","ProductDimensionType","Style","filteredProducts","linesAddedToOrderTemplateHeaderMessageText","assertive","linesAddedToOrderTemplateCustomPriceAlertMessageText","viewOrderTemplateButtonText","continueShoppingButtonText","AddProductsToOrderTemplateComponent","chosenOrderTemplate","setChosenOrderTemplate","setAddedProducts","isAddToOrderTemplateModalOpen","setIsAddToOrderTemplateModalOpen","isLinesAddedToOrderTemplateDialogOpen","setIsLinesAddedToOrderTemplateDialogOpen","addedItemsCount","setAddedItemsCount","linesToAdd","ProductListId","allProductInputs","linesToAdd_1","linesToAdd_1_1","listLine","FullProductInput","getProductDetailsCriteriaFromActionInput","getFullProducts","allProducts","ProductListsDataActions","addedLines","quantities","calculateSum","onAddProductsToOrderTemplateClick","addToOrderTemplateReference","addProductsToOrderTemplateButton","innerRef","DuplicateItemsWhenAddingToOrderTemplateDialog","executeOverrideQuantity","duplicatedProductsHeader","duplicatedProductsDescription","updateQuantityButtonText","cancelDuplicateItemsButtonText","ItemAddedToOrderTemplateDialog","orderTemplateId","productPrice","itemAddedToOrderTemplateHeaderItemOneText","itemAddedToOrderTemplateHeaderItemFormatText","itemAddedToOrderTemplateHeaderMessageText","viewports","xs","q","w","h","lg","xl","lazyload","renderOrderTemplateImage","join","AddToOrderTemplateComponentActions","addToOrderTemplate","AddToOrderTemplateComponent","addToOrderTemplateModalOpen","setAddToOrderTemplateModalOpen","chosenOrderTemplateId","setChosenOrderTemplateId","setProductPrice","itemAddedToOrderTemplateDialogOpen","setItemAddedToOrderTemplateDialogOpen","duplicateItemsWhenAddingToOrderTemplateDialogOpen","setDuplicateItemsWhenAddingToOrderTemplateDialogOpen","addToOrderTemplateButtonText","shouldShowButtonFailedTooltip","disableButton","addToOrderTemplateButtonTooltip","addToOrderTemplateRef","dialogData","orderTemplateTextMessage","AddItemToOrderTemplateInput","addItemToOrderTemplate","then","getPriceForSelectedVariant","PriceForSelectedVariantInput","retrievedProductPrice","reject","itemAddedToOrderTemplateDialogResources","duplicateItemsWhenAddingToOrderTemplateDialogResources","UpdateOrderTemplateInput","updateOrderTemplateAction","ItemAddedToCartDialog","itemAddedToCartHeaderItemOneText","itemAddedToCartHeaderItemFormatText","itemAddedToCartHeaderMessageText","renderImage","RenameOrderTemplateComponent","renameOrderTemplateButtonText","renameOrderTemplateDialogStrings","renameOrderTemplateDialogOpen","onRenameTemplate","SaveCartToOrderTemplateActions","SaveCartToOrderTemplateComponent","linesAddedToOrderTemplateDialogOpen","setLinesAddedToOrderTemplateDialogOpen","createOrderTemplateFromCartButton","createOrderTemplateFromCartButtonTooltip","getFullProductsDetails","productLines","allProdInputs","lines","updateLinesCounts","firstQuantity","secondQuantity","areAllCartlinesPriceKeyedIn","cartLines","IsPriceKeyedIn","allProductListLines","UnitOfMeasure","UnitOfMeasureSymbol","filteredProductListLines","addProductListLinesAsync","filteredAddedLines","linesAddedToOrderTemplateDialogResources","newLinesToupdate","getLinesInput","GetProductListLinesInput","getProductListLines","linesState","linesToUpdate","productListLine","lineToUpdate","updateProductListLinesAsync","updatedLines","renderOrderTemplateImages","getOriginalPrice","TradeAgreementPrice","formatCurrency","shouldUseFreePriceText","cultureFormatter","showPriceRangeForMasterProduct","isPriceMinMaxEnabled","Master","KitMaster","MinVariantPrice","MaxVariantPrice","renderCurrentPrice","maxVariantPrice","minVariantPrice","itemProp","priceResources","priceRangeSeparator","getActivePrice","isSalesAgreementPriceFeatureEnabled","SalesAgreementPrice","isExpanded_1","setIsExpanded_1","firstPriceLine","AttainablePriceLines","salesAgreementExpirationDatePrompt","formatDate","EffectiveDate","ExpirationDate","salesAgreementCommittedQuantityPrompt","CommittedQuantity","salesAgreementRemainingQuantityPrompt","RemainingQuantity","renderSalesAgreementDetail","originalSalesPrice","activeSalesPrice","showStrikethroughPricing","initialPrice","savingsText","renderCurrentPriceWithOriginalPrice","ProductComponentV2SwatchComponent","dimensionType","swatches","onSelectDimension","onSelectItem","SwatchComponent","list","ratingAriaLabel","ratingCountAriaLabel","isAllowBack","quickViewButton","productComparisonButton","inventoryLabel","dimensionAvailabilities","swatchItemAriaLabel","updateProductUrl","productDetailsPageUrl","coreContext","queryString","sourceUrl","URL","baseUrl","search","pathname","getDefaultColorSwatchSelected","attributeValues","colorAttribute","attributeValue","keyName","DimensionTypes","isDefault","getProductPageUrlSync","recordId","productImageUrlFromSwatch","dimensionToPreSelectInProductCard","defaultSwatch","productImageUrls","generateImageUrl","getProductImageUrlFromDefaultColorSwatch","productPageUrlFromSwatch","swatchValue","getProductPageUrlFromDefaultSwatch","productPageUrl","setProductPageUrl","productImageUrl","setProductImageUrl","selectedSwatchItems","Dictionary","updatePageAndImageUrl","swatchItem","productPageUrlWithSwatch","newUrl","searchParams","delete","swatchProductImageUrl","inventoryAvailabilityLabel","unitOfMeasure","rating","ratingAriaLabelText","reviewCount","ratingCountAriaLabelText","availability","reviewCountArialableText","swatchItems","validValues","dimensionTypeValue","checkIfShouldDisplayAsSwatch","DimensionSwatchDisplayTypes","productCard","itemId","colorHexCode","swatchColorHexCode","imageUrl","swatchImageUrl","dimensionAvailability","swatch","isUnitOfMeasureEnabled","getRatingAriaLabel","roundedRating","getReviewAriaLabel","averageRating","totalRatings","productCardimageSettings","emptyPlaceHolderImage","placeholderImageName","fallbackImageSource","imageProps","bypassHideOnFailure","renderProductPlacementImage","moduleTypeName","moduleId","productBasePrice","adjustedProductPrice","maxVariantProductPrice","savingsPriceResourceText","freePriceResourceText","originalPriceResourceText","currentPriceResourceText","channelConfig","Currency","renderPrice","basePrice","defaultUnitOfMeasure","hideRating","avgRating","numberRatings","RatingComponent","ratingCount","readOnly","renderRating","quickview","selectedDimensions","getValues","convertDimensionTypeToProductDimensionType","selectedProductId","renderQuickView","renderProductComparisonButton","ProductComponentSwatchComponent","ProductComponent","allowBack","getDefaultSwatchSelected","AttributeValues","attributeSwatches","KeyName","Swatches","IsDefault","swatchProductImageUrls","ProductImageUrls","SwatchValue","queryStringEncoded","encodeURIComponent","SwatchColorHexCode","SwatchImageUrl","AverageRating","TotalRatings","IsMasterProduct","Standalone","Dropdown","selectMenu","_onChanged","selectedIndex","dropdownId","selectId","selectedValue","innerText","onInitialize","initializedDimension","selectedItem","dropdownList","dropdownName","dropdownToggleName","dimensionChanged","_onInitializedDimension","initializeDimension","getProductConfigure","moduleName","pageName","selectDimensionFormatString","callbacks","configureErrors","getDropdownName","onChanged","__generator","dimensionSelectedAsync","onInitializedDimension","getTelemetryObject","telemetryPageName","dropdowns","productDimensionFull","dropdownCallback","DimensionValues","dM","containerProps","labelContainerProps","errors","heading","select","mapProductDimensionFullToDropdownViewProps","SwatchItemComponent","isColored","hasColor","hasImage","selectItem","selectionHandler","isSelectionEnabled","fullImageUrl","generateSwatchImageUrl","onKeyPress","shouldDisplayText","isRefineItem","containerClassName","selectedItemId","setSelectedItemId","didUserSetAnyItem","setDidUserSetAnyItem","onSelectItemCallback","defaultItem","ProductDimensionsMatrixDimensionItemComponent","swatchContent","swatchContainerClassName","swatchContentClassName","getDimensionName","Color","productDimensionTypeColor","Configuration","productDimensionTypeConfiguration","Size","productDimensionTypeSize","productDimensionTypeStyle","changeCurrentDimension","onDimensionTypeSelect","ProductDimensionsMatrixDimensionSelectionComponent","buttonTogglingReference","isPopoverShown","setIsPopoverShown","currentDimensionType","setCurrentDimensionType","currentDimensionTypeLabel","setCurrentDimensionTypeLabel","popoverClassName","togglePopoverHandler","onDimensionTypeChange","Popover","dimensionTypes","ProductDimensionsMatrixEnterAllQuantitiesPopoverContentComponent","defaultQuantity","setCurrentQuantity","handleQuantityChange","newQuantity","handleApplyAll","onApplyToAll","productDimensionsMatrixEnterAllQuantitiesQuantityText","IncrementalQuantity","currentCount","productDimensionsMatrixInputQuantityAriaLabel","minQuantityValue","maxQuantityValue","decrementButtonAriaLabel","productDimensionsMatrixEnterAllQuantitiesDecrementButtonAriaLabel","incrementButtonAriaLabel","productDimensionsMatrixEnterAllQuantitiesIncrementButtonAriaLabel","productDimensionsMatrixEnterAllQuantitiesEachText","productDimensionsMatrixEnterAllQuantitiesApplyToAllText","ProductDimensionsMatrixEnterAllQuantitiesComponent","productDimensionsMatrixEnterAllQuantitiesButtonText","getDimensionId","isDimensionAvailable","dimensionId","inventoryLevel","getInventoryLevelCodeFromDimensionValue","retrieveDimensionInventoryLevelCode","InventoryLevelValues","outOfStock","retrieveEndDimensionsNode","dimensionIds","isAvailable","endNodes","concat","isNodeAvailable","nodes_1","nodes_1_1","createDisplayOrders","usedDimensions","dimensions_1","dimensions_1_1","currentDimensions","currentResult","ProductDimensionsMatrix","_handleDisplayOrderChange","newDimensions","_displayOrderList","dimensionsOrder","_generateNodesByNewDimensions","reverse","lastChangeAllDate","now","_updateAllQuantities","totalQuantity","_clearAllQuantities","_defaultQuantityProps","_handleCollapseDimension","isExpanded","dimensionsExpandState","getValueWithDefaultValue","dimensionsExpandStateDate","_handleDimensionTypeChange","previousDimensionType","newDimensionType","previousDimension","newDimension","dimensionOnChange","_handleQuantityChange","difference","isMobile","variant","VariantType","Viewport","_retrieveNodes","retrieveAvailabilitiesInformation","dimensionValuesWithInventory","dimensionsList","flatten","nodeDimensions","productIds","dimensionProductIds","ProductIds","nodeDimensions_1","e_4","nodeDimensions_1_1","nodes_2","nodes_2_1","_renderMatrixEmptyCell","_className","_renderHeader","_renderMatrix","_renderFooter","warehouseAggregation","availabilitiesSearchCriteria","QuantityUnitTypeValue","FilterByChannelFulfillmentGroup","DeliveryModeTypeFilterValue","shipping","DefaultWarehouseOnly","availabilities","AggregatedProductInventoryAvailabilities","this_1","getInventoryLevelCodeFromProductAvailability","_renderDisplayOrderContainer","_renderActions","productDimensionsMatrixDisplayOrderSeparator","LabeledDropdown","labelClassname","labelText","productDimensionsMatrixDisplayOrderLabel","dropdownOptions","dropdownClassname","onSelectOption","_renderEnterAllQuantities","_renderClearAllQuantities","maxQuantityForCartLineItem","minQuantity","productDimensionsMatrixClearAllText","_renderMatrixDesktop","rowClassName","cellClassName","_renderMatrixRowsDesktop","reversedDimensions","_renderMatrixDimensionsHeader","_renderMatrixDimensionCell","cells","_renderMatrixMobile","allDimensions","singleDimensionClassName","dimensionsContainerClassName","_renderMatrixRowsMobile","previousNode","pastNode","haveSameItems","_renderMatrixMainDimensionMobile","expandButtonClassName","collapseClassName","collapseItemClassName","Collapse","partialDimensions","nodeIndex","newNodeIndex","nodeDimensionIdsLength","partialDimensionIdsLength","currentDimensionId","currentDimension","this_2","lastDimension","_renderMatrixCell","this_3","nextRows","ColorHexCode","ImageUrl","_renderMatrixQuantityCell","_renderMatrixOutOfStockCell","productDimensionsMatrixOutOfStockLabel","_renderTotalSummary","productDimensionsMatrixTotalItemsLabel","_retrieveProducts","_renderAddToOrderTemplate","customerInformation","_renderAddToCart","productDimensionsMatrixAddItemsToCartButtonText","onErrorMessage","_renderFooterActions","PromoCode","_onInputChange","promoCodeInputValue","canApply","_applyPromotion","appliedPromo","addPromoCode","promoCode","substatus","duplicatePromoCodeErrorText","invalidPromoCodeErrorText","failedToAddPromoCodeErrorText","_renderForm","promoPlaceholderText","promoCodeApplyButtonText","onSubmit","_removePromotion","removePromoCodes","promoCodes","failedToRemovePromoCodeErrorText","_calculateDiscount","discountAmount","e_2","DiscountCode","_renderAppliedPromoCode","Coupons","totalCouponDiscountAmount","coupon","Code","appliedPromoCodeHeadingText","removePromoAriaLabelFormat","removePromoText","ApplyPromoCode","isCollapseOpen","promoCodeHeadingText","PromoCodeComponent","RatingComponentActions","onSliderChanged","setRating","lastSelectedRating","getIndex","Rating","initialRating","useEffect","newRating","shouldShowDescription","shouldShowFullRatingDescription","starControl","renderStars","currentRating","reviewCountAriaLabel","mouseOver","filled","half","stars","glyphClass","RefinerOptionsType","RefinerItemType","getUpdatedRefinementCriteria","itemToggleNotification","currentRefinementCriteria","updatedRefinementCriteria","isToggledItemFound","currentRefinementCriteria_1","currentRefinementCriteria_1_1","selectedCriterion","isMatchingRefinementCriterion","refinerItemData","isSelecting","minValue","rangeStart","maxValue","rangeEnd","refinerOptionsData","typeValue","SingleSelect","refinerItemId","matchingIndex","findIndex","criterion","refinerItems","refinerValue","refinementCriterion","sourceTypeValue","RefinerApplyFunctionalComponent","applyRefinerAttributes","ApplyRefiner","RefinerApplyComponent","RefinerChoiceSummaryFunctionalComponent","clearAllText","choiceAriaLabel","choiceFormat","selectedChoices","onClickChoice","onClickClearAll","onClickChoiceHandler","selectedRefinerItem","targetChoiceItem","shouldClearAll","nextItemToFocus","nextSibling","onClickClearAllHandler","clearAllAttributes","choiceItem","choiceItemName","activeRefinerItem","overallFormat","refinerLabel","itemType","DateRange","refinerMinValue","refinerMaxValue","getTagName","choiceItemAttribute","RefinerChoiceSummaryComponent","RefinerFooterFunctionalComponent","refinerApplyProps","extraActions","RefinerFooterComponent","RefinerToggleFunctionalComponent","RefinerToggleComponent","selectLabelId","RefinerSortFunctionalComponent","currentSortOption","sortOptionState","setSortOptionState","selectHtmlElement","sortOption","RefinerSortComponent","RefinerHeaderFunctionalComponent","refinerToggleProps","refinerChoiceSummaryProps","refinerSortProps","RefinerHeaderComponent","RefinerItemCheckFunctionalComponent","isSingleSelect","isChecked","itemTypeClassName","refinerItemAttributes","RefinerItemCheckComponent","minInputLabelId","maxInputLabelId","RefinerItemDateRangeFunctionalComponent","minInputLabel","maxInputLabel","minInputAriaLabel","maxInputAriaLabel","minRangeValue","maxRangeValue","validationErrorForRange","fallbackPattern","onChangeMinValue","onChangeMaxValue","onBlurMinInput","onBlurMaxInput","selectedMinValue","setSelectedMinValue","selectedMaxValue","setSelectedMaxValue","validationErrorMessageForRange","setValidationErrorMessageForRange","validateRange","minimum","selectedFormattedValue","userSelectedMinValue","updatedMinInput","minInput","pattern","userSelectedMaxValue","updatedMaxInput","maxInput","RefinerItemDateRangeComponent","componentModalClassName","RefinerModalToggleFunctionalComponent","RefinerModalFunctionalComponent","autoFocus","applicationNode","returnFocusRef","returnRef","onToggle","zIndex","modalNode","modalTitle","modalHeaderNode","refinerOptions","modalCloseButtonText","modalFooterNode","RefinerModalToggleComponent","RefinerModalComponent","listItemClassName","RefinerOptionsFunctionalComponent","isExpandedOnInitialLoad","expandTimeout","onUpdateRefiners","shouldRefinerExpand","setShouldRefinerExpand","isRefinerExpanded","setIsRefinerExpanded","onToggleRefinerOptions","onClickRefinerItem","onMinValueUpdate","updatedMin","onMaxValueUpdate","updatedMax","refinerItem","isSingleSelectValue","selectedRefinerItems","refinerItemCheckProps","refinerDataRangeProps","minLabel","maxLabel","RefinerOptionsComponent","modalToggleWrapperClassName","RefinerFunctionalComponent","renderMobile","isMobileView","refinerModalProps","refinerHeaderProps","refinerModalToggleProps","createComponentInMobileView","refinerFooterProps","createComponentInDesktopView","RefinerComponent","SearchBarComponent","currentSearchOption","searchOptionState","setSearchOptionState","currentSearchText","searchTextState","setSearchTextState","searchButtonAttributes","Search","searchOptionsAriaLabel","searchOption","clearSearchTextOnOptionChange","searchBarPlaceholder","searchBarAriaLabel","searchButtonAriaLabel","searchButtonLabel","SocialMedia","SocialMediaComponent","setShareLinks","socialMediaName","socialMedia","pageUrl","postUrl","mediaImage","getElementsByName","Facebook","Twitter","postTitle","Pinterest","Mail","Linkedin","Customization","socialShareURL","screen","params","openWindow","TableCellContentType","TableHeaderComponent","contentType","TableRowComponent","TableCellComponent","TableComponent","WishListIconComponent","wishlistIconRef","wishlistTooltipText","showButtonIconTooltip","wishlistUrl","shouldShowCount","isDispayWishlistCount","wishlistCountlbl","wishlistCountLabel","wishlistItemCount","wishlistCount","countLabel","classname","fixRegExpWellKnownSymbolLogic","anObject","toLength","requireObjectCoercible","getMethod","advanceStringIndex","regExpExec","MATCH","nativeMatch","maybeCallNative","regexp","O","matcher","RegExp","string","rx","S","res","global","fullUnicode","unicode","lastIndex","A","matchStr","uncurryThis","speciesConstructor","stickyHelpers","fails","UNSUPPORTED_Y","stringSlice","SPLIT_WORKS_WITH_OVERWRITTEN_EXEC","re","originalExec","apply","BUGGY","SPLIT","nativeSplit","internalSplit","limit","splitter","C","unicodeMatching","flags","multiline","lim","p","z"],"sourceRoot":""}