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7d,IAEvD,MAAM,cAAEkI,EAAa,WAAEC,EAAU,aAAEC,EAAY,MAAEpC,GAAUhG,EAC3D,OACIF,IAAAA,cAAC+I,EAAAA,OAAMjB,OAAAC,OAAA,GAAKO,GACRtI,IAAAA,cAAC6H,EAAAA,KAAIC,OAAAC,OAAA,GAAKK,IACTlC,EACAmY,EAAiBhW,EAAYnI,YC9O1Cgf,EAAOC,QAAUnf,cCAjBkf,EAAOC,QAAUC","sources":["webpack://bju-press/./src/themes/base/views/custom-components/look-inside.component.tsx?80c8","webpack://bju-press/./src/utilities/parallel-promises.tsx?b217","webpack://bju-press/./src/themes/base/views/media-gallery.view.tsx?c964","webpack://bju-press/./src/utilities/class-name-helper.ts?dd10","webpack://bju-press/./lib/media-gallery/module-registration.js?47e5","webpack://bju-press/./src/modules/media-gallery/utils/helper.ts?b895","webpack://bju-press/./src/modules/media-gallery/utils/get-valid-product-images.ts?a364","webpack://bju-press/./src/modules/media-gallery/media-gallery.tsx?24d7","webpack://bju-press/./src/modules/media-gallery/media-gallery.view.tsx?5061","webpack://bju-press/./src/modules/adventureworks/views/media-gallery.view.tsx?7624","webpack://bju-press/external var \"React\"?0d3b","webpack://bju-press/external var \"ReactDOM\"?853b"],"sourcesContent":["//==============================================================================\r\n// Look Inside\r\n//\r\n// Opens a modal with a select set of book pages that the customer can look\r\n// through before purchasing.\r\n//==============================================================================\r\nimport * as React from 'react';\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport classnames from 'classnames';\r\n\r\nimport { clsHelper } from '../../../../utilities/class-name-helper';\r\nimport { promiseAllN } from '../../../../utilities/parallel-promises';\r\n\r\nimport { sendRequest } from '@msdyn365-commerce/core';\r\nimport { Modal, ModalBody, ModalFooter, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IMediaGalleryResources } from '../../definition-extensions/media-gallery.ext.props.autogenerated';\r\n\r\n//==============================================================================\r\n// INTERFACES\r\n//==============================================================================\r\nexport interface ILookInsideProps {\r\n resources: IMediaGalleryResources;\r\n imageUrl: string;\r\n productId: string;\r\n productName?: string;\r\n productPrice?: string;\r\n maxCount?: number;\r\n}\r\n\r\ninterface PageConfig {\r\n id: string;\r\n lookupString: string;\r\n title: string;\r\n maxPages: number;\r\n}\r\n\r\ninterface PageConfigIndexed extends PageConfig {\r\n index: number;\r\n}\r\n\r\n//==============================================================================\r\n// CLASS NAME UTILITY\r\n//==============================================================================\r\nconst BASE_CLASS = 'look-inside';\r\nconst cls = (fragment?: string) => clsHelper(BASE_CLASS, fragment);\r\n\r\n//==============================================================================\r\n// CLASS DEFINITION\r\n//==============================================================================\r\n/**\r\n * LookInside component\r\n * @extends {React.Component}\r\n */\r\n//==============================================================================\r\n@observer\r\nclass LookInside extends React.Component {\r\n //==========================================================================\r\n // VARIABLES\r\n //==========================================================================\r\n public lookInsideRef: React.RefObject;\r\n @observable private isOpen: boolean = false;\r\n @observable private pageIndex: number = 0;\r\n private readonly resources: IMediaGalleryResources = this.props.resources;\r\n private readonly lookupStringPrefix: string = '_000';\r\n private readonly lookupStringExt: string = '.jpg';\r\n private readonly pages: PageConfig[] = [\r\n { id: 'frontCover', lookupString: '_f', title: this.resources.lookInside_titleFrontCover, maxPages: 1 },\r\n { id: 'frontFlap', lookupString: '_ff', title: this.resources.lookInside_titleFrontFlap, maxPages: 1 },\r\n { id: 'titlePage', lookupString: '_t', title: this.resources.lookInside_titleTitlePage, maxPages: 1 },\r\n { id: 'copyright', lookupString: '_cp', title: this.resources.lookInside_titleCopyright, maxPages: 2 },\r\n { id: 'tableOfContents', lookupString: '_c', title: this.resources.lookInside_titleTableOfContents, maxPages: 15 },\r\n { id: 'preface', lookupString: '_pp', title: this.resources.lookInside_titlePreface, maxPages: 10 },\r\n { id: 'dedication', lookupString: '_d', title: this.resources.lookInside_titleDedication, maxPages: 1 },\r\n { id: 'introduction', lookupString: '_i', title: this.resources.lookInside_titleIntroduction, maxPages: 25 },\r\n { id: 'lessonPlanOverview', lookupString: '_o', title: this.resources.lookInside_titleLessonPlanOverview, maxPages: 60 },\r\n { id: 'sampleChapter', lookupString: '_p', title: this.resources.lookInside_titleSampleChapter, maxPages: this.props.maxCount || 5 },\r\n { id: 'sample', lookupString: '_s', title: this.resources.lookInside_titleSample, maxPages: this.props.maxCount || 5 },\r\n { id: 'acknowledgements', lookupString: '_a', title: this.resources.lookInside_titleAcknowledgements, maxPages: 3 },\r\n { id: 'backFlap', lookupString: '_bf', title: this.resources.lookInside_titleBackFlap, maxPages: 1 },\r\n { id: 'backCover', lookupString: '_b', title: this.resources.lookInside_titleBackCover, maxPages: 1 },\r\n { id: 'photoCredits', lookupString: '_pc', title: this.resources.lookInside_titlePhotoCredits, maxPages: 10 }\r\n ];\r\n @observable private imageRefs: string[] = [];\r\n private readonly defaultPageStart: number = 1;\r\n private readonly defaultPageLookup: string = `${this.pages[0].lookupString}${String(this.defaultPageStart)}`;\r\n\r\n //==========================================================================\r\n // PUBLIC METHODS\r\n //==========================================================================\r\n //------------------------------------------------------\r\n // Constructor\r\n //------------------------------------------------------\r\n constructor(props: ILookInsideProps) {\r\n super(props);\r\n this.lookInsideRef = React.createRef();\r\n }\r\n\r\n //------------------------------------------------------\r\n // Invoked immediately after component is mounted\r\n //------------------------------------------------------\r\n public async componentDidMount(): Promise {\r\n const { imageUrl, productId } = this.props;\r\n const enableLookInside = await this._checkMainImage(imageUrl, productId, this.defaultPageLookup);\r\n if (enableLookInside) {\r\n this._getImages(imageUrl, productId);\r\n }\r\n }\r\n\r\n //------------------------------------------------------\r\n // Render function\r\n //------------------------------------------------------\r\n public render(): JSX.Element | null {\r\n const { resources, productName, productPrice } = this.props;\r\n const pageConfig = this._createConfig();\r\n const defaultPageIndex = this._findPage(this.defaultPageLookup);\r\n const enableLookInside = !!this.imageRefs.length;\r\n\r\n // Do not return component if default page image does not exist\r\n if (!enableLookInside) {\r\n return null;\r\n }\r\n\r\n return (\r\n
\r\n\r\n {/* Modal button */}\r\n \r\n\r\n {/* Modal window */}\r\n \r\n \r\n \r\n
\r\n\r\n {/* Sidebar column*/}\r\n
\r\n\r\n {/* Cover image */}\r\n
\r\n {productName}\r\n
\r\n\r\n {/* Product info */}\r\n
\r\n
\r\n {productName}\r\n
\r\n
\r\n {productPrice}\r\n
\r\n
\r\n\r\n {/* Table of contents */}\r\n
\r\n
\r\n {resources.lookInside_headingTableOfContents}\r\n
\r\n
\r\n {pageConfig.map(page => (\r\n \r\n {page.title}\r\n \r\n ))}\r\n
\r\n
\r\n\r\n
\r\n\r\n {/* Content column */}\r\n
\r\n\r\n {/* Page nav */}\r\n
\r\n \r\n {resources.lookInside_pagePrevious}\r\n \r\n \r\n {resources.lookInside_pageNext}\r\n \r\n
\r\n\r\n {/* Page image */}\r\n
\r\n \r\n {productName}\r\n \r\n
\r\n\r\n {/* Copyright text */}\r\n
\r\n {resources.lookInside_copyright}\r\n
\r\n\r\n
\r\n\r\n
\r\n
\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n //==========================================================================\r\n // PRIVATE METHODS\r\n //==========================================================================\r\n //------------------------------------------------------\r\n // Toggle modal\r\n //------------------------------------------------------\r\n private readonly _toggle = (): void => {\r\n this.isOpen = !this.isOpen;\r\n };\r\n\r\n //------------------------------------------------------\r\n // Set page index\r\n //------------------------------------------------------\r\n private readonly _setPageIndex = (index: number) => (): void => {\r\n this.pageIndex = index;\r\n };\r\n\r\n //------------------------------------------------------\r\n // Format lookup string\r\n //------------------------------------------------------\r\n private readonly _formatLookupString = (lookupString: string): string => {\r\n return `${this.lookupStringPrefix}${lookupString}${this.lookupStringExt}`;\r\n };\r\n\r\n //------------------------------------------------------\r\n // Finds page index with provided lookup string\r\n //------------------------------------------------------\r\n private readonly _findPage = (lookupString: string): number => {\r\n return this.imageRefs.findIndex((imageURL: string) => imageURL.includes(lookupString));\r\n };\r\n\r\n //------------------------------------------------------\r\n // Creates filtered page config based on images present\r\n //------------------------------------------------------\r\n private readonly _createConfig = (): PageConfigIndexed[] => {\r\n return this.pages.map(page => ({\r\n ...page,\r\n index: this._findPage(this._formatLookupString(`${page.lookupString}${String(this.defaultPageStart)}`))\r\n })).filter(page => page.index !== -1);\r\n };\r\n\r\n //------------------------------------------------------\r\n // Build image URL\r\n //------------------------------------------------------\r\n private readonly _getImageUrl = (baseImageUrl: string, productId: string, lookupString: string): string => {\r\n return `${baseImageUrl}Products%2F${productId}${this.lookupStringPrefix}${lookupString}${this.lookupStringExt}`\r\n };\r\n\r\n //------------------------------------------------------\r\n // Checks main image before getting the rest of the\r\n // images\r\n //------------------------------------------------------\r\n private readonly _checkMainImage = async (baseImageUrl: string, productId: string, lookupString: string): Promise => {\r\n const imageUrl = this._getImageUrl(baseImageUrl, productId, lookupString);\r\n const imageResponse = await sendRequest(imageUrl, 'get');\r\n if (imageResponse?.status === 200) {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n //------------------------------------------------------\r\n // Builds array of images\r\n //------------------------------------------------------\r\n private readonly _getImages = async (baseImageUrl: string, productId: string): Promise => {\r\n const imageUrls: string[] = [];\r\n this.pages.forEach(page => {\r\n for (let i = 1; i <= page.maxPages; i++) {\r\n imageUrls.push(this._getImageUrl(baseImageUrl, productId, `${page.lookupString}${String(i)}`));\r\n }\r\n });\r\n this.pages.map(page => {\r\n this._getImageUrl(baseImageUrl, productId, page.lookupString);\r\n });\r\n const imageQueries: string[] = [];\r\n const imageRequesters: (() => Promise)[] = [];\r\n imageUrls.forEach(ref => {\r\n imageRequesters.push(() => sendRequest(ref, 'get'));\r\n });\r\n\r\n // Make image requests in parallel for improved speed\r\n const imageResponses = await promiseAllN(imageRequesters, 20);\r\n\r\n imageResponses.forEach((imageRequest: any) => {\r\n if (imageRequest?.status === 200) {\r\n imageQueries.push(imageRequest?.config?.url);\r\n }\r\n });\r\n\r\n // Return manual image search\r\n this.imageRefs = imageQueries;\r\n };\r\n}\r\n\r\nexport default LookInside;\r\n","//==============================================================================\r\n// Performs an arbitrary list of actions in parallel, but limits the number\r\n// running concurrently.\r\n//==============================================================================\r\n\r\n//==========================================================\r\n// Performs a list actions, throttling to a maximum\r\n// number of concurrent processes.\r\n//\r\n// Type is the result of a single action\r\n// IN: Array of functions that return a promise\r\n// OUT: A promise that resolves when all actions resolve.\r\n//\r\n// Rejects and stops initiating actions if any action rejects.\r\n//==========================================================\r\nexport function promiseAllN(collection: (() => Promise)[], maxConcurrency: number = 100): Promise {\r\n let index = 0;\r\n let jobsLeft = collection.length;\r\n let rejected = false;\r\n const outcome: any = [];\r\n\r\n const pendingPromise: Promise = new Promise(function (resolve, reject) {\r\n\r\n // Guard clause\r\n if (collection.length === 0) {\r\n return resolve([]);\r\n }\r\n\r\n // Execute the j'th thunk\r\n function runJob(j: number) {\r\n if (!rejected) {\r\n collection[j]().then((result: any) => {\r\n\r\n // If an operation failed, early out. Don't start any more jobs.\r\n if (rejected) { return; }\r\n\r\n outcome[j] = result;\r\n\r\n // If the last job just completed, resolve. We're done!\r\n if (--jobsLeft <= 0) {\r\n resolve(outcome);\r\n }\r\n // We're not done. Are there are jobs that haven't started yet? If so, start one.\r\n else if (index < collection.length) {\r\n runJob(index++);\r\n }\r\n }).catch((e: any) => {\r\n if (rejected) { return; }\r\n\r\n rejected = true; // Let any currently running jobs know to ignore their results\r\n reject(e);\r\n });\r\n }\r\n }\r\n\r\n // Bootstrap, while handling cases where the length of the given array is smaller than maxConcurrent jobs\r\n while (index < Math.min(collection.length, maxConcurrency)) {\r\n\r\n // Added a check to see if a job insta-rejected\r\n if (!rejected) {\r\n runJob(index++);\r\n }\r\n }\r\n });\r\n\r\n return pendingPromise;\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IMediaGalleryThumbnailItemViewProps, IMediaGalleryThumbnailsViewProps, IMediaGalleryViewProps } from '@msdyn365-commerce-modules/media-gallery';\r\n\r\n//----------------------------------------------------------\r\n// @CUSTOM: Added imports for customizations\r\n//----------------------------------------------------------\r\nimport { IMediaGalleryData } from '@msdyn365-commerce-modules/media-gallery';\r\nimport { IMediaGalleryProps } from '../definition-extensions/media-gallery.ext.props.autogenerated';\r\nimport LookInside from './custom-components/look-inside.component';\r\n//----------------------------------------------------------\r\n\r\nconst MediaGalleryView: React.FC> = props => { // @CUSTOM: Added extended definition props\r\n const { CarouselProps, Thumbnails, MediaGallery, Modal, config, context, resources } = props; // @CUSTOM: Added config, context, resources from extended definition props\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: Variables to pass to LookInside component\r\n //------------------------------------------------------\r\n const product = (MediaGallery.moduleProps.data as IMediaGalleryData).product.result;\r\n const formattedPrice = product && context.cultureFormatter.formatCurrency(product.Price);\r\n //------------------------------------------------------\r\n\r\n return (\r\n \r\n \r\n {Modal}\r\n {_renderThumbnails(Thumbnails)}\r\n {/* @CUSTOM: Render LookInside custom component below if enabled in config */}\r\n {config.enableLookInside && product && product.ItemId &&\r\n \r\n }\r\n \r\n );\r\n};\r\n\r\n// @CUSTOM: Adjusted result type to include null when only one product image or less\r\nconst _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element | null => {\r\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\r\n\r\n //------------------------------------------------------\r\n // @CUSTOM: If there's only one product image or less,\r\n // do not render thumbnails\r\n //------------------------------------------------------\r\n if (items && items.length <= 1) {\r\n return null;\r\n }\r\n //------------------------------------------------------\r\n\r\n return (\r\n \r\n {items && items.map(_renderThumbnailItem)}\r\n \r\n );\r\n};\r\n\r\nconst _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\r\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\r\n\r\n return {Picture};\r\n};\r\n\r\nexport default MediaGalleryView;\r\n","//==============================================================================\r\n// Class Name Helper\r\n//\r\n// Tool to standardize CSS class naming in module components and elements\r\n//==============================================================================\r\n\r\nexport function clsHelper(baseClass: string, fragment?: string, separator: string = '__'): string | undefined {\r\n return fragment ? `${baseClass}${separator}${fragment}` : undefined;\r\n}\r\n","const binding = { modules: {}, dataActions: {} };\n\n const registerActionId = (actionPath) => {\n if (binding.dataActions[actionPath] &&\n binding.dataActions[actionPath].default &&\n binding.dataActions[actionPath].default.prototype &&\n binding.dataActions[actionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[actionPath].default.prototype.id] = binding.dataActions[actionPath];\n } else {\n Object.keys(binding.dataActions[actionPath] || {}).forEach(exportName => {\n if (binding.dataActions[actionPath][exportName] &&\n binding.dataActions[actionPath][exportName].prototype &&\n binding.dataActions[actionPath][exportName].prototype.Action) {\n binding.dataActions[binding.dataActions[actionPath][exportName].prototype.id] = binding.dataActions[actionPath][exportName];\n }\n })\n }\n };\n\n const registerSanitizedActionPath = (sanitizedActionPath, dataAction) => {\n if (process.env.NODE_ENV === 'development') {\n if (!dataAction.default) {\n throw new Error('Data action path does not have a default export');\n }\n if (!(dataAction.default.prototype.id && binding.dataActions[dataAction.default.prototype.id]) || !binding.dataActions[sanitizedActionPath]) {\n binding.dataActions[sanitizedActionPath] = dataAction;\n }\n } else {\n binding.dataActions[sanitizedActionPath] = dataAction;\n if (!binding.dataActions[sanitizedActionPath].default) {\n throw new Error('Data action path ' + sanitizedActionPath + ' does not have a default export');\n }\n binding.dataActions[sanitizedActionPath].default.prototype.RegistrationId = sanitizedActionPath;\n if (binding.dataActions[sanitizedActionPath].default.prototype.id) {\n binding.dataActions[binding.dataActions[sanitizedActionPath].default.prototype.id] = sanitizedActionPath;\n }\n }\n };\n \n\n (binding.modules['media-gallery'] = {\n c: () => require('@msdyn365-commerce-modules/media-gallery/dist/lib/modules/media-gallery/media-gallery'),\n $type: 'contentModule',\n da: [{name:'mediaLocations', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id', runOn: 0},{name:'mediaLocationsForSelectedVariant', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant', runOn: 0},{name:'product', path:'@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant', runOn: 0}],\n \n iNM: true,\n ns: '@msdyn365-commerce-modules',\n n: 'media-gallery',\n p: 'media-gallery',\n \n pdp: '',\n \n \n md: 'node_modules/@msdyn365-commerce-modules/media-gallery/dist/lib/modules/media-gallery'\n });\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-by-id');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-media-locations-for-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n {\n const sanitizedActionPath = '@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant';\n let dataAction = require('@msdyn365-commerce-modules/retail-actions/dist/lib/get-selected-variant');\n registerSanitizedActionPath(sanitizedActionPath, dataAction);\n }\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|themes|base|views|media-gallery'] = {\n c: () => require('partner/themes/base/views/media-gallery.view.tsx'),\n cn: '__local__-__local__-media-gallery'\n };\nviewDictionary['@msdyn365-commerce-modules|media-gallery|modules|media-gallery|media-gallery'] = {\n c: () => require('@msdyn365-commerce-modules/media-gallery/dist/lib/modules/media-gallery/media-gallery.view.js'),\n cn: '@msdyn365-commerce-modules-media-gallery-media-gallery'\n };\nviewDictionary['@msdyn365-commerce-theme|adventureworks-theme-kit|modules|adventureworks|views|media-gallery'] = {\n c: () => require('@msdyn365-commerce-theme/adventureworks-theme-kit/dist/lib/modules/adventureworks/views/media-gallery.view.js'),\n cn: '@msdyn365-commerce-theme-adventureworks-theme-kit-media-gallery'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IRequestContext } from '@msdyn365-commerce/core';\n\n/**\n * Gets correct alt text for image based on configuration of site.\n * @param productName Product name.\n * @param context Current request context.\n * @param imageAltText Alt-text from CMS image.\n */\nexport function getAltText(\n context: IRequestContext,\n shouldUseCmsAltText: boolean,\n productName?: string,\n imageAltText?: string\n): string | undefined {\n if (!context?.app?.config?.OmniChannelMedia) {\n return productName;\n }\n if (shouldUseCmsAltText) {\n return imageAltText;\n }\n return productName;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { commerceApiRequest, getCatalogId, IActionContext, IImageData, IImageSettings } from '@msdyn365-commerce/core';\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { getMediaLocationsForSelectedVariant, MediaLocationsForSelectedVariantInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { getAltText } from './helper';\n\nasync function validateMediaLocationAsync(mediaLocation: MediaLocation): Promise<[IImageData, boolean]> {\n const imageData: IImageData = {\n src: mediaLocation.Uri || '',\n altText: mediaLocation.AltText || ''\n };\n if (mediaLocation.IsApplicableForChildEntities) {\n imageData.additionalProperties = { isApplicableForChildEntities: 'true' };\n }\n\n if (imageData.src === '') {\n return [imageData, false];\n }\n\n return new Promise<[IImageData, boolean]>(resolve => {\n try {\n const http = new XMLHttpRequest();\n http.open('HEAD', imageData.src!, true);\n\n http.addEventListener('load', () => {\n resolve([imageData, http.status === 200 || http.status === 201]);\n });\n\n http.addEventListener('error', () => {\n resolve([imageData, false]);\n });\n\n http.send();\n } catch {\n resolve([imageData, false]);\n }\n });\n}\n\nexport async function getValidProductImages(\n productId: number,\n channelId: number,\n actionContext: IActionContext,\n imageSettings: IImageSettings,\n selectedProduct?: SimpleProduct\n): Promise {\n const catalogId = getCatalogId(actionContext.requestContext);\n const actionInput = new MediaLocationsForSelectedVariantInput(productId, channelId, selectedProduct, catalogId);\n\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\n .then(mediaLocations => {\n if (mediaLocations) {\n return Promise.all(mediaLocations.map(mediaLocation => validateMediaLocationAsync(mediaLocation))).then(pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n });\n }\n\n return [];\n })\n .catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\n return [];\n });\n}\n\n/**\n * Gets product variant images on dimension change of buy-box module for Omni scenario.\n * @param productId Product record id.\n * @param shouldUseCmsAltText Alt-text source to use.\n * @param channelId Current channel id.\n * @param actionContext Current action context.\n * @param productName Product name.\n * @param selectedProduct Currently selected variant product.\n * @returns List of images.\n */\n\nexport async function getProductImages(\n productId: number,\n shouldUseCmsAltText: boolean,\n channelId: number,\n actionContext: IActionContext,\n productName?: string,\n selectedProduct?: SimpleProduct\n): Promise {\n const catalogId = getCatalogId(actionContext.requestContext);\n if (actionContext.requestContext?.params?.isPreview) {\n const response = await commerceApiRequest(actionContext.requestContext, 'msdyn365-ochannel-product-info', 'post', {\n productId: productId,\n channelId: channelId,\n catalogId: catalogId\n });\n if (response.status !== 200) {\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant for preview scenario');\n return [];\n }\n const previewImageData = response?.data as MediaLocation[];\n if (previewImageData) {\n return previewImageData.map(mediaLocation => {\n return {\n src: mediaLocation.Uri ?? '',\n altText: getAltText(actionContext.requestContext, shouldUseCmsAltText, productName, mediaLocation.AltText),\n additionalProperties: mediaLocation.IsApplicableForChildEntities\n ? {\n isApplicableForChildEntities: 'true'\n }\n : undefined\n };\n });\n }\n return [];\n }\n const actionInput = new MediaLocationsForSelectedVariantInput(productId, channelId, selectedProduct, catalogId);\n return getMediaLocationsForSelectedVariant(actionInput, actionContext)\n .then(mediaLocations => {\n if (mediaLocations) {\n return mediaLocations.map(mediaLocation => {\n return {\n src: mediaLocation.Uri ?? '',\n altText: getAltText(actionContext.requestContext, shouldUseCmsAltText, productName, mediaLocation.AltText),\n additionalProperties: mediaLocation.IsApplicableForChildEntities\n ? {\n isApplicableForChildEntities: 'true'\n }\n : undefined\n };\n });\n }\n return [];\n })\n .catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to get Media Locations for Selected Variant');\n return [];\n });\n}\n\nexport async function validateProductImages(\n mediaLocations: MediaLocation[],\n actionContext: IActionContext,\n imageSettings: IImageSettings\n): Promise {\n return Promise.all(mediaLocations.map(mediaLocation => validateMediaLocationAsync(mediaLocation)))\n .then(pairs => {\n return pairs.filter(pair => pair[1]).map(pair => pair[0]);\n })\n .catch(error => {\n actionContext.telemetry.exception(error);\n actionContext.telemetry.debug('Unable to validate product images');\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\nimport { Carousel, ICarouselProps } from '@msdyn365-commerce/components';\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport { MediaLocation, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions, getFallbackImageUrl, ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport {\n defaultDataScale,\n IComponentNodeProps,\n ImagefullView,\n IModalViewProps,\n IModuleProps,\n inlineZoomImageOnHover,\n inlineZoomImageOnMouseMove,\n inlineZoomImageOnMouseOut,\n inlineZoomInitClick,\n INodeProps,\n ISingleSlideCarouselProps,\n isMobile,\n KeyCodes,\n NodeTag,\n onContainerZoomInit,\n onMouseMoveLensContainer,\n onMouseOutLensContainer,\n onMouseOverImageContainer,\n removeContainerZoomStyle,\n removeInlineZoomStyle,\n SingleSlideCarousel,\n VariantType\n} from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { reaction } from 'mobx';\nimport * as React from 'react';\n\nimport { IMediaGalleryData } from './media-gallery.data';\nimport { imageSource, imageZoom, IMediaGalleryProps, thumbnailsOrientation } from './media-gallery.props.autogenerated';\nimport { getProductImages, getValidProductImages, validateProductImages } from './utils';\nimport { getAltText } from './utils/helper';\n\n/**\n * IMediaGalleryState Interface.\n */\nexport interface IMediaGalleryState {\n animating: boolean;\n activeIndex: number;\n isImageZoomed: boolean;\n modalIsOpen: boolean;\n lastUpdate?: number;\n isMobileImageZoomed?: boolean;\n mediaGalleryItems?: IImageData[];\n isInitialLoad?: boolean;\n shouldUseOptimizedImage?: boolean;\n}\n\n/**\n * IMediaGalleryThumbnailsViewProps Interface.\n */\nexport interface IMediaGalleryThumbnailsViewProps {\n ThumbnailsContainerProps: INodeProps;\n SingleSlideCarouselComponentProps: INodeProps;\n items?: IMediaGalleryThumbnailItemViewProps[];\n}\n\n/**\n * IMediaGalleryThumbnailItemViewProps Interface.\n */\nexport interface IMediaGalleryThumbnailItemViewProps {\n ThumbnailItemContainerProps: INodeProps;\n Picture: React.ReactElement;\n}\n\n/**\n * IMediaGalleryViewProps Interface.\n */\nexport interface IMediaGalleryViewProps extends IMediaGalleryProps {\n state: IMediaGalleryState;\n MediaGallery: IModuleProps;\n CarouselProps: INodeProps;\n Thumbnails: IMediaGalleryThumbnailsViewProps;\n Modal?: React.ReactElement | null;\n callbackToggle?(): void;\n callbackThumbnailClick?(index: number): void;\n callbackThumbnailKeyDown?(index: number): void;\n}\n\n/**\n * Props for carousel.\n */\ninterface IMediaGalleryCarouselItems {\n items: ItemType[];\n keys: (string | undefined)[];\n}\n\n/**\n * Media gallery component.\n */\nclass MediaGallery extends React.Component, IMediaGalleryState> {\n private readonly _inlineZoomDivRef: Map = new Map();\n\n private readonly fullScreenOverlayButtonRef: React.RefObject = React.createRef();\n\n private mediaGalleryImages: IImageData[] = [];\n\n private fallbackImage?: string;\n\n private readonly defaultGalleryImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=767&h=767&m=8', w: 0, h: 0 },\n sm: { q: 'w=600&h=600&m=8', w: 0, h: 0 },\n md: { q: 'w=600&h=772&m=8', w: 0, h: 0 },\n lg: { q: 'h=772&m=8', w: 0, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=100&m=8', w: 100, h: 0 },\n lg: { q: 'w=100&m=8', w: 100, h: 0 }\n },\n lazyload: true,\n cropFocalRegion: true\n };\n\n private readonly _zoomedImageSettings: IImageSettings;\n\n public constructor(props: IMediaGalleryProps) {\n super(props);\n this._toggleModal = this._toggleModal.bind(this);\n this.state = {\n activeIndex: 0,\n animating: false,\n isImageZoomed: false,\n modalIsOpen: false,\n isInitialLoad: true,\n shouldUseOptimizedImage: !!this.props.config.skipImageValidation\n };\n\n this._zoomedImageSettings =\n props.config.zoomedImageSettings ?? props.config.galleryImageSettings ?? this.defaultGalleryImageSettings;\n\n this._onImageMouseOut = this._onImageMouseOut.bind(this);\n this._inlineZoomImageOnHover = this._inlineZoomImageOnHover.bind(this);\n this._onInlineImageClick = this._onInlineImageClick.bind(this);\n this._onContainerZoomImageClick = this._onContainerZoomImageClick.bind(this);\n this._onMouseOutLensContainer = this._onMouseOutLensContainer.bind(this);\n }\n\n public isMobile(): boolean {\n const size = isMobile({ variant: VariantType.Viewport, context: this.props.context.request });\n return size === 'xs';\n }\n\n public async componentDidMount(): Promise {\n const source = this.props.config.imageSource ?? imageSource.pageContext;\n const shouldUpdateOnPartialDimensionSelection = this.props.config.shouldUpdateOnPartialDimensionSelection;\n this._setRenderType();\n if (!this.props.context.request.app?.config?.OmniChannelMedia) {\n if (source === imageSource.pageContext) {\n if (this.state.mediaGalleryItems === undefined && this.props.data.mediaLocationsForSelectedVariant.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocationsForSelectedVariant.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings\n );\n this._setImages(images);\n } else if (this.state.mediaGalleryItems === undefined && this.props.data.product.result) {\n const product = this.props.data.product.result;\n const images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n product.productVariant\n );\n\n this._setImages(images);\n } else {\n this._setImages([]);\n }\n }\n }\n\n reaction(\n () => {\n const product = this.props.data.product.result;\n if (!product) {\n return null;\n }\n\n if (!shouldUpdateOnPartialDimensionSelection || !product.productVariant?.RecordId) {\n return `${product.RecordId}`;\n }\n\n return `${product.RecordId}-${product.productVariant.RecordId}`;\n },\n async () => {\n const product = this.props.data.product.result;\n let images: IImageData[] = [];\n if (product) {\n if (this.props.context.app?.config?.OmniChannelMedia) {\n images = await getProductImages(\n product.RecordId,\n this.shouldUseCmsAltText(),\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n product.Name,\n shouldUpdateOnPartialDimensionSelection ? product.productVariant : undefined\n );\n } else {\n images = await getValidProductImages(\n product.RecordId,\n +this.props.context.request.apiSettings.channelId,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n shouldUpdateOnPartialDimensionSelection ? product.productVariant : undefined\n );\n }\n this._setImages(images);\n } else {\n this._setImages([]);\n }\n },\n { fireImmediately: true }\n );\n\n if (source === imageSource.productId && this.props.data.mediaLocations.result) {\n const images = await validateProductImages(\n this.props.data.mediaLocations.result,\n this.props.context.actionContext,\n this.props.config.thumbnailImageSettings ?? this.defaultThumbnailImageSettings\n );\n this._setImages(images);\n }\n }\n\n public shouldComponentUpdate(nextProps: IMediaGalleryProps, nextState: IMediaGalleryState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\n const { id, config, resources } = this.props;\n\n const { className, showPaginationTooltip } = config;\n\n const isVertical: boolean = config.thumbnailsOrientation === thumbnailsOrientation.vertical;\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- || is required.\n const isFullscreenAllowed: boolean = this.isMobile() || config.allowFullScreen || false;\n const zoomViewMode: string =\n config.imageZoom === imageZoom.inline ? imageZoom.inline : config.imageZoom === imageZoom.container ? imageZoom.container : '';\n const source = this.props.config.imageSource ?? imageSource.pageContext;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = this.props.context.app.config?.placeholderImageName as string;\n if (this.props.data.product.result) {\n this.fallbackImage = getFallbackImageUrl(\n this.props.data.product.result.ItemId,\n this.props.context.request.apiSettings,\n this.props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && this.fallbackImage) {\n this.fallbackImage = `${this.fallbackImage},${emptyPlaceHolderImage}`;\n }\n if (this.props.config.skipImageValidation && !this.state.mediaGalleryItems && this.state.isInitialLoad) {\n let images: IImageData[] = [];\n let mediaLocations: MediaLocation[] = [];\n if (source === imageSource.pageContext && this.props.data.mediaLocationsForSelectedVariant.result) {\n mediaLocations = this.props.data.mediaLocationsForSelectedVariant.result;\n } else if (source === imageSource.productId && this.props.data.mediaLocations.result) {\n mediaLocations = this.props.data.mediaLocations.result;\n }\n images = mediaLocations.map(mediaLocation => {\n return {\n src: mediaLocation.Uri ?? '',\n altText: getAltText(\n this.props.context.actionContext.requestContext,\n this.shouldUseCmsAltText(),\n this.props.data.product.result?.Name,\n mediaLocation.AltText\n )\n };\n });\n const curatedImages = this.props.config.images ?? [];\n this.mediaGalleryImages = [...this._filterMasterImageFromVariant(images), ...curatedImages];\n }\n const mediaGalleryCarouselItems = this._getMediaGalleryItems(isFullscreenAllowed, zoomViewMode);\n const mediaGalleryThumbnailCarouselItems = this._getMediaGalleryThumbnailItems();\n const viewProps: IMediaGalleryViewProps = {\n ...(this.props as IMediaGalleryProps),\n state: this.state,\n MediaGallery: {\n moduleProps: this.props,\n className: classnames(`ms-media-gallery ${isVertical ? 'vertical' : ''}`, className)\n },\n Modal: isFullscreenAllowed ? this.imageModalSlider(zoomViewMode) : null,\n callbackToggle: this.openModalDialog,\n callbackThumbnailClick: this._generateOnThumbnailClick,\n callbackThumbnailKeyDown: this._generateOnThumbnailKeyDown,\n CarouselProps: {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items: mediaGalleryCarouselItems.items,\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: showPaginationTooltip === true,\n indicatorAriaText: resources.ariaLabelForSlide,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n key: mediaGalleryCarouselItems.keys\n } as IComponentNodeProps,\n Thumbnails: {\n ThumbnailsContainerProps: { className: 'ms-media-gallery__thumbnails-container' },\n SingleSlideCarouselComponentProps: {\n tag: SingleSlideCarousel,\n className: 'ms-media-gallery__thumbnails',\n vertical: isVertical,\n flipperPrevLabel: resources.previousScreenshotFlipperText,\n flipperNextLabel: resources.nextScreenshotFlipperText,\n parentId: id,\n useTabList: true,\n key: JSON.stringify(mediaGalleryThumbnailCarouselItems.keys)\n } as IComponentNodeProps,\n items: mediaGalleryThumbnailCarouselItems.items\n }\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Zoomed out image on previous/next click.\n */\n public updateZoomedInImage(): void {\n this.setState({ isImageZoomed: false });\n }\n\n private readonly onExiting = () => {\n this.setState({ animating: true });\n };\n\n private readonly onExited = () => {\n this.setState({ animating: false });\n };\n\n /**\n * On click next in carousel.\n */\n private readonly next = (): void => {\n removeInlineZoomStyle();\n if (this.isLastItem() === undefined) {\n return;\n }\n\n const nextIndex = this.isLastItem() ? 0 : this.state.activeIndex + 1;\n this.goToIndex(nextIndex);\n\n this.updateZoomedInImage();\n };\n\n /**\n * On click previous in carousel.\n */\n private readonly previous = (): void => {\n removeInlineZoomStyle();\n const images = this.state.mediaGalleryItems;\n const nextIndex = this.isFirstItem() ? (images ? images.length - 1 : 0) : this.state.activeIndex - 1;\n this.goToIndex(nextIndex);\n this.updateZoomedInImage();\n };\n\n private readonly goToIndex = (index: number): void => {\n this.setState({ activeIndex: index });\n };\n\n private _getMediaGalleryThumbnailItems(): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems ?? this.mediaGalleryImages;\n const thumbnailImageSettings = this.props.config.thumbnailImageSettings;\n if (thumbnailImageSettings) {\n thumbnailImageSettings.cropFocalRegion = true;\n }\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n const defaultKey = 0;\n return {\n items: [this._getEmptyThumbnailItem(thumbnailImageSettings, defaultKey, this.state.activeIndex)],\n keys: ['empty']\n };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ...mediaGalleryItems!.map((item: IImageData, index: number) =>\n this._getThumbnailItem(\n item,\n thumbnailImageSettings ?? this.defaultThumbnailImageSettings,\n index,\n this.state.activeIndex\n )\n )\n ],\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private _getMediaGalleryItems(isFullscreenAllowed: boolean, zoomViewMode: string): IMediaGalleryCarouselItems {\n const mediaGalleryItems = this.state.mediaGalleryItems ?? this.mediaGalleryImages;\n const galleryImageSettings = this.props.config.galleryImageSettings;\n if (galleryImageSettings) {\n galleryImageSettings.cropFocalRegion = true;\n }\n\n const zoomView = isFullscreenAllowed ? 'fullscreen' : zoomViewMode;\n\n const hasMediaGalleryItems = ArrayExtensions.hasElements(mediaGalleryItems);\n\n if (!hasMediaGalleryItems) {\n if (this.state.lastUpdate) {\n return { items: [this._renderEmptyImage(galleryImageSettings)], keys: ['empty'] };\n }\n return { items: [], keys: [] };\n }\n\n return {\n items: [\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n ...mediaGalleryItems!.map((item: IImageData, index: number) =>\n this._renderCarouselItemImageView(zoomView, item, galleryImageSettings ?? this.defaultGalleryImageSettings, index)\n )\n ],\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n keys: [...mediaGalleryItems!.map(item => item.src)]\n };\n }\n\n private _setImages(images?: IImageData[]): void {\n const curatedImage = this.props.config.images || [];\n const imagesToSet = this._filterMasterImageFromVariant(images);\n\n this.setState({\n mediaGalleryItems: [...imagesToSet, ...curatedImage],\n activeIndex: 0,\n lastUpdate: Date.now(),\n shouldUseOptimizedImage: false\n });\n }\n\n private _setRenderType(): void {\n this.setState({\n isInitialLoad: false\n });\n }\n\n private _renderCarouselItemImageView(\n zoomView: string,\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n isInPopup: boolean = false\n ): React.ReactNode {\n if (this.isMobile()) {\n if (isInPopup) {\n return this._renderImageInContainerOnZoom(image, this._zoomedImageSettings, index);\n }\n return this._renderImageFullScreenOnZoom(image, imageSettings, index);\n }\n\n switch (zoomView) {\n case 'container': {\n return this._renderImageInContainerOnZoom(image, this._zoomedImageSettings, index);\n }\n case 'inline': {\n return this._renderImageInlineOnZoom(image, this._zoomedImageSettings, index);\n }\n case 'fullscreen': {\n return this._renderImageFullScreenOnZoom(image, imageSettings, index);\n }\n\n // No default\n }\n return <>{this._getCarouselItem(image, imageSettings, index, isInPopup)};\n }\n\n private _filterMasterImageFromVariant(images?: IImageData[]): IImageData[] {\n const shouldHidePrimaryImages = this.props.config.shouldHideMasterProductImagesForVariant ?? true;\n let variantImages = images ?? [];\n const isVariantProduct =\n !ObjectExtensions.isNullOrUndefined(this.props.data.product.result?.MasterProductId) ||\n !ObjectExtensions.isNullOrUndefined(this.props.data.product.result?.productVariant);\n const itemId = this.props.data.product.result?.ItemId;\n if (shouldHidePrimaryImages && isVariantProduct && itemId) {\n variantImages = variantImages.filter(item => {\n const isApplicableForChildEntities = item.additionalProperties?.isApplicableForChildEntities;\n return !isApplicableForChildEntities;\n });\n if (!ArrayExtensions.hasElements(variantImages)) {\n variantImages = images ?? [];\n }\n }\n return variantImages;\n }\n\n private readonly _getCarouselItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n isInPopup: boolean = false\n ): React.ReactNode => (\n \n );\n\n private readonly _getThumbnailItem = (\n image: IImageData,\n imageSettings: IImageSettings,\n index: number,\n modifiedActiveIndex: number\n ): IMediaGalleryThumbnailItemViewProps => {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: index,\n 'aria-label': image.altText,\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n };\n\n /**\n * Ref Handler.\n * @param index -Remove item click function.\n * @returns Set inline zoom.\n */\n private readonly _refHandler = (index: number) => (divRef: HTMLDivElement) => {\n this._inlineZoomDivRef.set(index, divRef);\n };\n\n private readonly _generateOnThumbnailKeyDown = (index: number) => {\n return (event: React.KeyboardEvent) => {\n if (event.which === KeyCodes.Enter || event.which === KeyCodes.Space) {\n event.preventDefault();\n\n this.goToIndex(index);\n }\n };\n };\n\n private readonly _generateOnThumbnailClick = (index: number) => {\n return (event: React.MouseEvent) => {\n event.preventDefault();\n\n this.goToIndex(index);\n };\n };\n\n private _renderImageInlineOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n \n \n \n \n );\n }\n\n private _inlineZoomImageOnHover(event: React.MouseEvent): void {\n inlineZoomImageOnHover(event, this.props.config.dataScale ?? String(defaultDataScale));\n }\n\n private _handleMobileViewZoomedImageClick(event: React.MouseEvent) {\n const target = this.state.shouldUseOptimizedImage ? (event.target as HTMLImageElement) : event.currentTarget;\n const mobileZoomedInImageClassName = 'msc-mobile-zoomed-in';\n if (!this.state.isMobileImageZoomed) {\n const bounds = target.getBoundingClientRect();\n const dataScale = Number(this.props.config.dataScale ?? defaultDataScale);\n\n const positionX = event.clientX - bounds.left;\n const positionY = event.clientY - bounds.top;\n const scaledPositionX = positionX * dataScale;\n const scaledPositionY = positionY * dataScale;\n\n target.style.transform = `scale(${dataScale})`;\n target.classList.add(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = 'auto';\n target.parentElement!.scrollTo(scaledPositionX - positionX, scaledPositionY - positionY);\n this.setState({\n isMobileImageZoomed: true\n });\n } else {\n target.style.transform = '';\n target.classList.remove(mobileZoomedInImageClassName);\n target.parentElement!.style.overflow = '';\n this.setState({\n isMobileImageZoomed: false\n });\n }\n }\n\n private _onInlineImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) {\n // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n inlineZoomInitClick(event, this.props.config.dataScale ?? String(defaultDataScale));\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onImageMouseOut(event: React.MouseEvent): void {\n inlineZoomImageOnMouseOut(event);\n this.setState({\n isImageZoomed: false\n });\n }\n\n private _onContainerZoomImageClick(event: React.MouseEvent): void {\n if (window.innerWidth <= 768) {\n // $msv-breakpoint-m\n this._handleMobileViewZoomedImageClick(event);\n return;\n }\n\n onContainerZoomInit(event);\n\n this.setState({\n isImageZoomed: true\n });\n }\n\n private _onMouseOutLensContainer(event: React.MouseEvent): void {\n onMouseOutLensContainer(event);\n\n this.setState({\n isImageZoomed: false\n });\n }\n\n private _renderImageInContainerOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n \n
\n );\n }\n\n private _renderImageFullScreenOnZoom(image: IImageData, imageSettings: IImageSettings, index: number): React.ReactNode {\n return (\n
\n \n
\n {}\n \n
\n
\n );\n }\n\n private _mapProductToImageData(product: SimpleProduct): IImageData {\n return {\n src: product.PrimaryImageUrl ?? ''\n };\n }\n\n private _renderEmptyImage(imageSettings: IImageSettings | undefined): React.ReactNode {\n return (\n
\n \n
\n );\n }\n\n private _getEmptyThumbnailItem(\n imageSettings: IImageSettings | undefined,\n index: number,\n modifiedActiveIndex: number\n ): IMediaGalleryThumbnailItemViewProps {\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === index ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'tab',\n tabIndex: 0,\n key: 'empty',\n 'aria-label': '',\n 'aria-selected': modifiedActiveIndex === index,\n onClick: this._generateOnThumbnailClick(index),\n onKeyDown: this._generateOnThumbnailKeyDown(index)\n },\n Picture: (\n \n )\n };\n }\n\n private readonly isFirstItem = () => this.state.activeIndex === 0;\n\n private readonly isLastItem = () => {\n const images = this.state.mediaGalleryItems;\n return images && this.state.activeIndex === images.length - 1;\n };\n\n private readonly openModalDialog = (): void => {\n this._toggleModal();\n };\n\n private _toggleModal(): void {\n if (this.state.modalIsOpen) {\n this.fullScreenOverlayButtonRef.current?.focus();\n const parentDiv = this._inlineZoomDivRef.get(this.state.activeIndex);\n if (parentDiv && parentDiv.children && parentDiv.children.length >= 2) {\n const image = parentDiv.children[1].querySelector('img');\n if (image) {\n image.removeAttribute('style');\n }\n }\n this.setState({\n isImageZoomed: false\n });\n }\n this.setState({\n isImageZoomed: false,\n modalIsOpen: !this.state.modalIsOpen\n });\n removeInlineZoomStyle();\n removeContainerZoomStyle();\n }\n\n private readonly imageModalSlider = (ZoomView: string): React.ReactElement => {\n const {\n data: {\n product: { result: product }\n },\n resources\n } = this.props;\n let mediaGalleryItems = this.state.mediaGalleryItems;\n\n if (!mediaGalleryItems && product) {\n mediaGalleryItems = [this._mapProductToImageData(product)];\n }\n const carouselprops = {\n tag: Carousel,\n className: 'ms-media-gallery__carousel',\n items:\n mediaGalleryItems &&\n mediaGalleryItems.map((item: IImageData, index: number) =>\n this._renderCarouselItemImageView(ZoomView, item, this._zoomedImageSettings, index, true)\n ),\n activeIndex: this.state.activeIndex,\n next: this.next,\n previous: this.previous,\n interval: false,\n directionTextPrev: resources.previousScreenshotFlipperText,\n directionTextNext: resources.nextScreenshotFlipperText,\n onIndicatorsClickHandler: this.goToIndex,\n showPaginationTooltip: true,\n hideIndicator: false,\n keyboard: false,\n handleOnExited: this.onExited,\n handleOnExiting: this.onExiting,\n isDisabledFunctionality: this.state.isMobileImageZoomed\n } as IComponentNodeProps;\n const carousel = ;\n\n const imageModalSliderProps: IModalViewProps = {\n modalIsOpen: this.state.modalIsOpen,\n ontoggle: this._toggleModal,\n galleryCarousel: carousel,\n classNames: classnames('ms-media-gallery__modal', 'msc-modal-input-required')\n };\n return ImagefullView(imageModalSliderProps) as React.ReactElement;\n };\n\n private shouldUseCmsAltText = (): boolean => {\n if (this.props.config.altTextSource === 'product') {\n return false;\n } else {\n return true;\n }\n };\n}\n\nexport default MediaGallery;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IMediaGalleryThumbnailItemViewProps, IMediaGalleryThumbnailsViewProps, IMediaGalleryViewProps } from '../..';\n\nconst MediaGalleryView: React.FC = props => {\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\n\n return (\n \n \n {Modal}\n {_renderThumbnails(Thumbnails)}\n \n );\n};\n\nconst _renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps): JSX.Element => {\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps, items } = thumbnails;\n\n return (\n \n {items && items.map(_renderThumbnailItem)}\n \n );\n};\n\nconst _renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\n\n return {Picture};\n};\n\nexport default MediaGalleryView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageData, IImageSettings, Image } from '@msdyn365-commerce/core';\nimport {\n IMediaGalleryThumbnailItemViewProps,\n IMediaGalleryThumbnailsViewProps,\n IMediaGalleryViewProps\n} from '@msdyn365-commerce-modules/media-gallery';\nimport { getFallbackImageUrl } from '@msdyn365-commerce-modules/retail-actions';\nimport { Button, KeyCodes, Module, Node, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport React from 'react';\n\n/**\n * Render the thumbnail item images.\n * @param thumbnail - The carousel thumbnail line props.\n * @returns Return HTML having thumnailcontainer props with image.\n */\nconst renderThumbnailItem = (thumbnail: IMediaGalleryThumbnailItemViewProps): JSX.Element => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { ThumbnailItemContainerProps, Picture } = thumbnail;\n\n return {Picture};\n};\n\n/**\n * Gets the thumbnail item to display media gallery images.\n * @param image - The media gallery images.\n * @param imageSettings - Image settings for the image gallery items.\n * @param imageId - Image id.\n * @param modifiedActiveIndex - Modified Index of the images when selection changes.\n * @param props - The Media gallery view props from business layer.\n * @returns Return thumbnail view props which will be used to render images.\n */\nconst GetThumbnailItemComponent = (\n image: IImageData,\n imageSettings: IImageSettings,\n imageId: number,\n modifiedActiveIndex: number,\n props: IMediaGalleryViewProps\n): IMediaGalleryThumbnailItemViewProps => {\n let fallbackImage: string | undefined = '';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\n if (props.data.product.result) {\n fallbackImage = getFallbackImageUrl(\n props.data.product.result.ItemId,\n props.context.request.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && fallbackImage) {\n fallbackImage = `${fallbackImage},${emptyPlaceHolderImage}`;\n }\n\n /**\n * OnClick method of media gallery item.\n */\n const onClick = () => {\n props.callbackToggle?.();\n props.callbackThumbnailClick?.(imageId);\n props.state.activeIndex = imageId;\n };\n\n const classes = classnames(\n 'ms-media-gallery__thumbnail-item',\n modifiedActiveIndex === imageId ? 'ms-media-gallery__thumbnail-item-active' : ''\n );\n\n /**\n * Keydown event of media gallery item.\n * @param event - React.KeyboardEvent.\n */\n const handleKeyDown = (event: React.KeyboardEvent) => {\n if (event.keyCode === KeyCodes.Enter) {\n event.preventDefault();\n onClick();\n }\n };\n const defaultIndex = 0;\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: classes,\n role: 'presentation',\n key: imageId\n },\n Picture: (\n \n \n \n \n \n \n \n \n )\n };\n};\n\n/**\n * Gets the empty thumbnail item to display media gallery images.\n * @param imageSettings - Image settings for the image gallery items.\n * @param props - The Media gallery view props from business layer.\n * @returns Return thumbnail view props which will be used to render empty images.\n */\nconst GetEmptyThumbnailItemComponent = (\n imageSettings: IImageSettings,\n props: IMediaGalleryViewProps\n): IMediaGalleryThumbnailItemViewProps => {\n let fallbackImage: string | undefined = '';\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Site level config can be of any type.\n const emptyPlaceHolderImage = props.context.app.config?.placeholderImageName as string;\n if (props.data.product.result) {\n fallbackImage = getFallbackImageUrl(\n props.data.product.result.ItemId,\n props.context.request.apiSettings,\n props.context.request.app?.config?.OmniChannelMedia\n );\n }\n if (emptyPlaceHolderImage && fallbackImage) {\n fallbackImage = `${fallbackImage},${emptyPlaceHolderImage}`;\n }\n return {\n ThumbnailItemContainerProps: {\n tag: 'li' as NodeTag,\n className: 'ms-media-gallery__thumbnail-item',\n role: 'tab',\n tabIndex: 0,\n key: 0,\n 'aria-label': '',\n 'aria-selected': true\n },\n Picture: (\n \n )\n };\n};\n\n/**\n * Update media gallery items method.\n * @param items - The media gallery thumbnail item view props.\n * @returns The IImageData array.\n */\nconst getMediaGalleryItems = (items?: IMediaGalleryThumbnailItemViewProps[]): IImageData[] | undefined => {\n return items?.map(item => {\n return {\n altText: item.Picture.props.altText,\n src: item.Picture.props.src\n };\n });\n};\n\nconst defaultThumbnailImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=295&h=295&q=80&m=6&f=jpg', w: 295, h: 295 },\n xl: { q: 'w=295&h=295&q=80&m=6&f=jpg', w: 295, h: 295 }\n },\n lazyload: true,\n cropFocalRegion: true\n};\n\n/**\n * Render the Media gallery thumbnails to represent images in grid view.\n * @param thumbnails - The thumbnail view props.\n * @param props - The media gallery view props.\n * @returns - The single slide carousel component to render as media gallery image.\n */\nconst renderThumbnails = (thumbnails: IMediaGalleryThumbnailsViewProps, props: IMediaGalleryViewProps): JSX.Element => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { ThumbnailsContainerProps, SingleSlideCarouselComponentProps } = thumbnails;\n const { state, Thumbnails } = props;\n const mediaGalleryItems = getMediaGalleryItems(Thumbnails.items);\n\n const items: IMediaGalleryThumbnailItemViewProps[] | undefined =\n // eslint-disable-next-line multiline-ternary -- need multiline for easy code reading\n state.lastUpdate && mediaGalleryItems && mediaGalleryItems[0].src === 'empty'\n ? [GetEmptyThumbnailItemComponent(defaultThumbnailImageSettings, props)]\n : // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery\n mediaGalleryItems?.map((item: IImageData, id: number) =>\n GetThumbnailItemComponent(item, defaultThumbnailImageSettings, id, state.activeIndex, props)\n );\n\n return (\n \n {items?.map(renderThumbnailItem)}\n \n );\n};\n\n/**\n * Render the Media gallery items using viewprops.\n * @param props - The media gallery view props.\n * @returns The media gallery module wrapping up images node.\n */\nconst mediaGalleryView: React.FC = props => {\n // eslint-disable-next-line @typescript-eslint/naming-convention -- Dependency from media-gallery.tsx file\n const { CarouselProps, Thumbnails, MediaGallery, Modal } = props;\n return (\n \n \n {Modal}\n {renderThumbnails(Thumbnails, props)}\n \n );\n};\n\nexport default mediaGalleryView;\n","module.exports = React;","module.exports = ReactDOM;"],"names":["BASE_CLASS","cls","fragment","clsHelper","LookInside","React","constructor","props","super","isOpen","pageIndex","resources","this","lookupStringPrefix","lookupStringExt","pages","id","lookupString","title","lookInside_titleFrontCover","maxPages","lookInside_titleFrontFlap","lookInside_titleTitlePage","lookInside_titleCopyright","lookInside_titleTableOfContents","lookInside_titlePreface","lookInside_titleDedication","lookInside_titleIntroduction","lookInside_titleLessonPlanOverview","lookInside_titleSampleChapter","maxCount","lookInside_titleSample","lookInside_titleAcknowledgements","lookInside_titleBackFlap","lookInside_titleBackCover","lookInside_titlePhotoCredits","imageRefs","defaultPageStart","defaultPageLookup","String","_toggle","_setPageIndex","index","_formatLookupString","_findPage","findIndex","imageURL","includes","_createConfig","map","page","_objectSpread","filter","_getImageUrl","baseImageUrl","productId","_checkMainImage","async","imageUrl","imageResponse","sendRequest","status","_getImages","imageUrls","forEach","i","push","imageQueries","imageRequesters","ref","collection","maxConcurrency","arguments","length","undefined","jobsLeft","rejected","outcome","Promise","resolve","reject","runJob","j","then","result","catch","e","Math","min","promiseAllN","imageRequest","_imageRequest$config","config","url","lookInsideRef","render","productName","productPrice","pageConfig","defaultPageIndex","className","onClick","lookInside_button","Modal","autoFocus","fade","returnFocusRef","toggle","horizontalPosition","verticalPosition","ModalHeader","ModalBody","src","alt","lookInside_headingTableOfContents","key","role","classnames","lookInside_pagePrevious","lookInside_pageNext","lookInside_copyright","ModalFooter","__decorate","observable","observer","_renderThumbnails","thumbnails","ThumbnailsContainerProps","SingleSlideCarouselComponentProps","items","Node","Object","assign","_renderThumbnailItem","thumbnail","ThumbnailItemContainerProps","Picture","CarouselProps","Thumbnails","MediaGallery","context","product","moduleProps","data","formattedPrice","cultureFormatter","formatCurrency","Price","Module","enableLookInside","ItemId","request","apiSettings","Name","lookInsideMaxPages","baseClass","separator","binding","modules","dataActions","registerSanitizedActionPath","sanitizedActionPath","dataAction","default","Error","prototype","RegistrationId","c","require","$type","da","name","path","runOn","iNM","ns","n","p","pdp","md","window","__bindings__","viewDictionary","cn","getAltText","shouldUseCmsAltText","imageAltText","_context$app","app","OmniChannelMedia","validateMediaLocationAsync","mediaLocation","imageData","Uri","altText","AltText","IsApplicableForChildEntities","additionalProperties","isApplicableForChildEntities","http","XMLHttpRequest","open","addEventListener","send","_unused","getValidProductImages","channelId","actionContext","imageSettings","selectedProduct","catalogId","getCatalogId","requestContext","actionInput","MediaLocationsForSelectedVariantInput","getMediaLocationsForSelectedVariant","mediaLocations","all","pairs","pair","error","telemetry","exception","debug","validateProductImages","_this","_ref","_props$config$zoomedI","_inlineZoomDivRef","Map","fullScreenOverlayButtonRef","mediaGalleryImages","defaultGalleryImageSettings","viewports","xs","q","w","h","sm","lg","lazyload","cropFocalRegion","defaultThumbnailImageSettings","onExiting","setState","animating","onExited","next","removeInlineZoomStyle","isLastItem","nextIndex","state","activeIndex","goToIndex","updateZoomedInImage","previous","images","mediaGalleryItems","isFirstItem","_getCarouselItem","image","isInPopup","Image","fallBackSrc","fallbackImage","gridSettings","loadFailureBehavior","shouldSkipToMainImage","bypassHideOnFailure","_getThumbnailItem","modifiedActiveIndex","tag","tabIndex","_generateOnThumbnailClick","onKeyDown","_generateOnThumbnailKeyDown","imageFallbackOptimize","shouldUseOptimizedImage","_refHandler","divRef","set","event","which","KeyCodes","Enter","Space","preventDefault","openModalDialog","_toggleModal","imageModalSlider","ZoomView","_mapProductToImageData","carouselprops","Carousel","item","_renderCarouselItemImageView","_zoomedImageSettings","interval","directionTextPrev","previousScreenshotFlipperText","directionTextNext","nextScreenshotFlipperText","onIndicatorsClickHandler","showPaginationTooltip","hideIndicator","keyboard","handleOnExited","handleOnExiting","isDisabledFunctionality","isMobileImageZoomed","carousel","imageModalSliderProps","modalIsOpen","ontoggle","galleryCarousel","classNames","ImagefullView","altTextSource","bind","isImageZoomed","isInitialLoad","skipImageValidation","zoomedImageSettings","galleryImageSettings","_onImageMouseOut","_inlineZoomImageOnHover","_onInlineImageClick","_onContainerZoomImageClick","_onMouseOutLensContainer","isMobile","variant","VariantType","Viewport","_this$props$config$im","_this$props$context$r","source","imageSource","shouldUpdateOnPartialDimensionSelection","_setRenderType","mediaLocationsForSelectedVariant","_this$props$config$th","thumbnailImageSettings","_setImages","_this$props$config$th2","RecordId","productVariant","reaction","_product$productVaria","_this$props$context$a","_this$props$config$th3","_actionContext$reques","params","isPreview","response","commerceApiRequest","previewImageData","_mediaLocation$Uri","_mediaLocation$Uri2","getProductImages","fireImmediately","_this$props$config$th4","shouldComponentUpdate","nextProps","nextState","_this$props$config$im2","_this$props$context$a2","isVertical","thumbnailsOrientation","isFullscreenAllowed","allowFullScreen","zoomViewMode","imageZoom","emptyPlaceHolderImage","placeholderImageName","_this$props$context$r2","getFallbackImageUrl","_this$props$config$im3","_this$props$data$prod","curatedImages","_filterMasterImageFromVariant","mediaGalleryCarouselItems","_getMediaGalleryItems","mediaGalleryThumbnailCarouselItems","_getMediaGalleryThumbnailItems","viewProps","callbackToggle","callbackThumbnailClick","callbackThumbnailKeyDown","indicatorAriaText","ariaLabelForSlide","keys","SingleSlideCarousel","vertical","flipperPrevLabel","flipperNextLabel","parentId","useTabList","JSON","stringify","renderView","_this$state$mediaGall","ArrayExtensions","hasElements","lastUpdate","defaultKey","_getEmptyThumbnailItem","_this$state$mediaGall2","zoomView","_renderEmptyImage","curatedImage","imagesToSet","Date","now","_renderImageInContainerOnZoom","_renderImageFullScreenOnZoom","_renderImageInlineOnZoom","_this$props$config$sh","_this$props$data$prod2","_this$props$data$prod3","_this$props$data$prod4","shouldHidePrimaryImages","shouldHideMasterProductImagesForVariant","variantImages","isVariantProduct","ObjectExtensions","isNullOrUndefined","MasterProductId","itemId","_item$additionalPrope","_this$props$config$da","dataScale","defaultDataScale","onMouseOver","onMouseMove","inlineZoomImageOnMouseMove","_this$props$config$da2","inlineZoomImageOnHover","_handleMobileViewZoomedImageClick","target","currentTarget","mobileZoomedInImageClassName","style","transform","classList","remove","parentElement","overflow","_this$props$config$da3","bounds","getBoundingClientRect","Number","positionX","clientX","left","positionY","clientY","top","scaledPositionX","scaledPositionY","add","scrollTo","_this$props$config$da4","innerWidth","inlineZoomInitClick","inlineZoomImageOnMouseOut","onContainerZoomInit","onMouseOutLensContainer","_this$props$config$da5","onMouseOut","onMouseMoveLensContainer","onMouseOverImageContainer","href","fullScreenTitleText","_product$PrimaryImage","PrimaryImageUrl","_this$fullScreenOverl","current","focus","parentDiv","get","children","querySelector","removeAttribute","removeContainerZoomStyle","renderThumbnailItem","GetEmptyThumbnailItemComponent","_props$context$app$co2","_props$config$thumbna2","_props$context$reques2","xl","renderThumbnails","getMediaGalleryItems","GetThumbnailItemComponent","imageId","_props$context$app$co","_props$config$thumbna","_props$context$reques","_props$callbackToggle","_props$callbackThumbn","call","handleKeyDown","keyCode","Button","module","exports","ReactDOM"],"sourceRoot":""}