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E,EAqKiB2Z,EAAoB,KAM9BX,GAuDED,IAEa,YAAhBxE,GAA6B2B,GAC3B3W,EAAAA,cAACqa,EAAAA,EAAa,CAACpX,QAAS3B,EAAM2B,QAAS0T,MAAOA,EAAO2D,KAAK,cAW/D1N,IAIX","sources":["webpack://Msdyn365.Commerce.Online/./src/components/switch/switch.tsx?ec26","webpack://Msdyn365.Commerce.Online/./src/components/common/product-list-order-quantity.tsx?cd94","webpack://Msdyn365.Commerce.Online/./src/shared-utils/cart-utils.ts?220b","webpack://Msdyn365.Commerce.Online/./src/themes/vinhuset-adventureworks/views/components/cartlineitem.component.tsx?aeac"],"sourcesContent":["import * as React from 'react';\r\nimport classnames from 'classnames';\r\n\r\ninterface ISwitchProps {\r\n className?: string;\r\n label?: string;\r\n checked?: boolean;\r\n onChange?: (value: boolean) => void;\r\n mini?: boolean;\r\n miniLabel?: string;\r\n}\r\n\r\nconst Switch: React.FC = ({\r\n className,\r\n label,\r\n checked,\r\n onChange,\r\n mini,\r\n miniLabel\r\n}) => {\r\n const [internalChecked, setInternalChecked] = React.useState(Boolean(checked));\r\n\r\n React.useEffect(() => {\r\n setInternalChecked(Boolean(checked));\r\n }, [checked]);\r\n\r\n const onChangeHandler = (event: React.ChangeEvent) => {\r\n setInternalChecked(event.target.checked);\r\n onChange?.(event.target.checked);\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default Switch;\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 { ICoreContext } from '@msdyn365-commerce/core';\r\nimport { SimpleProduct, UnitOfMeasureConversion } from '@msdyn365-commerce/retail-proxy';\r\nimport { reaction, computed, when } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\nimport classnames from 'classnames';\r\nimport { UnitOfMeasure, humanizeUnitOfMeasure } from '../unit-of-measure';\r\nimport Switch from '../switch/switch';\r\nimport { getMinimumDecimals, getMostRelevantConversion, getRoundedFactor } from '../../shared-utils/unit-conversion-utils';\r\n\r\ninterface IQuantityProps {\r\n context: ICoreContext;\r\n locale: string;\r\n product: SimpleProduct | undefined;\r\n unitConversions?: UnitOfMeasureConversion[];\r\n currentCount?: number;\r\n allowZero?: boolean;\r\n disabled?: boolean;\r\n hideUnitConversion?: boolean;\r\n incrementGlyphClass?: string;\r\n decrementGlyphClass?: string;\r\n decrementButtonAriaLabel?: string;\r\n incrementButtonAriaLabel?: string;\r\n inputQuantityAriaLabel?: string;\r\n id?: string;\r\n min?: number;\r\n breakoff?: boolean;\r\n legacyBreakoff?: boolean;\r\n onChange?(newValue: number): void;\r\n onBreakoffChange?(enabled: boolean): void;\r\n}\r\n\r\ninterface IQuantityState {\r\n currentInput: string | number;\r\n parsedCurrentInput: number;\r\n breakoff: boolean;\r\n}\r\n\r\nfunction getDecimalSeparator(locale: string) {\r\n const numberWithDecimalSeparator = 1.1;\r\n const separator = Intl.NumberFormat(locale)\r\n .formatToParts(numberWithDecimalSeparator)\r\n .find(part => part.type === 'decimal')\r\n ?.value;\r\n return separator ?? ',';\r\n}\r\n\r\nexport function getInitialBreakoffState(initialValue: number, product: SimpleProduct): { factor?: number, breakoff: boolean } {\r\n const multiplier = product.Behavior?.DefaultQuantity || 1;\r\n const factor = Math.round(((initialValue / multiplier) + Number.EPSILON) * 1000) / 1000;\r\n const remainder = (initialValue * 1000) % (multiplier * 1000);\r\n if (remainder === 0) {\r\n return { factor, breakoff: false };\r\n } else {\r\n return { breakoff: true };\r\n }\r\n}\r\n\r\n/**\r\n * Quantity Component - This component is used to add or remove quantity.\r\n */\r\n@observer\r\nexport default class ProductListOrderQuantity extends React.PureComponent {\r\n public static defaultProps: Partial = {\r\n allowZero: true,\r\n decrementGlyphClass: 'fas fa-minus',\r\n incrementGlyphClass: 'fas fa-plus'\r\n };\r\n\r\n private readonly inputRef: React.RefObject = React.createRef();\r\n\r\n @computed get hasBreakoff(): boolean {\r\n return !!this.props.product?.Behavior?.DefaultQuantity;\r\n }\r\n\r\n @computed get minimum(): number {\r\n return (this.productMinimumQuantity || Number(!this.props.allowZero)) / this.multipleOf;\r\n }\r\n\r\n @computed get maximum(): number {\r\n const max = this.productMaximumQuantity || 999_999_999;\r\n return max / this.multipleOf;\r\n }\r\n\r\n @computed get multipleOf(): number {\r\n if (this.state.breakoff) {\r\n // Breakoff is enabled\r\n return this.productMultipleOfQuantity || 1;\r\n }\r\n\r\n return this.productDefaultQuantity || 1;\r\n }\r\n\r\n @computed get productDefaultQuantity(): number | undefined {\r\n return this.props.product?.Behavior?.DefaultQuantity;\r\n }\r\n\r\n @computed get productMaximumQuantity(): number | undefined {\r\n return this.props.product?.Behavior?.MaximumQuantity;\r\n }\r\n\r\n @computed get productMinimumQuantity(): number | undefined {\r\n return this.props.product?.Behavior?.MinimumQuantity;\r\n }\r\n\r\n @computed get productMultipleOfQuantity(): number | undefined {\r\n return this.props.product?.Behavior?.MultipleOfQuantity;\r\n }\r\n\r\n @computed get total(): number {\r\n return this.state.parsedCurrentInput * this.multipleOf;\r\n }\r\n\r\n @computed get totalFormatted(): string {\r\n return this.total.toLocaleString(this.props.locale, {\r\n minimumFractionDigits: getMinimumDecimals(this.props.product?.DefaultUnitOfMeasure),\r\n maximumFractionDigits: 2,\r\n useGrouping: false\r\n });\r\n }\r\n\r\n @computed get showDecimals(): boolean {\r\n const units = [\r\n 'kg',\r\n 'Kilogram'\r\n ];\r\n const uom = this.props.product?.DefaultUnitOfMeasure;\r\n\r\n return !!uom && units.includes(uom);\r\n }\r\n\r\n constructor(props: IQuantityProps) {\r\n super(props);\r\n\r\n const { allowZero, currentCount, product } = this.props;\r\n let breakoff = false;\r\n let initialValue: number | string = '';\r\n\r\n if (product) {\r\n initialValue = currentCount || (allowZero ? 0 : this.productMinimumQuantity ?? 1);\r\n\r\n if (this.hasBreakoff) {\r\n if (props.breakoff) {\r\n breakoff = true;\r\n } else {\r\n const breakoffState = getInitialBreakoffState(initialValue, product);\r\n\r\n if (breakoffState.factor) {\r\n initialValue = breakoffState.factor;\r\n } else {\r\n breakoff = breakoffState.breakoff;\r\n }\r\n }\r\n }\r\n }\r\n\r\n this.state = {\r\n currentInput: initialValue,\r\n parsedCurrentInput: typeof initialValue === 'number' ? initialValue : Number.parseFloat(initialValue) || 0,\r\n breakoff\r\n };\r\n this._clamp = this._clamp.bind(this);\r\n this._handleChange = this._handleChange.bind(this);\r\n this._validateQuantity = this._validateQuantity.bind(this);\r\n this._onToggleBreakoff = this._onToggleBreakoff.bind(this);\r\n }\r\n\r\n public componentDidMount(): void {\r\n when(\r\n () => this.props.product !== undefined && (this.state.currentInput === '' || this.state.currentInput === 0),\r\n () => {\r\n const { allowZero, currentCount } = this.props;\r\n const initialValue = currentCount || (allowZero ? 0 : this.productMinimumQuantity ?? 1);\r\n\r\n if (this.hasBreakoff) {\r\n const multipler = this.productDefaultQuantity!;\r\n const factor = initialValue / multipler;\r\n const remainder = initialValue % multipler;\r\n\r\n if (remainder === 0) {\r\n this.setState({ currentInput: factor });\r\n } else {\r\n this.setState({ breakoff: true });\r\n }\r\n } else {\r\n this.setState({ currentInput: initialValue });\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.breakoff,\r\n (breakoff) => {\r\n this.setState({ breakoff: Boolean(breakoff) });\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.currentCount,\r\n () => {\r\n const currentInput = typeof this.state.currentInput === 'string'\r\n ? Number.parseFloat(this.state.currentInput.replace(',', '.') || '0')\r\n : this.state.currentInput;\r\n const oldQuantity = this._convertOutgoingQuantity(currentInput);\r\n const newQuantity = this._convertIncomingQuantity(this.props.currentCount ?? 0);\r\n\r\n // Only allow the change from props if it's meaningfully different\r\n if (this.props.currentCount !== oldQuantity) {\r\n this.setState({\r\n currentInput: newQuantity\r\n });\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.state.breakoff,\r\n (newValue) => {\r\n if (newValue) {\r\n const newInput = (this.props.currentCount ?? 0) / this.multipleOf;\r\n\r\n this.setState({\r\n currentInput: newInput,\r\n parsedCurrentInput: newInput\r\n });\r\n } else {\r\n const newInput = (this.props.currentCount ?? 0) / this.multipleOf;\r\n\r\n this.setState({\r\n currentInput: newInput,\r\n parsedCurrentInput: newInput\r\n });\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.state.currentInput,\r\n () => {\r\n this.setState({\r\n currentInput: this.showDecimals ? this.state.currentInput.toLocaleString(this.props.locale, {\r\n minimumFractionDigits: getMinimumDecimals(this.props.product?.DefaultUnitOfMeasure),\r\n maximumFractionDigits: 2,\r\n useGrouping: false\r\n }).replace('.', ',') : this.state.currentInput,\r\n parsedCurrentInput: Number.parseFloat(this.state.currentInput.toString().replace(',', '.') || '0')\r\n });\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { allowZero, context, product, hideUnitConversion } = this.props;\r\n const disabled = this.state.parsedCurrentInput === (allowZero ? 0 : this.minimum);\r\n const incDisabled = this.state.parsedCurrentInput === this.maximum;\r\n const currentValue = this.state.currentInput;\r\n const baseClassName = 'vinhuset-quantity';\r\n const miniBreakoff = !this.props.legacyBreakoff;\r\n\r\n let extraClass = '';\r\n if (disabled) {\r\n // The quantity has reached its boundaries (max or min)\r\n extraClass = 'disabled';\r\n } else if (this.props.disabled) {\r\n // This.props.disabled shows if the state is not succeded yet\r\n extraClass = 'transition';\r\n }\r\n const getChangeHandler = (action: 'increment' | 'decrement') => () => {\r\n let amount = action === 'increment' ? 1 : -1;\r\n\r\n const calcTotal = (change: number): number => {\r\n const newAmount = this.state.parsedCurrentInput + change;\r\n return this.multipleOf * newAmount;\r\n };\r\n\r\n let newTotal = calcTotal(amount);\r\n\r\n if (action === 'increment' && newTotal > 0) {\r\n if (this.productMinimumQuantity && newTotal < this.productMinimumQuantity) {\r\n amount = (this.productMinimumQuantity - this.total) / this.multipleOf;\r\n }\r\n\r\n newTotal = calcTotal(amount);\r\n\r\n if (this.productMaximumQuantity && newTotal > this.productMaximumQuantity) {\r\n amount = (this.productMaximumQuantity - this.total) / this.multipleOf;\r\n }\r\n }\r\n\r\n if (action === 'decrement' && newTotal > 0) {\r\n if (this.productMinimumQuantity && newTotal < this.productMinimumQuantity) {\r\n if (allowZero) {\r\n amount = -this.state.parsedCurrentInput;\r\n } else {\r\n amount = this.minimum - this.state.parsedCurrentInput;\r\n }\r\n }\r\n if (this.productMaximumQuantity && newTotal > this.productMaximumQuantity) {\r\n amount = this.maximum - this.state.parsedCurrentInput;\r\n }\r\n }\r\n\r\n this._onIncrementalChange(amount);\r\n };\r\n\r\n return (\r\n
\r\n {!product?.Behavior?.MinimumQuantity && !miniBreakoff && (\r\n \r\n )}\r\n
\r\n
\r\n {!product?.Behavior?.MinimumQuantity && miniBreakoff && this.hasBreakoff && (\r\n \r\n )}\r\n {miniBreakoff && this.hasBreakoff && (\r\n \r\n {`${this.multipleOf} `}\r\n  x\r\n \r\n )}\r\n \r\n {\r\n const NUMBER_DOT_COMMA = /^[\\d,.]*$/;\r\n const fieldValue = (e.target as any).value;\r\n const fieldHasCommaOrDot = fieldValue.includes('.') || fieldValue.includes(',');\r\n const keyIsCommaOrDot = e.key === '.' || e.key === ',';\r\n\r\n if (!NUMBER_DOT_COMMA.test(e.key) || (keyIsCommaOrDot && fieldHasCommaOrDot)) {\r\n e.preventDefault();\r\n }\r\n\r\n const separator = getDecimalSeparator(this.props.locale);\r\n const replace = separator === '.' ? ',' : '.';\r\n (e as any).target.value = fieldValue.replace(replace, separator);\r\n }}\r\n aria-live='polite'\r\n aria-label={`${this.props.inputQuantityAriaLabel}`}\r\n role='spinbutton'\r\n aria-valuemin={1}\r\n aria-valuemax={this.maximum}\r\n aria-valuenow={Number.parseFloat(currentValue.toString()) || 0}\r\n ref={this.inputRef}\r\n disabled={this.props.disabled}\r\n data-nomodalcss\r\n />\r\n \r\n
\r\n \r\n = {this.totalFormatted} \r\n \r\n \r\n
\r\n {!hideUnitConversion && (\r\n <>\r\n
\r\n 1 = \r\n {`${this.multipleOf} `}\r\n \r\n
\r\n
\r\n {this._getUnitOfMeasureConversion()}\r\n
\r\n \r\n )}\r\n
\r\n );\r\n }\r\n\r\n private _getUnitOfMeasureConversion = (): JSX.Element | undefined => {\r\n if (!this.props.unitConversions || !this.props.product?.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n const conversions = this.props.unitConversions?.filter(x => x.FromUnitOfMeasureSymbol === this.props.product?.DefaultUnitOfMeasure);\r\n const conversion = getMostRelevantConversion(conversions);\r\n\r\n if (!conversion) {\r\n return undefined;\r\n }\r\n\r\n const factor = getRoundedFactor(conversion).toLocaleString(this.props.locale, {\r\n minimumFractionDigits: getMinimumDecimals(conversion.ToUnitOfMeasureSymbol),\r\n maximumFractionDigits: 2,\r\n useGrouping: false\r\n });\r\n const defaultUOM = humanizeUnitOfMeasure(this.props.context, this.props.product?.DefaultUnitOfMeasure, this.props.product);\r\n const conversionUOM = humanizeUnitOfMeasure(this.props.context, conversion.ToUnitOfMeasureSymbol).toLocaleLowerCase();\r\n\r\n return (\r\n
\r\n 1 {defaultUOM} = {`${factor} ${conversionUOM}`}\r\n
\r\n );\r\n };\r\n\r\n private _convertIncomingQuantity = (quantity: number): number => {\r\n return quantity / this.multipleOf;\r\n };\r\n\r\n private _convertOutgoingQuantity = (quantity: number): number => {\r\n const outgoing = quantity * this.multipleOf;\r\n // We need to always round to nearest 2 decimal places to avoid floating point errors in quantity validation\r\n return Math.round((outgoing + Number.EPSILON) * 1000) / 1000;\r\n };\r\n\r\n private _onToggleBreakoff = (checked: boolean): void => {\r\n this.setState({ breakoff: checked });\r\n this.props.onBreakoffChange?.(checked);\r\n };\r\n\r\n private _onIncrementalChange(amount: number): void {\r\n const updatedQuantity = this.state.parsedCurrentInput + amount;\r\n\r\n if (this._isValidNewQuantity(updatedQuantity)) {\r\n this.props.onChange?.(this._convertOutgoingQuantity(updatedQuantity));\r\n }\r\n }\r\n\r\n private readonly _clamp = (total: number): number => {\r\n if (this.productMinimumQuantity && total >= 1 && total < this.productMinimumQuantity) {\r\n return this.productMinimumQuantity / this.multipleOf;\r\n } else if (this.productMaximumQuantity && total > this.productMaximumQuantity) {\r\n return this.productMaximumQuantity / this.multipleOf;\r\n } else {\r\n return total / this.multipleOf;\r\n }\r\n };\r\n\r\n private readonly _isValidNewQuantity = (newQuantity: number): boolean => {\r\n if (newQuantity === 0 && this.props.allowZero) {\r\n return true;\r\n }\r\n return !isNaN(newQuantity) && newQuantity >= this.minimum && newQuantity <= this.maximum;\r\n };\r\n\r\n private _handleChange(e: React.ChangeEvent): void {\r\n let newValue: string | number = e.target.value;\r\n\r\n e.persist();\r\n this.setState({ currentInput: newValue }, () => {\r\n if (typeof newValue === 'string') {\r\n newValue = Number.parseFloat(newValue.replace(',', '.'));\r\n }\r\n\r\n if (this._isValidNewQuantity(newValue)) {\r\n this.props.onChange?.(this._convertOutgoingQuantity(newValue));\r\n }\r\n });\r\n }\r\n\r\n private _validateQuantity(e: React.FocusEvent): void {\r\n const currentValue = Number.parseFloat(e.target.value.replace(',', '.') || '0');\r\n const total = this.multipleOf * currentValue;\r\n const newValue = Math.max(this._clamp(total) ?? 0, Number(!this.props.allowZero));\r\n\r\n e.persist();\r\n this.setState({ currentInput: newValue }, () => {\r\n this.props.onChange?.(this._convertOutgoingQuantity(newValue));\r\n });\r\n }\r\n}\r\n","import { Cart, CartLine, SalesOrder } from \"@msdyn365-commerce/retail-proxy\";\r\n\r\n/**\r\n * Merge duplicate cartlines for same product. Sums up quantity and prices to its own cartline.\r\n */\r\nexport function _mergeDuplicateCartlines(cartlines: CartLine[]): CartLine[] {\r\n return cartlines;\r\n\r\n // @ts-expect-error\r\n const mergedCartlines: CartLine[] = [];\r\n\r\n cartlines.forEach(cartline => {\r\n const existingCartline = mergedCartlines.find(cl => cl.ProductId === cartline.ProductId);\r\n\r\n if (existingCartline) {\r\n const quantity = (existingCartline.Quantity || 0) + (cartline.Quantity || 0);\r\n const netAmountWithoutTax = cartline.NetAmountWithoutTax\r\n ? (existingCartline.NetAmountWithoutTax || 0) + cartline.NetAmountWithoutTax\r\n : (existingCartline.NetAmountWithoutTax || 0) + (cartline.Price || 0) * (cartline.Quantity || 0);\r\n\r\n mergedCartlines[mergedCartlines.indexOf(existingCartline)] = {\r\n ...existingCartline,\r\n Quantity: quantity,\r\n NetAmountWithoutTax: netAmountWithoutTax\r\n };\r\n } else {\r\n mergedCartlines.push({ ...cartline });\r\n }\r\n });\r\n\r\n return mergedCartlines;\r\n}\r\n\r\nexport function getTotalDeposit(cartOrSalesOrder: Cart | SalesOrder | undefined): number {\r\n if (!cartOrSalesOrder) {\r\n return 0;\r\n }\r\n\r\n const depositInHeader = cartOrSalesOrder.ChargeLines?.reduce((acc, chargeLine) => {\r\n return acc + (chargeLine.ChargeCode?.includes('Pant') ? chargeLine.CalculatedAmount || 0 : 0);\r\n }, 0) || 0;\r\n let depositInLines = 0;\r\n\r\n if ('CartLines' in cartOrSalesOrder) {\r\n depositInLines = cartOrSalesOrder.CartLines?.reduce((acc, line) => {\r\n const summed = line.ChargeLines?.reduce((acc, chargeLine) => {\r\n const sumDeposit = (chargeLine.ChargeCode?.includes('Pant') ? chargeLine.CalculatedAmount || 0 : 0);\r\n return acc + sumDeposit;\r\n }, 0) || 0;\r\n return acc + summed;\r\n }, 0) || 0;\r\n } else if ('SalesLines' in cartOrSalesOrder) {\r\n depositInLines = cartOrSalesOrder.SalesLines?.reduce((acc, line) => {\r\n const summed = line.ChargeLines?.reduce((acc, chargeLine) => {\r\n const sumDeposit = (chargeLine.ChargeCode?.includes('Pant') ? chargeLine.CalculatedAmount || 0 : 0);\r\n return acc + sumDeposit;\r\n }, 0) || 0;\r\n return acc + summed;\r\n }, 0) || 0;\r\n }\r\n\r\n return depositInHeader + depositInLines;\r\n}\r\n\r\nexport interface IChargeSum {\r\n ChargeCode: string;\r\n Description: string;\r\n TotalCalculatedAmount: number;\r\n}\r\n\r\nexport function getAllCharges(cartOrSalesOrder: Cart | SalesOrder | undefined): IChargeSum[] | undefined {\r\n if (!cartOrSalesOrder) {\r\n return undefined;\r\n }\r\n\r\n const charges: IChargeSum[] = [];\r\n\r\n cartOrSalesOrder?.ChargeLines?.forEach(chargeLine => {\r\n if (chargeLine.Description && chargeLine.CalculatedAmount) {\r\n const existingCharge = charges.find(c => c.Description === chargeLine.Description);\r\n\r\n if (existingCharge) {\r\n existingCharge.TotalCalculatedAmount += chargeLine.CalculatedAmount;\r\n } else {\r\n charges.push({\r\n ChargeCode: chargeLine.ChargeCode || '',\r\n Description: chargeLine.Description,\r\n TotalCalculatedAmount: chargeLine.CalculatedAmount\r\n });\r\n }\r\n }\r\n });\r\n\r\n if ('CartLines' in cartOrSalesOrder) {\r\n cartOrSalesOrder.CartLines?.forEach(cartLine => {\r\n cartLine.ChargeLines?.forEach(chargeLine => {\r\n if (chargeLine.Description && chargeLine.CalculatedAmount) {\r\n const existingCharge = charges.find(c => c.Description === chargeLine.Description);\r\n\r\n if (existingCharge) {\r\n existingCharge.TotalCalculatedAmount += chargeLine.CalculatedAmount;\r\n } else {\r\n charges.push({\r\n ChargeCode: chargeLine.ChargeCode || '',\r\n Description: chargeLine.Description,\r\n TotalCalculatedAmount: chargeLine.CalculatedAmount\r\n });\r\n }\r\n }\r\n });\r\n });\r\n } else if ('SalesLines' in cartOrSalesOrder) {\r\n cartOrSalesOrder.SalesLines?.forEach(salesLine => {\r\n salesLine.ChargeLines?.forEach(chargeLine => {\r\n if (chargeLine.Description && chargeLine.CalculatedAmount) {\r\n const existingCharge = charges.find(c => c.Description === chargeLine.Description);\r\n\r\n if (existingCharge) {\r\n existingCharge.TotalCalculatedAmount += chargeLine.CalculatedAmount;\r\n } else {\r\n charges.push({\r\n ChargeCode: chargeLine.ChargeCode || '',\r\n Description: chargeLine.Description,\r\n TotalCalculatedAmount: chargeLine.CalculatedAmount\r\n });\r\n }\r\n }\r\n });\r\n });\r\n }\r\n\r\n return charges;\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 { ICartLinePriceEditorResources } from '@msdyn365-commerce/components';\r\nimport { IComponentProps, IGridSettings, IImageSettings, Image, msdyn365Commerce } from '@msdyn365-commerce/core';\r\nimport { ICartState } from '@msdyn365-commerce/global-state';\r\nimport {\r\n CartLine,\r\n ChannelDeliveryOptionConfiguration,\r\n DiscountLine,\r\n DiscountLineType,\r\n ProductCatalog,\r\n ProductDimensionType,\r\n SalesLine,\r\n SimpleProduct,\r\n UnitOfMeasureConversion,\r\n format\r\n} from '@msdyn365-commerce/retail-proxy';\r\nimport { ArrayExtensions, StringExtensions, getFallbackImageUrl, IProductInventoryInformation } from '@msdyn365-commerce-modules/retail-actions';\r\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classNames from 'classnames';\r\nimport * as React from 'react';\r\nimport { humanizeUnitOfMeasure, UnitOfMeasure } from '../../../../components/unit-of-measure';\r\nimport ProductListOrderQuantity from '../../../../components/common/product-list-order-quantity';\r\nimport { IProductError, ProductPriceExt, SimpleProductExt } from '../../../../shared-utils/types';\r\nimport DiscountBadge from '../../../../components/discount-badge/discount-badge';\r\nimport PriceComponent, { getDiscountLines, getDiscountPercentage, getOriginalPrice } from './price.component';\r\nimport { addInventoryVisibilityInfo } from '../../../../shared-utils/string-utils';\r\n\r\n/**\r\n * ICartlineResourceString: Interface for specifying the\r\n * resource strings that the component needs.\r\n */\r\nexport interface ICartlineResourceString {\r\n /**\r\n * Display string for discount label.\r\n */\r\n discountStringText: string;\r\n\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n quantityDisplayString: string;\r\n\r\n /**\r\n * Display string for quantity label.\r\n */\r\n inputQuantityAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the decrement button in quantity component.\r\n */\r\n decrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Aria label for the increment button in quantity component.\r\n */\r\n incrementButtonAriaLabel: string;\r\n\r\n /**\r\n * Original text screenreader.\r\n */\r\n originalPriceText: string;\r\n\r\n /**\r\n * Current text screenreader.\r\n */\r\n currentPriceText: string;\r\n\r\n /**\r\n * Shipping Charges Text.\r\n */\r\n shippingChargesText: string;\r\n\r\n /**\r\n * Price Editor Charges Text.\r\n */\r\n priceEditorResources?: ICartLinePriceEditorResources;\r\n\r\n /**\r\n * Sales agreement price prompt text.\r\n */\r\n salesAgreementPricePrompt?: string;\r\n\r\n /**\r\n * Shipping text.\r\n */\r\n shippingText?: string;\r\n\r\n /**\r\n * Confirmed Ship Date Label.\r\n */\r\n confirmedShipDateLabel?: string;\r\n\r\n /**\r\n * Request Delivery Date Label.\r\n */\r\n requestDeliveryDateLabel?: string;\r\n\r\n pricePerLiterText?: string;\r\n pricePerText?: string;\r\n depositSuffixText?: string;\r\n expectedInventoryDateWithQuantityText?: string;\r\n expectedInventoryDateText?: string;\r\n}\r\n\r\n/**\r\n * Represents cart line data interface.\r\n */\r\ninterface ICartLineData {\r\n cartLine: CartLine | SalesLine;\r\n cartState?: ICartState;\r\n product?: SimpleProduct;\r\n catalogs?: ProductCatalog[];\r\n availability?: IProductInventoryInformation;\r\n unitConversions?: UnitOfMeasureConversion[];\r\n}\r\n\r\nexport type CartLineDisplayMode = 'DEFAULT' | 'COMPACT';\r\n\r\n/**\r\n * ICartLineProps: The props required to render cartLineitem.\r\n */\r\nexport interface ICartLineProps extends IComponentProps {\r\n /**\r\n * The flag to change the quantity component from interactible to static.\r\n */\r\n disableQuantityInteractivity?: boolean;\r\n\r\n /**\r\n * The primary image url.\r\n */\r\n primaryImageUrl?: string;\r\n\r\n /**\r\n * The product error.\r\n */\r\n productError?: IProductError;\r\n\r\n /**\r\n * The product url.\r\n */\r\n productUrl?: string;\r\n\r\n /**\r\n * GridSettings for the product image in cartLine.\r\n */\r\n gridSettings: IGridSettings;\r\n\r\n /**\r\n * ImageSettings for the product image in cartLine.\r\n */\r\n imageSettings: IImageSettings;\r\n\r\n /**\r\n * Boolean flag to indicate if the item is out of stock.\r\n */\r\n isOutOfStock?: boolean;\r\n\r\n /**\r\n * Flag to make quantity section editable.\r\n */\r\n isQuantityEditable?: boolean;\r\n\r\n /**\r\n * Max quantity for line item.\r\n */\r\n maxQuantity?: number;\r\n\r\n /**\r\n * Current quantity for line item.\r\n */\r\n currentQuantity?: number;\r\n\r\n /**\r\n * Resource string for the component.\r\n */\r\n resources: ICartlineResourceString;\r\n\r\n /**\r\n * SalesLine flag.\r\n */\r\n isSalesLine?: boolean;\r\n\r\n /**\r\n * Error message to show in place of quantity.\r\n */\r\n errorMessage?: string;\r\n\r\n /**\r\n * Display mode to use.\r\n */\r\n displayMode?: CartLineDisplayMode;\r\n\r\n /**\r\n * Inventory information label.\r\n */\r\n inventoryInformationLabel?: string;\r\n\r\n /**\r\n * Inventory information class name.\r\n */\r\n inventoryLabelClassName?: string;\r\n\r\n /**\r\n * Flag to show/hide shipping charges for line items.\r\n */\r\n showShippingChargesForLineItems?: boolean;\r\n\r\n /**\r\n * Boolean flag to indicate if cart state status is ready.\r\n */\r\n isCartStateReady?: boolean;\r\n\r\n /**\r\n * Chanel Delivery Option configuration is from api.\r\n */\r\n channelDeliveryOptionConfig?: ChannelDeliveryOptionConfiguration;\r\n\r\n /**\r\n * The telemetry content.\r\n */\r\n telemetryContent?: ITelemetryContent;\r\n\r\n /**\r\n * The cart line index.\r\n */\r\n lineIndex?: number;\r\n\r\n /**\r\n * The cart line delivery location.\r\n */\r\n deliveryLocation?: string;\r\n\r\n /**\r\n * Quantity onChange callback.\r\n */\r\n quantityOnChange?(cartLine: CartLine, newQuantity: number, lineIndex?: number): void;\r\n priceCurrency?: string;\r\n\r\n /**\r\n * Sales line confirmed ship date.\r\n */\r\n confirmedShipDate?: string;\r\n\r\n /**\r\n * Sales line request delivery date.\r\n */\r\n requestDeliveryDate?: string;\r\n}\r\n\r\n/**\r\n * Represents dimensions strings.\r\n */\r\ninterface IDimensionStrings {\r\n /**\r\n * String for size key.\r\n */\r\n sizeString: string;\r\n\r\n /**\r\n * String for color key.\r\n */\r\n colorString: string;\r\n\r\n /**\r\n * String associated with the configuration product dimension.\r\n */\r\n configString: string;\r\n\r\n /**\r\n * String for style key.\r\n */\r\n styleString: string;\r\n\r\n /**\r\n * String for amount key.\r\n */\r\n amountString?: string;\r\n}\r\n\r\nconst cartLineItemFunctions = {\r\n /**\r\n * Render product dimensions.\r\n * @param product - Product data.\r\n * @param dimensionStrings - Dimension strings interface.\r\n * @returns JSX Element.\r\n */\r\n renderProductDimensions: (product: SimpleProduct, dimensionStrings: IDimensionStrings) => {\r\n if (!product.Dimensions) {\r\n return [];\r\n }\r\n\r\n return product.Dimensions.map(productDimension => {\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Color) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.colorString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Configuration) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.configString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Size) {\r\n return (\r\n
\r\n \r\n {dimensionStrings.sizeString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n\r\n if (productDimension.DimensionTypeValue === ProductDimensionType.Style) {\r\n return (\r\n
\r\n \r\n {product.IsGiftCard ? dimensionStrings.amountString : dimensionStrings.styleString}\r\n {': '}\r\n {productDimension.DimensionValue?.Value}\r\n \r\n
\r\n );\r\n }\r\n return null;\r\n });\r\n },\r\n\r\n /**\r\n * Gets the react node for product unit of price display.\r\n * @param props - The cart line props.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n renderProductUnitPrice: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.Price) {\r\n return null;\r\n }\r\n const zeroQuantity: number = 0;\r\n return (\r\n
\r\n \r\n zeroQuantity\r\n ? {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n : {\r\n price: {\r\n CustomerContextualPrice: props.data.cartLine.Price\r\n }\r\n }\r\n }\r\n context={props.context}\r\n id={props.id}\r\n typeName={props.typeName}\r\n currencyCode={props.priceCurrency}\r\n />\r\n \r\n
\r\n );\r\n },\r\n\r\n /**\r\n * Render discount lines.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderDiscountLines: (props: ICartLineProps) => {\r\n if (!props.data.cartLine.DiscountLines || !ArrayExtensions.hasElements(props.data.cartLine.DiscountLines)) {\r\n return null;\r\n }\r\n\r\n /**\r\n * Get the updated discount percentage.\r\n * @param discountLine - The discount line.\r\n * @param cartLine - The cart line.\r\n * @returns The updated discount percentage.\r\n */\r\n const discountPercent = (discountLine: DiscountLine, cartLine: CartLine): number => {\r\n const numberZero = 0;\r\n const decimalPrecision = 2;\r\n const fullPercentage = 100;\r\n let updatedPercent: number = discountLine.Percentage ?? numberZero;\r\n\r\n if (\r\n (discountLine.Percentage === numberZero ||\r\n (discountLine.DiscountLineTypeValue && discountLine.DiscountLineTypeValue === DiscountLineType.TenderTypeDiscount)) &&\r\n cartLine.Price &&\r\n cartLine.Price > numberZero &&\r\n cartLine.Quantity &&\r\n cartLine.Quantity !== numberZero\r\n ) {\r\n const effectiveAmount = discountLine.EffectiveAmount ?? numberZero;\r\n updatedPercent = Number(\r\n ((effectiveAmount / (cartLine.Price * cartLine.Quantity)) * fullPercentage).toFixed(decimalPrecision)\r\n );\r\n }\r\n\r\n return updatedPercent;\r\n };\r\n\r\n return props.data.cartLine.DiscountLines.map((discountLine, index) => {\r\n return (\r\n
\r\n {discountLine.OfferName ? discountLine.OfferName : ''}\r\n \r\n \r\n \r\n \r\n {` (${discountLine.Percentage !== undefined ? discountPercent(discountLine, props.data.cartLine) : ''}%)`}\r\n \r\n
\r\n );\r\n });\r\n },\r\n\r\n /**\r\n * Render inventory label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderInventoryLabel: (props: ICartLineProps) => {\r\n const { data, resources, inventoryLabelClassName, inventoryInformationLabel } = props;\r\n\r\n const availabilityClass = data.availability\r\n ? (data.availability?.IsProductAvailable\r\n ? 'available' : 'not-available')\r\n : '';\r\n const inventoryCssName = inventoryLabelClassName\r\n ? `msc-cart-line__product-inventory-label ${inventoryLabelClassName} ${availabilityClass}`\r\n : `msc-cart-line__product-inventory-label ${availabilityClass}`;\r\n const availableQuantity = data.availability?.ProductAvailableQuantity.AvailableQuantity || 0;\r\n\r\n let inventoryLabel = format(inventoryInformationLabel || '', availableQuantity);\r\n\r\n inventoryLabel = addInventoryVisibilityInfo(\r\n inventoryLabel,\r\n data.availability,\r\n resources.expectedInventoryDateWithQuantityText,\r\n resources.expectedInventoryDateText);\r\n\r\n return (\r\n

\r\n {inventoryLabel}\r\n

\r\n );\r\n },\r\n\r\n /**\r\n * Render shipping label.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderShippingLabel: (props: ICartLineProps) => {\r\n const pickupDeliveryModeCode = props.context.request.channel?.PickupDeliveryModeCode;\r\n const channelDeliveryOptionConfig = props.channelDeliveryOptionConfig;\r\n const cartline = props.data.cartLine;\r\n let hasShippingMethod = false;\r\n if (channelDeliveryOptionConfig !== undefined) {\r\n hasShippingMethod = !!(\r\n cartline.DeliveryMode &&\r\n channelDeliveryOptionConfig.PickupDeliveryModeCodes?.some(deliveryMode => deliveryMode !== cartline.DeliveryMode)\r\n );\r\n } else {\r\n hasShippingMethod = !!(cartline.DeliveryMode && cartline.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n if (!hasShippingMethod) {\r\n return undefined;\r\n }\r\n\r\n const shippingChargeLines = (cartline.ChargeLines ?? []).filter(chargeLine => chargeLine.IsShipping);\r\n\r\n if (!ArrayExtensions.hasElements(shippingChargeLines)) {\r\n return undefined;\r\n }\r\n\r\n const defaultCharge: number = 0;\r\n const freightFee = shippingChargeLines.reduce((chargeTotal, chargeLine) => {\r\n return chargeTotal + (chargeLine.CalculatedAmount ?? defaultCharge);\r\n }, defaultCharge);\r\n\r\n const priceComponent = (\r\n \r\n );\r\n return (\r\n <>\r\n \r\n {priceComponent}\r\n \r\n );\r\n },\r\n\r\n /**\r\n * Render other charges.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n renderOtherCharges: (props: ICartLineProps) => {\r\n const cartline = props.data.cartLine;\r\n const otherCharges = cartline.ChargeLines?.filter(chargeline => !chargeline.IsShipping);\r\n\r\n return (\r\n otherCharges?.map((otherCharge, index) => {\r\n const itemIndex = index;\r\n return otherCharge.CalculatedAmount ? (\r\n
\r\n \r\n \r\n \r\n \r\n
\r\n ) : (\r\n ''\r\n );\r\n }) ?? undefined\r\n );\r\n },\r\n\r\n /**\r\n * Render the sales agreement prompt.\r\n * @param props - The ICartLineProps.\r\n * @returns The JSX.Element.\r\n */\r\n renderSalesAgreementPrompt: (props: ICartLineProps): JSX.Element | null => {\r\n // eslint-disable-next-line @typescript-eslint/no-magic-numbers -- We use 0 to indicate no sales agreement applied on the cart line.\r\n if (props.data.cartLine.SalesAgreementLineRecordId === 0) {\r\n return null;\r\n }\r\n return
{props.resources.salesAgreementPricePrompt}
;\r\n },\r\n\r\n renderConfirmedShipDate: (props: ICartLineProps) => {\r\n if (!props.isSalesLine || props.confirmedShipDate === undefined || StringExtensions.isNullOrEmpty(props.confirmedShipDate)) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {props.resources.confirmedShipDateLabel}\r\n {props.confirmedShipDate}\r\n
\r\n );\r\n },\r\n\r\n renderRequestDeliveryDate: (props: ICartLineProps) => {\r\n if (!props.isSalesLine || props.requestDeliveryDate === undefined || StringExtensions.isNullOrEmpty(props.requestDeliveryDate)) {\r\n return null;\r\n }\r\n return (\r\n
\r\n {props.resources.requestDeliveryDateLabel}\r\n {props.requestDeliveryDate}\r\n
\r\n );\r\n }\r\n};\r\n\r\n/**\r\n * Render cartline component.\r\n * @param props - The cart line props.\r\n * @returns JSX element.\r\n */\r\n// eslint-disable-next-line no-redeclare\r\nconst CartLine: React.FC = (props: ICartLineProps) => {\r\n const { isSalesLine, productUrl, resources, displayMode } = props;\r\n const { product, cartLine } = props.data;\r\n const quantity = cartLine.Quantity || 1;\r\n const [stateQuantity, setStateQuantity] = React.useState(quantity);\r\n const fallbackImageUrl =\r\n product &&\r\n getFallbackImageUrl(\r\n product.ItemId,\r\n props.context.actionContext.requestContext.apiSettings,\r\n props.context.request.app?.config?.OmniChannelMedia\r\n );\r\n // 'renderProductUnitPrice' is not used at the moment, but it is kept here for possible future use\r\n // @ts-ignore\r\n const renderProductUnitPrice = cartLineItemFunctions.renderProductUnitPrice(props);\r\n const imageSettings = props.imageSettings;\r\n if (imageSettings) {\r\n imageSettings.cropFocalRegion = true;\r\n }\r\n // 'renderDiscountLines' is not used at the moment, but it is kept here for possible future use\r\n // @ts-ignore\r\n const renderDiscountLines = cartLineItemFunctions.renderDiscountLines(props);\r\n const renderInventoryLabel = cartLineItemFunctions.renderInventoryLabel(props);\r\n // @ts-expect-error\r\n const renderRequestDeliveryDate = cartLineItemFunctions.renderRequestDeliveryDate(props);\r\n const payLoad = getPayloadObject('click', props.telemetryContent!, '', product?.RecordId.toString());\r\n const productAttribute = getTelemetryAttributes(props.telemetryContent!, payLoad);\r\n const productName = product?.Name ?? cartLine.Description;\r\n const imgeClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-image' : 'msc-cart-line__product-image';\r\n const cartLineContentClassName = props.data.cartLine.IsInvoiceLine ? 'msc-cart-line__invoice-content' : 'msc-cart-line__content';\r\n\r\n React.useEffect(() => setStateQuantity(quantity), [props.data.cartLine.Quantity]);\r\n\r\n /**\r\n * Render other charges.\r\n * @param newValue - The cart line props.\r\n * @returns Boolean.\r\n */\r\n const onChange = (newValue: number) => {\r\n setStateQuantity(newValue);\r\n\r\n if (props.quantityOnChange) {\r\n props.quantityOnChange(props.data.cartLine, newValue);\r\n }\r\n };\r\n\r\n /**\r\n * Generate error message.\r\n * @returns JSX element.\r\n */\r\n const generateErrorMessage = (): JSX.Element | null => {\r\n if (props.errorMessage) {\r\n return (\r\n
\r\n \r\n {props.errorMessage}\r\n
\r\n );\r\n }\r\n\r\n return null;\r\n };\r\n\r\n /**\r\n * Render Saving component.\r\n * @returns JSX element.\r\n */\r\n // @ts-ignore\r\n const renderSaving = (): JSX.Element | null => {\r\n if (!props.data.cartLine.DiscountAmount) {\r\n return null;\r\n }\r\n const discountAmountZero: number = 0;\r\n\r\n if (props.data.cartLine.DiscountAmount > discountAmountZero) {\r\n return (\r\n <>\r\n {`${props.resources.discountStringText || 'Discount'}`}\r\n \r\n \r\n );\r\n }\r\n return null;\r\n };\r\n\r\n /**\r\n * Gets the react node for product unit of measure display.\r\n * @returns The node representing markup for unit of measure component.\r\n */\r\n const renderUnitOfMeasure = (asSpan: boolean = false) => {\r\n if (props.data.cartLine.IsInvoiceLine) {\r\n return null;\r\n }\r\n\r\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access -- Do not need type check for appsettings\r\n if (!props.context.app.config.unitOfMeasureDisplayType || props.context.app.config.unitOfMeasureDisplayType === 'none') {\r\n return undefined;\r\n }\r\n\r\n if (!product || !product.DefaultUnitOfMeasure) {\r\n return undefined;\r\n }\r\n\r\n if (asSpan) {\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 /**\r\n * Generate quantity and price component.\r\n * @returns JSX element.\r\n */\r\n const generatePrice = (): JSX.Element | null => {\r\n const {\r\n context,\r\n id,\r\n typeName,\r\n data: { cartLine, product, unitConversions },\r\n resources,\r\n displayMode\r\n } = props;\r\n\r\n let price = isSalesLine\r\n ? {\r\n CustomerContextualPrice: (cartLine as SalesLine).NetAmountWithAllInclusiveTax,\r\n BasePrice: (cartLine as SalesLine).GrossAmount\r\n } : {\r\n /* CustomerContextualPrice: (cartLine.Price || 0) * quantity, // This is shown in mini cart */\r\n CustomerContextualPrice: cartLine.NetAmountWithoutTax || (cartLine.Price || 0) * quantity, // This is shown in mini cart\r\n BasePrice: 0 // cartLine.NetPrice\r\n } as ProductPriceExt;\r\n const productPrice = (product as SimpleProductExt | undefined)?.ProductPrice;\r\n\r\n if (productPrice) {\r\n // price.CustomerContextualPrice = (productPrice.CustomerContextualPrice || 0) * quantity;\r\n\r\n // Only set the base price if there is an explicit discount\r\n if (getDiscountLines(productPrice.DiscountLines).length > 0) {\r\n price.BasePrice = getOriginalPrice(productPrice) * quantity;\r\n price.OverrideDiscountPercentage = getDiscountPercentage(price);\r\n }\r\n }\r\n\r\n const fpakToCl = unitConversions?.find(x => x.FromUnitOfMeasureSymbol === product?.DefaultUnitOfMeasure && x.ToUnitOfMeasureSymbol === 'cl')?.Factor;\r\n const fpakToLtr = unitConversions?.find(x => x.FromUnitOfMeasureSymbol === product?.DefaultUnitOfMeasure && x.ToUnitOfMeasureSymbol === 'ltr')?.Factor;\r\n const volumeCl = fpakToCl || (fpakToLtr ? fpakToLtr * 100 : undefined);\r\n const deposit = product?.ExtensionProperties?.find(x => x.Key === 'DEPOSIT')?.Value?.DecimalValue;\r\n\r\n return (\r\n
\r\n \r\n {displayMode !== 'COMPACT' && productPrice && !!product?.Behavior?.DefaultQuantity && (\r\n
\r\n \r\n  \r\n {format(resources.pricePerText || 'pr. {0}', humanizeUnitOfMeasure(context, product.DefaultUnitOfMeasure, product).toLocaleLowerCase())}\r\n
\r\n )}\r\n {displayMode !== 'COMPACT' && productPrice && volumeCl && (\r\n
\r\n \r\n  \r\n {resources.pricePerLiterText || 'pr. liter'}\r\n
\r\n )}\r\n {displayMode !== 'COMPACT' && deposit && (\r\n
\r\n +\r\n \r\n  \r\n {resources.depositSuffixText || 'pant'}\r\n
\r\n )}\r\n
\r\n );\r\n };\r\n\r\n const generateQuantity = (): JSX.Element | null => {\r\n const singleQuantity: number = 1;\r\n\r\n let quantityElement: JSX.Element | null = null;\r\n\r\n // No quantity selector for invoice line\r\n if (!props.data.cartLine.IsInvoiceLine) {\r\n if (props.data.product && props.isQuantityEditable) {\r\n quantityElement = (\r\n
\r\n {/*
{resources.quantityDisplayString}
*/}\r\n\r\n {generateErrorMessage()}\r\n\r\n \r\n\r\n {/* {renderUnitOfMeasure()} */}\r\n
\r\n );\r\n } else {\r\n quantityElement = (\r\n \r\n \r\n\r\n {generateErrorMessage()}\r\n\r\n {props.data.cartLine.Quantity}\r\n {' '}\r\n {renderUnitOfMeasure(true)}\r\n \r\n );\r\n }\r\n }\r\n\r\n return quantityElement;\r\n };\r\n\r\n // @ts-expect-error\r\n const _renderStoreLocation = (): JSX.Element | null => {\r\n if (cartLine && cartLine.FulfillmentStoreId) {\r\n return (\r\n
\r\n {props.deliveryLocation}\r\n
\r\n );\r\n } else {\r\n return (\r\n
\r\n {props.deliveryLocation}\r\n
\r\n );\r\n }\r\n };\r\n\r\n const badge = (props.data.product as SimpleProductExt | undefined)?.Badge;\r\n\r\n return (\r\n
\r\n {(displayMode === undefined || displayMode === 'DEFAULT') && (\r\n \r\n \r\n )}\r\n
\r\n
\r\n
\r\n {props.productError?.Error && (\r\n \r\n \r\n \r\n )}\r\n \r\n {productName}\r\n \r\n {renderInventoryLabel}\r\n
\r\n {generatePrice()}\r\n
\r\n {generateQuantity()}\r\n
\r\n {(displayMode !== 'COMPACT' && badge) && (\r\n \r\n )}\r\n
\r\n );\r\n};\r\n\r\n// @ts-expect-error\r\nexport const CartLineItemComponent: React.FunctionComponent = msdyn365Commerce.createComponentOverride(\r\n 'CartLineItem',\r\n {\r\n component: CartLine,\r\n ...cartLineItemFunctions\r\n }\r\n);\r\n\r\nexport default CartLineItemComponent;\r\n"],"names":["_ref","className","label","checked","onChange","mini","miniLabel","internalChecked","setInternalChecked","React","Boolean","classnames","title","type","event","target","getInitialBreakoffState","initialValue","product","_product$Behavior","multiplier","Behavior","DefaultQuantity","factor","Math","round","Number","EPSILON","breakoff","ProductListOrderQuantity","constructor","props","super","inputRef","_getUnitOfMeasureConversion","_this$props$product","_this$props$unitConve","_this$props$product3","this","unitConversions","DefaultUnitOfMeasure","conversions","filter","x","_this$props$product2","FromUnitOfMeasureSymbol","conversion","getMostRelevantConversion","getRoundedFactor","toLocaleString","locale","minimumFractionDigits","getMinimumDecimals","ToUnitOfMeasureSymbol","maximumFractionDigits","useGrouping","defaultUOM","humanizeUnitOfMeasure","context","conversionUOM","toLocaleLowerCase","_convertIncomingQuantity","quantity","multipleOf","_convertOutgoingQuantity","outgoing","_onToggleBreakoff","_this$props$onBreakof","_this$props","setState","onBreakoffChange","call","_clamp","total","productMinimumQuantity","productMaximumQuantity","_isValidNewQuantity","newQuantity","allowZero","isNaN","minimum","maximum","currentCount","_this$productMinimumQ","hasBreakoff","breakoffState","state","currentInput","parsedCurrentInput","parseFloat","bind","_handleChange","_validateQuantity","_this$props$product4","productMultipleOfQuantity","productDefaultQuantity","_this$props$product5","_this$props$product6","MaximumQuantity","_this$props$product7","MinimumQuantity","_this$props$product8","MultipleOfQuantity","_this$props$product9","_this$props$product10","uom","includes","componentDidMount","when","undefined","_this$productMinimumQ2","multipler","reaction","_this$props$currentCo","replace","oldQuantity","newValue","_this$props$currentCo2","newInput","_this$props$currentCo3","_this$props$product11","showDecimals","toString","render","_product$Behavior2","_product$Behavior3","hideUnitConversion","disabled","incDisabled","currentValue","baseClassName","miniBreakoff","legacyBreakoff","extraClass","getChangeHandler","action","amount","calcTotal","change","newAmount","newTotal","_onIncrementalChange","Switch","decrementButtonAriaLabel","onClick","tabIndex","color","pattern","value","onBlur","onKeyPress","e","fieldValue","fieldHasCommaOrDot","keyIsCommaOrDot","key","test","preventDefault","separator","_Intl$NumberFormat$fo","Intl","NumberFormat","formatToParts","find","part","getDecimalSeparator","inputQuantityAriaLabel","role","ref","incrementButtonAriaLabel","totalFormatted","UnitOfMeasure","simpleProduct","updatedQuantity","_this$props$onChange","_this$props2","persist","_this$props$onChange2","_this$props3","_this$_clamp","max","_this$props$onChange3","_this$props4","defaultProps","decrementGlyphClass","incrementGlyphClass","__decorate","computed","observer","_mergeDuplicateCartlines","cartlines","getAllCharges","cartOrSalesOrder","_cartOrSalesOrder$Cha2","charges","_cartOrSalesOrder$Car2","ChargeLines","forEach","chargeLine","Description","CalculatedAmount","existingCharge","c","TotalCalculatedAmount","push","ChargeCode","CartLines","cartLine","_cartLine$ChargeLines","_cartOrSalesOrder$Sal2","SalesLines","salesLine","_salesLine$ChargeLine","cartLineItemFunctions","renderProductDimensions","dimensionStrings","Dimensions","map","productDimension","_productDimension$Dim","_productDimension$Dim2","_productDimension$Dim3","_productDimension$Dim4","DimensionTypeValue","ProductDimensionType","Color","RecordId","colorString","DimensionValue","Value","Configuration","configString","Size","sizeString","Style","IsGiftCard","amountString","styleString","renderProductUnitPrice","data","Price","PriceComponent","Quantity","price","CustomerContextualPrice","id","typeName","currencyCode","priceCurrency","renderDiscountLines","DiscountLines","ArrayExtensions","hasElements","discountLine","index","_discountLine$OfferId","OfferId","OfferName","isSalesLine","PeriodicDiscount","EffectiveAmount","BasePrice","Percentage","discountPercent","_discountLine$Percent","updatedPercent","DiscountLineTypeValue","DiscountLineType","TenderTypeDiscount","_discountLine$Effecti","effectiveAmount","toFixed","renderInventoryLabel","_data$availability","_data$availability2","resources","inventoryLabelClassName","inventoryInformationLabel","availabilityClass","availability","IsProductAvailable","inventoryCssName","availableQuantity","ProductAvailableQuantity","AvailableQuantity","inventoryLabel","format","addInventoryVisibilityInfo","expectedInventoryDateWithQuantityText","expectedInventoryDateText","renderShippingLabel","_props$context$reques","_cartline$ChargeLines","pickupDeliveryModeCode","request","channel","PickupDeliveryModeCode","channelDeliveryOptionConfig","cartline","hasShippingMethod","_channelDeliveryOptio","DeliveryMode","PickupDeliveryModeCodes","some","deliveryMode","shippingChargeLines","IsShipping","freightFee","reduce","chargeTotal","_chargeLine$Calculate","priceComponent","freePriceText","shippingChargesText","renderOtherCharges","_cartline$ChargeLines2","_otherCharges$map","otherCharges","chargeline","otherCharge","itemIndex","String","renderSalesAgreementPrompt","SalesAgreementLineRecordId","salesAgreementPricePrompt","renderConfirmedShipDate","confirmedShipDate","StringExtensions","isNullOrEmpty","confirmedShipDateLabel","renderRequestDeliveryDate","requestDeliveryDate","requestDeliveryDateLabel","CartLineItemComponent","msdyn365Commerce","createComponentOverride","_objectSpread","component","_props$context$reques2","_product$Name","_props$data$product","_props$primaryImageUr","_props$productError","_props$productError2","productUrl","displayMode","stateQuantity","setStateQuantity","fallbackImageUrl","getFallbackImageUrl","ItemId","actionContext","requestContext","apiSettings","app","config","OmniChannelMedia","imageSettings","cropFocalRegion","payLoad","getPayloadObject","telemetryContent","productAttribute","getTelemetryAttributes","productName","Name","imgeClassName","IsInvoiceLine","cartLineContentClassName","quantityOnChange","generateErrorMessage","errorMessage","badge","Badge","href","Image","src","primaryImageUrl","fallBackSrc","altText","gridSettings","loadFailureBehavior","style","flex","productError","Error","display","Object","assign","generatePrice","_unitConversions$find","_unitConversions$find2","_product$ExtensionPro","NetAmountWithAllInclusiveTax","GrossAmount","NetAmountWithoutTax","productPrice","ProductPrice","getDiscountLines","length","getOriginalPrice","OverrideDiscountPercentage","getDiscountPercentage","fpakToCl","Factor","fpakToLtr","volumeCl","deposit","ExtensionProperties","Key","DecimalValue","originalPriceText","currentPriceText","discountPercentageSide","pricePerText","pricePerLiterText","depositSuffixText","generateQuantity","quantityElement","isQuantityEditable","LineId","isCartStateReady","min","classNames","htmlFor","quantityDisplayString","asSpan","arguments","unitOfMeasureDisplayType","renderUnitOfMeasure","DiscountBadge","size"],"sourceRoot":""}