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CL,EAAE,CAAEpQ,OAAQ,QAAS0Q,OAAO,GAAQ,CAClCjI,QAAS,SAAiBkI,GACxB,IAEIC,EAFAC,EAAIN,EAASjM,MACbwM,EAAYN,EAAkBK,GAKlC,OAHAP,EAAUK,IACVC,EAAIH,EAAmBI,EAAG,IACxBhK,OAASwJ,EAAiBO,EAAGC,EAAGA,EAAGC,EAAW,EAAG,EAAGH,EAAYI,UAAUlK,OAAS,EAAIkK,UAAU,QAAKzL,GACjGsL,CACT,oBChBqB,EAAQ,IAG/BI,CAAiB","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/model-viewer/components/AriPartsListTable.component.tsx?cb62","webpack://Msdyn365.Commerce.Online/./src/modules/model-viewer/components/assemblyDropdown.component.tsx?9cc7","webpack://Msdyn365.Commerce.Online/./src/modules/model-viewer/components/AriHotspotImage.component.tsx?7aff","webpack://Msdyn365.Commerce.Online/./src/modules/model-viewer/model-viewer.tsx?52ad","webpack://Msdyn365.Commerce.Online/./src/modules/model-viewer/model-viewer.view.tsx?9691","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.flat-map.js?a1b3","webpack://Msdyn365.Commerce.Online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.array.unscopables.flat-map.js?8a78"],"sourcesContent":["import React from 'react';\r\nimport Table from 'reactstrap/lib/Table';\r\nimport classnames from 'classnames';\r\nimport { ListGroup, ListGroupItem, ListGroupItemHeading, ListGroupItemText } from 'reactstrap';\r\nimport { IAriServiceAssemblyPartProductCombinations } from '../model-viewer';\r\nimport { ProductSearchResult } from '@msdyn365-commerce/retail-proxy';\r\nimport { CommercePropertyValueEnum } from '../../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\nimport getExtensionPropertyValueByKey from '../../../utils/getExtensionPropertyValueByKey';\r\n\r\ninterface IAriPArtsListTableProps {\r\n parts: IAriServiceAssemblyPartProductCombinations[];\r\n tableHeadings: string[];\r\n baseClassName: String;\r\n goToId(id: string): void;\r\n addPartToCart(part: ProductSearchResult, partId: string): void;\r\n partIdPrefix: string;\r\n selectedRow: string | undefined;\r\n isAuthenticated: boolean;\r\n requiresAuthentication: boolean;\r\n loginToViewPricingText: string;\r\n unavailableText: string;\r\n addToCartText: string;\r\n signInUrl: string;\r\n isMobile: boolean;\r\n isDrawerOpen: boolean;\r\n closePartDrawer(): void;\r\n priceFormatter: (price: string | number, currencyCode?: string | undefined) => string;\r\n mfrCode: string;\r\n}\r\n\r\n/**\r\n * Component to display a list of parts\r\n * @param props props\r\n */\r\nexport const AriPartsListTableComponent: React.FC<IAriPArtsListTableProps> = props => {\r\n const {\r\n tableHeadings,\r\n parts,\r\n baseClassName,\r\n goToId,\r\n addPartToCart,\r\n partIdPrefix,\r\n selectedRow,\r\n isAuthenticated,\r\n requiresAuthentication,\r\n loginToViewPricingText,\r\n signInUrl,\r\n isMobile,\r\n isDrawerOpen,\r\n unavailableText,\r\n addToCartText,\r\n closePartDrawer,\r\n priceFormatter\r\n } = props;\r\n\r\n const [yPosition, setYPosition] = React.useState(0);\r\n React.useEffect(() => {\r\n //Scroll event handling\r\n window.removeEventListener('scroll', () => setYPosition(window.pageYOffset));\r\n window.addEventListener('scroll', () => setYPosition(window.pageYOffset), { passive: true });\r\n window.removeEventListener('scroll', () => setYPosition(window.pageYOffset));\r\n return;\r\n });\r\n\r\n const scrollDownClickHandler = (id: string) => {\r\n const element = document.getElementById(id);\r\n return window.scrollTo(0, element ? element.getBoundingClientRect().top : 0);\r\n };\r\n const selectedPartIdName = `${baseClassName}__part-selection-popover`;\r\n\r\n return (\r\n <>\r\n <div className={`${baseClassName}__list`}>\r\n {!isMobile ? (\r\n <Table className={'list-view__table'}>\r\n <thead>\r\n <tr>\r\n {tableHeadings.map(th => (\r\n <th key={th}>{th}</th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody>\r\n {parts &&\r\n parts.map(part => {\r\n const product = part.Product;\r\n const partId = product && product.ItemId;\r\n if (product?.ItemId === 'HOM538938002') {\r\n debugger;\r\n }\r\n const description = (product && product.Name) || part.Description;\r\n // TODO: Don't use hardcoded key\r\n const currentInvString =\r\n product &&\r\n getExtensionPropertyValueByKey(\r\n product.ExtensionProperties,\r\n 'inventory',\r\n CommercePropertyValueEnum.string\r\n );\r\n let currentInventory = parseInt(currentInvString as string, 10);\r\n if (isNaN(currentInventory)) {\r\n currentInventory = 0;\r\n }\r\n const oosUpperBound = part.Product?.oosUpperBoundLimit || 0;\r\n const canAddToCart = part.Product && currentInventory > oosUpperBound && part.Product?.isEligible;\r\n return (\r\n <tr\r\n key={part.PartId}\r\n data-part={JSON.stringify(part)}\r\n id={`${partIdPrefix}${part.Tag!}`}\r\n className={classnames(\r\n (selectedRow && selectedRow === part.Tag && `${baseClassName}__selected-row`) || '',\r\n `${baseClassName}__parts-row`\r\n )}\r\n >\r\n <td>\r\n <button className={`${baseClassName}__ref-btn`} onClick={() => goToId(part.Tag!)}>\r\n {part.Tag}\r\n </button>\r\n </td>\r\n <td>{partId || 'N/A'}</td>\r\n <td>{description}</td>\r\n {isAuthenticated || !requiresAuthentication ? (\r\n <React.Fragment>\r\n <td>{currentInventory}</td>\r\n <td>{priceFormatter(part.Product?.BasePrice || 0)}</td>\r\n <td>{priceFormatter(part.Product?.Price || 0)}</td>\r\n {canAddToCart ? (\r\n <>\r\n <td>\r\n <input\r\n className='quantity-input'\r\n defaultValue='1'\r\n type='number'\r\n disabled={!part.Product}\r\n min={1}\r\n id={part.PartId}\r\n />\r\n </td>\r\n <td>\r\n {' '}\r\n <button\r\n className={`${baseClassName}__ref-btn add-to-cart-btn`}\r\n onClick={() => addPartToCart(part.Product!, part.PartId!)}\r\n >\r\n {addToCartText}\r\n </button>\r\n <p className={`hide-status hide-status-${part.PartId}`}></p>\r\n </td>\r\n </>\r\n ) : (\r\n <td colSpan={2}>\r\n <button className={`${baseClassName}__ref-btn disabled`} disabled={true}>\r\n {unavailableText}\r\n </button>{' '}\r\n </td>\r\n )}\r\n </React.Fragment>\r\n ) : (\r\n <React.Fragment>\r\n <td>{currentInventory}</td>\r\n <td>{priceFormatter(part.Product?.BasePrice || 0)}</td>\r\n <td colSpan={3}>\r\n <a href={signInUrl}>{loginToViewPricingText}</a>\r\n </td>\r\n </React.Fragment>\r\n )}\r\n </tr>\r\n );\r\n })}\r\n </tbody>\r\n </Table>\r\n ) : (\r\n <ListGroup className='ari-model-viewer__parts-list'>\r\n {parts &&\r\n parts.map(part => {\r\n const product = part.Product;\r\n const partId = product && product.ItemId;\r\n if (product?.ItemId === 'HOM538938002') {\r\n debugger;\r\n }\r\n const description = (product && product.Name) || part.Description;\r\n const currentInvString =\r\n product &&\r\n getExtensionPropertyValueByKey(\r\n product.ExtensionProperties,\r\n 'inventory',\r\n CommercePropertyValueEnum.string\r\n );\r\n let currentInventory = parseInt(currentInvString as string, 10);\r\n if (isNaN(currentInventory)) {\r\n currentInventory = 0;\r\n }\r\n const oosUpperBound = part.Product?.oosUpperBoundLimit || 0;\r\n const canAddToCart = part.Product && currentInventory > oosUpperBound && part.Product?.isEligible;\r\n return (\r\n <ListGroupItem key={part.PartId} active>\r\n <ListGroupItemHeading className='ari-model-viewer__parts-list-heading'>\r\n <span className='ari-model-viewer__parts-list-heading--part-id'>\r\n {`${tableHeadings[0]}: `}\r\n {part.Tag}\r\n </span>\r\n <span className='ari-model-viewer__parts-list-heading--part-number'>\r\n {`${tableHeadings[1]}: `}\r\n {`${partId}`}\r\n </span>\r\n </ListGroupItemHeading>\r\n <ListGroupItemText>\r\n <span className='ari-model-viewer__parts-list-part-desc'>\r\n {`${tableHeadings[2]}: ${description}`}\r\n </span>\r\n </ListGroupItemText>\r\n <ListGroupItemText>\r\n {isAuthenticated || !requiresAuthentication ? (\r\n <div className='ari-model-viewer__parts-list-item-details'>\r\n <span className='ari-model-viewer__parts-list-item-details--part-price'>{`${\r\n tableHeadings[4]\r\n }: ${priceFormatter(part.Product?.Price || 0)}`}</span>\r\n <span className='ari-model-viewer__parts-list-item-details--part-qty'>{`${tableHeadings[3]}: ${currentInventory}`}</span>\r\n </div>\r\n ) : (\r\n <a href={signInUrl}>{loginToViewPricingText}</a>\r\n )}\r\n </ListGroupItemText>\r\n <ListGroupItemText>\r\n {isAuthenticated || !requiresAuthentication ? (\r\n <div className='quantity-btns'>\r\n {canAddToCart ? (\r\n <div>\r\n <input\r\n className='quantity-input'\r\n defaultValue='1'\r\n type='number'\r\n disabled={!part.Product}\r\n min={1}\r\n id={part.PartId}\r\n />\r\n\r\n <button\r\n className={`${baseClassName}__ref-btn addtocart`}\r\n onClick={() => addPartToCart(part.Product!, part.PartId!)}\r\n >\r\n {addToCartText}\r\n </button>\r\n <p className={`hide-status-${part.PartId}`}></p>\r\n </div>\r\n ) : (\r\n <button className={`${baseClassName}__ref-btn addtocart disabled`} disabled={true}>\r\n {unavailableText}\r\n </button>\r\n )}\r\n </div>\r\n ) : (\r\n ''\r\n )}\r\n </ListGroupItemText>\r\n </ListGroupItem>\r\n );\r\n })}\r\n </ListGroup>\r\n )}\r\n {yPosition <= 0 && (\r\n <div className='scroll-down-chevron' onClick={e => scrollDownClickHandler(`${baseClassName}__list`)}>\r\n scroll down\r\n </div>\r\n )}\r\n </div>\r\n <div\r\n id={`${selectedPartIdName}`}\r\n className={`${selectedPartIdName} ${isDrawerOpen ? `${selectedPartIdName}--opened` : `${selectedPartIdName}--closed`}`}\r\n >\r\n <div className={`${selectedPartIdName}-table-wrapper`}>\r\n <Table className={`${selectedPartIdName}-table`}>\r\n <thead>\r\n <tr>\r\n {tableHeadings.map(th => (\r\n <th key={th}>{th}</th>\r\n ))}\r\n </tr>\r\n </thead>\r\n <tbody id={`${selectedPartIdName}-table--body`}></tbody>\r\n </Table>\r\n <div className={`${selectedPartIdName}-close-drawer`} onClick={closePartDrawer}>\r\n X\r\n </div>\r\n </div>\r\n </div>\r\n </>\r\n );\r\n};\r\n","import React from 'react';\r\nimport { IAriServiceModelAssemblySearch } from '../../../actions/DataServiceEntities.g';\r\n\r\ninterface IAssemblyDropdownComponent {\r\n baseClassName: string;\r\n assemblyData: IAriServiceModelAssemblySearch[];\r\n onAssemblySelect(id: number): void;\r\n defaultOptionString: string;\r\n}\r\n\r\nexport const AssemblyDropdownComponent: React.FC<IAssemblyDropdownComponent> = ({\r\n baseClassName,\r\n assemblyData,\r\n onAssemblySelect,\r\n defaultOptionString\r\n}) => {\r\n const handleAssemblySelect = (e: React.ChangeEvent<HTMLSelectElement>) => {\r\n const id = e.target.value;\r\n onAssemblySelect(parseInt(id, 10));\r\n };\r\n if (!assemblyData) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className={`${baseClassName}__dropdown`}>\r\n <select className={`${baseClassName}__dropdown-select`} onChange={handleAssemblySelect}>\r\n <option value={'0'}>{defaultOptionString}</option>\r\n {assemblyData.map(assembly => (\r\n <option key={assembly.Id} value={assembly.Id}>\r\n {assembly.Name}\r\n </option>\r\n ))}\r\n </select>\r\n </div>\r\n );\r\n};\r\n","import React from 'react';\r\nimport { IAriServiceHotSpot, IAriServiceAssemblyInformation } from '../../../actions/DataServiceEntities.g';\r\nimport { ReactZoomPanPinchRef, TransformComponent, TransformWrapper } from 'react-zoom-pan-pinch';\r\n\r\n/**\r\n * Resource strings from definition file\r\n */\r\ninterface IAriHotspotImageResources {\r\n centerButtonText: string;\r\n resetButtonText: string;\r\n zoomInButtonText: string;\r\n zoomOutButtonText: string;\r\n hotspotUsageHelpText: string;\r\n assemblyOptionsPlaceholderText: string;\r\n}\r\n\r\n/**\r\n * Component props\r\n */\r\ninterface IAriHotspotImageProps {\r\n renderHeader(renderToolButtonRow: JSX.Element | null): JSX.Element;\r\n assemblyDetailState: IAriServiceAssemblyInformation | undefined;\r\n resources: IAriHotspotImageResources;\r\n baseClassName: string;\r\n ImageUrl?: string;\r\n HotSpots?: IAriServiceHotSpot[];\r\n Name?: string;\r\n transformRef: React.Ref<ReactZoomPanPinchRef>;\r\n goToPart(id: string, selectedPartIdName: string): void;\r\n tagIdPrefix: string;\r\n isMobile: boolean;\r\n}\r\n\r\n/**\r\n * Component to render the image with hotspots\r\n * @param props component props\r\n */\r\nexport const AriHotspotImage: React.FC<IAriHotspotImageProps> = props => {\r\n const {\r\n baseClassName,\r\n // ImageUrl,\r\n // HotSpots,\r\n // Name,\r\n transformRef,\r\n resources: {\r\n centerButtonText,\r\n zoomInButtonText,\r\n zoomOutButtonText,\r\n resetButtonText,\r\n hotspotUsageHelpText,\r\n assemblyOptionsPlaceholderText\r\n },\r\n goToPart,\r\n tagIdPrefix,\r\n isMobile,\r\n renderHeader,\r\n assemblyDetailState\r\n } = props;\r\n\r\n const [mapUsed, setMapUsed] = React.useState<boolean>(false);\r\n const [shouldRender, setShouldRender] = React.useState<boolean>(true);\r\n\r\n React.useEffect(() => {\r\n // console.log(`In timeout: ${shouldRender}`);\r\n setShouldRender(false);\r\n setTimeout(() => {\r\n setShouldRender(true);\r\n }, 50);\r\n }, [assemblyDetailState]);\r\n\r\n /**\r\n * Generates the style required for the hotspot\r\n * @param hs hotspot\r\n */\r\n const generateHotspotStyle = (hs: IAriServiceHotSpot): React.CSSProperties => {\r\n const cssProperties: React.CSSProperties = {};\r\n if (!hs.TopLeft?.X || !hs.TopLeft.Y) {\r\n return {};\r\n }\r\n cssProperties.left = `${hs.TopLeft.X}px`;\r\n cssProperties.top = `${hs.TopLeft.Y}px`;\r\n if (hs.BottomRight?.X && hs.BottomRight.Y) {\r\n cssProperties.height = `${parseInt(hs.BottomRight.X, 10) - parseInt(hs.TopLeft.X, 10) + 10}px`;\r\n cssProperties.width = `${parseInt(hs.BottomRight.Y, 10) - parseInt(hs.TopLeft.Y, 10) + 10}px`;\r\n }\r\n return cssProperties;\r\n };\r\n\r\n const renderToolButtonRow = (\r\n baseClassName: string,\r\n zoomIn: () => void,\r\n zoomOut: () => void,\r\n resetTransform: () => void,\r\n centerView: () => void,\r\n centerButtonText: string,\r\n zoomInButtonText: string,\r\n zoomOutButtonText: string,\r\n resetButtonText: string\r\n ) => {\r\n return (\r\n <div className={`${baseClassName}__tools ${isMobileToolsClassName}`}>\r\n <button className={`${baseClassName}__tools-button ${baseClassName}__tool-button--zoom-in`} onClick={() => zoomIn()}>\r\n {zoomInButtonText}\r\n </button>\r\n <button className={`${baseClassName}__tools-button ${baseClassName}__tool-button--zoom-out`} onClick={() => zoomOut()}>\r\n {zoomOutButtonText}\r\n </button>\r\n <button className={`${baseClassName}__tools-button ${baseClassName}__tool-button--reset`} onClick={() => resetTransform()}>\r\n {resetButtonText}\r\n </button>\r\n <button className={`${baseClassName}__tools-button ${baseClassName}__tool-button--center`} onClick={() => centerView()}>\r\n {centerButtonText}\r\n </button>\r\n </div>\r\n );\r\n };\r\n\r\n const handleHelperWrapperClick = () => setMapUsed(true);\r\n const initialScale = isMobile ? 0.4 : 0.6;\r\n const initialPositionX = isMobile ? 0 : 150;\r\n const isMobileToolsClassName = isMobile ? `${baseClassName}__tools--mobile` : '';\r\n const isMobileTransformWrapperClassName = isMobile ? `${baseClassName}__transform-wrapper--mobile` : '';\r\n const selectedPartIdName = `${baseClassName}__part-selection-popover`;\r\n return (\r\n <TransformWrapper\r\n initialPositionX={initialPositionX}\r\n initialScale={initialScale}\r\n limitToBounds={true}\r\n ref={transformRef}\r\n minScale={0}\r\n wheel={{ wheelDisabled: true }}\r\n >\r\n {({ zoomIn, zoomOut, resetTransform, centerView, ...rest }) => (\r\n <React.Fragment>\r\n {assemblyDetailState && shouldRender ? (\r\n <>\r\n {renderHeader(\r\n renderToolButtonRow(\r\n baseClassName,\r\n zoomIn,\r\n zoomOut,\r\n resetTransform,\r\n centerView,\r\n centerButtonText,\r\n zoomInButtonText,\r\n zoomOutButtonText,\r\n resetButtonText\r\n )\r\n )}\r\n <TransformComponent wrapperClass={`${baseClassName}__transform-wrapper ${isMobileTransformWrapperClassName}`}>\r\n <div className={`${baseClassName}__zoom-wrapper`}>\r\n {!mapUsed ? (\r\n <div className={`${baseClassName}__help-text-wrapper`} onClick={handleHelperWrapperClick}>\r\n <span className={`${baseClassName}__help-text`}>{hotspotUsageHelpText}</span>\r\n </div>\r\n ) : null}\r\n <img src={assemblyDetailState.ImageUrl} alt={assemblyDetailState.Name} />\r\n <div className={`${baseClassName}__zoom-wrapper--hotspots`}>\r\n {!isMobile &&\r\n assemblyDetailState.HotSpots &&\r\n assemblyDetailState.HotSpots.map(hs => (\r\n <span\r\n key={`${assemblyDetailState?.AssemblyId}-${hs.Tag}`}\r\n style={generateHotspotStyle(hs)}\r\n className={`${baseClassName}__hotspot`}\r\n onClick={() => goToPart(hs.Tag!, selectedPartIdName)}\r\n id={`${tagIdPrefix}${hs.Tag}`}\r\n />\r\n ))}\r\n </div>\r\n </div>\r\n </TransformComponent>\r\n </>\r\n ) : (\r\n <>\r\n {renderHeader(null)}\r\n <TransformComponent wrapperClass={`${baseClassName}__image-placeholder`}>\r\n <div />\r\n </TransformComponent>\r\n <div className={`${baseClassName}__image-placeholder`}>\r\n <span>{assemblyOptionsPlaceholderText}</span>\r\n </div>\r\n </>\r\n )}\r\n </React.Fragment>\r\n )}\r\n </TransformWrapper>\r\n );\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport * as React from 'react';\r\nimport { computed, observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nimport { IModelViewerData } from './model-viewer.data';\r\nimport { IModelViewerProps } from './model-viewer.props.autogenerated';\r\nimport { getAriAssemblyDetailsAsync, getManufacturerBrandNameAsync } from '../../actions/DataActionExtension.g';\r\nimport { IAriServiceAssemblyInformation, IAriServiceAssemblyPart } from '../../actions/DataServiceEntities.g';\r\nimport { ReactZoomPanPinchRef } from 'react-zoom-pan-pinch';\r\nimport { AssemblyDropdownComponent } from './components/assemblyDropdown.component';\r\nimport { AriHotspotImage } from './components/AriHotspotImage.component';\r\nimport { AriPartsListTableComponent } from './components/AriPartsListTable.component';\r\nimport { ProductSearchResult, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\r\nimport * as _ from 'lodash';\r\nimport getPartStateAction, { GetPartStateInput, IProductSearchResultWithState } from '../../actions/get-part-state.action';\r\nimport getExtensionPropertyValueByKey from '../../utils/getExtensionPropertyValueByKey';\r\nimport { CommercePropertyValueEnum } from '../../modules/allowable-freight/utils/CommercePropertyValueEnum';\r\n\r\n/**\r\n * Props for the view component\r\n */\r\nexport interface IModelViewerViewProps extends IModelViewerProps<IModelViewerData> {\r\n assemblyList: React.ReactNode;\r\n hotspotImage: React.ReactNode | null;\r\n partsList: React.ReactNode | null;\r\n baseClassName: string;\r\n heading: React.ReactNode | null;\r\n isMobile: boolean;\r\n}\r\n\r\nexport interface IAriServiceAssemblyPartProductCombinations extends IAriServiceAssemblyPart {\r\n Product?: IProductSearchResultWithState;\r\n}\r\n\r\ntype GridSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/**\r\n * State for the component\r\n */\r\ninterface IModelViewerState {\r\n assemblyDetail: IAriServiceAssemblyInformation | undefined;\r\n isPartResponseError: boolean;\r\n selectedRow: string | undefined;\r\n isDrawerOpen: boolean;\r\n ariBrandName: string;\r\n manufacturerCode: string;\r\n gotProductData: boolean;\r\n}\r\n\r\nexport interface RowFeedback {\r\n message: string;\r\n success: boolean;\r\n}\r\n\r\nexport enum SupersessionKey {\r\n SupersededId = 'superseded-from-id',\r\n SupersededName = 'superseded-from-name',\r\n Inventory = 'inventory'\r\n}\r\n\r\n/**\r\n *\r\n * ModelViewer component\r\n * @extends {React.PureComponent<IModelViewerProps<IModelViewerData>>}\r\n */\r\n@observer\r\nclass ModelViewer extends React.PureComponent<IModelViewerProps<IModelViewerData>, IModelViewerState> {\r\n /**\r\n * Base class name for the elements on the page\r\n * @private\r\n */\r\n private _baseClassName = 'ari-model-viewer';\r\n /**\r\n * React Ref pointing to the transition component\r\n * @private\r\n */\r\n private _transformRef = React.createRef<ReactZoomPanPinchRef>();\r\n /**\r\n * Id prefix for the part\r\n * @private\r\n */\r\n private _partIdPrefix = 'part__';\r\n /**\r\n * Id prefix for the tag\r\n * @private\r\n */\r\n private _tagIdPrefix = 'ref__';\r\n\r\n @observable\r\n private _viewport: GridSize;\r\n\r\n constructor(props: IModelViewerProps<IModelViewerData>) {\r\n super(props);\r\n\r\n this._viewport =\r\n props.context.request && props.context.request.device && props.context.request.device.Type === 'Mobile' ? 'xs' : 'lg';\r\n\r\n this.state = {\r\n assemblyDetail: undefined,\r\n isPartResponseError: false,\r\n selectedRow: undefined,\r\n isDrawerOpen: false,\r\n ariBrandName: '',\r\n manufacturerCode: '',\r\n gotProductData: false\r\n };\r\n\r\n this._updateViewport = this._updateViewport.bind(this);\r\n this.getAssemblyDetails = this.getAssemblyDetails.bind(this);\r\n this.goToId = this.goToId.bind(this);\r\n this.goToPart = this.goToPart.bind(this);\r\n this.closePartDrawer = this.closePartDrawer.bind(this);\r\n this.renderAssemblyHeader = this.renderAssemblyHeader.bind(this);\r\n this.addPartToCart = this.addPartToCart.bind(this);\r\n }\r\n\r\n @computed get isMobile(): boolean {\r\n // return this._viewport === 'xs' || this._viewport === 'sm';\r\n return this._viewport === 'xs';\r\n }\r\n\r\n public componentDidMount(): void {\r\n const {\r\n context: {\r\n request: { query }\r\n }\r\n } = this.props;\r\n if (MsDyn365.isBrowser) {\r\n window.addEventListener('resize', this._updateViewport);\r\n this._updateViewport();\r\n }\r\n void this._getManufacturerCodeName(query!.brandCode);\r\n }\r\n\r\n public componentWillUnmount(): void {\r\n if (MsDyn365.isBrowser) {\r\n window.removeEventListener('resize', this._updateViewport);\r\n }\r\n }\r\n\r\n /**\r\n * Renders the assembly header\r\n * @private\r\n */\r\n private renderAssemblyHeader(renderToolButtonRow: JSX.Element | null) {\r\n const {\r\n data: {\r\n assemblyList: { result }\r\n },\r\n resources: { defaultAssemblyOption, selectedOptionPrefix }\r\n } = this.props;\r\n const { assemblyDetail } = this.state;\r\n const isMobileClassName = this.isMobile ? `${this._baseClassName}__header--mobile` : '';\r\n if (!result) {\r\n return <div />;\r\n } else {\r\n return (\r\n <div className={`${this._baseClassName}__header ${isMobileClassName}`}>\r\n {assemblyDetail ? (\r\n <div className={`${this._baseClassName}__header--title`}>\r\n <h3>\r\n {selectedOptionPrefix} {assemblyDetail?.Name}\r\n </h3>\r\n </div>\r\n ) : null}\r\n <div className={`${this._baseClassName}__header--details`}>\r\n <AssemblyDropdownComponent\r\n baseClassName={this._baseClassName}\r\n assemblyData={result.ariAssemblyData}\r\n onAssemblySelect={this.getAssemblyDetails}\r\n defaultOptionString={defaultAssemblyOption}\r\n />\r\n {renderToolButtonRow}\r\n </div>\r\n </div>\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Renders the page title\r\n * @private\r\n */\r\n private renderTitle() {\r\n const {\r\n data: {\r\n assemblyList: { result }\r\n }\r\n } = this.props;\r\n if (result && result.ariAssemblyData?.length) {\r\n const firstAssembly = result.ariAssemblyData[0];\r\n return (\r\n <div className={`${this._baseClassName}-title-wrapper`}>\r\n <h1 className={`${this._baseClassName}-title-wrapper__title`}>{`${\r\n this.state.ariBrandName ? `${this.state.ariBrandName} - ` : ''\r\n }${firstAssembly.ParentName}`}</h1>\r\n </div>\r\n );\r\n }\r\n return null;\r\n }\r\n\r\n private async _getManufacturerCodeName(brandCode: string): Promise<void> {\r\n const codesResults = this.props.data.manufacturerCodes.result ? this.props.data.manufacturerCodes.result : [];\r\n\r\n if (codesResults.length === 0) {\r\n return;\r\n }\r\n try {\r\n const response = await getManufacturerBrandNameAsync({ callerContext: this.props.context.actionContext }, brandCode);\r\n this.setState({ ariBrandName: response[0].Description || '', manufacturerCode: response[0].ManufacturerCode || '' });\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n }\r\n\r\n /**\r\n * Gets assembly details from the data service\r\n * @param assemblyId Assembly Id to get details for\r\n * @private\r\n */\r\n private async getAssemblyDetails(assemblyId: number) {\r\n if (assemblyId === 0) {\r\n return;\r\n }\r\n const {\r\n context: {\r\n request: {\r\n // @ts-ignore\r\n query: { brandCode, modelId }\r\n }\r\n }\r\n } = this.props;\r\n try {\r\n const response = await getAriAssemblyDetailsAsync(\r\n { callerContext: this.props.context.actionContext },\r\n brandCode,\r\n parseInt(modelId, 10),\r\n assemblyId\r\n );\r\n\r\n this.setState(\r\n {\r\n assemblyDetail: response\r\n },\r\n () => this.loadProductMappings()\r\n );\r\n } catch (err) {\r\n this.setState({ isPartResponseError: true });\r\n }\r\n }\r\n\r\n private async loadProductMappings() {\r\n const mfrCode = this.state.manufacturerCode;\r\n const baseParts = this.state.assemblyDetail?.Parts;\r\n\r\n if (!baseParts) {\r\n return;\r\n }\r\n\r\n const mfrCodes: string[] = [];\r\n\r\n if (mfrCode === 'HRT' || mfrCode === 'TTI' || mfrCode === 'HOM') {\r\n mfrCodes.push(...['HOM', 'HRT', 'TTI'].filter(c => c !== mfrCode));\r\n }\r\n mfrCodes.unshift(mfrCode);\r\n const partIds: string[] = baseParts.flatMap(p => {\r\n return mfrCodes.map(m => {\r\n return `${m}${p.Sku}`;\r\n });\r\n });\r\n\r\n if (partIds && Array.isArray(partIds)) {\r\n const promises = await this.getProducts(partIds);\r\n const response = _.flatten(promises);\r\n const partproducts: IAriServiceAssemblyPartProductCombinations[] = [];\r\n const parts = baseParts?.slice() as IAriServiceAssemblyPartProductCombinations[];\r\n\r\n parts?.forEach(part => {\r\n const codes = mfrCodes.map(m => `${m}${part.Sku || ''}`);\r\n const responseProduct = response.find(p => {\r\n const supersededIdRes = getExtensionPropertyValueByKey(\r\n p.ExtensionProperties,\r\n SupersessionKey.SupersededId,\r\n CommercePropertyValueEnum.string\r\n );\r\n const supersededId = typeof supersededIdRes === 'string' ? supersededIdRes : undefined;\r\n const foundCode = codes.find(c => p.ItemId === c || (supersededId && supersededId === c));\r\n return foundCode ? p : null;\r\n // return p.ItemId === code || (supersededId && supersededId === code);\r\n });\r\n partproducts.push({ ...part, Product: responseProduct });\r\n });\r\n\r\n const stateAssemblyCopy = this.state.assemblyDetail;\r\n\r\n if (stateAssemblyCopy) {\r\n stateAssemblyCopy.Parts = partproducts;\r\n\r\n this.setState({\r\n assemblyDetail: stateAssemblyCopy,\r\n gotProductData: true\r\n });\r\n }\r\n }\r\n }\r\n\r\n private async getProducts(partIds: string[]): Promise<IProductSearchResultWithState[]> {\r\n const cart = await this.props.data.cart;\r\n const cartId = cart.cart.Id;\r\n const addressId = cart.cart.ShippingAddress?.RecordId || 0;\r\n const input = new GetPartStateInput(partIds, addressId, cartId, this.props.context.request.channel!.RecordId);\r\n const partresponse = await getPartStateAction(input, this.props.context.actionContext);\r\n\r\n // needed to get list of products excluded from criteriaResponse data action in getPartStateAction\r\n const missingProducts = [];\r\n if (this.state.assemblyDetail?.Parts) {\r\n for (let i = 0; i < this.state.assemblyDetail?.Parts?.length; i++) {\r\n let found = false;\r\n for (let j = 0; j < partresponse.productResults.length; j++) {\r\n // if (partresponse.productResults[j].ItemId === this.state.assemblyDetail?.Parts[i].PartId) {\r\n if (partresponse.productResults[j].ItemId?.substring(3) === this.state.assemblyDetail?.Parts[i].Sku) {\r\n found = true;\r\n break;\r\n }\r\n }\r\n if (!found) {\r\n const tempProduct: IProductSearchResultWithState = {\r\n ItemId: `${this.state.manufacturerCode}${this.state.assemblyDetail?.Parts[i].Sku}`,\r\n Name: this.state.assemblyDetail?.Parts[i].Description,\r\n Description: this.state.assemblyDetail?.Parts[i].Description,\r\n Price: this.state.assemblyDetail?.Parts[i].MSRP,\r\n RecordId: 0\r\n };\r\n missingProducts.push(tempProduct);\r\n }\r\n }\r\n // end get missing list of products\r\n }\r\n return partresponse.productResults.concat(missingProducts);\r\n }\r\n\r\n /**\r\n * Renders the hotspot image\r\n * @private\r\n */\r\n private renderHotspotImage() {\r\n const {\r\n resources: {\r\n assemblyOptionsPlaceholderText,\r\n centerButtonText,\r\n resetButtonText,\r\n zoomInButtonText,\r\n zoomOutButtonText,\r\n hotspotUsageHelpText\r\n }\r\n } = this.props;\r\n const resources = {\r\n centerButtonText,\r\n resetButtonText,\r\n zoomInButtonText,\r\n zoomOutButtonText,\r\n hotspotUsageHelpText,\r\n assemblyOptionsPlaceholderText\r\n };\r\n return (\r\n <AriHotspotImage\r\n renderHeader={this.renderAssemblyHeader}\r\n assemblyDetailState={this.state.assemblyDetail}\r\n resources={resources}\r\n baseClassName={this._baseClassName}\r\n // ImageUrl={ImageUrl}\r\n // HotSpots={HotSpots}\r\n // Name={Name}\r\n transformRef={this._transformRef}\r\n goToPart={this.goToPart}\r\n tagIdPrefix={this._tagIdPrefix}\r\n isMobile={this.isMobile}\r\n />\r\n );\r\n }\r\n\r\n /**\r\n * Renders the parts list\r\n * @private\r\n */\r\n private renderPartsList() {\r\n if (this.state.assemblyDetail === undefined) {\r\n return null;\r\n }\r\n const {\r\n state: {\r\n assemblyDetail: { Parts },\r\n selectedRow,\r\n isDrawerOpen\r\n },\r\n _baseClassName,\r\n goToId,\r\n addPartToCart,\r\n closePartDrawer,\r\n _partIdPrefix\r\n } = this;\r\n\r\n const {\r\n resources: {\r\n refIdColHeading,\r\n partNoColHeading,\r\n descriptionColHeading,\r\n availabilityColHeading,\r\n yourPriceColHeading,\r\n listPriceColHeading,\r\n qtyColHeading,\r\n loginToViewPricingText,\r\n addToCartText,\r\n unavailableText,\r\n orderColHeading\r\n },\r\n context: {\r\n request: {\r\n user: { isAuthenticated, signInUrl }\r\n },\r\n cultureFormatter: { formatCurrency }\r\n }\r\n } = this.props;\r\n const tableHeadings = [\r\n refIdColHeading,\r\n partNoColHeading,\r\n descriptionColHeading,\r\n availabilityColHeading,\r\n listPriceColHeading,\r\n yourPriceColHeading,\r\n qtyColHeading,\r\n orderColHeading\r\n ];\r\n\r\n return this.state.gotProductData ? (\r\n <AriPartsListTableComponent\r\n parts={Parts || []}\r\n tableHeadings={tableHeadings}\r\n baseClassName={_baseClassName}\r\n goToId={goToId}\r\n addPartToCart={addPartToCart}\r\n partIdPrefix={_partIdPrefix}\r\n selectedRow={selectedRow}\r\n requiresAuthentication={this.props.config.onlyShowPriceWhenAuthenticated || false}\r\n isAuthenticated={isAuthenticated}\r\n loginToViewPricingText={loginToViewPricingText}\r\n signInUrl={signInUrl || ''}\r\n isMobile={this.isMobile}\r\n isDrawerOpen={isDrawerOpen}\r\n closePartDrawer={closePartDrawer}\r\n addToCartText={addToCartText}\r\n unavailableText={unavailableText}\r\n priceFormatter={formatCurrency}\r\n mfrCode={this.state.manufacturerCode}\r\n />\r\n ) : (\r\n <></>\r\n );\r\n }\r\n\r\n /**\r\n * Scrolls the page to the hotspot on the image after clicking the ref in the part list, causes the hotspot to flash\r\n * @param id id of the hotspot to go to\r\n * @private\r\n */\r\n private async goToId(id: string) {\r\n if (this._transformRef?.current?.zoomToElement) {\r\n const target = `${this._tagIdPrefix}${id}`;\r\n window.scrollTo({ top: 0, left: 0, behavior: 'smooth' });\r\n await this.waitForScroll();\r\n const elementList = document.querySelectorAll<HTMLSpanElement>(`#${target}`);\r\n this._transformRef.current.zoomToElement(target, elementList.length === 1 ? 2 : 1);\r\n if (elementList.length) {\r\n elementList.forEach(el => {\r\n const classToAdd = `${this._baseClassName}__part-flash`;\r\n el.classList.add(classToAdd);\r\n setTimeout(() => el.classList.remove(classToAdd), 4000);\r\n });\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Scrolls the page to the hotspot on the image after clicking the ref in the part list, causes the hotspot to flash\r\n * @param id id of the hotspot to go to\r\n * @private\r\n */\r\n private async addPartToCart(part: ProductSearchResult, partId: string) {\r\n let cart;\r\n let partQty;\r\n let partEl: HTMLElement | null;\r\n\r\n if (!part || !partId) {\r\n return; // {\"message\":\"Sorry,there was an error retrieving the part.\",\"success\": false};\r\n }\r\n\r\n partEl = document.querySelector(`p.hide-status-${partId}`);\r\n partQty = parseInt((document.getElementById(partId) as HTMLInputElement).value, 10);\r\n cart = await this.props.data.cart;\r\n\r\n if (!cart) {\r\n if (partEl) {\r\n partEl.textContent = this.props.resources.errorRetrievingCart;\r\n partEl.style.display = 'block';\r\n setTimeout(() => {\r\n partEl!.style.display = 'none';\r\n }, 7000);\r\n }\r\n }\r\n\r\n const product: SimpleProduct = {\r\n AdjustedPrice: part.Price,\r\n ProductTypeValue: 0,\r\n BasePrice: part.BasePrice || 0,\r\n Name: part.Name,\r\n Price: part.Price,\r\n ItemId: part.ItemId,\r\n RecordId: part.RecordId,\r\n ExtensionProperties: part.ExtensionProperties\r\n };\r\n\r\n await cart\r\n .addProductToCart({ product, count: partQty, catalogId: 0 })\r\n .then(response => {\r\n if (response.status === 'SUCCESS') {\r\n if (partEl) {\r\n partEl.textContent = this.props.resources.addToCartSuccess;\r\n partEl.style.display = 'block';\r\n\r\n setTimeout(() => {\r\n partEl!.style.display = 'none';\r\n }, 7000);\r\n }\r\n } else {\r\n if (partEl) {\r\n partEl.textContent = this.props.resources.errorAddingtoCart;\r\n partEl.style.display = 'block';\r\n\r\n setTimeout(() => {\r\n partEl!.style.display = 'none';\r\n }, 7000);\r\n }\r\n }\r\n })\r\n .catch(() => {\r\n if (partEl) {\r\n partEl.textContent = this.props.resources.errorAddingtoCart;\r\n partEl.style.display = 'block';\r\n\r\n setTimeout(() => {\r\n partEl!.style.display = 'none';\r\n }, 7000);\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * displays the part associated with the hotspot in a slide up box at the bottom of the screen\r\n * @param id part id\r\n * @private\r\n */\r\n private goToPart(id: string, selectedPartIdName: string) {\r\n this.setState({\r\n selectedRow: id,\r\n isDrawerOpen: true\r\n });\r\n const elementIdName = `${selectedPartIdName}-table--body`;\r\n this.clearPartSelection(elementIdName);\r\n const elementId = `#${this._partIdPrefix}${id}`;\r\n const selectedElements = document.querySelectorAll<HTMLTableRowElement>(elementId);\r\n const destinationElement = document.getElementById(`${elementIdName}`);\r\n\r\n selectedElements.forEach(element => {\r\n const clonedElement = element.cloneNode(true);\r\n if (destinationElement) {\r\n destinationElement.appendChild(clonedElement);\r\n const cartBtn = (clonedElement as HTMLTableRowElement).querySelector('.add-to-cart-btn') as HTMLButtonElement;\r\n const part = JSON.parse(element.dataset.part || '');\r\n cartBtn?.addEventListener('click', () => this.addPartToCart(part.Product, part.PartId));\r\n }\r\n });\r\n }\r\n\r\n private clearPartSelection(elementIdName: string) {\r\n const destinationElement = document.getElementById(elementIdName);\r\n if (destinationElement) {\r\n destinationElement.innerHTML = '';\r\n }\r\n }\r\n private closePartDrawer() {\r\n this.setState({\r\n isDrawerOpen: false\r\n });\r\n }\r\n\r\n /**\r\n * Waits for scrolling to finish and returns a promise when it does.\r\n */\r\n private waitForScroll(): Promise<void> {\r\n let lastChangedFrame = 0;\r\n let lastX = window.scrollX;\r\n let lastY = window.scrollY;\r\n return new Promise<void>(resolve => {\r\n function tick(frames: number) {\r\n if (frames >= 500 || frames - lastChangedFrame > 20) {\r\n resolve();\r\n } else {\r\n if (window.scrollX !== lastX || window.scrollY !== lastY) {\r\n lastChangedFrame = frames;\r\n lastX = window.scrollX;\r\n lastY = window.scrollY;\r\n }\r\n requestAnimationFrame(tick.bind(null, frames + 1));\r\n }\r\n }\r\n tick(0);\r\n });\r\n }\r\n\r\n private _updateViewport(): void {\r\n this._viewport = this._getViewport();\r\n }\r\n\r\n private readonly _getViewport = (): GridSize => {\r\n const { context } = this.props;\r\n\r\n if (MsDyn365.isBrowser && window.innerWidth) {\r\n const gridSettings = context.request.gridSettings;\r\n if (gridSettings) {\r\n if (gridSettings.xs && window.innerWidth <= gridSettings.xs.w) {\r\n return 'xs';\r\n } else if (gridSettings.sm && window.innerWidth <= gridSettings.sm.w) {\r\n return 'sm';\r\n } else if (gridSettings.md && window.innerWidth <= gridSettings.md.w) {\r\n return 'md';\r\n } else if (gridSettings.lg && window.innerWidth <= gridSettings.lg.w) {\r\n return 'lg';\r\n }\r\n return 'xl';\r\n }\r\n }\r\n\r\n return 'xs';\r\n };\r\n\r\n public render(): JSX.Element | null {\r\n const viewProps: IModelViewerViewProps = {\r\n ...this.props,\r\n assemblyList: this.renderAssemblyHeader(null),\r\n hotspotImage: this.renderHotspotImage(),\r\n partsList: this.renderPartsList(),\r\n heading: this.renderTitle(),\r\n baseClassName: this._baseClassName,\r\n isMobile: this.isMobile\r\n };\r\n return this.props.renderView(viewProps);\r\n }\r\n}\r\n\r\nexport default ModelViewer;\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 * as React from 'react';\r\nimport { IModelViewerViewProps } from './model-viewer';\r\n\r\nexport default (props: IModelViewerViewProps) => {\r\n const isMobileClassName = props.isMobile ? `${props.baseClassName}__image-wrapper--mobile` : '';\r\n return (\r\n <div className='row'>\r\n {props.heading}\r\n <div className={`${props.baseClassName}__image-wrapper ${isMobileClassName}`}>{props.hotspotImage}</div>\r\n {props.partsList}\r\n </div>\r\n );\r\n};\r\n","'use strict';\nvar $ = require('../internals/export');\nvar flattenIntoArray = require('../internals/flatten-into-array');\nvar aCallable = require('../internals/a-callable');\nvar toObject = require('../internals/to-object');\nvar lengthOfArrayLike = require('../internals/length-of-array-like');\nvar arraySpeciesCreate = require('../internals/array-species-create');\n\n// `Array.prototype.flatMap` method\n// https://tc39.es/ecma262/#sec-array.prototype.flatmap\n$({ target: 'Array', proto: true }, {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen = lengthOfArrayLike(O);\n var A;\n aCallable(callbackfn);\n A = arraySpeciesCreate(O, 0);\n A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n return A;\n }\n});\n","'use strict';\n// this method was added to unscopables after implementation\n// in popular engines, so it's moved to a separate module\nvar addToUnscopables = require('../internals/add-to-unscopables');\n\n// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables\naddToUnscopables('flatMap');\n"],"names":["AriPartsListTableComponent","props","tableHeadings","parts","baseClassName","goToId","addPartToCart","partIdPrefix","selectedRow","isAuthenticated","requiresAuthentication","loginToViewPricingText","signInUrl","isMobile","isDrawerOpen","unavailableText","addToCartText","closePartDrawer","priceFormatter","yPosition","setYPosition","React","window","removeEventListener","pageYOffset","addEventListener","passive","selectedPartIdName","className","ListGroup","map","part","_part$Product6","_part$Product7","_part$Product8","product","Product","partId","ItemId","description","Name","Description","currentInvString","getExtensionPropertyValueByKey","ExtensionProperties","CommercePropertyValueEnum","string","currentInventory","parseInt","isNaN","oosUpperBound","oosUpperBoundLimit","canAddToCart","isEligible","ListGroupItem","key","PartId","active","ListGroupItemHeading","Tag","ListGroupItemText","Price","href","defaultValue","type","disabled","min","id","onClick","Table","th","_part$Product","_part$Product2","_part$Product3","_part$Product4","_part$Product5","JSON","stringify","classnames","BasePrice","colSpan","e","element","document","getElementById","scrollTo","getBoundingClientRect","top","scrollDownClickHandler","AssemblyDropdownComponent","_ref","assemblyData","onAssemblySelect","defaultOptionString","onChange","target","value","assembly","Id","AriHotspotImage","transformRef","resources","centerButtonText","zoomInButtonText","zoomOutButtonText","resetButtonText","hotspotUsageHelpText","assemblyOptionsPlaceholderText","goToPart","tagIdPrefix","renderHeader","assemblyDetailState","mapUsed","setMapUsed","shouldRender","setShouldRender","setTimeout","generateHotspotStyle","hs","_hs$TopLeft","_hs$BottomRight","cssProperties","TopLeft","X","Y","left","BottomRight","height","width","handleHelperWrapperClick","initialScale","initialPositionX","isMobileToolsClassName","isMobileTransformWrapperClassName","TransformWrapper","limitToBounds","ref","minScale","wheel","wheelDisabled","zoomIn","zoomOut","resetTransform","centerView","_objectWithoutProperties","_excluded","renderToolButtonRow","TransformComponent","wrapperClass","src","ImageUrl","alt","HotSpots","AssemblyId","style","SupersessionKey","ModelViewer","constructor","super","_baseClassName","_transformRef","_partIdPrefix","_tagIdPrefix","_getViewport","context","this","MsDyn365","isBrowser","innerWidth","gridSettings","request","xs","w","sm","md","lg","_viewport","device","Type","state","assemblyDetail","undefined","isPartResponseError","ariBrandName","manufacturerCode","gotProductData","_updateViewport","bind","getAssemblyDetails","renderAssemblyHeader","componentDidMount","query","_getManufacturerCodeName","brandCode","componentWillUnmount","data","assemblyList","result","defaultAssemblyOption","selectedOptionPrefix","isMobileClassName","ariAssemblyData","renderTitle","_result$ariAssemblyDa","length","firstAssembly","ParentName","async","manufacturerCodes","response","getManufacturerBrandNameAsync","callerContext","actionContext","setState","ManufacturerCode","err","console","error","assemblyId","modelId","getAriAssemblyDetailsAsync","loadProductMappings","_this$state$assemblyD","mfrCode","baseParts","Parts","mfrCodes","push","filter","c","unshift","partIds","flatMap","p","m","Sku","Array","isArray","promises","getProducts","_flatten","partproducts","slice","forEach","codes","responseProduct","find","supersededIdRes","SupersededId","supersededId","_objectSpread","stateAssemblyCopy","_cart$cart$ShippingAd","_this$state$assemblyD2","cart","cartId","addressId","ShippingAddress","RecordId","input","GetPartStateInput","channel","partresponse","getPartStateAction","missingProducts","i","_this$state$assemblyD3","found","j","productResults","_partresponse$product","_this$state$assemblyD4","substring","_this$state$assemblyD5","_this$state$assemblyD6","_this$state$assemblyD7","_this$state$assemblyD8","tempProduct","MSRP","concat","renderHotspotImage","renderPartsList","refIdColHeading","partNoColHeading","descriptionColHeading","availabilityColHeading","yourPriceColHeading","listPriceColHeading","qtyColHeading","orderColHeading","user","cultureFormatter","formatCurrency","config","onlyShowPriceWhenAuthenticated","_this$_transformRef","current","zoomToElement","behavior","waitForScroll","elementList","querySelectorAll","el","classToAdd","classList","add","remove","partQty","partEl","querySelector","textContent","errorRetrievingCart","display","AdjustedPrice","ProductTypeValue","addProductToCart","count","catalogId","then","status","addToCartSuccess","errorAddingtoCart","catch","elementIdName","clearPartSelection","elementId","selectedElements","destinationElement","clonedElement","cloneNode","appendChild","cartBtn","parse","dataset","innerHTML","lastChangedFrame","lastX","scrollX","lastY","scrollY","Promise","resolve","tick","frames","requestAnimationFrame","render","viewProps","hotspotImage","partsList","heading","renderView","__decorate","observable","computed","observer","$","flattenIntoArray","aCallable","toObject","lengthOfArrayLike","arraySpeciesCreate","proto","callbackfn","A","O","sourceLen","arguments","addToUnscopables"],"sourceRoot":""}