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,EAAO,EAAQ,IACfC,EAAgC,EAAQ,KACxCC,EAAW,EAAQ,IACnBnK,EAAoB,EAAQ,IAC5BoK,EAAW,EAAQ,KACnBhoB,EAAW,EAAQ,IACnBioB,EAAyB,EAAQ,IACjCC,EAAY,EAAQ,IACpBC,EAAqB,EAAQ,KAC7BC,EAAa,EAAQ,KAGzBN,EAA8B,SAAS,SAAUO,EAAOC,EAAaC,GACnE,MAAO,CAGL,SAAeC,GACb,IAAIC,EAAIR,EAAuBr3B,MAC3B83B,EAAU9K,EAAkB4K,QAAUpzB,EAAY8yB,EAAUM,EAAQH,GACxE,OAAOK,EAAUb,EAAKa,EAASF,EAAQC,GAAK,IAAIr1B,OAAOo1B,GAAQH,GAAOroB,EAASyoB,KAIjF,SAAUE,GACR,IAAIC,EAAKb,EAASn3B,MACdi4B,EAAI7oB,EAAS2oB,GACbG,EAAMP,EAAgBD,EAAaM,EAAIC,GAE3C,GAAIC,EAAIC,KAAM,OAAOD,EAAIz9B,MAEzB,IAAKu9B,EAAGI,OAAQ,OAAOZ,EAAWQ,EAAIC,GAEtC,IAAII,EAAcL,EAAGM,QACrBN,EAAGO,UAAY,EAIf,IAHA,IAEIz1B,EAFA01B,EAAI,GACJC,EAAI,EAEgC,QAAhC31B,EAAS00B,EAAWQ,EAAIC,KAAc,CAC5C,IAAIS,EAAWtpB,EAAStM,EAAO,IAC/B01B,EAAEC,GAAKC,EACU,KAAbA,IAAiBV,EAAGO,UAAYhB,EAAmBU,EAAGb,EAASY,EAAGO,WAAYF,IAClFI,IAEF,OAAa,IAANA,EAAU,KAAOD","sources":["webpack://msdyn365.commerce.online/./src/common/components/address-detail-item.tsx?37df","webpack://msdyn365.commerce.online/./src/common/components/address-show.tsx?1a46","webpack://msdyn365.commerce.online/./src/common/components/address-list.tsx?3d4b","webpack://msdyn365.commerce.online/./src/modules/smwe-account-management-address/smwe-account-management-address.tsx?64a7","webpack://msdyn365.commerce.online/./src/modules/smwe-account-management-address/smwe-account-management-address.view.tsx?6d72","webpack://msdyn365.commerce.online/./src/common/components/address-billing-checkbox.tsx?9fec","webpack://msdyn365.commerce.online/./src/common/components/address-billing-heading.tsx?b746","webpack://msdyn365.commerce.online/./src/modules/smwe-checkout-billing-address/smwe-checkout-billing-address.tsx?5de4","webpack://msdyn365.commerce.online/./src/modules/smwe-checkout-billing-address/smwe-checkout-billing-address.view.tsx?a5c5","webpack://msdyn365.commerce.online/./src/common/components/address-select.tsx?a3b0","webpack://msdyn365.commerce.online/./src/modules/smwe-checkout-shipping-address/smwe-checkout-shipping-address.tsx?f83e","webpack://msdyn365.commerce.online/./src/modules/smwe-checkout-shipping-address/smwe-checkout-shipping-address.view.tsx?6613","webpack://msdyn365.commerce.online/./src/checkout-errors/checkout-errors.ts?a9e0","webpack://msdyn365.commerce.online/./src/common/error.tsx?096f","webpack://msdyn365.commerce.online/./src/modules/checkout-customer-account-payment/components/get-account-payment-form-edit-mode.tsx?83e6","webpack://msdyn365.commerce.online/./src/modules/checkout-customer-account-payment/components/get-account-payment-form-summary-mode.tsx?5675","webpack://msdyn365.commerce.online/./src/modules/checkout-customer-account-payment/checkout-customer-account-payment.tsx?de67","webpack://msdyn365.commerce.online/./src/modules/checkout-customer-account-payment/checkout-customer-account-payment.view.tsx?79c6","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/components/checkout-pickup-group.tsx?9de7","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/components/checkout-pickup-utility.ts?b7eb","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/components/checkout-pickup-date-dropdown.tsx?e5a3","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/components/checkout-pickup-timeslot-dropdown.tsx?aef8","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/checkout-pickup.tsx?28aa","webpack://msdyn365.commerce.online/./src/modules/checkout-pickup/checkout-pickup.view.tsx?d64e","webpack://msdyn365.commerce.online/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.check-box.tsx?3b17","webpack://msdyn365.commerce.online/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-message.tsx?c6a5","webpack://msdyn365.commerce.online/./src/modules/checkout-terms-and-conditions/components/checkout-terms-and-conditions.error-title.tsx?f908","webpack://msdyn365.commerce.online/./src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.tsx?9243","webpack://msdyn365.commerce.online/./src/modules/checkout-terms-and-conditions/checkout-terms-and-conditions.view.tsx?26e8","webpack://msdyn365.commerce.online/./node_modules/@msdyn365-commerce/bootloader/node_modules/core-js/modules/es.string.match.js?f0c8"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classname from 'classnames';\r\nimport * as React from 'react';\r\n\r\nexport interface IAddressDetailItem {\r\n isNewLine: boolean;\r\n isShowLabel: boolean;\r\n labelText: string;\r\n name: string;\r\n value: string;\r\n}\r\n\r\nconst AddressDetailItem: React.FC = ({\r\n isNewLine,\r\n isShowLabel,\r\n labelText,\r\n name,\r\n value\r\n}) => {\r\n const className = `msc-address-detail__item msc-address-detail__item-${name.toLowerCase()}`;\r\n const isEmpty = !(value && value.length > 0);\r\n const mainClass = isShowLabel ? `msc-address-detail__item msc-address-detail__item-address-detail_${labelText}` : classname(className, { 'msc-address-detail__item-empty': isEmpty, 'msc-address-detail__item-newline': isNewLine });\r\n value = (name.toLowerCase() === 'phone') ? _formatPhoneNumber(value) : value;\r\n return (\r\n
\r\n {\r\n isShowLabel && <>\r\n {labelText}\r\n \r\n \r\n }\r\n {value}\r\n
\r\n );\r\n};\r\n\r\nfunction _formatPhoneNumber(phoneNumberString: string): string {\r\n const cleaned = phoneNumberString.replace(/\\D/g, '');\r\n const match = cleaned.match(/^(1|)?(\\d{3})(\\d{3})(\\d{4})$/);\r\n if (match) {\r\n const intlCode = (match[1] ? '+1-' : '');\r\n return [intlCode, match[2], '-', match[3], '-', match[4]].join('');\r\n }\r\n return '';\r\n}\r\n\r\nexport default AddressDetailItem;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressItemType, IAddressItem } from '../../common/address-format.data';\r\nimport AddressDetailItemComponent from './address-detail-item';\r\n\r\nexport interface IAddressShowItem {\r\n key: string;\r\n description: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressShowProps {\r\n AddressDetail: INodeProps;\r\n items: IAddressShowItem[];\r\n}\r\n\r\nexport interface IAddressShowInputProps {\r\n addressFormat: IAddressItem[];\r\n address: Address;\r\n}\r\n\r\nexport const AddressShow = (props: IAddressShowInputProps): IAddressShowProps => {\r\n const { addressFormat, address } = props;\r\n\r\n return {\r\n AddressDetail: { className: 'msc-address-detail' },\r\n items: addressFormat.map((item) => {\r\n return {\r\n key: item.name,\r\n description: \r\n };\r\n })\r\n };\r\n};","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classname from 'classnames';\r\nimport * as React from 'react';\r\n\r\nimport { Heading as HeadingData } from '@msdyn365-commerce-modules/data-types';\r\nimport { Heading, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { IAddressResource, IAddressResponse } from '../../common/address-module.data';\r\nimport AddressButtonComponent from './address-button';\r\nimport AddressErrorMessageComponent from './address-error-message';\r\nimport AddressErrorTitleComponent from './address-error-title';\r\nimport { AddressShow, IAddressShowProps } from './address-show';\r\n\r\nexport interface IAddressListError {\r\n Error: INodeProps;\r\n isShowError: boolean;\r\n title: React.ReactNode;\r\n message: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressListItem {\r\n Item: INodeProps;\r\n key: number;\r\n error: IAddressListError;\r\n showItems: IAddressShowProps;\r\n isShowPrimaryButton: boolean;\r\n primaryButton: React.ReactNode;\r\n editButton: React.ReactNode;\r\n}\r\n\r\nexport interface IAddressList {\r\n List: INodeProps;\r\n isShowList: boolean;\r\n heading: React.ReactNode;\r\n items: IAddressListItem[];\r\n}\r\n\r\nexport interface IAddressListProps {\r\n ListAddress: INodeProps;\r\n heading: React.ReactNode;\r\n isShowEmptyListMessage: boolean;\r\n emptyListMessage: React.ReactNode;\r\n addButton: React.ReactNode;\r\n primaryAddressList: IAddressList;\r\n otherAddressList: IAddressList;\r\n}\r\n\r\nexport interface IAddressListInputProps {\r\n isUpdating?: boolean;\r\n selectedAddress?: Address;\r\n addressFormat: AddressFormat;\r\n addresses: Address[];\r\n heading?: HeadingData;\r\n primaryAddressSectionHeading?: HeadingData;\r\n otherAddressSectionHeading?: HeadingData;\r\n addressActionResponse?: IAddressResponse;\r\n resources: IAddressResource;\r\n onAddAddress(): void;\r\n onEditAddress(address?: Address): void;\r\n onUpdatePrimaryAddress(address: Address): void;\r\n}\r\n\r\nconst getButtonAriaLabel = (ariaLabel: string, addressName?: string): string => {\r\n return ariaLabel.replace('{addressName}', addressName || '');\r\n};\r\n\r\nconst getAddressList = (className: string, addresses: Address[], showPrimaryButton: boolean, props: IAddressListInputProps, heading?: HeadingData): IAddressList => {\r\n const { resources, isUpdating, addressActionResponse, selectedAddress, addressFormat, onEditAddress, onUpdatePrimaryAddress } = props;\r\n const { errorTitle = null, errorMessage = null } = addressActionResponse || {};\r\n\r\n return {\r\n List: { className: className },\r\n isShowList: addresses.length > 0,\r\n heading: heading && ,\r\n items: addresses.map((address: Address): IAddressListItem => {\r\n const isSelectedAddress = selectedAddress && selectedAddress.RecordId === address.RecordId;\r\n const isShowError = isSelectedAddress && errorTitle && errorMessage;\r\n return {\r\n Item: { className: `${className}-list` },\r\n key: address.RecordId || 0,\r\n showItems: AddressShow({ addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''), address: address }),\r\n error: {\r\n Error: { className: `${className}-error` },\r\n isShowError: isShowError ? true : false,\r\n title: ,\r\n message: \r\n },\r\n isShowPrimaryButton: showPrimaryButton,\r\n\r\n primaryButton: (\r\n { onUpdatePrimaryAddress(address); }\r\n }\r\n }\r\n />\r\n ),\r\n editButton: (\r\n { onEditAddress(address); }\r\n }\r\n }\r\n />\r\n )\r\n };\r\n })\r\n };\r\n};\r\n\r\nconst getPrimaryAddressList = (props: IAddressListInputProps): IAddressList => {\r\n const { addresses, primaryAddressSectionHeading } = props;\r\n const primaryAddresses = addresses.filter((address: Address) => address.IsPrimary);\r\n return getAddressList('msc-address-list__primary', primaryAddresses, false, props, primaryAddressSectionHeading);\r\n};\r\n\r\nconst getOtherAddressList = (props: IAddressListInputProps): IAddressList => {\r\n const { addresses, otherAddressSectionHeading } = props;\r\n const otherAddresses = addresses.filter((address: Address) => !address.IsPrimary);\r\n return getAddressList('msc-address-list__primary', otherAddresses, true, props, otherAddressSectionHeading);\r\n};\r\n\r\nexport const AddressList = (props: IAddressListInputProps): IAddressListProps => {\r\n const { addresses, heading, resources, onAddAddress } = props;\r\n\r\n return {\r\n ListAddress: { className: 'ms-address-list' },\r\n heading: heading && ,\r\n isShowEmptyListMessage: addresses.length === 0,\r\n emptyListMessage:

{resources.addressEmptyListAddressMessage}

,\r\n addButton: (\r\n \r\n ),\r\n primaryAddressList: getPrimaryAddressList(props),\r\n otherAddressList: getOtherAddressList(props)\r\n };\r\n};\r\n","\r\n/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classnames from 'classnames';\r\nimport { observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n Address, CountryRegionInfo, StateProvinceInfo\r\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressCommon } from '../../common/address-common';\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { AddressItemType } from '../../common/address-format.data';\r\nimport { AddressMetaData } from '../../common/address-meta-data';\r\nimport {\r\n AddressOperation, AddressType, IAddressResource, IAddressResponse\r\n} from '../../common/address-module.data';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport { AddressList, IAddressListProps } from '../../common/components/address-list';\r\nimport { ISmweAccountManagementAddressData } from './smwe-account-management-address.data';\r\nimport { ISmweAccountManagementAddressProps } from './smwe-account-management-address.props.autogenerated';\r\n\r\nexport interface IAccountManagementAddressViewState {\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\nexport interface IAccountManagementAddressViewProps extends React.Component> {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n customerAddresses: Address[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: IAccountManagementAddressViewState;\r\n AccountAddressManagement: IModuleProps;\r\n isUpdating: boolean;\r\n showAddressList: IAddressListProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n}\r\n\r\n/**\r\n *\r\n * Address component\r\n * @extends {React.Component>}\r\n */\r\n@observer\r\nclass AccountManagementAddress extends React.Component> {\r\n @observable private currentOperation: AddressOperation;\r\n @observable private selectedAddress?: Address;\r\n @observable private countryRegionId: string = 'USA';\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n @observable private customerAddresses: Address[];\r\n @observable private addUpdateAddress: Address;\r\n @observable private validationError: object;\r\n @observable private addressActionResponse?: IAddressResponse;\r\n @observable private isUpdating?: boolean;\r\n @observable private hasError?: boolean;\r\n\r\n private addressCommon: AddressCommon;\r\n private addressFormat: AddressFormat;\r\n private countryRegions: CountryRegionInfo[];\r\n private customerAccountNumber?: string;\r\n private resources: IAddressResource;\r\n\r\n constructor(props: ISmweAccountManagementAddressProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.customerAccountNumber = context && context.request && context.request.user && context.request.user.customerAccountNumber;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.addressFormat = new AddressFormat(context, this.countryRegions, new AddressMetaData({ ...resources }));\r\n this.addressCommon = new AddressCommon(context, resources, telemetry, this.customerAccountNumber);\r\n this._setDefaultCountryRegionId();\r\n }\r\n\r\n public componentDidMount(): void {\r\n reaction(\r\n () => this.countryRegionId,\r\n () => this._getStateProvinces()\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element {\r\n const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n customerAddresses: this.customerAddresses,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n isUpdating: this.isUpdating,\r\n hasError: this.hasError,\r\n className: config.className,\r\n viewState: {\r\n isShowAddresList: this.currentOperation === AddressOperation.List,\r\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.List,\r\n },\r\n AccountAddressManagement: {\r\n moduleProps: this.props,\r\n className: classnames('ms-account-management-address', config.className)\r\n },\r\n showAddressList: this._renderListAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate(\r\n {\r\n isUpdating: this.isUpdating,\r\n resources: this.resources,\r\n addressType: AddressType.Shipping,\r\n addressFormat: this.addressFormat.getAddressFormat((this.addUpdateAddress.ThreeLetterISORegionName) || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(this.resources.addressStateDefaultSelectionText, this.stateProvinceInfo, true),\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n onSave: this._onAddressAddUpdateSubmit,\r\n onCancel: this._resetView\r\n }\r\n );\r\n };\r\n\r\n private _renderListAddress = (): IAddressListProps => {\r\n const { config } = this.props;\r\n\r\n return AddressList(\r\n {\r\n isUpdating: this.isUpdating,\r\n selectedAddress: this.selectedAddress,\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n resources: this.resources,\r\n heading: config.heading,\r\n primaryAddressSectionHeading: config.primaryAddressSectionHeading,\r\n otherAddressSectionHeading: config.otherAddressSectionHeading,\r\n onEditAddress: this._goToEditAddress,\r\n onAddAddress: this._goToAddAddress,\r\n onUpdatePrimaryAddress: this._onSubmitUpdatePrimaryAddress\r\n }\r\n );\r\n };\r\n\r\n private onAddressAddUpdate = (name: string, value: string) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n };\r\n\r\n private _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n };\r\n\r\n private _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n private _onAddressUpdate = (response: Promise, onSuccess: (response: IAddressResponse) => void): void => {\r\n this.isUpdating = true;\r\n response.then(\r\n (result: IAddressResponse) => {\r\n if (result.address) {\r\n this.hasError = false;\r\n onSuccess(result);\r\n } else {\r\n this.hasError = true;\r\n this.addressActionResponse = result;\r\n }\r\n this.isUpdating = false;\r\n },\r\n () => {\r\n this.hasError = true;\r\n this.isUpdating = false;\r\n }\r\n );\r\n };\r\n\r\n private _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n return;\r\n }\r\n\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow()) {\r\n response = this.currentOperation === AddressOperation.Update ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress) : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\r\n } else {\r\n response = Promise.resolve({ address: this.addUpdateAddress });\r\n }\r\n\r\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\r\n };\r\n\r\n private _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: countryRegionId });\r\n };\r\n\r\n private _getStateProvinces = (): void => {\r\n if (!this.countryRegionId || !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\r\n return;\r\n }\r\n\r\n // tslint:disable-next-line:no-floating-promises\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then(\r\n (result: StateProvinceInfo[]) => {\r\n this.stateProvinceInfo = result;\r\n }).catch(e => this.props.telemetry.exception(e));\r\n };\r\n\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n private _updateCurrentOperation = (operation: AddressOperation) => {\r\n this.currentOperation = operation;\r\n };\r\n\r\n private _onSubmitUpdatePrimaryAddress = (address: Address): void => {\r\n this.selectedAddress = address;\r\n const response = this.addressCommon.updateCustomerPrimaryAddress(address);\r\n this._onAddressUpdate(response, this._onUpdatePrimaryAddressSuccess);\r\n };\r\n\r\n private _goToEditAddress = (address: Address): void => {\r\n this.addUpdateAddress = { ...address };\r\n this.countryRegionId = this.addUpdateAddress.ThreeLetterISORegionName || 'USA';\r\n this._updateCurrentOperation(AddressOperation.Update);\r\n };\r\n\r\n private _goToAddAddress = (): void => {\r\n this.addUpdateAddress = {};\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: this.countryRegionId });\r\n\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n private _onAddOrUpdateSuccess = (response: IAddressResponse): void => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n this._resetView();\r\n };\r\n\r\n private _onUpdatePrimaryAddressSuccess = (response: IAddressResponse): void => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n };\r\n\r\n private _resetView = (): void => {\r\n this.selectedAddress = undefined;\r\n this._updateCurrentOperation(AddressOperation.List);\r\n };\r\n}\r\n\r\nexport default AccountManagementAddress;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport { IAddressList, IAddressListItem, IAddressListProps } from '../../common/components/address-list';\r\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\r\nimport { IAccountManagementAddressViewProps } from './smwe-account-management-address';\r\nimport { ISmweAccountManagementAddressConfig } from './smwe-account-management-address.props.autogenerated';\r\n\r\nconst AddressShow: React.FC = ({\r\n AddressDetail,\r\n items\r\n}) => {\r\n\r\n return (\r\n \r\n {items && items.map((item: IAddressShowItem) => {\r\n return (\r\n <>\r\n {item.description}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\nconst AddressList: React.FC = ({\r\n List,\r\n isShowList,\r\n heading,\r\n items\r\n}) => {\r\n\r\n if (!isShowList) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {heading}\r\n {items && items.map((item: IAddressListItem) => {\r\n const { Item, key, error, showItems, isShowPrimaryButton, primaryButton, editButton } = item;\r\n const { Error, isShowError, title, message } = error;\r\n return (\r\n \r\n {isShowError && \r\n {title}\r\n {message}\r\n }\r\n {isShowPrimaryButton && primaryButton}\r\n {editButton}\r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\nconst AddressLists: React.FC = ({\r\n ListAddress,\r\n heading,\r\n isShowEmptyListMessage,\r\n emptyListMessage,\r\n addButton,\r\n primaryAddressList,\r\n otherAddressList\r\n}) => {\r\n\r\n return (\r\n \r\n {heading}\r\n {isShowEmptyListMessage && emptyListMessage}\r\n {addButton}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n}) => {\r\n\r\n return (\r\n \r\n {heading}\r\n {items && items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n {label}\r\n {alert}\r\n {input}\r\n );\r\n })}\r\n {hasError && \r\n {error.title}\r\n {error.message}\r\n }\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\nconst AccountManagementAddressView: React.FC = props => {\r\n const { AccountAddressManagement, viewState, showAddressList, showAddOrUpdateAddress } = props;\r\n const headingText = (AccountAddressManagement.moduleProps.config as ISmweAccountManagementAddressConfig).heading?.text;\r\n\r\n return (\r\n
\r\n {headingText}\r\n \r\n {viewState.isShowAddresList && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default AccountManagementAddressView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\nimport { WineClubDataStore } from '../../modules/wine-club-signup/wine-club-data';\r\nimport { AddressInputComponent } from './address-input';\r\n\r\nexport interface IAddressBillingCheckbox {\r\n isChecked: boolean;\r\n value: string;\r\n ariaLabel: string;\r\n text: string;\r\n wineState: boolean;\r\n onChange(event: React.ChangeEvent): void;\r\n}\r\n\r\nconst AddressBillingCheckbox: React.FC = ({\r\n isChecked,\r\n value,\r\n ariaLabel,\r\n text,\r\n wineState,\r\n onChange\r\n}) => {\r\n\r\n const additionalAttributes = {\r\n checked: isChecked,\r\n 'aria-checked': isChecked,\r\n };\r\n\r\n const clubData = WineClubDataStore.getInstance().get();\r\n let shouldShowCheckbox = true;\r\n if (clubData.deliveryType === 'PICKUP' && wineState) {\r\n shouldShowCheckbox = false;\r\n }\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nexport default AddressBillingCheckbox;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nexport interface IAddressBillingHeading {\r\n text: string;\r\n}\r\n\r\nconst IAddressBillingHeadingGenerator: React.FC = ({\r\n text\r\n}) => (\r\n

{text}

\r\n );\r\n\r\nexport default IAddressBillingHeadingGenerator;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport {\r\n Address, AttributeValue, CountryRegionInfo, GiftCard, StateProvinceInfo\r\n} from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { AddressCommon } from '../../common/address-common';\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { AddressItemType } from '../../common/address-format.data';\r\nimport { AddressMetaData } from '../../common/address-meta-data';\r\nimport {\r\n AddressOperation, AddressType, IAddressResource, IAddressResponse\r\n} from '../../common/address-module.data';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport AddressBillingCheckoxComponent from '../../common/components/address-billing-checkbox';\r\nimport AddressBillingHeadingComponent from '../../common/components/address-billing-heading';\r\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\r\n\r\nimport { ICheckoutState } from '@msdyn365-commerce/global-state';\r\nimport { WineClubDataStore } from '../wine-club-signup/wine-club-data';\r\nimport { ISmweCheckoutBillingAddressData } from './smwe-checkout-billing-address.data';\r\nimport { ISmweCheckoutBillingAddressProps } from './smwe-checkout-billing-address.props.autogenerated';\r\nimport { updateAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/CartsDataActions.g';\r\n\r\nexport interface IProps extends ISmweCheckoutBillingAddressProps, IModuleStateProps { }\r\n\r\nexport interface ICheckoutBillingAddressViewState {\r\n isShowAddress: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n isShowSameAsShippingCheckbox: boolean;\r\n}\r\n\r\nexport interface ICheckoutBillingAddressViewProps extends IProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutBillingAddressViewState;\r\n CheckoutBillingAddress: IModuleProps;\r\n sameAsShippingCheckbox: React.ReactNode;\r\n heading: React.ReactNode;\r\n showAddress: IAddressShowProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutBillingAddress component\r\n * @extends {React.PureComponent>}\r\n */\r\n// @ts-ignore\r\n@withModuleState\r\n@observer\r\nclass CheckoutBillingAddress extends React.Component {\r\n\r\n @observable private currentOperation: AddressOperation;\r\n @observable private isBillingAddressSameAsShipping: boolean;\r\n @observable private selectedAddress?: Address;\r\n @observable private addUpdateAddress: Address;\r\n @observable private countryRegionId: string = 'USA';\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n @observable private validationError: object;\r\n @observable private addressActionResponse?: IAddressResponse;\r\n\r\n private addressCommon: AddressCommon;\r\n private addressFormat: AddressFormat;\r\n private countryRegions: CountryRegionInfo[];\r\n private customerAccountNumber?: string;\r\n private resources: IAddressResource;\r\n // private addRenderRef: React.RefObject;\r\n\r\n constructor(props: IProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.isBillingAddressSameAsShipping = false;\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.customerAccountNumber = context && context.request && context.request.user && context.request.user.customerAccountNumber;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressFormat = new AddressFormat(context, this.countryRegions, new AddressMetaData({ ...resources }));\r\n this.addressCommon = new AddressCommon(context, resources, telemetry, this.customerAccountNumber);\r\n\r\n // this.addRenderRef = React.createRef();\r\n }\r\n\r\n public componentDidMount(): void {\r\n this.props.data.checkout.then(() => {\r\n this._initModuleState();\r\n this._setDefaultCountryRegionId();\r\n }).catch(e => this.props.telemetry.exception(e));\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => this._getStateProvinces()\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress,\r\n shippingAddress => {\r\n if (this.props.moduleState.isUpdating) {\r\n if (shippingAddress && this.isBillingAddressSameAsShipping) {\r\n this.isBillingAddressSameAsShipping = true;\r\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\r\n } else if (shippingAddress && this.isBillingAddressSameAsShipping) {\r\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\r\n }\r\n }\r\n }\r\n );\r\n\r\n reaction(\r\n () => this.isBillingAddressRequried,\r\n isBillingAddressRequried => {\r\n if (isBillingAddressRequried && this.props.moduleState.isDisabled) {\r\n this.onEdit();\r\n } else {\r\n this.props.moduleState.onDisable();\r\n }\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!(this.isBillingAddressRequried)) {\r\n return null;\r\n }\r\n\r\n const { resources } = this.props;\r\n\r\n const { renderView, config } = this.props;\r\n\r\n const clubStore = WineClubDataStore.getInstance().get();\r\n const wineState = this.props.moduleState.getModuleByTypeName('checkout-club-info-collector').hasModuleState;\r\n\r\n let isShowSameAsShippingCheckbox = this.isCartContainsItemsForShipping && this.props.moduleState.isUpdating;\r\n if (clubStore.deliveryType === 'PICKUP' && wineState) {\r\n isShowSameAsShippingCheckbox = false;\r\n }\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.selectedAddress && this.currentOperation === AddressOperation.Show,\r\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.Show,\r\n isShowSameAsShippingCheckbox: isShowSameAsShippingCheckbox\r\n },\r\n CheckoutBillingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-billing-address', config.className)\r\n },\r\n heading: ,\r\n\r\n // tslint:disable-next-line: max-line-length\r\n sameAsShippingCheckbox: (\r\n \r\n ),\r\n showAddress: this._renderShowAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate(\r\n {\r\n resources: this.resources,\r\n addressType: AddressType.Billing,\r\n addressFormat: this.addressFormat.getAddressFormat((this.addUpdateAddress.ThreeLetterISORegionName) || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(this.resources.addressStateDefaultSelectionText, this.stateProvinceInfo),\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n onSave: this._onSubmitAddress,\r\n onCancel: this._resetView\r\n }\r\n );\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({ address: this.selectedAddress, addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || '') });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: countryRegionId });\r\n };\r\n\r\n private onAddressAddUpdate = (name: string, value: string) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n };\r\n\r\n private _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n };\r\n\r\n private _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n private _getStateProvinces = (): void => {\r\n if (!this.countryRegionId || !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\r\n return;\r\n }\r\n\r\n // tslint:disable-next-line:no-floating-promises\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then(\r\n (result: StateProvinceInfo[]) => {\r\n this.stateProvinceInfo = result;\r\n }).catch(e => this.props.telemetry.exception(e));\r\n };\r\n\r\n private _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n status: this.isBillingAddressRequried ? 'updating' : 'disabled',\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit\r\n });\r\n\r\n if (this.isBillingAddressRequried) {\r\n const { checkout } = this.props.data;\r\n const cart = checkout.result && checkout.result.checkoutCart.cart;\r\n if (this.isCartContainsItemsForShipping) {\r\n const clubStore = WineClubDataStore.getInstance().get();\r\n const wineState = this.props.moduleState.getModuleByTypeName('checkout-club-info-collector').hasModuleState;\r\n if (clubStore.deliveryType === 'PICKUP' && wineState) {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n } else {\r\n this.isBillingAddressSameAsShipping = true;\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n }\r\n } else if (cart && cart.CartLines && cart.CartLines.filter(item=>item.ItemId==='GIFTCARD').length===1) {\r\n if (this.billingAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.billingAddress);\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n } else {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n };\r\n\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n private _onBillingAddressSameAsShippingChange = (event: React.ChangeEvent) => {\r\n this.isBillingAddressSameAsShipping = event.currentTarget.checked;\r\n\r\n if (this.isBillingAddressSameAsShipping && this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\r\n }\r\n };\r\n\r\n @computed get isCartContainsItemsForShipping(): boolean {\r\n const { request } = this.props.context;\r\n\r\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\r\n return ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine => cartLine.DeliveryMode !== pickupDeliveryModeCode);\r\n }\r\n\r\n @computed get billingAddress(): Address | undefined {\r\n return this.props.data.checkout.result && this.props.data.checkout.result.billingAddress;\r\n }\r\n\r\n @computed get shippingAddress(): Address | undefined {\r\n return this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress;\r\n }\r\n\r\n @computed get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n return checkoutState && checkoutState.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\r\n }\r\n\r\n @computed get getGiftCardTotalAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.giftCards) {\r\n return 0;\r\n }\r\n return checkoutState.giftCards.reduce(\r\n (count: number, giftCard: GiftCard) => {\r\n return count + (giftCard.Balance || 0);\r\n },\r\n 0);\r\n }\r\n\r\n @computed get shouldPaidByCard(): boolean {\r\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\r\n if (!cart || !cart.CartLines || !cart.CartLines.length) {\r\n return false;\r\n }\r\n // Use payment card when it is not free or gift card balance + Loyalty amount can not cover the total amount\r\n const amountDue = (cart.TotalAmount || 0) - this.getGiftCardTotalAmount - this.getLoyaltyAmount;\r\n return amountDue > 0;\r\n }\r\n\r\n @computed get isBillingAddressRequried(): boolean {\r\n return this.shouldPaidByCard;\r\n }\r\n\r\n private _onSubmitAddress = (): void => {\r\n const isBilling = true;\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, isBilling)) {\r\n this.props.moduleState.setHasError(true);\r\n return;\r\n }\r\n\r\n void this._setBillingAddress(this.addUpdateAddress).then(async () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.addUpdateAddress);\r\n this._updateModuleState();\r\n // tslint:disable-next-line:no-floating-promises\r\n await this.updateCartDeliverySpecification();\r\n });\r\n };\r\n\r\n private updateCartDeliverySpecification = async(): Promise => {\r\n const { resources } = this.props;\r\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\r\n if(this.props.data.checkout.result?.checkoutCart.cart &&\r\n this.props.data.checkout.result?.checkoutCart.cart.CartLines &&\r\n this.props.data.checkout.result?.checkoutCart.cart.CartLines.length > 0 &&\r\n this.props.data.checkout.result?.checkoutCart.cart.CartLines[0].DeliveryMode) {\r\n const updateCartDeliverySpecificationInput = {\r\n deliveryModeId: this.props.data.checkout.result?.checkoutCart.cart.CartLines[0].DeliveryMode || '',\r\n shippingAddress: checkoutState.shippingAddress\r\n };\r\n await checkoutState.checkoutCart.updateCartDeliverySpecification(updateCartDeliverySpecificationInput)\r\n .then((response) => {\r\n if (\r\n response.status === 'FAILED' &&\r\n response.substatus === 'NOCONTENT' &&\r\n this._containsOnlyGifts()\r\n ) {\r\n this.onReady();\r\n return;\r\n }\r\n if (response.status === 'FAILED') {\r\n this.setError(resources.addressGenericErrorMessage);\r\n } else {\r\n this.onReady();\r\n }\r\n })\r\n .catch(\r\n () => {\r\n this.setError(resources.addressGenericErrorMessage);\r\n }\r\n );\r\n }\r\n };\r\n\r\n private async _containsOnlyGifts(): Promise {\r\n const cart = await this.props.data.checkout;\r\n const emailCode = this.props.context.request.channel?.EmailDeliveryModeCode;\r\n const nonDigitalItems = cart.checkoutCart.cart.CartLines?.filter(line => line.DeliveryMode !== emailCode);\r\n return nonDigitalItems?.length === 0;\r\n }\r\n\r\n private onReady = () => {\r\n this.props.moduleState.onReady();\r\n };\r\n\r\n private setError = (errorMessage: string): void => {\r\n this.props.telemetry.error(errorMessage);\r\n this.props.moduleState.setHasError(true);\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private onSubmit = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._onSubmitAddress();\r\n break;\r\n case AddressOperation.Show:\r\n if (this.selectedAddress) {\r\n void this._setBillingAddress(this.selectedAddress).then(async () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.selectedAddress);\r\n this._updateModuleState();\r\n // tslint:disable-next-line:no-floating-promises\r\n await this.updateCartDeliverySpecification();\r\n });\r\n }\r\n break;\r\n default:\r\n // tslint:disable-next-line:no-floating-promises\r\n void this.updateCartDeliverySpecification();\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onCancel = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._resetView();\r\n break;\r\n case AddressOperation.Show:\r\n // @ts-ignore: Compiler not reconizing property form extending class\r\n this._resetView();\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onEdit = (): void => {\r\n if (this.isBillingAddressSameAsShipping && this.shippingAddress && this.isCartContainsItemsForShipping) {\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\r\n }\r\n this.props.moduleState.onUpdating();\r\n };\r\n\r\n private _setBillingAddress = async (address: Address): Promise => {\r\n if (this.props.data.checkout.result) {\r\n // tslint:disable-next-line: no-floating-promises\r\n await this.props.data.checkout.result.updateBillingAddress({ newBillingAddress: address }).then(async () => {\r\n const wineState = this.props.moduleState.getModuleByTypeName(\r\n 'checkout-club-info-collector'\r\n ).hasModuleState;\r\n const clubStore = WineClubDataStore.getInstance().get();\r\n if (wineState && clubStore.deliveryType === 'PICKUP') {\r\n const checkoutCart = this.props.data.checkout.result\r\n ?.checkoutCart;\r\n const attributeValues =\r\n (checkoutCart?.cart.AttributeValues as AttributeValue[]) ||\r\n [];\r\n const billingIndex = attributeValues.findIndex(\r\n (item) => item.Name === 'BillingAddress'\r\n );\r\n const billingAddress: Address = {\r\n AttentionTo: address.AttentionTo,\r\n BuildingCompliment: address.BuildingCompliment,\r\n City: address.City,\r\n County: address.County,\r\n DistrictName: address.DistrictName,\r\n Email: address.Email,\r\n IsAsyncAddress: address.IsAsyncAddress,\r\n Name: address.Name,\r\n Phone: address.Phone,\r\n State: address.State,\r\n Street: address.Street,\r\n StreetNumber: address.StreetNumber,\r\n ThreeLetterISORegionName: address.ThreeLetterISORegionName,\r\n ZipCode: address.ZipCode,\r\n };\r\n const attr = {\r\n // @ts-ignore\r\n '@odata.type':\r\n '#Microsoft.Dynamics.Commerce.Runtime.DataModel.AttributeTextValue',\r\n Name: 'BillingAddress',\r\n TextValue: JSON.stringify({ ...billingAddress }),\r\n TextValueTranslations: []\r\n };\r\n\r\n if (billingIndex >= 0) {\r\n attributeValues[billingIndex] = attr;\r\n } else {\r\n attributeValues.push(attr);\r\n }\r\n await updateAsync(\r\n { callerContext: this.props.context.actionContext },\r\n checkoutCart!.cart\r\n );\r\n await checkoutCart!.refreshCart({});\r\n }\r\n });\r\n }\r\n };\r\n\r\n private _resetView = () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.billingAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n private _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = { ...this.selectedAddress } || {};\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId });\r\n }\r\n };\r\n\r\n private _updateModuleState = () => {\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutBillingAddress;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\r\nimport { ICheckoutBillingAddressViewProps } from './smwe-checkout-billing-address';\r\n\r\nconst AddressShow: React.FC = ({\r\n AddressDetail,\r\n items\r\n}) => {\r\n\r\n return (\r\n \r\n {items && items.map((item: IAddressShowItem) => {\r\n return (\r\n <>\r\n {item.description}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n}) => {\r\n\r\n return (\r\n \r\n {heading}\r\n {items && items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n {label}\r\n {alert}\r\n {input}\r\n );\r\n })}\r\n {hasError && \r\n {error.title}\r\n {error.message}\r\n }\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\nconst CheckoutBillingAddressView: React.FC = props => {\r\n const { CheckoutBillingAddress, viewState, heading, sameAsShippingCheckbox, showAddress, showAddOrUpdateAddress } = props;\r\n\r\n return (\r\n
\r\n {props.config.heading?.text}\r\n \r\n {heading}\r\n {viewState.isShowSameAsShippingCheckbox && sameAsShippingCheckbox}\r\n
(Provide full name and address matching your driver's license)
\r\n
 
\r\n {viewState.isShowAddress && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default CheckoutBillingAddressView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { IAddressResource } from '../../common/address-module.data';\r\nimport AddressButtonComponent from './address-button';\r\nimport { AddressInputComponent } from './address-input';\r\nimport { AddressShow, IAddressShowProps } from './address-show';\r\n\r\nexport interface IAddressSelectInputProps {\r\n hasExternalSubmitGroup?: boolean;\r\n addressFormat: AddressFormat;\r\n addresses: Address[];\r\n resources: IAddressResource;\r\n selectedAddress: Address;\r\n onAddressOptionChange(event: React.ChangeEvent): void;\r\n onAddAddress(): void;\r\n onSave(): void;\r\n onCancel(): void;\r\n}\r\n\r\nexport interface IAddressSelectItem {\r\n key: number;\r\n SelectItem: INodeProps;\r\n input: React.ReactNode;\r\n showItems: IAddressShowProps;\r\n}\r\n\r\nexport interface IAddressSelectProps {\r\n SelectAddress: INodeProps;\r\n addButton: React.ReactNode;\r\n items: IAddressSelectItem[];\r\n isShowSaveButton: boolean;\r\n saveButton: React.ReactNode;\r\n isShowCancelButton: boolean;\r\n cancelButton: React.ReactNode;\r\n}\r\n\r\nconst getInput = (index: number, address: Address, props: IAddressSelectInputProps): React.ReactNode => {\r\n const { addresses, onAddressOptionChange, selectedAddress } = props;\r\n\r\n const ichecked = address.RecordId === selectedAddress.RecordId;\r\n const additionalAttributes = {\r\n checked: ichecked,\r\n 'aria-checked': ichecked,\r\n 'aria-setsize': addresses.length,\r\n 'aria-posinset': index + 1\r\n };\r\n\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst getAddressSelectItems = (props: IAddressSelectInputProps): IAddressSelectItem[] => {\r\n const { addresses, addressFormat } = props;\r\n\r\n return addresses.map((address, index) => {\r\n return {\r\n key: address.RecordId || 0,\r\n SelectItem: { className: 'msc-address-select__item' },\r\n input: getInput(index, address, props),\r\n showItems: AddressShow({ addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''), address: address })\r\n };\r\n });\r\n};\r\n\r\nexport const AddressSelect = (props: IAddressSelectInputProps): IAddressSelectProps => {\r\n const { resources, onCancel, onSave, onAddAddress, hasExternalSubmitGroup } = props;\r\n\r\n return {\r\n SelectAddress: { className: 'msc-address-select' },\r\n addButton: (\r\n \r\n ),\r\n isShowSaveButton: !hasExternalSubmitGroup,\r\n saveButton: (\r\n \r\n ),\r\n isShowCancelButton: !hasExternalSubmitGroup,\r\n cancelButton: (\r\n \r\n ),\r\n items: getAddressSelectItems(props)\r\n };\r\n};","\r\n/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport classnames from 'classnames';\r\nimport { computed, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { IModuleStateProps, statusType, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { Address, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\n\r\nimport { AddressCommon } from '../../common/address-common';\r\nimport { AddressFormat } from '../../common/address-format';\r\nimport { AddressItemType } from '../../common/address-format.data';\r\nimport { AddressMetaData } from '../../common/address-meta-data';\r\nimport {\r\n AddressOperation, AddressType, IAddressResource, IAddressResponse\r\n} from '../../common/address-module.data';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport { AddressSelect, IAddressSelectProps } from '../../common/components/address-select';\r\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\r\nimport { WineClubDataStore } from '../wine-club-signup/wine-club-data';\r\nimport { ISmweCheckoutShippingAddressData } from './smwe-checkout-shipping-address.data';\r\nimport { ISmweCheckoutShippingAddressProps } from './smwe-checkout-shipping-address.props.autogenerated';\r\n\r\nexport interface IProps extends ISmweCheckoutShippingAddressProps, IModuleStateProps { }\r\n\r\nexport interface ICheckoutShippingAddressViewState {\r\n isShowAddress: boolean;\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\nexport interface ICheckoutShippingAddressViewProps extends IProps {\r\n className: string;\r\n currentOperation: AddressOperation;\r\n selectedAddress?: Address;\r\n addUpdateAddress: Address;\r\n addressListSelectedAddress: Address;\r\n countryRegionId: string;\r\n stateProvinceInfo?: StateProvinceInfo[];\r\n customerAddresses: Address[];\r\n validationError: object;\r\n addressActionResponse?: IAddressResponse;\r\n viewState: ICheckoutShippingAddressViewState;\r\n CheckoutShippingAddress: IModuleProps;\r\n isUpdating: boolean;\r\n hasError: boolean;\r\n showAddress: IAddressShowProps;\r\n showAddressSelect: IAddressSelectProps;\r\n showAddOrUpdateAddress: IAddressAddUpdateProps;\r\n}\r\n\r\n/**\r\n *\r\n * Address component\r\n * @extends {React.Component>}\r\n */\r\n// @ts-ignore\r\n@withModuleState\r\n@observer\r\nclass CheckoutShippingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n @observable private selectedAddress?: Address;\r\n @observable private addUpdateAddress: Address;\r\n @observable private countryRegionId: string = 'USA';\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n @observable private customerAddresses: Address[];\r\n @observable private validationError: object;\r\n @observable private addressActionResponse?: IAddressResponse;\r\n @observable private isUpdating?: boolean;\r\n @observable private hasError?: boolean;\r\n @observable private addressListSelectedAddress: Address = {};\r\n\r\n private addressCommon: AddressCommon;\r\n private addressFormat: AddressFormat;\r\n private countryRegions: CountryRegionInfo[];\r\n private customerAccountNumber?: string;\r\n private resources: IAddressResource;\r\n\r\n constructor(props: IProps) {\r\n super(props);\r\n const { context, data, resources, telemetry } = this.props;\r\n\r\n this.addUpdateAddress = {};\r\n this.resources = resources;\r\n this.currentOperation = AddressOperation.List;\r\n this.customerAccountNumber = context && context.request && context.request.user && context.request.user.customerAccountNumber;\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressFormat = new AddressFormat(context, this.countryRegions, new AddressMetaData({ ...resources }));\r\n this.addressCommon = new AddressCommon(context, resources, telemetry, this.customerAccountNumber);\r\n this.validationError = {};\r\n }\r\n\r\n public componentDidMount(): void {\r\n this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n }).catch(e => this.props.telemetry.exception(e));\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => this._getStateProvinces()\r\n );\r\n\r\n reaction(\r\n () => this.currentOperation,\r\n () => {\r\n this._getStateProvinces();\r\n }\r\n );\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this._canShip()) {\r\n return null;\r\n }\r\n\r\n const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.selectedAddress,\r\n addUpdateAddress: this.addUpdateAddress,\r\n addressListSelectedAddress: this.addressListSelectedAddress,\r\n countryRegionId: this.countryRegionId,\r\n stateProvinceInfo: this.stateProvinceInfo,\r\n customerAddresses: this.customerAddresses,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n isUpdating: this.isUpdating,\r\n hasError: this.hasError,\r\n className: config.className,\r\n viewState: {\r\n isShowAddress: this.currentOperation === AddressOperation.Show && this.selectedAddress,\r\n isShowAddresList: this.currentOperation === AddressOperation.List && this.customerAddresses.length > 0,\r\n isShowAddOrUpdateAddress: this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update,\r\n },\r\n CheckoutShippingAddress: {\r\n moduleProps: this.props,\r\n className: classnames('ms-checkout-shipping-address', config.className)\r\n },\r\n showAddress: this._renderShowAddress(),\r\n showAddressSelect: this._renderSelectAddress(),\r\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n\r\n }\r\n\r\n private _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate(\r\n {\r\n isUpdating: this.isUpdating,\r\n resources: this.resources,\r\n addressType: AddressType.Shipping,\r\n addressFormat: this.addressFormat.getAddressFormat((this.addUpdateAddress.ThreeLetterISORegionName) || this.countryRegionId),\r\n defaultCountryRegionId: this.countryRegionId,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n hasError: this.hasError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(this.resources.addressStateDefaultSelectionText, this.stateProvinceInfo, true),\r\n onInputChange: this._onAddressAddUpdateInputChange,\r\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n onSave: this.onSubmit,\r\n // tslint:disable-next-line: no-empty\r\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => { } : this._resetView\r\n }\r\n );\r\n };\r\n\r\n private _renderSelectAddress = (): IAddressSelectProps => {\r\n return AddressSelect(\r\n {\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n resources: this.resources,\r\n selectedAddress: this.addressListSelectedAddress,\r\n onAddressOptionChange: this._onAddressOptionChange,\r\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\r\n onAddAddress: this._goToAddAddress,\r\n onSave: this._onSelectAddress,\r\n // tslint:disable-next-line: no-empty\r\n onCancel: !this.selectedAddress ? () => { } : this._resetView\r\n }\r\n );\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({ address: this.selectedAddress, addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || '') });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n private _onAddressOptionChange = (event: React.ChangeEvent) => {\r\n const addressRecordId = event.currentTarget.value;\r\n const selectedAddress = this.customerAddresses.find((address) => (address.RecordId || '').toString() === addressRecordId);\r\n if (selectedAddress) {\r\n this.addressListSelectedAddress = selectedAddress;\r\n }\r\n };\r\n\r\n private onAddressAddUpdate = (name: string, value: string) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n };\r\n\r\n private _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\r\n this.onAddressAddUpdate(event.target.name, value);\r\n };\r\n\r\n private _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n this.onAddressAddUpdate(event.target.name, event.target.value);\r\n\r\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\r\n this._onCountryChange(event.target.value);\r\n }\r\n };\r\n\r\n private _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n this.takeFocustoErrorField();\r\n return;\r\n }\r\n\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow()) {\r\n response = this.currentOperation === AddressOperation.Update ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress) : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\r\n } else {\r\n response = Promise.resolve({ address: this.addUpdateAddress });\r\n }\r\n\r\n this.isUpdating = true;\r\n this._updateModuleState();\r\n\r\n response.then(\r\n (result: IAddressResponse) => {\r\n this.isUpdating = false;\r\n\r\n if (result.address) {\r\n this.hasError = false;\r\n this._onAddOrUpdateSuccess(result);\r\n } else {\r\n this.hasError = true;\r\n this.addressActionResponse = result;\r\n this._updateModuleState();\r\n }\r\n },\r\n () => {\r\n this.hasError = true;\r\n this.isUpdating = false;\r\n this._updateModuleState();\r\n }\r\n );\r\n };\r\n\r\n private _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: countryRegionId });\r\n };\r\n\r\n private _getStateProvinces = (): void => {\r\n if (!this.countryRegionId || !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\r\n return;\r\n }\r\n\r\n // tslint:disable-next-line:no-floating-promises\r\n this.addressCommon.getStateProvinces(this.countryRegionId).then(\r\n (result: StateProvinceInfo[]) => {\r\n this.stateProvinceInfo = result;\r\n }).catch(e => this.props.telemetry.exception(e));\r\n };\r\n\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n private _getDefaultAddress = (): Address | undefined => {\r\n if (this.customerAddresses) {\r\n const primaryAddress = this.customerAddresses.find((address: Address) => address.IsPrimary);\r\n return primaryAddress || (this.customerAddresses.length > 0 ? this.customerAddresses[0] : undefined);\r\n }\r\n return undefined;\r\n };\r\n\r\n private _forceDisable(): boolean {\r\n const store = WineClubDataStore.getInstance().get();\r\n const wineState = this.props.moduleState.getModuleByTypeName('checkout-club-info-collector');\r\n return store.deliveryType === 'PICKUP' && wineState.hasModuleState;\r\n }\r\n\r\n private _initModuleState = (): void => {\r\n let status: statusType = this._canShip() ? 'updating' : 'disabled';\r\n if (this._forceDisable()) {\r\n status = 'disabled';\r\n this._setShippingAddress(this.addressListSelectedAddress); // DG: Force the shipping address to be {} instead of undefined. Undefined breaks API calls.\r\n }\r\n const { request } = this.props.context;\r\n this.props.moduleState.init({\r\n status: status,\r\n onEdit: this.onEdit,\r\n onCancel: this.onCancel,\r\n onSubmit: this.onSubmit\r\n });\r\n\r\n const defaultAddress = this._getDefaultAddress();\r\n if (this._canShip()) {\r\n if (defaultAddress) {\r\n this._updateCurrentOperation(AddressOperation.Show, defaultAddress);\r\n this._setShippingAddress(defaultAddress);\r\n this._updateModuleState();\r\n } else {\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n } else {\r\n this.props.data.cart.then(() => {\r\n const { cart } = this.props.data;\r\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\r\n // \"GIFT CARD CHECK\"\r\n if (cart && cart.result && cart.result.CartLines && cart.result.CartLines.filter(item => item.DeliveryMode === emailDeliveryModeCode).length === 1) {\r\n if (!defaultAddress) {\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n }).catch(e => this.props.telemetry.exception(e));\r\n }\r\n\r\n if (this._forceDisable()) { this.props.moduleState.onDisable(); }\r\n };\r\n\r\n // private _setBillingAddress = (newBillingAddress: Address): void => {\r\n // if (this.props.data.checkout.result) {\r\n // this.props.data.checkout.result.updateBillingAddress({newBillingAddress});\r\n // }\r\n // }\r\n\r\n private onSubmit = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._onAddressAddUpdateSubmit();\r\n break;\r\n case AddressOperation.List:\r\n this._onSelectAddress();\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onCancel = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n if (!(!this.selectedAddress && !this.addressCommon.isAuthenticatedFlow())) {\r\n this._resetView();\r\n }\r\n\r\n break;\r\n case AddressOperation.List:\r\n if (this.selectedAddress) {\r\n this._resetView();\r\n }\r\n break;\r\n default:\r\n this.props.telemetry.error('Invalid operation');\r\n }\r\n };\r\n\r\n private onEdit = (): void => {\r\n if (this.addressCommon.isAuthenticatedFlow() && this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.List, this.shippingAddress);\r\n } else if (this.shippingAddress) {\r\n this._updateCurrentOperation(AddressOperation.Update, this.shippingAddress);\r\n }\r\n\r\n this._updateModuleState();\r\n };\r\n\r\n private _canShip = (): boolean => {\r\n const { checkout } = this.props.data;\r\n const { request } = this.props.context;\r\n if (!checkout.result || !request.channel || checkout.result.checkoutCart.isEmpty) {\r\n return false;\r\n }\r\n // @ts-ignore: Type-checker not realizing above request.channel check\r\n return checkout.result.checkoutCart.cart.CartLines.some(cartLine => cartLine.DeliveryMode !== request.channel.PickupDeliveryModeCode);\r\n };\r\n\r\n private _onSelectAddress = () => {\r\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\r\n this._setShippingAddress(this.addressListSelectedAddress);\r\n this._updateModuleState();\r\n };\r\n\r\n private _goToAddAddress = () => {\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n private _onAddOrUpdateSuccess = (response: IAddressResponse) => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n\r\n if (response.address) {\r\n this._updateCurrentOperation(AddressOperation.Show, response.address);\r\n this._setShippingAddress(response.address);\r\n this._updateModuleState();\r\n }\r\n };\r\n\r\n private _setShippingAddress = (address: Address): void => {\r\n if (this.props.data.checkout.result) {\r\n const newShippingAddress = { ...address };\r\n\r\n if (address.ThreeLetterISORegionName && !newShippingAddress.TwoLetterISORegionName) {\r\n newShippingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\r\n }\r\n\r\n // tslint:disable-next-line:no-floating-promises\r\n void this.props.data.checkout.result.updateShippingAddress({ newShippingAddress });\r\n }\r\n };\r\n\r\n @computed get shippingAddress(): Address | undefined {\r\n return this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress;\r\n }\r\n\r\n private _resetView = (): void => {\r\n switch (this.currentOperation) {\r\n case AddressOperation.Add:\r\n case AddressOperation.Update:\r\n this._updateCurrentOperation(this.addressCommon.isAuthenticatedFlow() ? AddressOperation.List : AddressOperation.Show, this.shippingAddress);\r\n break;\r\n default:\r\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\r\n }\r\n this._updateModuleState();\r\n };\r\n\r\n private _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\r\n this.currentOperation = operation;\r\n this.selectedAddress = selectedAddress;\r\n\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n this.addUpdateAddress = { ...this.selectedAddress } || {};\r\n set(this.addUpdateAddress, { ['ThreeLetterISORegionName']: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId });\r\n } else if (this.currentOperation === AddressOperation.List) {\r\n this.addressListSelectedAddress = { ...this.selectedAddress } || {};\r\n }\r\n };\r\n\r\n private _updateModuleState = () => {\r\n if (this._forceDisable()) { this.props.moduleState.onDisable(); return; }\r\n if (this.currentOperation === AddressOperation.Show) {\r\n this.props.moduleState.onReady();\r\n } else if (this.isUpdating) {\r\n this.props.moduleState.onPending();\r\n } else {\r\n this.props.moduleState.onUpdating();\r\n }\r\n };\r\n private takeFocustoErrorField = () => {\r\n var errors = this.validationError;\r\n if (errors[\"Name\"] !== null) {\r\n const shipping_addressname = document.getElementById(\"shipping_addressname\");\r\n shipping_addressname?.focus();\r\n }\r\n else if (errors[\"Street\"] !== null) {\r\n const shipping_addressstreet = document.getElementById(\"shipping_addressstreet\");\r\n shipping_addressstreet?.focus();\r\n }\r\n else if (errors[\"City\"] !== null) {\r\n const shipping_addresscity = document.getElementById(\"shipping_addresscity\");\r\n shipping_addresscity?.focus();\r\n }\r\n else if (errors[\"State\"] !== null) {\r\n const shipping_addressstate = document.getElementById(\"shipping_addressstate\");\r\n shipping_addressstate?.focus();\r\n }\r\n else if (errors[\"ZipCode\"] !== null) {\r\n const shipping_addresszipcode = document.getElementById(\"shipping_addresszipcode\");\r\n shipping_addresszipcode?.focus();\r\n }\r\n else if (errors[\"Phone\"] !== null) {\r\n const shipping_addressphone = document.getElementById(\"shipping_addressphone\");\r\n shipping_addressphone?.focus();\r\n }\r\n };\r\n}\r\n\r\nexport default CheckoutShippingAddress;","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport * as React from 'react';\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\n\r\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\r\nimport { IAddressSelectItem, IAddressSelectProps } from '../../common/components/address-select';\r\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\r\nimport { ICheckoutShippingAddressViewProps } from './smwe-checkout-shipping-address';\r\n\r\nconst AddressShow: React.FC = ({\r\n AddressDetail,\r\n items\r\n}) => {\r\n\r\n return (\r\n \r\n {items && items.map((item: IAddressShowItem) => {\r\n return (\r\n <>\r\n {item.description}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\nconst AddressSelect: React.FC = ({\r\n SelectAddress,\r\n addButton,\r\n items,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n}) => {\r\n\r\n return (\r\n \r\n {addButton}\r\n {items && items.map((item: IAddressSelectItem) => {\r\n const SelectItem = item.SelectItem;\r\n return ();\r\n })}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\nconst AddressAddUpdate: React.FC = ({\r\n AddressForm,\r\n heading,\r\n items,\r\n hasError,\r\n error,\r\n isShowSaveButton,\r\n saveButton,\r\n isShowCancelButton,\r\n cancelButton,\r\n}) => {\r\n\r\n return (\r\n \r\n {heading}\r\n {items && items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n {label}\r\n {alert}\r\n {input}\r\n );\r\n })}\r\n {hasError && \r\n {error.title}\r\n {error.message}\r\n }\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\nconst CheckoutShippingAddressView: React.FC = props => {\r\n const { CheckoutShippingAddress, viewState, showAddress, showAddressSelect, showAddOrUpdateAddress } = props;\r\n return (\r\n
\r\n {props.config.heading?.text}\r\n \r\n {viewState.isShowAddress && }\r\n {viewState.isShowAddresList && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default CheckoutShippingAddressView;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionContext } from '@msdyn365-commerce/core';\nimport {\n CheckoutModule,\n ErrorCode,\n ErrorLocation,\n ErrorMessageResource,\n getCheckoutState,\n ICheckoutError,\n ICheckoutState\n} from '@msdyn365-commerce/global-state/';\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class -- create global class\nexport class CheckoutErrors {\n public static readonly ActionError: ICheckoutError = {\n errorCode: ErrorCode.ActionError,\n errorMessageResource: ErrorMessageResource.checkoutTimeoutErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n errorMessageResource: ErrorMessageResource.blockedLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n errorMessageResource: ErrorMessageResource.customerAccountLimitSignDifferentFromAmountDueErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsAvailableCreditLimitErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n errorMessageResource: ErrorMessageResource.customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_FraudRisk: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n errorMessageResource: ErrorMessageResource.fraudRiskErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n errorMessageResource: ErrorMessageResource.giftCardBalanceInquiryFailedErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n errorMessageResource: ErrorMessageResource.giftCardCurrencyMismatchErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n errorMessageResource: ErrorMessageResource.invalidCartVersionErrorMessage,\n errorLocation: ErrorLocation.Checkout\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n errorMessageResource: ErrorMessageResource.invalidLoyaltyCardNumberErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n errorMessageResource: ErrorMessageResource.invalidPaymentRequestConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n errorMessageResource: ErrorMessageResource.missingRequiredCartTenderLinesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n errorMessageResource: ErrorMessageResource.multipleCustomerAccountPaymentsNotAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n errorMessageResource: ErrorMessageResource.noMoreThanOneLoyaltyTenderErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n errorMessageResource: ErrorMessageResource.noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n errorMessageResource: ErrorMessageResource.noTenderLoyaltyCardErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n errorMessageResource: ErrorMessageResource.notEnoughRewardPointsErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n errorMessageResource: ErrorMessageResource.paymentAlreadyVoidedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n errorMessageResource: ErrorMessageResource.paymentAmountExceedsGiftBalanceErrorMessage,\n errorLocation: ErrorLocation.CheckoutGiftCard\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n errorMessageResource: ErrorMessageResource.paymentRequiresMerchantPropertiesConsoleErrorMessage,\n errorLocation: ErrorLocation.Console\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n errorMessageResource: ErrorMessageResource.paymentUsingUnauthorizedAccountErrorMessage,\n errorLocation: ErrorLocation.CheckoutCustomerAccountPayment\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n errorMessageResource: ErrorMessageResource.refundAmountMoreThanAllowedErrorMessage,\n errorLocation: ErrorLocation.CheckoutLoyalty\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n errorMessageResource: ErrorMessageResource.unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n errorMessageResource: ErrorMessageResource.unableToCancelPaymentErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n errorMessageResource: ErrorMessageResource.unableToReadCardTokenInfoErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult: ICheckoutError = {\n errorCode: ErrorCode.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult,\n errorMessageResource: ErrorMessageResource.unableToRetrieveCardPaymentAcceptResultErrorMessage,\n errorLocation: ErrorLocation.CheckoutPaymentInstrument\n };\n\n public static readonly checkoutErrorsList: ICheckoutError[] = [\n CheckoutErrors.ActionError,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_FraudRisk,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo,\n CheckoutErrors.Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult\n ];\n}\n\nexport async function setCheckoutErrors(\n errorCode: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n resources: any,\n isExpressCheckoutApplied: boolean,\n ctx: IActionContext,\n apiError?: string | undefined\n): Promise {\n let clientCheckoutError: ICheckoutError | undefined;\n const consoleCheckoutErrors: ICheckoutError[] = [];\n\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n // find the checkout errors\n for (const checkoutError of CheckoutErrors.checkoutErrorsList) {\n if (errorCode === checkoutError.errorCode) {\n if (checkoutError.errorLocation === ErrorLocation.Console) {\n const consoleCheckoutError: ICheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n consoleCheckoutErrors.push(consoleCheckoutError);\n } else {\n if (clientCheckoutError) {\n ctx.telemetry.exception(new Error('Invalid number of client checkout errors.'));\n throw new Error('Invalid number of client checkout errors.');\n } else {\n clientCheckoutError = {\n errorCode: checkoutError.errorCode,\n errorMessageResource: checkoutError.errorMessageResource,\n errorLocation: checkoutError.errorLocation\n };\n }\n }\n }\n }\n\n // log the console checkout errors\n for (const consoleCheckoutError of consoleCheckoutErrors) {\n consoleCheckoutError.errorMessage = getCheckoutErrorMessage(resources, consoleCheckoutError.errorMessageResource!, apiError!);\n console.log(consoleCheckoutError.errorMessage);\n }\n\n // handle the client checkout error\n if (clientCheckoutError) {\n clientCheckoutError.errorMessage = getCheckoutErrorMessage(resources, clientCheckoutError.errorMessageResource!, apiError!);\n\n if (isExpressCheckoutApplied && clientCheckoutError.errorLocation === ErrorLocation.CheckoutPaymentInstrument) {\n clientCheckoutError.errorLocation = ErrorLocation.Checkout;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: clientCheckoutError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n } else {\n // if could not map to any checkout error(s), show the API error message over generic error\n if (consoleCheckoutErrors.length === 0) {\n const genericError = {\n errorLocation: ErrorLocation.Checkout\n };\n if (apiError) {\n genericError['errorMessage'] = apiError;\n } else {\n genericError['errorMessage'] = resources.genericErrorMessage;\n }\n\n await checkoutState.updateCheckoutError({ newCheckoutError: genericError });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: true });\n }\n }\n}\n\nexport async function focusOnCheckoutError(checkoutErrorRef: React.RefObject, ctx: IActionContext): Promise {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n checkoutErrorRef.current && checkoutErrorRef.current.scrollIntoView();\n\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule.None });\n await checkoutState.updateShouldFocusOnCheckoutError({ newShouldFocusOnCheckoutError: false });\n}\n\nexport async function setCheckoutErrorFocus(checkoutModuleId: string, ctx: IActionContext): Promise {\n const checkoutState: ICheckoutState = await getCheckoutState(ctx).catch((error: Error) => {\n ctx.telemetry.exception(error);\n throw error;\n });\n\n for (const checkoutModule of Object.keys(CheckoutModule)) {\n if (checkoutModuleId.includes(CheckoutModule[checkoutModule])) {\n await checkoutState.updateCheckoutErrorFocus({ newCheckoutErrorFocus: CheckoutModule[checkoutModule] });\n return;\n }\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getCheckoutErrorMessage(resources: any, errorMessageResource: ErrorMessageResource, errorMessageFromAPI: string): string {\n const errorResource = Object.keys(resources).find(resource => resource === errorMessageResource);\n // return API error when error resource string is not found in checkout definition file\n return errorResource !== undefined ? resources[errorResource] : errorMessageFromAPI;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\n/**\n * The payment error.\n */\nexport interface IPaymentError {\n title: string;\n message: string;\n className?: string;\n}\n\n/**\n * The payment error.\n * @param param0 - First param.\n * @param param0.title - Title.\n * @param param0.message - Message.\n * @param param0.className - ClassName.\n * @returns React node.\n */\nexport const ErrorComponent: React.FC = ({ title, message, className = 'ms-checkout-payment-instrument' }) => (\n
\n

{title}

\n

{message}

\n
\n);\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Customer } from '@msdyn365-commerce/retail-proxy';\nimport { Alert, Button, INodeProps, NodeTag, getLocaleBasedCustomizedPrice, ILocalizedPrice } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentEditViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n customizedAmt: string;\n amount: number;\n amountVariable: string;\n maxAmount: number;\n customer: Customer | undefined;\n customerCreatedDate: string;\n availableCredit: string;\n showCreditLimit: boolean;\n errorMessage: string | undefined;\n creditSectionIsExpanded: boolean;\n orderTotal: string;\n excessCredit: string | undefined;\n appliedAmount: string | undefined;\n locale: string;\n onAddPayment(): Promise;\n onChangePaymentAmount(customizedAmt: string, paymentAmount: number, amountVariable: string): void;\n onToggleCreditSection(): void;\n onRemovePayment(): Promise;\n skipOnChangeLogic?: boolean;\n}\n\nexport interface IAccountPaymentEditViewForm {\n formProps: INodeProps;\n inputLabel: React.ReactNode;\n inputAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n customerName: React.ReactNode;\n customerAccountNumber: React.ReactNode;\n customerSince: React.ReactNode;\n accountCredit: React.ReactNode;\n alert: React.ReactNode;\n accountDetails: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n}\n\n/**\n * On Add Account Payment Function.\n * @param onAddPayment -On Add Payment Function.\n * @returns Call of Add payment function.\n */\nconst onAddAccountPayment = (onAddPayment: () => Promise) => async (event: React.SyntheticEvent): Promise => {\n event.preventDefault();\n await onAddPayment();\n};\n\n/**\n * On Change Amount Function.\n * @param onChangePaymentAmount -On Change Payment Amount Function.\n * @returns Call of Change payment Amount function.\n */\nconst onChangeAmountHandler = (\n customizedAmt: string,\n paymentAmount: number,\n amountVariable: string,\n locale: string,\n onChangePaymentAmount: (customizedAmt: string, paymentAmount: number, amountVariable: string) => void\n) => (event: React.ChangeEvent) => {\n const value = event.target.value;\n const customState: ILocalizedPrice = {\n customizedAmount: customizedAmt,\n amountVariable: amountVariable,\n paymentAmount: paymentAmount\n };\n const returnModifiedState = getLocaleBasedCustomizedPrice(value, customState, locale, keyCode);\n customizedAmt = returnModifiedState.customizedAmount as string;\n paymentAmount = returnModifiedState.paymentAmount as number;\n amountVariable = returnModifiedState.amountVariable as string;\n onChangePaymentAmount(customizedAmt, paymentAmount, amountVariable);\n keyCode = 0;\n};\n\nlet keyCode: number = 0;\nexport const getAccountPaymentFormEditMode = (options: IGetAccountPaymentEditViewFormInput): IAccountPaymentEditViewForm => {\n const {\n resources,\n onAddPayment,\n amount,\n customizedAmt,\n amountVariable,\n onChangePaymentAmount,\n maxAmount,\n customer,\n customerCreatedDate,\n availableCredit,\n showCreditLimit,\n errorMessage,\n onToggleCreditSection,\n creditSectionIsExpanded,\n orderTotal,\n excessCredit,\n onRemovePayment,\n appliedAmount,\n locale,\n skipOnChangeLogic\n } = options;\n\n const {\n addPaymentButtonLabel,\n inputAmountLabel,\n inputAmountAriaLabel,\n customerSinceLabel,\n accountCreditLabel,\n creditDetailsSectionLabel,\n orderTotalLabel,\n availableCreditLabel,\n creditExcessLabel,\n appliedCustomerAccountPaymentLabel,\n removeCustomerAccountPaymentLabel,\n accountCreditDetails\n } = resources;\n\n const inputLabel = (\n \n {inputAmountLabel}\n \n );\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-edit',\n onSubmit: onAddAccountPayment(onAddPayment),\n tag: 'form' as NodeTag\n };\n\n const addPaymentButton = (\n maxAmount || amount < 0 || Number.isNaN(amount)}\n >\n {addPaymentButtonLabel}\n \n );\n\n const inputAmount = (\n onChangePaymentAmount(value, Number(value), value)\n : onChangeAmountHandler(customizedAmt, amount, amountVariable, locale, onChangePaymentAmount)\n }\n onKeyDown={event => (keyCode = event.which)}\n aria-label={inputAmountAriaLabel}\n aria-valuemin={0}\n aria-valuemax={maxAmount}\n aria-valuenow={amount}\n min={0}\n max={maxAmount}\n />\n );\n\n const customerName =
{customer?.Name}
;\n\n const customerAccountNumber =
#{customer?.AccountNumber}
;\n\n const customerSince = (\n
\n {customerSinceLabel}\n {customerCreatedDate}\n
\n );\n\n const accountCredit = (\n <>\n {accountCreditLabel}\n {showCreditLimit && {availableCredit}}\n \n \n );\n\n const accountDetails = creditSectionIsExpanded ? (\n
\n <>\n
\n \n \n {creditDetailsSectionLabel}\n \n
\n \n
\n {availableCreditLabel}\n {availableCredit}\n
\n
\n {orderTotalLabel}\n {orderTotal}\n
\n
\n {creditExcessLabel}\n {excessCredit ?? '0'}\n
\n
\n ) : (\n undefined\n );\n\n const alert = (\n \n {errorMessage}\n \n );\n\n const appliedLine = appliedAmount ? (\n
\n {appliedCustomerAccountPaymentLabel}\n {appliedAmount}\n \n {removeCustomerAccountPaymentLabel}\n \n
\n ) : (\n undefined\n );\n\n const bottomBorder =
;\n\n return {\n formProps,\n inputLabel,\n inputAmount,\n addPaymentButton,\n customerName,\n customerAccountNumber,\n customerSince,\n accountCredit,\n alert,\n accountDetails,\n appliedLine,\n bottomBorder\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, INodeProps, NodeTag } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentResources } from '../checkout-customer-account-payment.props.autogenerated';\n\nexport interface IGetAccountPaymentSummaryViewFormInput {\n resources: ICheckoutCustomerAccountPaymentResources;\n amount: number;\n appliedAmount: string | undefined;\n}\n\nexport interface IAccountPaymentSummaryViewForm {\n formProps: INodeProps;\n label: React.ReactNode;\n paymentAmount: React.ReactNode;\n addPaymentButton: React.ReactNode;\n appliedLine: React.ReactNode;\n bottomBorder: React.ReactNode;\n alert?: React.ReactNode;\n paymentAmountInput?: React.ReactNode;\n}\n\nexport const getAccountPaymentFormSummaryMode = (options: IGetAccountPaymentSummaryViewFormInput): IAccountPaymentSummaryViewForm => {\n const { resources, amount, appliedAmount } = options;\n\n const { addPaymentButtonLabel, inputAmountSummaryLabel, appliedCustomerAccountPaymentLabel, inputAmountAriaLabel } = resources;\n\n const label = (\n \n );\n\n const formProps = {\n className: 'ms-checkout-customer-account__form-summary',\n tag: 'form' as NodeTag\n };\n\n const paymentAmount = ;\n\n const paymentAmountInput = (\n \n );\n\n const addPaymentButton = (\n \n );\n\n const appliedLine = appliedAmount ? (\n
\n {appliedCustomerAccountPaymentLabel}\n {appliedAmount}\n
\n ) : (\n undefined\n );\n\n const bottomBorder =
;\n\n return {\n formProps,\n label,\n paymentAmount,\n addPaymentButton,\n appliedLine,\n bottomBorder,\n paymentAmountInput\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { isChannelTypeB2B } from '@msdyn365-commerce/core';\nimport { CustomerBalances } from '@msdyn365-commerce/retail-proxy';\nimport { IModuleStateManager, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classnames from 'classnames';\nimport get from 'lodash/get';\nimport { action, computed, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentData } from './checkout-customer-account-payment.data';\nimport { ICheckoutCustomerAccountPaymentProps } from './checkout-customer-account-payment.props.autogenerated';\nimport { getAccountPaymentFormEditMode, IAccountPaymentEditViewForm } from './components/get-account-payment-form-edit-mode';\nimport { getAccountPaymentFormSummaryMode, IAccountPaymentSummaryViewForm } from './components/get-account-payment-form-summary-mode';\nimport { ErrorComponent } from '../../common/error';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutCustomerAccountPaymentViewProps\n extends ICheckoutCustomerAccountPaymentProps {\n checkoutCustomerAccount: IModuleProps;\n summaryView: IAccountPaymentSummaryViewForm;\n editView: IAccountPaymentEditViewForm;\n moduleState: IModuleStateManager;\n alert?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n}\n\nexport interface ICheckoutCustomerAccountPaymentState {\n paymentAmount: number;\n isCreditSectionExpanded: boolean;\n customizedAmt: string;\n amountVariable: string;\n errorMessage?: string;\n handleSaveAndContinue?: boolean;\n}\n\n/**\n *\n * CheckoutCustomerAccount component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nexport class CheckoutCustomerAccountPayment extends React.Component<\n ICheckoutCustomerAccountPaymentViewProps,\n ICheckoutCustomerAccountPaymentState\n> {\n private readonly defaultLocale: string = 'en-us';\n @computed get isCustomerAccountPaymentEnabled(): boolean {\n const customerInfo = get(this.props, 'data.customerInformation.result');\n const request = get(this.props, 'context.request');\n const b2bChannel = isChannelTypeB2B(request);\n const platform = get(this.props, 'context.request.app.platform');\n\n return (\n customerInfo &&\n customerInfo.AllowOnAccountPayment === true &&\n platform &&\n (platform.enableCustomerAccountPayment === 'all' ||\n (platform.enableCustomerAccountPayment === 'b2b' && b2bChannel) ||\n (platform.enableCustomerAccountPayment === 'b2c' && !b2bChannel))\n );\n }\n\n @computed get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.loyaltyAmount) {\n return 0;\n }\n return checkoutState.loyaltyAmount;\n }\n\n @computed get maxPaymentAmount(): number {\n const cart = this.props.data.checkout.result ? this.props.data.checkout.result.checkoutCart.cart : undefined;\n if (!cart) {\n return 0;\n }\n\n // Use customer account after loyalty.\n const amountDue = Math.max(0, (cart.TotalAmount || 0) - this.getLoyaltyAmount);\n\n // If the user has a mandatory credit limit, then the max amount must not be more than that\n if (this.props.data.customerInformation?.result?.MandatoryCreditLimit) {\n return Math.min(this.getAvailableCredit(this.props.data.creditBalances?.result), amountDue);\n }\n return amountDue;\n }\n\n @computed get errorMessage(): string | undefined {\n if (this.state.paymentAmount > this.maxPaymentAmount) {\n return this.props.resources.invalidAmountExceedAmountDueMessage;\n }\n\n if (this.state.paymentAmount < 0) {\n return this.props.resources.invalidAmountNegativeMessage;\n }\n\n return undefined;\n }\n\n @computed get currencyCode(): string | undefined {\n return get(this.props, 'context.request.channel.Currency');\n }\n\n @computed get availableCredit(): number {\n const creditBalances = get(this.props, 'data.creditBalances.result');\n\n return creditBalances ? this.getAvailableCredit(creditBalances) : 0;\n }\n\n @computed get orderTotal(): number {\n const orderTotal = get(this.props, 'data.checkout.result.checkoutCart.cart.TotalAmount');\n\n return orderTotal ? orderTotal : 0;\n }\n\n @computed get formattedExcessCredit(): string | undefined {\n const excessCredit = this.availableCredit - this.orderTotal;\n return excessCredit < 0 ? this.props.context.cultureFormatter.formatCurrency(excessCredit, this.currencyCode) : undefined;\n }\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n private readonly baseClassName: string = 'ms-checkout-customer-account';\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n public constructor(props: ICheckoutCustomerAccountPaymentViewProps) {\n super(props);\n const locale = get(this.props, 'context.request.locale') || this.defaultLocale;\n this.state = {\n paymentAmount: this.maxPaymentAmount,\n isCreditSectionExpanded: false,\n customizedAmt: new Intl.NumberFormat(locale).format(this.maxPaymentAmount),\n amountVariable: this.maxPaymentAmount.toString(),\n handleSaveAndContinue: false\n };\n }\n\n public async componentDidMount(): Promise {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n // When the cart.TotalAmount gets updated (like if selecting the delivery option adds a charge) we need to update the amount based on the new total amount.\n reaction(\n () =>\n this.props.data.checkout.result &&\n this.props.data.checkout.result.checkoutCart.cart &&\n this.props.data.checkout.result.checkoutCart.cart.TotalAmount,\n totalAmount => {\n this.updateMaxAmount(this.maxPaymentAmount);\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutCustomerAccountPayment &&\n checkoutError.errorMessage\n ) {\n this._setErrorMessage(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutCustomerAccountPayment) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(\n nextProps: ICheckoutCustomerAccountPaymentProps,\n nextState: ICheckoutCustomerAccountPaymentState\n ): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const customerInfo = this.props.data.customerInformation?.result;\n\n if (!this.isCustomerAccountPaymentEnabled) {\n this.props.context.telemetry.information(\n 'customer account payments will not display, because the feature is disabled or not enabled for this type of customer'\n );\n return null;\n }\n\n const checkoutState = this.props.data.checkout.result;\n const cart = checkoutState ? checkoutState.checkoutCart.cart : undefined;\n const hasInvoiceLine = checkoutState?.checkoutCart.hasInvoiceLine;\n const creditBalances = this.props.data.creditBalances.result;\n\n if (!cart || hasInvoiceLine) {\n return null;\n }\n const resources = this.props.resources;\n const locale = get(this.props, 'context.request.locale') || this.defaultLocale;\n\n const customerSinceDate = new Date(customerInfo?.CreatedDateTime || 0).toLocaleDateString(locale);\n\n const hasError = this.props.moduleState.hasError;\n const errorMessage = this.state.errorMessage;\n\n const props = {\n ...this.props,\n checkoutErrorRef: this.checkoutErrorRef,\n checkoutCustomerAccount: {\n moduleProps: this.props,\n className: classnames(this.baseClassName)\n },\n alert: hasError && errorMessage && (\n \n ),\n editView: getAccountPaymentFormEditMode({\n onAddPayment: this.addPayment,\n resources,\n customizedAmt: this.state.customizedAmt,\n amountVariable: this.state.amountVariable,\n amount: this.state.paymentAmount,\n onChangePaymentAmount: this.onChangePaymentAmount,\n maxAmount: this.maxPaymentAmount,\n customer: customerInfo,\n customerCreatedDate: customerSinceDate,\n availableCredit: this.props.context.cultureFormatter.formatCurrency(\n this.getAvailableCredit(creditBalances),\n this.currencyCode\n ),\n showCreditLimit: customerInfo?.MandatoryCreditLimit || false,\n errorMessage: this.errorMessage,\n onToggleCreditSection: this.toggleCreditSection,\n creditSectionIsExpanded: this.state.isCreditSectionExpanded,\n orderTotal: this.props.context.cultureFormatter.formatCurrency(this.orderTotal, this.currencyCode),\n excessCredit: this.formattedExcessCredit,\n onRemovePayment: this.removePayment,\n appliedAmount:\n checkoutState && checkoutState.customerAccountAmount > 0\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\n : undefined,\n locale:\n this.props.context && this.props.context.request && this.props.context.request.locale\n ? this.props.context.request.locale\n : this.defaultLocale,\n skipOnChangeLogic: this.props.context.request.features?.skipCheckoutOnChangeLogic\n }),\n summaryView: getAccountPaymentFormSummaryMode({\n resources,\n amount: this.state.paymentAmount,\n appliedAmount:\n checkoutState && checkoutState.customerAccountAmount > 0\n ? this.props.context.cultureFormatter.formatCurrency(checkoutState.customerAccountAmount, this.currencyCode)\n : undefined\n })\n };\n\n return this.props.renderView(props) as React.ReactElement;\n }\n\n private readonly getAvailableCredit = (creditBalances: CustomerBalances | undefined) => {\n let availableCredit = 0;\n\n if (!creditBalances) {\n return 0;\n }\n\n if (creditBalances.InvoiceAccountCreditLimit === 0) {\n availableCredit = creditBalances.CreditLimit - creditBalances.Balance - creditBalances.PendingBalance;\n } else {\n availableCredit =\n creditBalances.InvoiceAccountCreditLimit -\n creditBalances.InvoiceAccountBalance -\n creditBalances.InvoiceAccountPendingBalance;\n }\n\n return availableCredit;\n };\n\n private readonly addPayment = async (): Promise => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n this.setState({ handleSaveAndContinue: true });\n this._clearError();\n await checkoutState.updateCustomerAccountAmount({ newAmount: this.state.paymentAmount });\n this.props.context.telemetry.information('customer account payment amount updated');\n };\n\n private readonly toggleCreditSection = (): void => {\n this.setState({\n isCreditSectionExpanded: !this.state.isCreditSectionExpanded\n });\n };\n\n private readonly init = async (): Promise => {\n this.props.moduleState.init({\n onCancel: this.handleCancelOrSubmit,\n onSubmit: this.handleCancelOrSubmit,\n onEdit: this.onEdit\n });\n\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount !== 0) {\n this.props.moduleState.onReady();\n }\n };\n\n private readonly onChangePaymentAmount = (customizedAmt: string, paymentAmount: number, amountVariable: string): void => {\n this.setState({\n customizedAmt: customizedAmt,\n paymentAmount: paymentAmount,\n amountVariable: amountVariable\n });\n };\n\n private readonly updateMaxAmount = (newAmount: number): void => {\n // If the user has already set an amount, we should not override that in the UI because it will be confusing.\n if (this.props.data.checkout.result && this.props.data.checkout.result.customerAccountAmount === 0) {\n this.setState({\n // We should never allow a negative amount.\n paymentAmount: Math.max(0, newAmount),\n customizedAmt: Math.max(0, newAmount).toString()\n });\n }\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Payment section customer account payment onEdit is called.');\n\n this.props.moduleState.onUpdating();\n };\n\n private readonly handleCancelOrSubmit = () => {\n const checkoutState = this.props.data.checkout.result;\n if (checkoutState && checkoutState.customerAccountAmount > 0) {\n this.setState({ handleSaveAndContinue: false });\n this.props.telemetry.information('Payment section customer account payment onSubmit is called.');\n\n if (\n Msdyn365.isOboRequest(this.props.context.request) &&\n checkoutState?.customerAccountAmount !== checkoutState?.checkoutCart.cart.TotalAmount\n ) {\n this._setErrorMessage(this.props.resources.invalidAmountForOBOMessage);\n } else {\n this.props.moduleState.onReady();\n }\n } else if (\n checkoutState?.customerAccountAmount === 0 &&\n !this.state.handleSaveAndContinue &&\n this.props.config.isCheckoutCustomerAccountPaymentRequired\n ) {\n this._setErrorMessage(this.props.resources.customerAccountCreditErrorMessage);\n } else {\n this.props.telemetry.information('Payment section customer account payment onCancel is called.');\n\n // Skip the module\n this.props.moduleState.onSkip();\n }\n };\n\n private readonly removePayment = async (): Promise => {\n const checkoutState = this.props.data.checkout.result;\n\n if (!checkoutState) {\n this.props.context.telemetry.error('checkout state not found');\n return;\n }\n\n this.setState({\n paymentAmount: 0\n });\n\n this.onChangePaymentAmount('', NaN, '0');\n\n this._clearError();\n await checkoutState.updateCustomerAccountAmount({ newAmount: 0 });\n this.props.context.telemetry.information('customer account payment removed');\n };\n\n @action\n private readonly _setErrorMessage = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.setState({\n errorMessage\n });\n };\n\n private readonly _clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.setState({\n errorMessage: ''\n });\n };\n}\n\nexport default CheckoutCustomerAccountPayment;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutCustomerAccountPaymentViewProps, IAccountPaymentEditViewForm, IAccountPaymentSummaryViewForm } from './index';\n\nexport const SummaryForm: React.FC = ({\n formProps,\n label,\n paymentAmount,\n addPaymentButton,\n appliedLine,\n bottomBorder\n}) => (\n \n <>\n {label}\n {paymentAmount}\n {addPaymentButton}\n {appliedLine}\n {bottomBorder}\n \n \n);\n\nexport const EditForm: React.FC = ({\n formProps,\n inputLabel,\n inputAmount,\n addPaymentButton,\n customerName,\n customerAccountNumber,\n customerSince,\n accountCredit,\n alert,\n accountDetails,\n appliedLine,\n bottomBorder\n}) => (\n \n <>\n {customerName}\n {customerAccountNumber}\n {customerSince}\n {accountCredit}\n {accountDetails}\n {inputLabel}\n {alert}\n {inputAmount}\n {addPaymentButton}\n {appliedLine}\n {bottomBorder}\n \n \n);\n\nconst CheckoutCustomerAccountView: React.FC = props => {\n const { checkoutCustomerAccount, checkoutErrorRef, summaryView, editView, moduleState, alert } = props;\n return (\n \n {alert}\n {moduleState.isReady && summaryView && }\n {!moduleState.isReady && editView && }\n \n );\n};\n\nexport default CheckoutCustomerAccountView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IImageProps, IImageSettings, Image, IModule } from '@msdyn365-commerce/core';\nimport {\n Address,\n CartLine,\n LineDeliverySpecification,\n PickupTimeslotAvailability,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface ICheckoutPickupGroupKey {\n pickupStoreId: string;\n deliveryMode: string;\n}\n\nexport interface ICheckoutPickupGroup extends ICheckoutPickupGroupKey {\n pickupModeName: string;\n storeName: string;\n pickupAddress?: Address;\n availabilityState: PickupTimeslotAvailabilityState;\n groupErrorMessage?: string;\n dateErrorMessage?: string;\n timeslotErrorMessage?: string;\n lineDeliverySpecs: LineDeliverySpecification[];\n cartLines: ICartLineWithProduct[];\n\n availableDates: Date[];\n availableTimeslots: PickupTimeslotAvailability[];\n\n selectedDate?: Date;\n selectedTimeslot?: PickupTimeslotAvailability;\n}\n\nexport enum PickupTimeslotAvailabilityState {\n None,\n Available,\n NotDefined,\n NotAvailable // All slots occupied\n}\n\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\nexport interface ICheckoutPickupGroupViewProps {\n moduleProps: IModule;\n\n pickupGroupContainer: INodeProps;\n dateTimeslotContainer: INodeProps;\n\n pickupStoreId: string;\n pickupModeName: string;\n deliveryMode: string;\n\n groupDivider: React.ReactNode;\n groupHeader: React.ReactNode;\n groupErrorMessage: React.ReactNode;\n cartLineImages: React.ReactNode;\n pickupDateDropdown: React.ReactNode;\n pickupTimeslotDropdown: React.ReactNode;\n\n selectedDateTimeslot: React.ReactNode;\n pickupAddress: React.ReactNode;\n}\n\nexport interface ICheckoutPickupErrorProps {\n errorMessage?: string;\n}\n\nexport const CheckoutPickupError: React.FC = ({ errorMessage }) => {\n if (!errorMessage) {\n return null;\n }\n\n return (\n \n \n );\n};\n\nexport interface ICheckoutPickupGroupHeaderProps {\n moduleClassName: string;\n storeInfo: string;\n items: string;\n}\n\nexport const CheckoutPickupGroupHeader: React.FC = ({ moduleClassName, storeInfo, items }) => {\n return (\n
\n
{storeInfo}
\n
{items}
\n
\n );\n};\n\nexport interface ICheckoutPickupTimeslotInfoProps {\n moduleClassName: string;\n title: string;\n content: string;\n}\n\nexport const CheckoutPickupTimeslotInfo: React.FC = ({ moduleClassName, title, content }) => {\n return (\n
\n
{title}
\n
{content}
\n
\n );\n};\n\nexport interface ICheckoutPickupAddressProps {\n moduleClassName: string;\n title: string;\n address?: Address;\n}\n\nexport const CheckoutPickupAddress: React.FC = ({ moduleClassName, title, address }) => {\n if (!address) {\n return null;\n }\n\n return (\n
\n
{title}
\n {address.Name && {address.Name}}\n <>\n {address.Street && {address.Street}}\n {address.City && {address.City}}\n {address.State && {`, ${address.State}`}}\n {address.County && {`, ${address.County}`}}\n {address.ZipCode && {` ${address.ZipCode}`}}\n {address.ThreeLetterISORegionName && (\n \n {` ${address.ThreeLetterISORegionName}`}\n \n )}\n \n
\n );\n};\n\nexport interface ICheckoutPickupCartLineInfo {\n lineId: string;\n imageProps: IImageProps;\n quantity: number;\n}\n\nexport interface ICheckoutPickupCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutPickupCartLineInfo[];\n}\n\nexport const CheckoutPickupCartLines: React.FC = ({ moduleClassName, cartLines }) => {\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n return (\n
\n {cartLines.map(prop => {\n const showQty = prop.quantity > 1;\n let className = `${moduleClassName}__group-product-image`;\n if (showQty) {\n className = classnames(className, ' product-image-wide');\n }\n return (\n
\n \n {showQty &&
{prop.quantity}
}\n
\n );\n })}\n
\n );\n};\n\nexport const DefaultImageSettings: IImageSettings = {\n viewports: {\n xs: { q: 'w=108&h=108&q=80&m=6&f=jpg\"', w: 108, h: 108 },\n lg: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 },\n xl: { q: 'w=108&h=108&q=80&m=6&f=jpg', w: 108, h: 108 }\n },\n lazyload: true,\n quality: 80\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { format } from '@msdyn365-commerce-modules/utilities';\n\nexport function getDate(date: Date | undefined, locale: string): string {\n if (!date) {\n return '';\n }\n const options: Intl.DateTimeFormatOptions = {\n timeZone: 'UTC'\n };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return formatter.format(new Date(date));\n}\n\nexport const getTimeslot = (\n placeHolder: string,\n startDate: Date | undefined,\n endDate: Date | undefined,\n locale: string,\n useHour12TimeFormat?: boolean\n): string => {\n if (!startDate || !endDate) {\n return '';\n }\n let options: Intl.DateTimeFormatOptions = { hour: 'numeric', minute: 'numeric' };\n options = useHour12TimeFormat\n ? { hour: 'numeric', minute: 'numeric', timeZone: 'UTC' }\n : { hour: 'numeric', minute: 'numeric', timeZone: 'UTC', hour12: true };\n const formatter = new Intl.DateTimeFormat(locale, options);\n return format(placeHolder, formatter.format(new Date(startDate)), formatter.format(new Date(endDate)));\n};\n\nexport const getUTCDateWithoutTime = (input: Date): Date => {\n const date: Date = new Date(input);\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), 0, 0, 0));\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification,\n ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\nimport { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { CheckoutPickupError } from './checkout-pickup-group';\nimport { getDate } from './checkout-pickup-utility';\n\nexport interface IPickupDropdownProps {\n pickupStoreId: string;\n deliveryMode: string;\n\n className: string;\n labelClassname?: string;\n labelText: string;\n defaultText: string;\n errorMessage?: string;\n\n locale: string;\n\n // Props for the LabeledDropdown component\n dropdownId: string;\n controlledByParent: boolean;\n toggleColor?: string;\n dropdownClassname?: string;\n}\n\nexport interface IPickupDateDropdownProps extends IPickupDropdownProps {\n availableDates: Date[];\n selectedDate?: Date;\n setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): void;\n}\n\n/**\n *\n * CheckoutPickupDateDropdown component.\n * @extends {React.Component}\n */\nexport class CheckoutPickupDateDropdown extends React.PureComponent {\n private readonly defaultKey: number = -1;\n\n private readonly defaultOption: ILabeledDropdownOption;\n\n // As the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getDateMap(): Map {\n const map = new Map();\n this.props.availableDates.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupDateDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateDateSelection = this.updateDateSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n className,\n labelClassname,\n labelText,\n errorMessage,\n dropdownId,\n availableDates,\n selectedDate,\n controlledByParent,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapDatesToOptions(availableDates, selectedDate);\n\n return (\n
\n \n \n \n
\n );\n }\n\n private readonly updateDateSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { pickupStoreId, deliveryMode, setDateHandler } = this.props;\n const date: Date | undefined = this.getDate(notification);\n setDateHandler(pickupStoreId, deliveryMode, date);\n };\n\n private readonly getDate = (notification: ILabeledDropdownOnChangeNotification): Date | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getDateMap.has(key)) {\n return undefined;\n }\n return this.getDateMap.get(key);\n };\n\n private readonly mapDatesToOptions = (\n dates: Date[],\n selectedDate: Date | undefined\n ): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { locale } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n options = dates.map((value: Date, index: number) => {\n return {\n key: index.toString(),\n value: getDate(value, locale)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = dates.findIndex((value: Date) => selectedDate !== undefined && selectedDate.getTime() === value.getTime());\n if (index >= 0 && selectedDate) {\n selectedOption = {\n key: index.toString(),\n value: getDate(selectedDate, locale)\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption\n };\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PickupTimeslotAvailability } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { LabeledDropdown } from '@msdyn365-commerce-modules/utilities';\nimport {\n ILabeledDropdownOnChangeNotification,\n ILabeledDropdownOption\n} from '@msdyn365-commerce-modules/utilities/dist/types/labeled-dropdown/LabeledDropdown.props';\nimport { computed } from 'mobx';\nimport * as React from 'react';\n\nimport { IPickupDropdownProps } from './checkout-pickup-date-dropdown';\nimport { CheckoutPickupError } from './checkout-pickup-group';\nimport { getTimeslot } from './checkout-pickup-utility';\n\nexport interface IPickupTimeslotDropdownProps extends IPickupDropdownProps {\n availableTimeslots: PickupTimeslotAvailability[];\n selectedTimeslot?: PickupTimeslotAvailability;\n timeslotPlaceHolder: string;\n setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void;\n useHour12TimeFormat?: boolean;\n}\n\n/**\n *\n * CheckoutPickupTimeslotDropdown component.\n * @extends {React.Component}\n */\nexport class CheckoutPickupTimeslotDropdown extends React.PureComponent {\n private readonly defaultKey: number = -1;\n\n private readonly defaultOption: ILabeledDropdownOption;\n\n // As the LabeledDropdown control only offers key and value, we need to map the key with date and timeslot data\n @computed get getTimeslotMap(): Map {\n const map = new Map();\n this.props.availableTimeslots.forEach((value, index) => {\n map.set(index.toString(), value);\n });\n return map;\n }\n\n constructor(props: IPickupTimeslotDropdownProps) {\n super(props);\n this.defaultOption = { key: this.defaultKey.toString(), value: props.defaultText };\n this.updateTimeslotSelection = this.updateTimeslotSelection.bind(this);\n }\n\n public render(): JSX.Element | null {\n const {\n className,\n labelClassname,\n labelText,\n errorMessage,\n dropdownId,\n availableTimeslots,\n selectedTimeslot,\n controlledByParent,\n toggleColor,\n dropdownClassname\n } = this.props;\n\n const { dropdownOptions, selectedOption } = this.mapTimeslotsToOptions(availableTimeslots, selectedTimeslot);\n\n return (\n
\n \n \n \n
\n );\n }\n\n private readonly updateTimeslotSelection = (notification: ILabeledDropdownOnChangeNotification): void => {\n const { pickupStoreId, deliveryMode, setTimeslotHandler } = this.props;\n const timeslot: PickupTimeslotAvailability | undefined = this.getTimeslot(notification);\n setTimeslotHandler(pickupStoreId, deliveryMode, timeslot);\n };\n\n private readonly getTimeslot = (notification: ILabeledDropdownOnChangeNotification): PickupTimeslotAvailability | undefined => {\n const key: string = notification.selectedOption.key;\n if (key === this.defaultKey.toString() || !this.getTimeslotMap.has(key)) {\n return undefined;\n }\n return this.getTimeslotMap.get(key);\n };\n\n private readonly mapTimeslotsToOptions = (\n timeslots: PickupTimeslotAvailability[],\n selectedTimeslot: PickupTimeslotAvailability | undefined\n ): { dropdownOptions: ILabeledDropdownOption[]; selectedOption: ILabeledDropdownOption | undefined } => {\n const { timeslotPlaceHolder, locale, useHour12TimeFormat } = this.props;\n let options: ILabeledDropdownOption[] = [];\n let selectedOption: ILabeledDropdownOption = this.defaultOption;\n\n options = timeslots.map((value: PickupTimeslotAvailability, index: number) => {\n return {\n key: index.toString(),\n value: getTimeslot(timeslotPlaceHolder, value.StartDateTime, value.EndDateTime, locale, useHour12TimeFormat)\n };\n });\n options.unshift(this.defaultOption);\n\n const index: number = timeslots.findIndex(\n value =>\n selectedTimeslot !== undefined &&\n selectedTimeslot.StartDateTime?.getTime() === value.StartDateTime?.getTime() &&\n selectedTimeslot.EndDateTime?.getTime() === value.EndDateTime?.getTime()\n );\n if (index >= 0 && selectedTimeslot) {\n selectedOption = {\n key: index.toString(),\n value: getTimeslot(\n timeslotPlaceHolder,\n selectedTimeslot.StartDateTime,\n selectedTimeslot.EndDateTime,\n locale,\n useHour12TimeFormat\n )\n };\n }\n\n return {\n dropdownOptions: options,\n selectedOption\n };\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { CheckoutModule, ErrorLocation, ICheckoutState } from '@msdyn365-commerce/global-state';\nimport { getEstimatedPickupTimeslotAvailabilitiesAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/StoreOperationsDataActions.g';\nimport {\n CartLine,\n LineDeliverySpecification,\n OrgUnitLocation,\n PickupTimeslotAvailability,\n PickupTimeslotAvailabilitySearchCriteria,\n ProductDeliveryOptions,\n SimpleProduct\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport {\n ArrayExtensions,\n getFallbackImageUrl,\n getSimpleProducts,\n ObjectExtensions,\n ProductInput\n} from '@msdyn365-commerce-modules/retail-actions';\nimport { format, IModuleProps, isNullOrWhiteSpace, Waiting } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutPickupData } from './checkout-pickup.data';\nimport { ICheckoutPickupProps } from './checkout-pickup.props.autogenerated';\nimport {\n CheckoutPickupDateDropdown,\n CheckoutPickupError,\n CheckoutPickupTimeslotDropdown,\n getDate,\n getTimeslot,\n getUTCDateWithoutTime\n} from './components';\nimport {\n CheckoutPickupAddress,\n CheckoutPickupCartLines,\n CheckoutPickupGroupHeader,\n CheckoutPickupTimeslotInfo,\n DefaultImageSettings,\n ICheckoutPickupAddressProps,\n ICheckoutPickupCartLineInfo,\n ICheckoutPickupCartLinesProps,\n ICheckoutPickupGroup,\n ICheckoutPickupGroupHeaderProps,\n ICheckoutPickupGroupViewProps,\n ICheckoutPickupTimeslotInfoProps,\n PickupTimeslotAvailabilityState\n} from './components/checkout-pickup-group';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutPickupModuleProps extends ICheckoutPickupProps, IModuleStateProps {}\n\nexport interface ICheckoutPickupState {\n pickupGroups: ICheckoutPickupGroup[];\n}\n\nexport interface ICheckoutPickupViewState {\n isLoading: boolean;\n isHeaderError: boolean;\n isShowDropdown: boolean;\n isShowSelected: boolean;\n}\n\nexport interface ICheckoutPickupViewProps extends ICheckoutPickupProps<{}> {\n checkoutPickup: IModuleProps;\n viewState: ICheckoutPickupViewState;\n headerError: React.ReactNode;\n waiting: React.ReactNode;\n pickupGroups: ICheckoutPickupGroupViewProps[];\n checkoutErrorRef?: React.RefObject;\n}\n\n/**\n *\n * CheckoutPickup component.\n * @extends {React.Component}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutPickup extends React.Component {\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n @observable private isLoading: boolean = false;\n\n @observable private headerErrorMessage?: string;\n\n @computed get isDataReady(): boolean {\n return (\n (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS' &&\n (this.props.data.orgUnitLocations.result && this.props.data.orgUnitLocations.status) === 'SUCCESS'\n );\n }\n\n constructor(props: ICheckoutPickupModuleProps) {\n super(props);\n this.state = { pickupGroups: [] };\n\n this.setDateHandler = this.setDateHandler.bind(this);\n this.setTimeslotHandler = this.setTimeslotHandler.bind(this);\n }\n\n public componentDidMount(): void {\n when(\n () => this.isDataReady,\n async () => {\n await this.initPickupGroup();\n this.initModuleState();\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (checkoutError && checkoutError.errorLocation === ErrorLocation.CheckoutPickup && checkoutError.errorMessage) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutPickup) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutPickupModuleProps, nextState: ICheckoutPickupState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n if (!this.isDataReady || !this.canPickup()) {\n return null;\n }\n\n const { resources, config, context } = this.props;\n\n const {\n pickupDateLabel,\n pickupTimeslotLabel,\n pickupDateDefaultText,\n pickupTimeslotDefaultText,\n itemsText,\n singleItemText,\n pickupDateTimeslotText,\n pickupTimeslotPlaceHolder,\n pickupLocationLabel\n } = resources;\n\n const { locale } = context.request;\n const { className, imageSettings, useHour12TimeFormat } = config;\n const defaultClassName = 'ms-checkout-pickup';\n const groupsViewProps: ICheckoutPickupGroupViewProps[] = [];\n\n this.state.pickupGroups.forEach((value, index) => {\n // Divider line for each pickup group\n const groupDivider: React.ReactNode = index !== 0 &&
;\n\n // Line images\n const cartlines: ICheckoutPickupCartLineInfo[] = value.cartLines\n .filter(x => !ObjectExtensions.isNullOrUndefined(x.product))\n .map(line => ({\n lineId: line.cartLine.LineId || '',\n imageProps: {\n requestContext: context.actionContext.requestContext,\n className: `${defaultClassName}__group-line-image`,\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl || '',\n fallBackSrc: getFallbackImageUrl(\n line.product?.ItemId,\n context.actionContext.requestContext.apiSettings,\n context.request.app?.config?.OmniChannelMedia\n ),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings || DefaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity || 0\n }));\n\n // Heading for each group\n const numberOfCartLines = this._countItems(cartlines);\n const itemText = numberOfCartLines > 1 ? itemsText : singleItemText;\n const itemTitle = `(${format(itemText, numberOfCartLines)})`;\n const headerProps: ICheckoutPickupGroupHeaderProps = {\n moduleClassName: defaultClassName,\n storeInfo: `${value.pickupModeName}, ${value.storeName}`,\n items: itemTitle\n };\n const groupHeader: React.ReactNode = ;\n\n const lineImageProps: ICheckoutPickupCartLinesProps = {\n moduleClassName: defaultClassName,\n cartLines: cartlines.filter(x => !ObjectExtensions.isNullOrUndefined(x))\n };\n const cartLineImages: React.ReactNode = ;\n\n // Selected pickup date and timeslot node\n const dateString = getDate(value.selectedDate, locale);\n const timeslotString = getTimeslot(\n pickupTimeslotPlaceHolder,\n value.selectedTimeslot?.StartDateTime,\n value.selectedTimeslot?.EndDateTime,\n locale,\n useHour12TimeFormat\n );\n const timeslotInfoProps: ICheckoutPickupTimeslotInfoProps = {\n moduleClassName: defaultClassName,\n title: pickupDateTimeslotText,\n content: `${dateString} ${timeslotString}`\n };\n const selectedDateTimeslotNode: React.ReactNode = ;\n\n // Pickup address\n const addressProps: ICheckoutPickupAddressProps = {\n moduleClassName: defaultClassName,\n title: pickupLocationLabel,\n address: value.pickupAddress\n };\n const pickupAddress: React.ReactNode = ;\n\n // Pickup date and timeslot dropdown list\n const dropdownClassName = `${defaultClassName}__group-datetime-dropdown`;\n const labelClassName = `${dropdownClassName}-label`;\n const dropdownSelectClassName = `${dropdownClassName}-select`;\n const dateDropdownNode: React.ReactNode = (\n \n );\n\n const timeslotDropdownNode: React.ReactNode = (\n \n );\n\n const viewProp: ICheckoutPickupGroupViewProps = {\n moduleProps: { ...this.props },\n pickupGroupContainer: { className: `${defaultClassName}__group` },\n dateTimeslotContainer: { className: `${defaultClassName}__group-datetime` },\n pickupStoreId: value.pickupStoreId,\n pickupModeName: value.pickupModeName,\n deliveryMode: value.deliveryMode,\n groupDivider,\n groupHeader,\n groupErrorMessage: ,\n cartLineImages,\n pickupDateDropdown: dateDropdownNode,\n pickupTimeslotDropdown: timeslotDropdownNode,\n selectedDateTimeslot: selectedDateTimeslotNode,\n pickupAddress\n };\n\n groupsViewProps.push(viewProp);\n });\n\n const {\n moduleState: { isReady, hasError }\n } = this.props;\n const isHeaderError = !this.isLoading && this.headerErrorMessage !== undefined;\n const isShowDropdown = !this.isLoading && !isReady;\n const isShowSelected = !this.isLoading && !hasError && isReady;\n\n const viewProps: ICheckoutPickupViewProps = {\n ...this.props,\n checkoutPickup: {\n moduleProps: this.props,\n className: classname(defaultClassName, className)\n },\n viewState: {\n isLoading: this.isLoading,\n isHeaderError,\n isShowSelected,\n isShowDropdown\n },\n headerError: ,\n waiting: ,\n pickupGroups: groupsViewProps,\n checkoutErrorRef: this.checkoutErrorRef\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n @action\n public async setDateHandler(pickupStoreId: string, deliveryMode: string, pickupDate: Date | undefined): Promise {\n const oldGroup = this.state.pickupGroups.find(\n group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode\n );\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n newGroup.selectedDate = pickupDate;\n newGroup.selectedTimeslot = undefined; // Clear the selected timeslot in any case\n newGroup.timeslotErrorMessage = undefined; // Clear the timeslot error message if any\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = undefined;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = undefined;\n }\n });\n\n if (pickupDate) {\n // Date is set\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: pickupDate,\n EndDate: pickupDate,\n SearchOptionValue: 2 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n const timeslotResults: PickupTimeslotAvailability[] = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' },\n searchCriteria\n );\n\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n newGroup.dateErrorMessage =\n newGroup.availableTimeslots.length === 0 ? this.props.resources.noAvailableTimeslotError : undefined;\n } else {\n // Date is not set\n newGroup.availableTimeslots = [];\n newGroup.dateErrorMessage = undefined;\n }\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n }\n return group;\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n public setTimeslotHandler(pickupStoreId: string, deliveryMode: string, pickupTimeslot: PickupTimeslotAvailability | undefined): void {\n const oldGroup = this.state.pickupGroups.find(\n group => group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode\n );\n if (!oldGroup) {\n return;\n }\n\n const newGroup: ICheckoutPickupGroup = { ...oldGroup };\n\n newGroup.selectedTimeslot = pickupTimeslot;\n newGroup.lineDeliverySpecs.forEach((lineSpec: LineDeliverySpecification) => {\n if (lineSpec.DeliverySpecification) {\n lineSpec.DeliverySpecification.PickupTimeslotStartDateTime = pickupTimeslot?.StartDateTime;\n lineSpec.DeliverySpecification.PickupTimeslotEndDateTime = pickupTimeslot?.EndDateTime;\n }\n });\n\n if (pickupTimeslot) {\n newGroup.timeslotErrorMessage = undefined;\n }\n\n const groups = this.state.pickupGroups.map(group => {\n if (group.pickupStoreId === pickupStoreId && group.deliveryMode === deliveryMode) {\n return newGroup;\n }\n return group;\n });\n\n this.setState({ pickupGroups: groups });\n }\n\n @action\n private readonly initModuleState = (): void => {\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onSubmit: this.onSubmit,\n status: this.canPickup() ? (this.isPickupTimeSlotSet() ? 'ready' : 'updating') : 'disabled'\n });\n };\n\n private readonly onEdit = (): void => {\n this.props.moduleState.onUpdating();\n };\n\n private readonly onReady = (): void => {\n this.props.moduleState.onReady();\n };\n\n private readonly onPending = (): void => {\n this.props.moduleState.onPending();\n };\n\n private readonly onSubmit = async (): Promise => {\n await this.updateCartLinePickupDateTimeslot();\n };\n\n private readonly setError = (errorMessage: string, isHeaderError: boolean = true): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n if (isHeaderError) {\n this.headerErrorMessage = errorMessage;\n }\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.headerErrorMessage = undefined;\n };\n\n @action\n private readonly initPickupGroup = async (): Promise => {\n const pickupCartLines: CartLine[] = this.getCartLinesforPickup();\n let products: SimpleProduct[] = [];\n try {\n products = await this.getProductsByCartLines(\n this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0,\n pickupCartLines\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n const pickupGroups: ICheckoutPickupGroup[] = [];\n const locations: OrgUnitLocation[] = this.props.data.orgUnitLocations.result || [];\n this.isLoading = true;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { featureState, deliveryOptions } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n\n for (const line of pickupCartLines) {\n const group: ICheckoutPickupGroup | undefined = pickupGroups.find(\n x => x.pickupStoreId === line.FulfillmentStoreId && x.deliveryMode === line.DeliveryMode\n );\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\n const lineDeliverySpecification: LineDeliverySpecification = {\n LineId: line.LineId,\n DeliverySpecification: {\n DeliveryModeId: line.DeliveryMode,\n DeliveryPreferenceTypeValue: 2,\n PickUpStoreId: line.FulfillmentStoreId,\n PickupTimeslotStartDateTime: line.PickupTimeslotStartDateTime,\n PickupTimeslotEndDateTime: line.PickupTimeslotEndDateTime,\n DeliveryAddress: line.ShippingAddress\n }\n };\n if (group) {\n group.lineDeliverySpecs.push(lineDeliverySpecification);\n group.cartLines.push({ cartLine: line, product });\n } else {\n // Group not exists yet\n const location: OrgUnitLocation | undefined = locations.find(x => x.OrgUnitNumber === line.FulfillmentStoreId);\n const storeName: string = this.getStoreName(location, line);\n const selectedDate: Date | undefined =\n line.PickupTimeslotStartDateTime && getUTCDateWithoutTime(line.PickupTimeslotStartDateTime);\n const selectedTimeslot =\n line.PickupTimeslotStartDateTime && line.PickupTimeslotEndDateTime\n ? { StartDateTime: line.PickupTimeslotStartDateTime, EndDateTime: line.PickupTimeslotEndDateTime }\n : undefined;\n const newGroup: ICheckoutPickupGroup = {\n pickupModeName: retailMultiplePickUpOptionEnabled\n ? this.getPickupModeDescription(\n this.props.resources.generalPickupText,\n line.DeliveryMode,\n deliveryOptions?.result,\n product\n )\n : this.props.resources.generalPickupText,\n pickupStoreId: line.FulfillmentStoreId || '',\n deliveryMode: line.DeliveryMode || '',\n storeName,\n pickupAddress: line.ShippingAddress,\n availabilityState: PickupTimeslotAvailabilityState.None,\n lineDeliverySpecs: [lineDeliverySpecification],\n cartLines: [{ cartLine: line, product }],\n availableDates: [],\n availableTimeslots: [],\n selectedDate,\n selectedTimeslot\n };\n\n let dailyGroupingResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n SearchOptionValue: 1 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.DailyGroupingTimeslotOnly\n };\n dailyGroupingResults = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {} },\n searchCriteria\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n newGroup.availabilityState = this.getPickupTimeslotAvailabilityState(dailyGroupingResults);\n if (newGroup.availabilityState === PickupTimeslotAvailabilityState.NotAvailable) {\n newGroup.groupErrorMessage = this.props.resources.noAvailableDateError;\n this.setError(newGroup.groupErrorMessage, false);\n }\n dailyGroupingResults.forEach(value => {\n if (value.StartDateTime && (value.AvailableCapacity || 0) > 0) {\n newGroup.availableDates.push(getUTCDateWithoutTime(value.StartDateTime));\n }\n });\n\n if (selectedDate) {\n let timeslotResults: PickupTimeslotAvailability[] = [];\n try {\n const searchCriteria: PickupTimeslotAvailabilitySearchCriteria = {\n DeliveryModeCode: newGroup.deliveryMode,\n StoreId: newGroup.pickupStoreId,\n StartDate: selectedDate,\n EndDate: selectedDate,\n SearchOptionValue: 2 // Test runtime does not recognize PickupTimeslotAvailabilitySearchOption.All\n };\n timeslotResults = await getEstimatedPickupTimeslotAvailabilitiesAsync(\n { callerContext: this.props.context.actionContext, queryResultSettings: {}, bypassCache: 'get' },\n searchCriteria\n );\n } catch (error) {\n this.props.telemetry.error(error);\n }\n newGroup.availableTimeslots = timeslotResults.filter(value => (value.AvailableCapacity || 0) > 0);\n }\n pickupGroups.push(newGroup);\n }\n }\n\n const filteredPickupGroups = pickupGroups.filter(\n group =>\n group.availabilityState === PickupTimeslotAvailabilityState.Available ||\n group.availabilityState === PickupTimeslotAvailabilityState.NotAvailable\n );\n\n if (!ArrayExtensions.hasElements(filteredPickupGroups)) {\n this.props.context.telemetry.error('Data is not ready or pickup group is empty, module wont render.');\n }\n this.isLoading = false;\n this.setState({ pickupGroups: filteredPickupGroups });\n };\n\n @action\n private readonly updateCartLinePickupDateTimeslot = async (): Promise => {\n if (!this.validateTimeslot()) {\n return;\n }\n const { resources } = this.props;\n let lineSpecs: LineDeliverySpecification[] = [];\n\n this.state.pickupGroups.forEach(group => {\n lineSpecs = lineSpecs.concat(group.lineDeliverySpecs);\n });\n\n this.clearError();\n this.onPending();\n\n try {\n const checkoutState = this.props.data.checkout.result as ICheckoutState;\n const response = await checkoutState.checkoutCart.updateCartLinePickupDateTimeslot({ lineDeliverySpecifications: lineSpecs });\n\n if (response.status === 'FAILED') {\n this.setError(resources.genericErrorMessage);\n } else {\n this.onReady();\n this.props.moduleState.setIsCancellable(true);\n }\n } catch {\n this.setError(resources.genericErrorMessage);\n }\n };\n\n private readonly getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise => {\n const actionContext = this.props.context.actionContext;\n const productInputs = cartLines\n .filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId))\n .map(\n line =>\n new ProductInput(\n line.ProductId || 0,\n actionContext.requestContext.apiSettings,\n channelId,\n undefined,\n actionContext.requestContext\n )\n );\n return getSimpleProducts(productInputs, actionContext);\n };\n\n private readonly validateTimeslot = (): boolean => {\n let validationResult = true;\n this.state.pickupGroups.forEach(group => {\n switch (group.availabilityState) {\n case PickupTimeslotAvailabilityState.NotAvailable:\n // Need customer to select another store in this case\n validationResult = false;\n break;\n case PickupTimeslotAvailabilityState.Available:\n if (!group.selectedDate || !group.selectedTimeslot) {\n if (!group.selectedDate) {\n group.dateErrorMessage = this.props.resources.pickupDateRequired;\n }\n if (!group.selectedTimeslot) {\n group.timeslotErrorMessage = this.props.resources.pickupTimeslotRequired;\n }\n this.setError(this.props.resources.pickupDateTimeslotRequired, false);\n validationResult = false;\n } else {\n group.dateErrorMessage = undefined;\n group.timeslotErrorMessage = undefined;\n }\n break;\n\n // We consider timeslot not defined as fallback case\n case PickupTimeslotAvailabilityState.NotDefined:\n default:\n }\n });\n\n return validationResult;\n };\n\n private readonly getStoreName = (orgUnitLocation: OrgUnitLocation | undefined, cartLine: CartLine): string => {\n return orgUnitLocation?.OrgUnitName || cartLine.ShippingAddress?.Name || cartLine.FulfillmentStoreId || '';\n };\n\n private readonly canPickup = (): boolean => {\n return ArrayExtensions.hasElements(this.state.pickupGroups);\n };\n\n private readonly isPickupTimeSlotSet = (): boolean => {\n return (\n ArrayExtensions.hasElements(this.state.pickupGroups) &&\n this.state.pickupGroups.every(\n group =>\n !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.StartDateTime) &&\n !ObjectExtensions.isNullOrUndefined(group.selectedTimeslot?.EndDateTime)\n )\n );\n };\n\n private readonly getCartLinesforPickup = (): CartLine[] => {\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this.isPickupLine(line)) || [];\n };\n\n private readonly isPickupMode = (deliveryMode: string | undefined): boolean => {\n const pickupDeliveryModeCode = this.props.context.request.channel?.PickupDeliveryModeCode;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props?.data;\n const retailMultiplePickUpOptionEnabled = featureState?.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\n ?.IsEnabled;\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\n const pickupDeliveryMode = channelDeliveryOptionConfig?.result?.PickupDeliveryModeCodes?.includes(deliveryMode);\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\n }\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && deliveryMode === pickupDeliveryModeCode;\n };\n\n private readonly isPickupLine = (line: CartLine): boolean => {\n return (\n this.isPickupMode(line.DeliveryMode) && line.FulfillmentStoreId !== undefined && !isNullOrWhiteSpace(line.FulfillmentStoreId)\n );\n };\n\n private readonly getPickupModeDescription = (\n resourceString: string,\n deliveryMode?: string,\n deliveryOptions?: ProductDeliveryOptions[],\n product?: SimpleProduct\n ): string => {\n let deliveryOption: string = resourceString;\n if (ArrayExtensions.hasElements(deliveryOptions) && product !== undefined) {\n let foundProductDeliveryOption;\n foundProductDeliveryOption = deliveryOptions?.find(deliveryO => {\n return deliveryO && deliveryO.ProductId === product.RecordId;\n });\n const deliveryDesc = foundProductDeliveryOption?.DeliveryOptions\n ? foundProductDeliveryOption?.DeliveryOptions?.find(option => option.Code === deliveryMode)?.Description\n : resourceString;\n if (deliveryDesc !== undefined) {\n deliveryOption = deliveryDesc;\n }\n }\n return deliveryOption;\n };\n\n private readonly getPickupTimeslotAvailabilityState = (dailyResult: PickupTimeslotAvailability[]) => {\n let state: PickupTimeslotAvailabilityState = PickupTimeslotAvailabilityState.None;\n if (!ArrayExtensions.hasElements(dailyResult)) {\n state = PickupTimeslotAvailabilityState.NotDefined;\n } else if (dailyResult.every(date => (date.AvailableCapacity || 0) <= 0)) {\n state = PickupTimeslotAvailabilityState.NotAvailable;\n } else {\n state = PickupTimeslotAvailabilityState.Available;\n }\n return state;\n };\n\n /**\n * Returns count of products.\n * @param cartLine - The checkout pickup cart line info props.\n * @returns Number of products.\n */\n private readonly _countItems = (cartlines: ICheckoutPickupCartLineInfo[]): number => {\n return cartlines.reduce((count, line) => {\n return count + (line.quantity || 0);\n }, 0);\n };\n}\n\nexport default CheckoutPickup;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { ICheckoutPickupGroupViewProps, ICheckoutPickupViewProps } from './index';\n\nconst CheckoutPickupView: React.FC = props => {\n const { checkoutPickup, checkoutErrorRef, viewState, headerError, waiting, pickupGroups } = props;\n\n return (\n \n {viewState.isLoading && waiting}\n {viewState.isHeaderError && headerError}\n {pickupGroups.map(\n (pickupGroupViewProps: ICheckoutPickupGroupViewProps, index: number): React.ReactElement => {\n const {\n pickupGroupContainer,\n dateTimeslotContainer,\n groupDivider,\n groupHeader,\n groupErrorMessage,\n cartLineImages,\n pickupDateDropdown,\n pickupTimeslotDropdown,\n selectedDateTimeslot,\n pickupAddress\n } = pickupGroupViewProps;\n\n return (\n \n {groupDivider}\n {groupHeader}\n {groupErrorMessage}\n {cartLineImages}\n {viewState.isShowDropdown && (\n \n {pickupDateDropdown}\n {pickupTimeslotDropdown}\n \n )}\n {viewState.isShowSelected && pickupAddress}\n {viewState.isShowSelected && selectedDateTimeslot}\n \n );\n }\n )}\n \n );\n};\n\nexport default CheckoutPickupView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsCheckboxProps {\n isChecked: boolean;\n ariaLabel?: string;\n disabled: boolean;\n id?: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.isChecked\n * @param root0.ariaLabel\n * @param root0.disabled\n * @param root0.telemetryContent\n * @param root0.onChange\n * @param root0.id\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsCheckbox: React.FC = ({\n isChecked,\n ariaLabel,\n disabled,\n telemetryContent,\n onChange,\n id\n}) => {\n const payLoad = getPayloadObject('click', telemetryContent!, '');\n const attribute = getTelemetryAttributes(telemetryContent!, payLoad);\n\n return (\n <>\n \n \n );\n};\n\nexport default CheckoutTermsAndConditionsCheckbox;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorMessageProps {\n message?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.message\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsErrorMessage: React.FC = ({ message }) => {\n if (!message) {\n return null;\n }\n\n return

{message}

;\n};\n\nexport default CheckoutTermsAndConditionsErrorMessage;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface ICheckoutTermsAndConditionsErrorTitleProps {\n title?: string;\n}\n\n/**\n * AddPaymentForm SFC.\n * @param root0\n * @param root0.title\n * @extends {React.FC}\n */\nconst CheckoutTermsAndConditionsErrorTitle: React.FC = ({ title }) => {\n if (!title) {\n return null;\n }\n\n return

{title}

;\n};\n\nexport default CheckoutTermsAndConditionsErrorTitle;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as MsDyn365 from '@msdyn365-commerce/core';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { Button, getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport { CheckoutModule, ErrorLocation } from '@msdyn365-commerce/global-state';\nimport classname from 'classnames';\nimport { action, computed, observable, reaction, when } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { ICheckoutTermsAndConditionsData } from './checkout-terms-and-conditions.data';\nimport { ICheckoutTermsAndConditionsProps } from './checkout-terms-and-conditions.props.autogenerated';\nimport CheckboxComponent from './components/checkout-terms-and-conditions.check-box';\nimport ErrorMessageComponent from './components/checkout-terms-and-conditions.error-message';\nimport ErrorTitleComponent from './components/checkout-terms-and-conditions.error-title';\nimport { focusOnCheckoutError } from '../../checkout-errors';\n\nexport interface ICheckoutTermsAndConditionsModuleProps\n extends ICheckoutTermsAndConditionsProps,\n IModuleStateProps {}\n\nexport interface ICheckoutTermsAndConditions {\n termsAndConditionAcceptance: INodeProps;\n checkBox: React.ReactNode;\n description: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsError {\n error: INodeProps;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface ICheckoutTermsAndConditionsViewState {\n isError: boolean;\n isShowSaveButton: boolean;\n isShowEditButton: boolean;\n isShowCancelButton: boolean;\n}\n\nexport interface ICheckoutTermsAndConditionsViewProps extends ICheckoutTermsAndConditionsProps<{}> {\n checkoutTermsAndConditions: IModuleProps;\n isTermsAccepted: boolean;\n errorMessageData: string;\n viewState: ICheckoutTermsAndConditionsViewState;\n termsAndConditionsContent: ICheckoutTermsAndConditions;\n errorMessage?: ICheckoutTermsAndConditionsError;\n saveButton?: React.ReactNode;\n editButton?: React.ReactNode;\n cancelButton?: React.ReactNode;\n checkoutErrorRef?: React.RefObject;\n onChange(event: React.ChangeEvent): void;\n onSave(): void;\n onEdit(): void;\n onCancel(): void;\n}\n\n/**\n *\n * CheckoutTermsAndConditions component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutTermsAndConditions extends React.Component {\n private readonly telemetryContent: ITelemetryContent;\n\n private readonly checkoutErrorRef: React.RefObject = React.createRef();\n\n @observable private isTermsAccepted: boolean = true;\n\n @observable private errorMessage?: string;\n\n constructor(props: ICheckoutTermsAndConditionsModuleProps) {\n super(props);\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n @computed get isDataReady(): boolean {\n return (this.props.data.checkout.result && this.props.data.checkout.status) === 'SUCCESS';\n }\n\n @computed get isShowButtons(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && (showControlButtons || false);\n }\n\n @computed get isAutoSave(): boolean {\n const { showControlButtons } = this.props.config;\n return !this.props.moduleState.hasExternalSubmitGroup && !showControlButtons;\n }\n\n @computed get defaultTermsAndConditionAcceptedValue(): boolean {\n const { showCheckbox } = this.props.config;\n return !showCheckbox;\n }\n\n public async componentDidMount(): Promise {\n when(\n () => this.isDataReady,\n async () => {\n await this.init();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.isTermsAndConditionAccepted,\n async () => {\n this.isTermsAccepted =\n this.props.data.checkout.result?.isTermsAndConditionAccepted || this.defaultTermsAndConditionAcceptedValue;\n }\n );\n\n if (this.props.data.checkout.result?.shouldEnableCheckoutErrorDisplayMessaging) {\n reaction(\n () => this.props.data.checkout.result?.checkoutError,\n checkoutError => {\n if (\n checkoutError &&\n checkoutError.errorLocation === ErrorLocation.CheckoutTermsAndConditions &&\n checkoutError.errorMessage\n ) {\n this.setError(checkoutError.errorMessage);\n }\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.checkoutErrorFocus,\n checkoutErrorFocus => {\n if (checkoutErrorFocus === CheckoutModule.CheckoutTermsAndConditions) {\n focusOnCheckoutError(this.checkoutErrorRef, this.props.context.actionContext);\n }\n }\n );\n }\n }\n\n public shouldComponentUpdate(\n nextProps: ICheckoutTermsAndConditionsModuleProps,\n nextState: ICheckoutTermsAndConditionsViewState\n ): boolean {\n if (this.state === nextState && this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const {\n moduleState: { isReady, hasError },\n config: { className }\n } = this.props;\n const isTermsAndConditionAccepted = this.props.data.checkout.result?.isTermsAndConditionAccepted;\n const isError = hasError;\n const isShowContent = !isReady;\n const isShowSelected = !hasError && isReady;\n\n const viewProps = {\n ...this.props,\n ...this.state,\n isTermsAccepted: this.isTermsAccepted,\n errorMessageData: this.errorMessage,\n checkoutErrorRef: this.checkoutErrorRef,\n viewState: {\n isError,\n isShowSaveButton: isShowContent && this.isShowButtons,\n isShowEditButton: isShowSelected && this.isShowButtons,\n isShowCancelButton: isShowContent && this.isShowButtons && isTermsAndConditionAccepted\n },\n checkoutTermsAndConditions: {\n moduleProps: this.props,\n className: classname('ms-checkout-terms-and-conditions', className)\n },\n termsAndConditionsContent: this.getTermsAndConditions(),\n errorMessage: this.getErrorMessage(),\n saveButton: this.getSaveButton(),\n editButton: this.getEditButton(),\n cancelButton: this.getCancelButton(),\n onSave: this.onSubmit,\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onChange: this.onChange\n };\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n public handleTextChange = (event: MsDyn365.ContentEditableEvent) => (this.props.config.description = event.target.value);\n\n private readonly getTermsAndConditions = (): ICheckoutTermsAndConditions => {\n const {\n moduleState: { isReady },\n config: { showCheckbox, description }\n } = this.props;\n const isDisabled = isReady && !this.isAutoSave;\n const isTermsAndConditionAccepted = this.isTermsAccepted;\n const { checkboxAriaLabel } = this.props.resources;\n return {\n termsAndConditionAcceptance: { className: 'ms-checkout-terms-and-conditions__container' },\n checkBox: showCheckbox && (\n \n ),\n description: (\n \n )\n };\n };\n\n @action\n private readonly init = async (): Promise => {\n const {\n data,\n config: { showCheckbox }\n } = this.props;\n\n const hasInvoiceLine = this.props.data.checkout.result?.checkoutCart.hasInvoiceLine;\n\n // If hasInvoiceLine is true, this is for b2b and isTermsAccepted should be true\n if (hasInvoiceLine || data.checkout.result?.isTermsAndConditionAccepted || !showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(true);\n this.isTermsAccepted = true;\n } else if (showCheckbox) {\n await this.updateTermsAndConditionsAcceptance(false);\n this.isTermsAccepted = false;\n }\n\n this.props.moduleState.init({\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit,\n status: hasInvoiceLine ? 'disabled' : this.isTermsAccepted ? 'ready' : 'updating'\n });\n\n if (this.props.data.checkout.result?.isPaymentVerificationRedirection) {\n this.isTermsAccepted = true;\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly getErrorMessage = (): ICheckoutTermsAndConditionsError => {\n const { errorMessageTitle } = this.props.resources;\n return {\n error: { tag: 'div', className: 'ms-checkout-terms-and-conditions__error', role: 'alert', 'aria-live': 'assertive' },\n title: ,\n message: \n };\n };\n\n private readonly getCancelButton = (): React.ReactNode => {\n const { cancelBtnLabel = 'Cancel', cancelBtnAriaLabel } = this.props.resources;\n return (\n \n {cancelBtnLabel}\n \n );\n };\n\n private readonly getSaveButton = (): React.ReactNode => {\n const { saveBtnLabel = 'Save', saveBtnAriaLabel } = this.props.resources;\n return (\n \n {saveBtnLabel}\n \n );\n };\n\n private readonly getEditButton = (): React.ReactNode => {\n const { editBtnLabel = 'Change', editBtnAriaLabel } = this.props.resources;\n return (\n \n {editBtnLabel}\n \n );\n };\n\n private readonly onEdit = (): void => {\n this.props.telemetry.information('Terms and conditions onEdit is called.');\n\n this.onUpdating();\n };\n\n private readonly onSubmit = async (): Promise => {\n this.props.telemetry.information('Terms and conditions onSubmit is called.');\n\n if (!this.isTermsAccepted) {\n if (this.isAutoSave) {\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n } else {\n this.setError(this.props.resources.errorMessage);\n this.props.moduleState.setHasError(true);\n }\n } else {\n this.clearError();\n await this.updateTermsAndConditionsAcceptance(this.isTermsAccepted);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly onUpdating = () => {\n this.props.moduleState.onUpdating();\n };\n\n private readonly setError = (errorMessage: string): void => {\n this.props.telemetry.error(errorMessage);\n this.props.moduleState.setHasError(true);\n this.props.moduleState.onUpdating();\n this.errorMessage = errorMessage;\n };\n\n private readonly onCancel = (): void => {\n this.props.telemetry.information('Terms and conditions onCancel is called.');\n\n // Reset to the saved value\n if (!this.props.data.checkout.result) {\n return;\n }\n\n const isTermsAccepted = this.props.data.checkout.result.isTermsAndConditionAccepted;\n if (!isTermsAccepted) {\n // It has no saved email, set to status updating and request user to fill the email form\n this.props.moduleState.onUpdating();\n } else {\n // It has saved email, set to status ready\n this.isTermsAccepted = true;\n this.props.moduleState.setHasError(false);\n this.props.moduleState.onReady();\n }\n };\n\n private readonly updateTermsAndConditionsAcceptance = async (isTermsAccepted: boolean): Promise => {\n if (this.props.data.checkout.result) {\n await this.props.data.checkout.result.updateTermsAndConditionsAcceptance({ newIsTermsAndConditionAccepted: isTermsAccepted });\n }\n };\n\n private readonly clearError = (): void => {\n this.props.moduleState.setHasError(false);\n this.errorMessage = undefined;\n };\n\n private readonly onChange = async (event: React.ChangeEvent) => {\n const checked = event.target.checked;\n this.isTermsAccepted = checked;\n\n if (this.props.data.checkout.result?.shouldEnableSinglePaymentAuthorizationCheckout) {\n await this.props.data.checkout.result.updateIsTermsAndConditionsChecked({ newIsTermsAndConditionChecked: checked });\n }\n\n if (this.isAutoSave) {\n await this.onSubmit();\n }\n };\n}\n\nexport default CheckoutTermsAndConditions;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport {\n ICheckoutTermsAndConditions,\n ICheckoutTermsAndConditionsError,\n ICheckoutTermsAndConditionsViewProps\n} from './checkout-terms-and-conditions';\n\nconst TermsAndCondition: React.FC = ({ termsAndConditionAcceptance, checkBox, description }) => {\n return (\n \n {checkBox}\n {description}\n \n );\n};\n\nconst ErrorMessage: React.FC = ({ error, title, message }) => {\n return (\n \n {title}\n {message}\n \n );\n};\n\nconst CheckoutTermsAndConditionsView: React.FC = props => {\n const {\n checkoutTermsAndConditions,\n checkoutErrorRef,\n viewState,\n termsAndConditionsContent,\n errorMessage,\n saveButton,\n editButton,\n cancelButton\n } = props;\n\n return (\n // TODO: All wrapper div should be provided by viewProps. Once SDK provide the sln, update markup.\n \n {viewState.isError && errorMessage && }\n \n {viewState.isShowSaveButton && saveButton}\n {viewState.isShowEditButton && editButton}\n {viewState.isShowCancelButton && cancelButton}\n \n );\n};\n\nexport default CheckoutTermsAndConditionsView;\n","'use strict';\nvar call = require('../internals/function-call');\nvar fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic');\nvar anObject = require('../internals/an-object');\nvar isNullOrUndefined = require('../internals/is-null-or-undefined');\nvar toLength = require('../internals/to-length');\nvar toString = require('../internals/to-string');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\nvar getMethod = require('../internals/get-method');\nvar advanceStringIndex = require('../internals/advance-string-index');\nvar regExpExec = require('../internals/regexp-exec-abstract');\n\n// @@match logic\nfixRegExpWellKnownSymbolLogic('match', function (MATCH, nativeMatch, maybeCallNative) {\n return [\n // `String.prototype.match` method\n // https://tc39.es/ecma262/#sec-string.prototype.match\n function match(regexp) {\n var O = requireObjectCoercible(this);\n var matcher = isNullOrUndefined(regexp) ? undefined : getMethod(regexp, MATCH);\n return matcher ? call(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString(O));\n },\n // `RegExp.prototype[@@match]` method\n // https://tc39.es/ecma262/#sec-regexp.prototype-@@match\n function (string) {\n var rx = anObject(this);\n var S = toString(string);\n var res = maybeCallNative(nativeMatch, rx, S);\n\n if (res.done) return res.value;\n\n if (!rx.global) return regExpExec(rx, S);\n\n var fullUnicode = rx.unicode;\n rx.lastIndex = 0;\n var A = [];\n var n = 0;\n var result;\n while ((result = regExpExec(rx, S)) !== null) {\n var matchStr = toString(result[0]);\n A[n] = matchStr;\n if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);\n n++;\n }\n return n === 0 ? null : A;\n }\n ];\n});\n"],"names":["_ref","isNewLine","isShowLabel","labelText","name","value","className","toLowerCase","isEmpty","length","mainClass","classname","phoneNumberString","match","replace","join","_formatPhoneNumber","React","AddressShow","props","addressFormat","address","AddressDetail","items","map","item","key","description","AddressDetailItemComponent","Object","assign","type","AddressItemType","Phone","label","getButtonAriaLabel","ariaLabel","addressName","getAddressList","addresses","showPrimaryButton","heading","resources","isUpdating","addressActionResponse","selectedAddress","onEditAddress","onUpdatePrimaryAddress","errorTitle","errorMessage","List","isShowList","Heading","isSelectedAddress","RecordId","isShowError","Item","showItems","getAddressFormat","ThreeLetterISORegionName","error","Error","title","AddressErrorTitleComponent","message","AddressErrorMessageComponent","isShowPrimaryButton","primaryButton","AddressButtonComponent","disabled","text","addressPrimaryButtonText","addressPrimaryButtonAriaLabel","Name","onClick","editButton","addressEditButtonText","addressEditButtonAriaLabel","getPrimaryAddressList","primaryAddressSectionHeading","primaryAddresses","filter","IsPrimary","getOtherAddressList","otherAddressSectionHeading","otherAddresses","AccountManagementAddress","constructor","super","countryRegionId","_renderAddOrUpdateAddress","AddressAddUpdate","this","addressType","AddressType","Shipping","addUpdateAddress","defaultCountryRegionId","validationError","dropdownDisplayData","getPrefilledAddressDropdownData","addressStateDefaultSelectionText","stateProvinceInfo","onInputChange","_onAddressAddUpdateInputChange","onDropdownChange","_onAddressAddUpdateDropdownChange","onSave","_onAddressAddUpdateSubmit","onCancel","_resetView","_renderListAddress","config","onAddAddress","ListAddress","isShowEmptyListMessage","emptyListMessage","addressEmptyListAddressMessage","addButton","addressAddButtonText","addressAddButtonAriaLabel","primaryAddressList","otherAddressList","AddressList","customerAddresses","_goToEditAddress","_goToAddAddress","_onSubmitUpdatePrimaryAddress","onAddressAddUpdate","set","event","target","RegExp","_onCountryChange","_onAddressUpdate","response","onSuccess","then","result","hasError","validateAddressFormat","addressCommon","isAuthenticatedFlow","currentOperation","AddressOperation","Update","updateCustomerAddress","addCustomerAddress","Promise","resolve","_onAddOrUpdateSuccess","_getStateProvinces","Add","getStateProvinces","catch","e","telemetry","exception","_updateCurrentOperation","operation","updateCustomerPrimaryAddress","_onUpdatePrimaryAddressSuccess","_objectSpread","_setDefaultCountryRegionId","undefined","context","data","customerAccountNumber","request","user","countryRegions","AddressFormat","AddressMetaData","AddressCommon","componentDidMount","reaction","render","renderView","viewState","isShowAddresList","isShowAddOrUpdateAddress","AccountAddressManagement","moduleProps","classnames","showAddressList","showAddOrUpdateAddress","market","channel","ChannelCountryRegionISOCode","getDefaultCountryRegionId","__decorate","observable","observer","Node","_ref2","AddressLists","_ref3","_ref4","AddressForm","isShowSaveButton","saveButton","isShowCancelButton","cancelButton","AddressItem","alert","input","AddressError","_AccountAddressManage","headingText","Module","isChecked","wineState","onChange","additionalAttributes","checked","shouldShowCheckbox","WineClubDataStore","getInstance","get","deliveryType","AddressInputComponent","additionalAddributes","CheckoutBillingAddress","Billing","hasExternalSubmitGroup","moduleState","_onSubmitAddress","_initModuleState","init","status","isBillingAddressRequried","onEdit","onSubmit","checkout","cart","checkoutCart","isCartContainsItemsForShipping","clubStore","getModuleByTypeName","hasModuleState","isBillingAddressSameAsShipping","Show","shippingAddress","CartLines","ItemId","billingAddress","_onBillingAddressSameAsShippingChange","currentTarget","_setBillingAddress","async","_updateModuleState","updateCartDeliverySpecification","setHasError","_this$props$data$chec","_this$props$data$chec2","_this$props$data$chec3","_this$props$data$chec4","checkoutState","DeliveryMode","_this$props$data$chec5","updateCartDeliverySpecificationInput","deliveryModeId","substatus","_containsOnlyGifts","onReady","setError","addressGenericErrorMessage","onUpdating","updateBillingAddress","newBillingAddress","_this$props$data$chec6","attributeValues","AttributeValues","billingIndex","findIndex","AttentionTo","BuildingCompliment","City","County","DistrictName","Email","IsAsyncAddress","State","Street","StreetNumber","ZipCode","attr","TextValue","JSON","stringify","TextValueTranslations","push","updateAsync","callerContext","actionContext","refreshCart","countryStates","isDisabled","onDisable","isShowSameAsShippingCheckbox","isShowAddress","AddressBillingHeadingComponent","addressBillingAddressHeading","sameAsShippingCheckbox","AddressBillingCheckoxComponent","addressSameAsShippingAddressAriaLabel","addressSameAsShippingAddressText","showAddress","_renderShowAddress","pickupDeliveryModeCode","PickupDeliveryModeCode","some","cartLine","loyaltyAmount","giftCards","reduce","count","giftCard","Balance","TotalAmount","getGiftCardTotalAmount","getLoyaltyAmount","shouldPaidByCard","_this$props$context$r","_cart$checkoutCart$ca","emailCode","EmailDeliveryModeCode","nonDigitalItems","line","computed","withModuleState","_props$config$heading","getInput","index","onAddressOptionChange","ichecked","toString","getAddressSelectItems","SelectItem","CheckoutShippingAddress","addressListSelectedAddress","_renderSelectAddress","SelectAddress","addressSaveButtonText","addressSaveButtonAriaLabel","addressCancelButtonText","addressCancelButtonAriaLabel","AddressSelect","_onAddressOptionChange","_onSelectAddress","addressRecordId","find","takeFocustoErrorField","_getDefaultAddress","_canShip","_forceDisable","_setShippingAddress","defaultAddress","emailDeliveryModeCode","newShippingAddress","TwoLetterISORegionName","getTwoLetterISORegionName","updateShippingAddress","onPending","errors","shipping_addressname","document","getElementById","focus","shipping_addressstreet","shipping_addresscity","shipping_addressstate","shipping_addresszipcode","shipping_addressphone","showAddressSelect","store","CheckoutErrors","setCheckoutErrors","errorCode","isExpressCheckoutApplied","ctx","apiError","clientCheckoutError","consoleCheckoutErrors","getCheckoutState","checkoutError","checkoutErrorsList","errorLocation","ErrorLocation","Console","consoleCheckoutError","errorMessageResource","getCheckoutErrorMessage","console","log","CheckoutPaymentInstrument","Checkout","updateCheckoutError","newCheckoutError","updateShouldFocusOnCheckoutError","newShouldFocusOnCheckoutError","genericError","genericErrorMessage","focusOnCheckoutError","checkoutErrorRef","current","scrollIntoView","updateCheckoutErrorFocus","newCheckoutErrorFocus","CheckoutModule","None","setCheckoutErrorFocus","checkoutModuleId","checkoutModule","keys","includes","errorMessageFromAPI","errorResource","resource","ActionError","ErrorCode","ErrorMessageResource","checkoutTimeoutErrorMessage","Microsoft_Dynamics_Commerce_Runtime_BlockedLoyaltyCard","blockedLoyaltyCardErrorMessage","CheckoutLoyalty","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountLimitSignDifferentFromAmountDue","customerAccountLimitSignDifferentFromAmountDueErrorMessage","CheckoutCustomerAccountPayment","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsAvailableCreditLimit","customerAccountPaymentExceedsAvailableCreditLimitErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsCustomerAccountFloorLimit","customerAccountPaymentExceedsCustomerAccountFloorLimitErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItems","customerAccountPaymentExceedsTotalAmountForCarryOutAndReturnItemsErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentForCustomerWithoutAllowOnAccount","customerAccountPaymentForCustomerWithoutAllowOnAccountErrorMessage","Microsoft_Dynamics_Commerce_Runtime_CustomerAccountPaymentNotAllowedForOpenInvoices","customerAccountPaymentNotAllowedForOpenInvoicesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_FraudRisk","fraudRiskErrorMessage","Microsoft_Dynamics_Commerce_Runtime_GiftCardBalanceInquiryFailed","giftCardBalanceInquiryFailedErrorMessage","CheckoutGiftCard","Microsoft_Dynamics_Commerce_Runtime_GiftCardCurrencyMismatch","giftCardCurrencyMismatchErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidCartVersion","invalidCartVersionErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidLoyaltyCardNumber","invalidLoyaltyCardNumberErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest","invalidPaymentRequestErrorMessage","Microsoft_Dynamics_Commerce_Runtime_InvalidPaymentRequest_Console","invalidPaymentRequestConsoleErrorMessage","Microsoft_Dynamics_Commerce_Runtime_MissingRequiredCartTenderLines","missingRequiredCartTenderLinesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_MultipleCustomerAccountPaymentsNotAllowed","multipleCustomerAccountPaymentsNotAllowedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoMoreThanOneLoyaltyTender","noMoreThanOneLoyaltyTenderErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoResponseFromGatewayForGiftCardBalanceInquiry","noResponseFromGatewayForGiftCardBalanceInquiryErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NoTenderLoyaltyCard","noTenderLoyaltyCardErrorMessage","Microsoft_Dynamics_Commerce_Runtime_NotEnoughRewardPoints","notEnoughRewardPointsErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentAlreadyVoided","paymentAlreadyVoidedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentAmountExceedsGiftBalance","paymentAmountExceedsGiftBalanceErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties","paymentRequiresMerchantPropertiesErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentRequiresMerchantProperties_Console","paymentRequiresMerchantPropertiesConsoleErrorMessage","Microsoft_Dynamics_Commerce_Runtime_PaymentUsingUnauthorizedAccount","paymentUsingUnauthorizedAccountErrorMessage","Microsoft_Dynamics_Commerce_Runtime_RefundAmountMoreThanAllowed","refundAmountMoreThanAllowedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePayment","unableToAuthorizePaymentErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardAdditionalContextRequired","unableToAuthorizePaymentCardAdditionalContextRequiredErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToAuthorizePaymentCardTypeMissingOrNotSupported","unableToAuthorizePaymentCardTypeMissingOrNotSupportedErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToCancelPayment","unableToCancelPaymentErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToReadCardTokenInfo","unableToReadCardTokenInfoErrorMessage","Microsoft_Dynamics_Commerce_Runtime_UnableToRetrieveCardPaymentAcceptResult","unableToRetrieveCardPaymentAcceptResultErrorMessage","ErrorComponent","role","onAddAccountPayment","onAddPayment","preventDefault","onChangeAmountHandler","customizedAmt","paymentAmount","amountVariable","locale","onChangePaymentAmount","customState","customizedAmount","returnModifiedState","getLocaleBasedCustomizedPrice","keyCode","getAccountPaymentFormEditMode","options","amount","maxAmount","customer","customerCreatedDate","availableCredit","showCreditLimit","onToggleCreditSection","creditSectionIsExpanded","orderTotal","excessCredit","onRemovePayment","appliedAmount","skipOnChangeLogic","addPaymentButtonLabel","inputAmountLabel","inputAmountAriaLabel","customerSinceLabel","accountCreditLabel","creditDetailsSectionLabel","orderTotalLabel","availableCreditLabel","creditExcessLabel","appliedCustomerAccountPaymentLabel","removeCustomerAccountPaymentLabel","accountCreditDetails","inputLabel","id","formProps","tag","addPaymentButton","Button","Number","isNaN","inputAmount","onInput","onKeyDown","which","min","max","customerName","AccountNumber","customerSince","accountCredit","accountDetails","Alert","assertive","fade","includeAlertClass","isOpen","appliedLine","bottomBorder","getAccountPaymentFormSummaryMode","inputAmountSummaryLabel","paymentAmountInput","defaultLocale","baseClassName","getAvailableCredit","creditBalances","InvoiceAccountCreditLimit","CreditLimit","PendingBalance","InvoiceAccountBalance","InvoiceAccountPendingBalance","addPayment","setState","handleSaveAndContinue","_clearError","updateCustomerAccountAmount","newAmount","state","information","toggleCreditSection","isCreditSectionExpanded","handleCancelOrSubmit","customerAccountAmount","updateMaxAmount","Math","Msdyn365","_setErrorMessage","invalidAmountForOBOMessage","isCheckoutCustomerAccountPaymentRequired","customerAccountCreditErrorMessage","onSkip","removePayment","NaN","maxPaymentAmount","Intl","NumberFormat","format","customerInfo","b2bChannel","isChannelTypeB2B","platform","AllowOnAccountPayment","enableCustomerAccountPayment","_this$props$data$cust","amountDue","_this$props$data$cred","customerInformation","MandatoryCreditLimit","invalidAmountExceedAmountDueMessage","invalidAmountNegativeMessage","cultureFormatter","formatCurrency","currencyCode","when","isDataReady","totalAmount","shouldEnableCheckoutErrorDisplayMessaging","checkoutErrorFocus","shouldComponentUpdate","nextProps","nextState","_this$props$data$cust2","isCustomerAccountPaymentEnabled","hasInvoiceLine","customerSinceDate","Date","CreatedDateTime","toLocaleDateString","checkoutCustomerAccount","errorMessageTitle","editView","formattedExcessCredit","features","skipCheckoutOnChangeLogic","summaryView","action","SummaryForm","EditForm","ref","isReady","PickupTimeslotAvailabilityState","CheckoutPickupError","CheckoutPickupGroupHeader","moduleClassName","storeInfo","CheckoutPickupTimeslotInfo","content","CheckoutPickupAddress","CheckoutPickupCartLines","_ref5","cartLines","ArrayExtensions","hasElements","prop","showQty","quantity","lineId","Image","imageProps","DefaultImageSettings","viewports","xs","q","w","h","lg","xl","lazyload","quality","getDate","date","DateTimeFormat","timeZone","getTimeslot","placeHolder","startDate","endDate","useHour12TimeFormat","hour","minute","hour12","formatter","getUTCDateWithoutTime","UTC","getUTCFullYear","getUTCMonth","getUTCDate","CheckoutPickupDateDropdown","defaultKey","updateDateSelection","notification","pickupStoreId","deliveryMode","setDateHandler","selectedOption","getDateMap","has","mapDatesToOptions","dates","selectedDate","defaultOption","unshift","getTime","dropdownOptions","defaultText","bind","Map","availableDates","forEach","labelClassname","dropdownId","controlledByParent","toggleColor","dropdownClassname","htmlFor","LabeledDropdown","onSelectOption","CheckoutPickupTimeslotDropdown","updateTimeslotSelection","setTimeslotHandler","getTimeslotMap","mapTimeslotsToOptions","timeslots","selectedTimeslot","timeslotPlaceHolder","StartDateTime","EndDateTime","_selectedTimeslot$Sta","_value$StartDateTime","_selectedTimeslot$End","_value$EndDateTime","availableTimeslots","CheckoutPickup","_this","isLoading","initModuleState","canPickup","isPickupTimeSlotSet","updateCartLinePickupDateTimeslot","isHeaderError","arguments","headerErrorMessage","clearError","initPickupGroup","_this$props","_featureState$result","pickupCartLines","getCartLinesforPickup","products","getProductsByCartLines","ChannelId","pickupGroups","locations","orgUnitLocations","featureState","deliveryOptions","retailMultiplePickUpOptionEnabled","feature","IsEnabled","group","x","FulfillmentStoreId","product","ProductId","lineDeliverySpecification","LineId","DeliverySpecification","DeliveryModeId","DeliveryPreferenceTypeValue","PickUpStoreId","PickupTimeslotStartDateTime","PickupTimeslotEndDateTime","DeliveryAddress","ShippingAddress","lineDeliverySpecs","location","OrgUnitNumber","storeName","getStoreName","newGroup","pickupModeName","getPickupModeDescription","generalPickupText","pickupAddress","availabilityState","dailyGroupingResults","searchCriteria","DeliveryModeCode","StoreId","SearchOptionValue","getEstimatedPickupTimeslotAvailabilitiesAsync","queryResultSettings","getPickupTimeslotAvailabilityState","NotAvailable","groupErrorMessage","noAvailableDateError","AvailableCapacity","timeslotResults","StartDate","EndDate","bypassCache","filteredPickupGroups","Available","validateTimeslot","lineSpecs","concat","lineDeliverySpecifications","setIsCancellable","_unused","channelId","productInputs","ObjectExtensions","isNullOrUndefined","ProductInput","requestContext","apiSettings","getSimpleProducts","validationResult","dateErrorMessage","timeslotErrorMessage","pickupDateRequired","pickupTimeslotRequired","pickupDateTimeslotRequired","NotDefined","orgUnitLocation","_cartLine$ShippingAdd","OrgUnitName","every","_group$selectedTimesl","_group$selectedTimesl2","isPickupLine","isPickupMode","_this$props2","_featureState$result2","channelDeliveryOptionConfig","_channelDeliveryOptio","pickupDeliveryMode","PickupDeliveryModeCodes","isNullOrWhiteSpace","resourceString","deliveryOption","_foundProductDelivery","_foundProductDelivery2","foundProductDeliveryOption","deliveryO","deliveryDesc","DeliveryOptions","option","Code","Description","dailyResult","_countItems","cartlines","pickupDateLabel","pickupTimeslotLabel","pickupDateDefaultText","pickupTimeslotDefaultText","itemsText","singleItemText","pickupDateTimeslotText","pickupTimeslotPlaceHolder","pickupLocationLabel","imageSettings","defaultClassName","groupsViewProps","_value$selectedTimesl","_value$selectedTimesl2","groupDivider","_line$product","_line$product2","_line$product3","_context$request$app","altText","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","app","OmniChannelMedia","gridSettings","loadFailureBehavior","Quantity","numberOfCartLines","itemText","itemTitle","headerProps","groupHeader","lineImageProps","cartLineImages","dateString","timeslotString","timeslotInfoProps","selectedDateTimeslotNode","addressProps","dropdownClassName","labelClassName","dropdownSelectClassName","dateDropdownNode","timeslotDropdownNode","viewProp","pickupGroupContainer","dateTimeslotContainer","pickupDateDropdown","pickupTimeslotDropdown","selectedDateTimeslot","isShowDropdown","isShowSelected","viewProps","checkoutPickup","headerError","waiting","Waiting","pickupDate","oldGroup","lineSpec","noAvailableTimeslotError","groups","pickupTimeslot","pickupGroupViewProps","telemetryContent","payLoad","getPayloadObject","attribute","getTelemetryAttributes","CheckoutTermsAndConditions","isTermsAccepted","handleTextChange","getTermsAndConditions","showCheckbox","isAutoSave","isTermsAndConditionAccepted","checkboxAriaLabel","termsAndConditionAcceptance","checkBox","CheckboxComponent","MsDyn365","editProps","_data$checkout$result","updateTermsAndConditionsAcceptance","isPaymentVerificationRedirection","getErrorMessage","ErrorTitleComponent","ErrorMessageComponent","getCancelButton","cancelBtnLabel","cancelBtnAriaLabel","color","getSaveButton","saveBtnLabel","saveBtnAriaLabel","getEditButton","editBtnLabel","editBtnAriaLabel","newIsTermsAndConditionAccepted","shouldEnableSinglePaymentAuthorizationCheckout","updateIsTermsAndConditionsChecked","newIsTermsAndConditionChecked","getTelemetryObject","telemetryPageName","friendlyName","showControlButtons","defaultTermsAndConditionAcceptedValue","_this$props$data$chec7","_this$props$data$chec8","isError","isShowContent","errorMessageData","isShowButtons","isShowEditButton","checkoutTermsAndConditions","termsAndConditionsContent","TermsAndCondition","ErrorMessage","call","fixRegExpWellKnownSymbolLogic","anObject","toLength","requireObjectCoercible","getMethod","advanceStringIndex","regExpExec","MATCH","nativeMatch","maybeCallNative","regexp","O","matcher","string","rx","S","res","done","global","fullUnicode","unicode","lastIndex","A","n","matchStr"],"sourceRoot":""}