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AAA,EAAoB,KAMhC,SAAYC,GACRA,EAAA,qCACAA,EAAA,mDACAA,EAAA,qCAHJ,CAAYA,IAAAA,EAA8B","sources":["webpack://Msdyn365.Commerce.Online.Memx/./src/components/product-warranty/product-warranty.props.ts?d0b6","webpack://Msdyn365.Commerce.Online.Memx/./src/components/product-warranty/components/warranty-header.tsx?92f6","webpack://Msdyn365.Commerce.Online.Memx/./src/components/product-warranty/components/warranty-icon.tsx?c827","webpack://Msdyn365.Commerce.Online.Memx/./src/components/product-warranty/components/warranty-options-control.tsx?8149","webpack://Msdyn365.Commerce.Online.Memx/./src/components/product-warranty/product-warranty.tsx?0866","webpack://Msdyn365.Commerce.Online.Memx/./src/utilities/warranty/utils.ts?03a2"],"sourcesContent":["import { IButtonProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IProductWarranties, IWarrantyIcon, IWarrantyOption } from '../../actions/DataServiceEntities.g';\r\nimport { IWarrantyHeaderProps, IWarrantyHeaderResourceData } from './components/warranty-header';\r\nimport { IWarrantyIconProps, IWarrantyIconResourceData } from './components/warranty-icon';\r\nimport { IWarrantyControlResourceData, IWarrantyOptionsControlProps } from './components/warranty-options-control';\r\nimport { ILinkData } from '@msdyn365-commerce/core-internal';\r\n\r\nexport enum WarrantyType {\r\n EW = 'EW',\r\n IPR = 'IPR'\r\n}\r\n\r\nexport enum ProductWarrantyNameDictionary {\r\n EW = 'Extended Warranty',\r\n IPR = 'In-Store Product Replacement',\r\n Service = 'Service'\r\n}\r\n\r\nexport interface IProductWarrantyComponentState {\r\n selectedWarrantyOption: IWarrantyOption | undefined;\r\n isSelectWarrantyDisabled: boolean | undefined;\r\n}\r\n\r\nexport interface IProductWarrantyComponentProps extends React.HTMLAttributes {\r\n productWarranties: IProductWarranties;\r\n selectedWarranty?: IWarrantyOption;\r\n\r\n className?: string;\r\n design?: string;\r\n warrantyIcons?: IWarrantyIcon[];\r\n isSelectWarrantyDisabled?: boolean | undefined;\r\n\r\n productQuantity?: number;\r\n\r\n showHeader?: boolean;\r\n showIcon?: boolean;\r\n showDetailButton?: boolean;\r\n learnMoreLink?: ILinkData;\r\n\r\n onSelectWarrantyOption?(selectedWarrantyOption: IWarrantyOption | undefined): any;\r\n\r\n iprProductWarrantyResources?: Partial;\r\n ewProductWarrantyResources?: Partial;\r\n}\r\n\r\nexport interface IProductWarrantyViewProps {\r\n warrantyType: WarrantyType;\r\n warrantyOptions: IWarrantyOption[];\r\n productWarrantyText: IProductWarrantyResources;\r\n\r\n warrantyHeader: IWarrantyHeaderProps;\r\n warrantyOptionsControl: IWarrantyOptionsControlProps;\r\n warrantyButton: IButtonProps;\r\n warrantyIcon: IWarrantyIconProps;\r\n\r\n className: string;\r\n showHeader: boolean;\r\n showIcon: boolean;\r\n showDetailButton: boolean;\r\n\r\n warrantyDisabledMessage?: string;\r\n}\r\n\r\nexport interface IProductWarrantyViewState {\r\n selectedWarrantyOption: IWarrantyOption | undefined;\r\n}\r\n\r\nexport interface IProductWarrantyResources {\r\n iconResources: IWarrantyIconResourceData;\r\n headerResources: IWarrantyHeaderResourceData;\r\n optionsControlResources: IWarrantyControlResourceData;\r\n textResource: string;\r\n}\r\n","import { Heading, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IWarrantyHeaderProps {\r\n resources: IWarrantyHeaderResourceData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n}\r\n\r\nexport interface IWarrantyHeaderResourceData {\r\n textTitle: string;\r\n textSubtitle: string;\r\n}\r\n\r\n/**\r\n *\r\n * Warranty header component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class WarrantyHeader extends React.PureComponent {\r\n constructor(props: IWarrantyHeaderProps) {\r\n super(props);\r\n }\r\n\r\n public render(): JSX.Element {\r\n return (\r\n
\r\n \r\n {this.props.resources.textSubtitle}\r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default WarrantyHeader;\r\n","import { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nexport interface IWarrantyIconProps {\r\n resources: IWarrantyIconResourceData;\r\n\r\n className?: string;\r\n iconWidth?: number;\r\n iconHeight?: number;\r\n iconDimensionsUnit?: string;\r\n telemetryContent?: ITelemetryContent;\r\n}\r\n\r\nexport interface IWarrantyIconState {\r\n isSrcValid: boolean;\r\n}\r\n\r\nexport interface IWarrantyIconResourceData {\r\n imageAltText: string;\r\n imageSrc: string;\r\n}\r\n\r\n/**\r\n * Warranty Icon component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class WarrantyIcon extends React.PureComponent {\r\n constructor(props: IWarrantyIconProps) {\r\n super(props);\r\n this.state = {\r\n isSrcValid: true\r\n };\r\n }\r\n\r\n protected onError = () => {\r\n if (!this.state.isSrcValid) {\r\n this.setState({\r\n isSrcValid: false\r\n });\r\n }\r\n };\r\n\r\n public render(): JSX.Element {\r\n return (\r\n
\r\n \r\n
\r\n );\r\n }\r\n}\r\n\r\nexport default WarrantyIcon;\r\n","import { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IWarrantyOption } from '../../../actions/DataServiceEntities.g';\r\nimport { getWarrantyOptionByPeriod } from '../../../utilities/warranty/utils';\r\nimport _uniqueId from 'lodash/uniqueId';\r\n\r\nexport interface IWarrantyOptionsControlProps {\r\n warrantyOptions: IWarrantyOption[];\r\n resources: IWarrantyControlResourceData;\r\n className?: string;\r\n telemetryContent?: ITelemetryContent;\r\n design?: string;\r\n selectedWarrantyOption?: IWarrantyOption;\r\n isSelectWarrantyDisabled?: boolean;\r\n\r\n onSelectWarrantyOption?(selectedWarrantyOption: IWarrantyOption | undefined): void;\r\n}\r\n\r\nexport interface IWarrantyOptionsControlState {\r\n selectedWarrantyOption: IWarrantyOption | undefined;\r\n isSelectWarrantyDisabled: boolean | undefined;\r\n}\r\n\r\nexport interface IWarrantyControlResourceData {\r\n textPriceBridge: string;\r\n textNoSelection: string;\r\n}\r\n\r\n/**\r\n *\r\n * Warranty options control component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class WarrantyOptionsControl extends React.PureComponent {\r\n private controlGroupId: string;\r\n\r\n constructor(props: IWarrantyOptionsControlProps) {\r\n super(props);\r\n\r\n this.state = {\r\n selectedWarrantyOption: props.selectedWarrantyOption ?? undefined,\r\n isSelectWarrantyDisabled: false\r\n };\r\n this.controlGroupId = _uniqueId('product-warranty-selection');\r\n this.onChangeValue = this.onChangeValue.bind(this);\r\n }\r\n\r\n /**\r\n * When attached to the radio button set, updates the state of this component to match the user's selection.\r\n *\r\n * @param event - The event triggered by the user selecting an new radio button.\r\n */\r\n private onChangeValue(event: any) {\r\n const selectedWarrantyOptionPeriod = event.target?.value;\r\n const selectedWarrantyOption = getWarrantyOptionByPeriod(this.props.warrantyOptions, selectedWarrantyOptionPeriod);\r\n this.setState({\r\n selectedWarrantyOption: selectedWarrantyOption\r\n });\r\n if (this.props.onSelectWarrantyOption) {\r\n this.props.onSelectWarrantyOption(selectedWarrantyOption);\r\n }\r\n }\r\n\r\n public _updateDisabledState = (state: boolean) => {\r\n this.setState({\r\n isSelectWarrantyDisabled: state\r\n });\r\n };\r\n\r\n private setDefaultWarranty() {\r\n if (!this.state.selectedWarrantyOption) {\r\n const defaultWarrantyOption = this.props.selectedWarrantyOption\r\n ? getWarrantyOptionByPeriod(this.props.warrantyOptions, this.props.selectedWarrantyOption.Period)\r\n : getWarrantyOptionByPeriod(this.props.warrantyOptions, 0);\r\n this.setState({\r\n selectedWarrantyOption: defaultWarrantyOption\r\n });\r\n }\r\n }\r\n\r\n public static getDerivedStateFromProps(props: any, state: any) {\r\n if (props.isSelectWarrantyDisabled !== state.isSelectWarrantyDisabled) {\r\n return {\r\n selectedWarrantyOption: state.selectedWarrantyOption,\r\n isSelectWarrantyDisabled: props.isSelectWarrantyDisabled\r\n };\r\n }\r\n //no change in state\r\n return null;\r\n }\r\n\r\n public render(): JSX.Element {\r\n this.setDefaultWarranty();\r\n switch (this.props.design) {\r\n case 'faithful':\r\n return (\r\n
\r\n {this.props.warrantyOptions.map((warrantyOption: IWarrantyOption) => {\r\n return this._renderRadioButton(warrantyOption);\r\n })}\r\n
\r\n );\r\n case 'button':\r\n return this._renderWarrantyOptionsControlGrouped(this.props);\r\n case 'grouped':\r\n return this._renderWarrantyOptionsControlGrouped(this.props);\r\n default:\r\n return (\r\n
\r\n {this.props.warrantyOptions.map((warrantyOption: IWarrantyOption) => {\r\n return this._renderRadioButton(warrantyOption);\r\n })}\r\n
\r\n );\r\n }\r\n }\r\n\r\n private _renderWarrantyOptionsControlGrouped(props: IWarrantyOptionsControlProps) {\r\n return (\r\n
\r\n {this.props.warrantyOptions.map((warrantyOption: IWarrantyOption) => {\r\n return this._renderRadioButtonGrouped(warrantyOption);\r\n })}\r\n
\r\n );\r\n }\r\n\r\n private _renderRadioButton(warrantyOption: IWarrantyOption) {\r\n if (warrantyOption.Period === 0) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n }\r\n\r\n private _renderRadioButtonGrouped(warrantyOption: IWarrantyOption) {\r\n const termInfo = warrantyOption.TermName?.split('. ') ?? ['', ''];\r\n if (warrantyOption.Period === 0) {\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n );\r\n }\r\n }\r\n}\r\n\r\nexport default WarrantyOptionsControl;\r\n","import * as React from 'react';\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n IProductWarrantyComponentProps,\r\n WarrantyType,\r\n IProductWarrantyViewProps,\r\n IProductWarrantyComponentState,\r\n IProductWarrantyResources,\r\n ProductWarrantyNameDictionary\r\n} from './product-warranty.props';\r\nimport { Button } from 'reactstrap';\r\nimport { IWarrantyHeaderProps, WarrantyHeader } from './components/warranty-header';\r\nimport { IWarrantyIconProps, WarrantyIcon } from './components/warranty-icon';\r\nimport { IWarrantyOptionsControlProps, WarrantyOptionsControl } from './components/warranty-options-control';\r\nimport { IWarrantyGroup, IWarrantyOption } from '../../actions/DataServiceEntities.g';\r\n\r\nexport const DISABLE_WARRANTY_MULTIPLE_QUANTITY_MESSAGE = 'Warranty not selectable when selected quantity is greater than 1';\r\n\r\n/**\r\n * Product warranty component.\r\n * @extends {React.PureComponent}\r\n */\r\nexport class ProductWarrantyComponent extends React.PureComponent {\r\n public props: IProductWarrantyComponentProps;\r\n\r\n constructor(props: IProductWarrantyComponentProps) {\r\n super(props);\r\n this.props = props;\r\n\r\n this.state = {\r\n selectedWarrantyOption: props.selectedWarranty ?? undefined,\r\n isSelectWarrantyDisabled: props.isSelectWarrantyDisabled ?? false\r\n };\r\n\r\n this._updateDisabledState = this._updateDisabledState.bind(this);\r\n }\r\n\r\n public toggleSelectWarrantyDisabled = () => {\r\n this.setState({ isSelectWarrantyDisabled: !this.state.isSelectWarrantyDisabled });\r\n };\r\n\r\n public _updateDisabledState = (state: boolean) => {\r\n this.setState({\r\n isSelectWarrantyDisabled: state\r\n });\r\n };\r\n\r\n public _getPropTextByWarrantyType(warrantyType: WarrantyType): IProductWarrantyResources {\r\n const imageIconSrc = this.props.warrantyIcons?.find(icon => warrantyType.toString() === icon.WarrantyType)?.Image;\r\n\r\n return {\r\n iconResources: {\r\n imageSrc: imageIconSrc ? `data:image/gif;base64,${imageIconSrc}` : '',\r\n imageAltText: warrantyType.toString()\r\n },\r\n headerResources: {\r\n textTitle: `${ProductWarrantyNameDictionary[warrantyType.toString()]} (${warrantyType.toString()})`,\r\n textSubtitle: `Protect your purchase with an ${warrantyType.toString()} plan`\r\n },\r\n optionsControlResources: {\r\n textNoSelection: 'None',\r\n textPriceBridge: '- only'\r\n },\r\n textResource: `Learn more about ${warrantyType.toString()}`\r\n };\r\n }\r\n\r\n public _setSelectedWarrantyOption = (selectedWarrantyOption: IWarrantyOption | undefined) => {\r\n this.setState({\r\n selectedWarrantyOption: selectedWarrantyOption\r\n });\r\n if (this.props.onSelectWarrantyOption) {\r\n this.props.onSelectWarrantyOption(selectedWarrantyOption);\r\n }\r\n };\r\n\r\n public static getDerivedStateFromProps(props: any, state: any) {\r\n if (props.isSelectWarrantyDisabled !== state.isSelectWarrantyDisabled) {\r\n return {\r\n selectedWarrantyOption: state.selectedWarrantyOption,\r\n isSelectWarrantyDisabled: props.isSelectWarrantyDisabled\r\n };\r\n }\r\n //no change in state\r\n return null;\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (this.props.productWarranties) {\r\n const warrantyGroups = this.props.productWarranties.WarrantyGroups;\r\n\r\n if (warrantyGroups && warrantyGroups[0]) {\r\n const usedWarrantyGroup: IWarrantyGroup = warrantyGroups[0];\r\n const warrantyOptions: IWarrantyOption[] = usedWarrantyGroup.WarrantyOptions ?? [];\r\n\r\n if (warrantyOptions) {\r\n var warrantyType: WarrantyType;\r\n\r\n if (usedWarrantyGroup.Type && usedWarrantyGroup.Type.includes(WarrantyType.EW)) {\r\n warrantyType = WarrantyType.EW;\r\n } else if (usedWarrantyGroup.Type && usedWarrantyGroup.Type.includes(WarrantyType.IPR)) {\r\n warrantyType = WarrantyType.IPR;\r\n } else {\r\n return this._renderViewNoWarranties();\r\n }\r\n\r\n const productWarrantyText = this._getPropTextByWarrantyType(warrantyType);\r\n const className = 'mmx-product-warranty';\r\n warrantyOptions.sort((a, b) => a.Period - b.Period);\r\n const productWarrantyViewProps: IProductWarrantyViewProps = {\r\n ...this.props,\r\n productWarrantyText: productWarrantyText,\r\n warrantyType: warrantyType,\r\n warrantyOptions: warrantyOptions,\r\n warrantyOptionsControl: {\r\n design: this.props.design,\r\n warrantyOptions: warrantyOptions,\r\n resources: productWarrantyText.optionsControlResources,\r\n className: `${className}`,\r\n selectedWarrantyOption: this.props.selectedWarranty,\r\n isSelectWarrantyDisabled: this.state.isSelectWarrantyDisabled,\r\n onSelectWarrantyOption: this._setSelectedWarrantyOption\r\n },\r\n warrantyHeader: {\r\n resources: productWarrantyText.headerResources,\r\n className: `${className}__header-title`\r\n },\r\n warrantyButton: {\r\n title: 'Learn More button',\r\n className: `${className}__more-info`,\r\n href: this.props.learnMoreLink?.destinationUrl\r\n },\r\n warrantyIcon: {\r\n resources: productWarrantyText.iconResources,\r\n className: `${className}__stamp`\r\n },\r\n className: className,\r\n showHeader: this.props.showHeader ?? true,\r\n showIcon: this.props.showIcon ?? true,\r\n showDetailButton: this.props.showDetailButton ?? true,\r\n warrantyDisabledMessage:\r\n this.props.productQuantity && this.props.productQuantity > 1\r\n ? DISABLE_WARRANTY_MULTIPLE_QUANTITY_MESSAGE\r\n : undefined\r\n };\r\n\r\n const DEFAULTMOCK = this._getFaithfulView(productWarrantyViewProps);\r\n switch (this.props.design) {\r\n case 'faithful':\r\n return this._getFaithfulView(productWarrantyViewProps);\r\n case 'button':\r\n return this._getButtonView(productWarrantyViewProps);\r\n case 'grouped':\r\n return this._getGroupedButtonView(productWarrantyViewProps);\r\n default:\r\n return DEFAULTMOCK;\r\n }\r\n }\r\n }\r\n }\r\n return this._renderViewNoWarranties();\r\n }\r\n\r\n protected _renderWarrantyIcon = (props: IWarrantyIconProps): JSX.Element => {\r\n return ;\r\n };\r\n\r\n protected _renderWarrantyHeader = (props: IWarrantyHeaderProps): JSX.Element => {\r\n return ;\r\n };\r\n\r\n protected _renderWarrantyOptionsControl = (props: IWarrantyOptionsControlProps): JSX.Element => {\r\n return ;\r\n };\r\n\r\n protected _renderWarrantyButton = (props: any, text: string): JSX.Element => {\r\n return ;\r\n };\r\n\r\n protected _renderWarrantyDisabledMessage = (message: string) => {\r\n return
{message}
;\r\n };\r\n\r\n protected _getFaithfulView(props: IProductWarrantyViewProps): JSX.Element | null {\r\n const nodeFaithfulView = { className: props.className };\r\n const nodeWarrantyContent = { className: `${props.className}__content` };\r\n const nodeWarrantyHeader = { className: `${props.className}__header-block` };\r\n return (\r\n
\r\n \r\n \r\n \r\n {props.showIcon && props.warrantyIcon && this._renderWarrantyIcon(props.warrantyIcon)}\r\n {props.showHeader && props.warrantyHeader && this._renderWarrantyHeader(props.warrantyHeader)}\r\n \r\n {props.warrantyDisabledMessage && this._renderWarrantyDisabledMessage(props.warrantyDisabledMessage)}\r\n {props.warrantyOptionsControl && this._renderWarrantyOptionsControl(props.warrantyOptionsControl)}\r\n {props.showDetailButton &&\r\n props.warrantyButton &&\r\n this._renderWarrantyButton(props.warrantyButton, props.productWarrantyText.textResource)}\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n protected _getButtonView(props: IProductWarrantyViewProps): JSX.Element | null {\r\n const nodeButtonView = { className: `${props.className}__buttons` };\r\n const nodeWarrantyContent = { className: `${props.className}__content` };\r\n const nodeWarrantyHeader = { className: `${props.className}__header-block` };\r\n return (\r\n
\r\n \r\n \r\n \r\n {props.showIcon && props.warrantyIcon && this._renderWarrantyIcon(props.warrantyIcon)}\r\n {props.showHeader && props.warrantyHeader && this._renderWarrantyHeader(props.warrantyHeader)}\r\n \r\n {props.warrantyDisabledMessage && this._renderWarrantyDisabledMessage(props.warrantyDisabledMessage)}\r\n {props.warrantyOptionsControl && this._renderWarrantyOptionsControl(props.warrantyOptionsControl)}\r\n {props.showDetailButton &&\r\n props.warrantyButton &&\r\n this._renderWarrantyButton(props.warrantyButton, props.productWarrantyText.textResource)}\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n protected _getGroupedButtonView(props: IProductWarrantyViewProps): JSX.Element | null {\r\n const nodeGroupedButtonView = { className: `${props.className}__grouped` };\r\n const nodeWarrantyContent = { className: `${props.className}__content` };\r\n const nodeWarrantyHeader = { className: `${props.className}__header-block` };\r\n return (\r\n
\r\n \r\n \r\n \r\n {props.showIcon && props.warrantyIcon && this._renderWarrantyIcon(props.warrantyIcon)}\r\n {props.showHeader && props.warrantyHeader && this._renderWarrantyHeader(props.warrantyHeader)}\r\n \r\n {props.warrantyDisabledMessage && this._renderWarrantyDisabledMessage(props.warrantyDisabledMessage)}\r\n {props.warrantyOptionsControl && this._renderWarrantyOptionsControl(props.warrantyOptionsControl)}\r\n {props.showDetailButton &&\r\n props.warrantyButton &&\r\n this._renderWarrantyButton(props.warrantyButton, props.productWarrantyText.textResource)}\r\n \r\n \r\n
\r\n );\r\n }\r\n\r\n protected _renderViewNoWarranties(): JSX.Element | null {\r\n return <>;\r\n }\r\n}\r\n\r\nexport default ProductWarrantyComponent;\r\n","import { IProductWarranties, IWarrantyOption } from '../../actions/DataServiceEntities.g';\r\nimport { CommerceProperty, CommercePropertyValue } from '@msdyn365-commerce/retail-proxy';\r\n\r\nexport interface IPairedWarrantyLine {\r\n item: T;\r\n warranty: T | undefined;\r\n}\r\n\r\ninterface ILineItem {\r\n data?: any;\r\n}\r\n\r\nexport enum WarrantyLineDataType {\r\n ICartlinesViewProps = 'cartline',\r\n IFlyoutCartLineItemViewProps = 'cartline',\r\n ISalesLine = 'salesLine'\r\n}\r\n\r\nexport enum WarrantyLineCommerceProperties {\r\n isWarrantyLine = 'Memx_IsWarrantyLine',\r\n warrantableLineNumber = 'Memx_WarrantableLineNumber',\r\n warrantyPeriod = 'Memx_WarrantyPeriod'\r\n}\r\n\r\n/**\r\n * Determins if an item line is a warranty line.\r\n * @param itemLines the itemLine to evaluate.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function getIsWarrantyLine(itemLine: T, lineDataType: WarrantyLineDataType): boolean {\r\n return getWarrantyLineProperty(itemLine, lineDataType, WarrantyLineCommerceProperties.isWarrantyLine)?.BooleanValue ?? false;\r\n}\r\n\r\n/**\r\n * Retreives a warranty line property from an item line.\r\n * @param itemLines the itemLine to evaluate.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n * @param commercePropName The name of the commerce property to search for.\r\n */\r\nexport function getWarrantyLineProperty(\r\n itemLine: T,\r\n lineDataType: WarrantyLineDataType,\r\n commercePropName: WarrantyLineCommerceProperties\r\n): CommercePropertyValue {\r\n return itemLine.data[lineDataType].ExtensionProperties?.find((commerceProp: CommerceProperty) => commerceProp.Key === commercePropName)\r\n ?.Value;\r\n}\r\n\r\n/**\r\n * Determines if item line number matches value provided.\r\n * @param value The number to compare to the provided itemLine's line number.\r\n * @param itemLines the itemLine to compare the value to.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function getDoesValueMatchLineNumber(\r\n value: number | undefined,\r\n itemLine: T,\r\n lineDataType: WarrantyLineDataType\r\n) {\r\n return itemLine.data[lineDataType].LineNumber === value;\r\n}\r\n\r\n/**\r\n * Given a set of Line items, returns a list of paired line items,\r\n * where cart line items are paired with their associated warranties.\r\n * @param itemLines the list of itemLines to pair.\r\n * @param lineDataType the data item within the object. This should be the WarrantyLineCommerceProperty where the name matches the value of T.\r\n */\r\nexport function pairWarrantyItemLines(itemLines: T[], lineDataType: WarrantyLineDataType): IPairedWarrantyLine[] {\r\n const pairedItemLines: IPairedWarrantyLine[] = [];\r\n const warrantyItemLines: T[] = [];\r\n\r\n let lastItemLine: T | undefined;\r\n\r\n itemLines.forEach(function(itemLine) {\r\n const isWarranty: boolean = getIsWarrantyLine(itemLine, lineDataType);\r\n if (isWarranty) {\r\n if (\r\n lastItemLine &&\r\n itemLine.data &&\r\n getDoesValueMatchLineNumber(\r\n getWarrantyLineProperty(itemLine, lineDataType, WarrantyLineCommerceProperties.warrantableLineNumber)?.DecimalValue,\r\n itemLine,\r\n lineDataType\r\n )\r\n ) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: itemLine });\r\n lastItemLine = undefined;\r\n } else {\r\n warrantyItemLines.push(itemLine);\r\n }\r\n } else {\r\n if (lastItemLine) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: undefined });\r\n }\r\n lastItemLine = itemLine;\r\n }\r\n });\r\n\r\n if (lastItemLine) {\r\n pairedItemLines.push({ item: lastItemLine, warranty: undefined });\r\n }\r\n\r\n warrantyItemLines.forEach(function(warrantyItemLine) {\r\n if (warrantyItemLine.data) {\r\n const warrantableLineNumber = getWarrantyLineProperty(\r\n warrantyItemLine,\r\n lineDataType,\r\n WarrantyLineCommerceProperties.warrantableLineNumber\r\n );\r\n const warrantableItemLineIndex = pairedItemLines.findIndex(\r\n pairedItemLines =>\r\n pairedItemLines.item.data &&\r\n getDoesValueMatchLineNumber(warrantableLineNumber?.DecimalValue, pairedItemLines.item, lineDataType)\r\n );\r\n if (warrantableItemLineIndex >= 0) {\r\n const pairedItemLine = pairedItemLines[warrantableItemLineIndex];\r\n pairedItemLines[warrantableItemLineIndex] = { item: pairedItemLine.item, warranty: warrantyItemLine };\r\n }\r\n }\r\n });\r\n\r\n return pairedItemLines;\r\n}\r\n\r\n/**\r\n * Searches the provided list of cartlines for the provided item to determine what its\r\n * currently selected warranty is.\r\n * @param recordId Id of the product which\r\n * @param pairedCartLine The warranty in this item/warranty pair contains the list on which the\r\n * selected item is searched.\r\n * @param productWarrantiesForCartline The list of active product warranties in the cart. Most modules that\r\n * concern the cart have this in their data actions.\r\n */\r\nexport function findSelectedWarranty(\r\n recordId: number,\r\n pairedItemLine: IPairedWarrantyLine,\r\n productWarrantiesForItemLine: IProductWarranties | undefined,\r\n lineDataType: WarrantyLineDataType\r\n): IWarrantyOption | undefined {\r\n if (\r\n productWarrantiesForItemLine &&\r\n productWarrantiesForItemLine.WarrantyGroups &&\r\n productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions &&\r\n productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions.length > 0\r\n ) {\r\n let selectedWarranty = productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions.find(\r\n warrantyOption =>\r\n warrantyOption.Period ===\r\n pairedItemLine.warranty?.data[lineDataType].ExtensionProperties?.find(\r\n (commerceProp: CommerceProperty) => commerceProp.Key === WarrantyLineCommerceProperties.warrantyPeriod\r\n )?.Value?.IntegerValue\r\n );\r\n if (selectedWarranty) {\r\n return selectedWarranty;\r\n }\r\n return getEmptyWarrantyOption(recordId ?? 0, productWarrantiesForItemLine?.WarrantyGroups[0].WarrantyOptions);\r\n }\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Returns a full warranty option from the provided list based on the provided term name.\r\n *\r\n * @param warrantyOptions A list of warranty options for a product.\r\n * @param period The duration the warranty is valid for, in string or number format. (note that warranty options have no unique id)\r\n */\r\nexport function getWarrantyOptionByPeriod(warrantyOptions: IWarrantyOption[], period: string | number): IWarrantyOption | undefined {\r\n if (typeof period === 'string') {\r\n period = parseInt(period, 10);\r\n }\r\n if (period === 0) {\r\n return getEmptyWarrantyOption(0, warrantyOptions);\r\n } else {\r\n return getWarrantyOptionsInternal(warrantyOptions, period);\r\n }\r\n}\r\n\r\n/*\r\n * Internal function. Returns a full warranty option from the provided list based on the provided term name.\r\n *\r\n * @param warrantyOptions - A list of warranty options for a product.\r\n * @param period - The duration the warranty is valid for. (note that warranty options have no unique id)\r\n */\r\nfunction getWarrantyOptionsInternal(warrantyOptions: IWarrantyOption[], period: number): IWarrantyOption | undefined {\r\n return warrantyOptions.find(option => {\r\n return option.Period === period;\r\n });\r\n}\r\n\r\n/**\r\n * Returns a warranty with a period of 0. This function can be called without warranty options, but this is not recommended.\r\n *\r\n * @param warrantyOptions A list of warranty options for a product.\r\n * @param period The duration the warranty is valid for, in string or number format. (note that warranty options have no unique id)\r\n * @param warrantyType The associated warrranty type (e.g. EW/IPR).\r\n */\r\nexport function getEmptyWarrantyOption(\r\n warrantableProduct: number,\r\n warrantyOptions?: IWarrantyOption[],\r\n warrantyType?: string\r\n): IWarrantyOption | undefined {\r\n let emptyWarranty: IWarrantyOption | undefined;\r\n if (warrantyOptions) {\r\n emptyWarranty = getWarrantyOptionsInternal(warrantyOptions, 0);\r\n }\r\n if (!emptyWarranty) {\r\n const emptyWarrantyType = warrantyType ?? (warrantyOptions ? warrantyOptions[0].Type : undefined);\r\n emptyWarranty = {\r\n Charge: 0,\r\n Description: 'None',\r\n Period: 0,\r\n Product: 0,\r\n Rate: 0,\r\n RecordId: 1,\r\n TermName: `${emptyWarrantyType} None`,\r\n Type: emptyWarrantyType,\r\n WarrantableProduct: +warrantableProduct,\r\n WarrantableProductPrice: 0\r\n };\r\n }\r\n return emptyWarranty;\r\n}\r\n"],"names":["WarrantyType","ProductWarrantyNameDictionary","WarrantyHeader","React","constructor","props","super","render","_this$props$resources","className","this","Heading","Object","assign","text","resources","textTitle","headingTag","textSubtitle","WarrantyIcon","onError","state","isSrcValid","setState","src","imageSrc","style","display","WarrantyOptionsControl","_props$selectedWarran","_updateDisabledState","isSelectWarrantyDisabled","selectedWarrantyOption","undefined","controlGroupId","_uniqueId","onChangeValue","bind","event","_event$target","selectedWarrantyOptionPeriod","target","value","getWarrantyOptionByPeriod","warrantyOptions","onSelectWarrantyOption","setDefaultWarranty","defaultWarrantyOption","Period","design","onChange","map","warrantyOption","_renderRadioButton","_renderWarrantyOptionsControlGrouped","_renderRadioButtonGrouped","_this$state$isSelectW","_this$state$selectedW","_this$state$isSelectW2","_this$state$isSelectW3","_this$state$selectedW2","_this$state$isSelectW4","key","TermName","type","name","checked","disabled","textNoSelection","textPriceBridge","Charge","_warrantyOption$TermN","_warrantyOption$TermN2","termInfo","split","_this$state$isSelectW5","_this$state$selectedW3","_this$state$isSelectW6","_this$state$isSelectW7","_this$state$selectedW4","_this$state$isSelectW8","valueOf","ProductWarrantyComponent","_props$isSelectWarran","toggleSelectWarrantyDisabled","_setSelectedWarrantyOption","_renderWarrantyIcon","_renderWarrantyHeader","_renderWarrantyOptionsControl","_renderWarrantyButton","Button","_renderWarrantyDisabledMessage","message","selectedWarranty","_getPropTextByWarrantyType","warrantyType","_this$props$warrantyI","imageIconSrc","warrantyIcons","find","icon","toString","Image","iconResources","imageAltText","headerResources","optionsControlResources","textResource","productWarranties","warrantyGroups","WarrantyGroups","_usedWarrantyGroup$Wa","usedWarrantyGroup","WarrantyOptions","_this$props$learnMore","_this$props$showHeade","_this$props$showIcon","_this$props$showDetai","Type","includes","EW","IPR","_renderViewNoWarranties","productWarrantyText","sort","a","b","productWarrantyViewProps","_objectSpread","warrantyOptionsControl","warrantyHeader","warrantyButton","title","href","learnMoreLink","destinationUrl","warrantyIcon","showHeader","showIcon","showDetailButton","warrantyDisabledMessage","productQuantity","DEFAULTMOCK","_getFaithfulView","_getButtonView","_getGroupedButtonView","nodeFaithfulView","nodeWarrantyContent","nodeWarrantyHeader","Node","nodeButtonView","nodeGroupedButtonView","WarrantyLineDataType","WarrantyLineCommerceProperties","getIsWarrantyLine","itemLine","lineDataType","_getWarrantyLinePrope","_getWarrantyLinePrope2","getWarrantyLineProperty","isWarrantyLine","BooleanValue","commercePropName","_itemLine$data$lineDa","data","ExtensionProperties","commerceProp","Key","Value","getDoesValueMatchLineNumber","LineNumber","pairWarrantyItemLines","itemLines","pairedItemLines","warrantyItemLines","lastItemLine","forEach","_getWarrantyLinePrope3","warrantableLineNumber","DecimalValue","push","item","warranty","warrantyItemLine","warrantableItemLineIndex","findIndex","pairedItemLine","findSelectedWarranty","recordId","productWarrantiesForItemLine","length","_pairedItemLine$warra","warrantyPeriod","IntegerValue","getEmptyWarrantyOption","period","parseInt","getWarrantyOptionsInternal","option","warrantableProduct","emptyWarranty","emptyWarrantyType","Description","Product","Rate","RecordId","WarrantableProduct","WarrantableProductPrice"],"sourceRoot":""}