{"version":3,"sources":["webpack:///src/modules/account-management-address/account-management-address.tsx?2c3f","webpack:///src/modules/checkout-shipping-address/checkout-shipping-address.view.tsx?e155","webpack:///src/common/components/address-select.tsx?e342","webpack:///./src/modules/b2b-account-management-address/b2b-account-management-address.tsx?f1bb","webpack:///src/common/address-autosuggest.ts?520f","webpack:///src/common/components/address-button.tsx?e3b2","webpack:///./src/modules/b2b-checkout-billing-address/b2b-checkout-billing-address.view.tsx?4313","webpack:///src/modules/business-account-address/index.ts?0f93","webpack:///src/common/components/address-error-title.tsx?a723","webpack:///src/modules/business-account-address/business-account-address.tsx?d57d","webpack:///src/common/components/address-label.tsx?9ddc","webpack:///src/common/components/address-show.tsx?376c","webpack:///src/common/address-meta-data.ts?d29d","webpack:///../../src/index.ts?0e3e","webpack:///src/modules/account-management-address/account-management-address.view.tsx?739e","webpack:///src/common/address-format.data.ts?da4c","webpack:///src/modules/checkout-billing-address/index.ts?56c1","webpack:///../../../src/module-state-manager/with-module-state.tsx?61ca","webpack:///src/common/components/address-billing-checkbox.tsx?1b2a","webpack:///src/common/components/address-alert.tsx?0da8","webpack:///src/modules/checkout-shipping-address/components/checkout-shipping-cartlines-images.tsx?7802","webpack:///src/modules/checkout-shipping-address/checkout-shipping-address.tsx?bd44","webpack:///src/modules/checkout-shipping-address/index.ts?8a8c","webpack:///../../src/checkout-state.ts?acd8","webpack:///src/modules/business-account-address/business-account-address.view.tsx?dcd1","webpack:///src/common/components/address-dropdown.tsx?3e73","webpack:///src/common/components/address-billing-heading.tsx?4a5c","webpack:///src/modules/checkout-billing-address/checkout-billing-address.tsx?83e6","webpack:///../../../src/module-state-manager/module-state.ts?7579","webpack:///./src/modules/b2b-checkout-billing-address/b2b-checkout-billing-address.tsx?6a6b","webpack:///src/common/components/address-list.tsx?8cb2","webpack:///src/common/address-format.ts?400b","webpack:///src/common/address-common.ts?0583","webpack:///src/modules/account-management-address/index.ts?5d50","webpack:///src/modules/checkout-billing-address/checkout-billing-address.view.tsx?d08e","webpack:///../../../src/module-state-manager/index.ts?8e3a","webpack:///src/common/components/address-checkbox.tsx?a46e","webpack:///src/common/components/address-add.tsx?0cbd","webpack:///src/index.ts?c6ae","webpack:///src/common/components/address-error-message.tsx?c7bd","webpack:///./src/modules/b2b-account-management-address/b2b-account-management-address.view.tsx?6b81","webpack:///src/common/components/address-input.tsx?ed8f","webpack:///../../src/checkout-state-data-action.ts?8344","webpack:///src/common/components/address-detail-item.tsx?c5b6","webpack:///src/common/address-module.data.ts?1a63"],"names":["AccountManagementAddress","React","constructor","props","super","countryRegionId","countryRegions","addressPurposes","defaultAddressType","asyncCustAddressCreationFeatureName","asyncCustomerAddressCreationFeatureIsEnabled","_onSuggestionSelected","async","this","_clearAddressFields","address","addressFormat","getTranformedAddress","result","stateProvinceInfo","set","addUpdateAddress","Street","ZipCode","CountyName","City","State","DistrictName","FullAddress","setTimeout","getAddressFormat","ThreeLetterISORegionName","forEach","format","_this$autoSuggest","undefined","name","autoSuggest","excludedAddressFields","includes","_clearValidation","validationError","_dataInitialize","data","reaction","_data$countryRegions$","_data$addressPurposes","_data$address$result","customerAddresses","_renderAddOrUpdateAddress","AddressAddUpdate","isUpdating","resources","addressType","AddressType","Shipping","defaultCountryRegionId","selectedAddress","addressActionResponse","dropdownDisplayData","getPrefilledAddressDropdownData","addressStateDefaultSelectionText","telemetryContent","onInputChange","_onAddressAddUpdateInputChange","onDropdownChange","_onAddressAddUpdateDropdownChange","onSave","_onAddressAddUpdateSubmit","onCancel","_resetView","_renderListAddress","_this$props$data$cust","_this$props$context$a","config","heading","text","headingTag","tag","AddressList","addresses","primaryAddressSectionHeading","otherAddressSectionHeading","contextRequest","context","request","handleLineItemHeadingChange","event","target","value","onEditAddress","_goToEditAddress","onRemoveAddress","_onRemoveAddress","onAddAddress","_goToAddAddress","onUpdatePrimaryAddress","_onSubmitUpdatePrimaryAddress","isAsyncCustomerAddressCreationFeatureEnabled","isAsyncCustomer","customerInformation","IsAsyncCustomer","canRenderAsyncCustomerDataAsUnmodifiable","app","_attachMapAutoSuggest","storeSelectorStateManager","_this$autoSuggest2","isMapApiLoaded","attachAutoSuggest","onAddressAddUpdate","validateAddressFormat","type","checked","replace","RegExp","AddressItemType","AddressTypeValue","_onCountryChange","_onAddressUpdate","response","onSuccess","then","hasError","addressCommon","isAuthenticatedFlow","currentOperation","AddressOperation","Update","updateCustomerAddress","addCustomerAddress","Promise","resolve","_onAddOrUpdateSuccess","_this$autoSuggest3","twoLetterISORegionName","getTwoLetterISORegionName","TwoLetterISORegionName","changeAutoSuggestionCountryCode","_getAddressFormatExcludeList","addressFormatExcludeList","showAddressType","push","IsPrimary","_getStateProvinces","Add","getStateProvinces","some","state","StateId","_updateCurrentOperation","operation","updateCustomerPrimaryAddress","_onUpdatePrimaryAddressSuccess","_objectSpread","Deactivate","removeAddressData","_renderScreenReaderRemoveText","notification","formatNotification","removeAddressNotification","Name","className","_setDefaultCountryRegionId","List","telemetry","AddressCommon","AddressFormat","AddressMetaData","getTelemetryObject","telemetryPageName","friendlyName","actionContext","requestContext","channel","autoSuggestionEnabled","autoSuggestOptions","BingMapsApiKey","error","BingMapsEnabled","options","AutoSuggest","ChannelCountryRegionISOCode","DefaultLanguageId","_this$props$data$stor","loadMapApi","_this$autoSuggest4","_loadMapAPI","_this$props$data$stor2","_this$props$data$stor3","_this$autoSuggest5","disposeAutoSuggest","shouldComponentUpdate","nextProps","nextState","render","_data$featureState","_this$props$context$a2","renderView","featureState","find","feature","IsEnabled","infoMessageBar","Msdyn365","accountProcessingPendingInfoMessageCanAddAddress","accountProcessingPendingInfoMessage","viewState","isShowAddresList","isShowAddOrUpdateAddress","AccountAddressManagement","moduleProps","classnames","showAddressList","showAddOrUpdateAddress","screenReaderNotification","market","getDefaultCountryRegionId","__decorate","observable","action","observer","AddressShow","_ref","AddressDetail","items","Node","Object","assign","map","item","description","AddressSelect","_ref2","SelectAddress","addButton","isShowSaveButton","saveButton","isShowCancelButton","cancelButton","SelectItem","key","input","showItems","_ref3","AddressForm","AddressItem","label","alert","AddressError","title","message","CheckoutShippingAddressView","CheckoutShippingAddress","showAddress","showAddressSelect","cartLineImages","Module","isShowAddress","getInput","index","onAddressOptionChange","ichecked","RecordId","additionalAttributes","length","addressChangeCheckboxAriaLabel","AddressInputComponent","toString","onChange","additionalAddributes","getAddressSelectItems","hasExternalSubmitGroup","AddressButtonComponent","addressAddButtonText","ariaLabel","addressAddButtonAriaLabel","onClick","addressSaveButtonText","addressSaveButtonAriaLabel","addressCancelButtonText","addressCancelButtonAriaLabel","filter","countryCode","defaultLanguageId","inputId","containerId","selectedSuggestionCallback","autoSuggestManager","Microsoft","Maps","loadModule","callback","_document$querySelect","AutosuggestManager","attachAutosuggest","document","querySelector","setAttribute","_document$querySelect2","errorCallback","debug","credentials","bingMapsApiKey","setOptions","_this$autoSuggestMana","_this$autoSuggestMana2","detachAutosuggest","dispose","lang","AddressButtonFunctionComponent","disabled","isDisabled","role","payLoad","getPayloadObject","attributes","getTelemetryAttributes","CheckoutBillingAddressView","CheckoutBillingAddress","isError","AddressErrorTitleFunctionComponent","BusinessAccountAddress","shouldAutoFocus","excludedList","_resetAddressFields","addressFormatItem","displayType","AddressItemDisplayType","Input","Checkbox","countryStates","_data$countryStates$r","Company","_updateAddress","_updateCountryRegionId","updateForm","isRequired","cleanValue","_isEmpty","_isInputRequired","addressItemValue","ObjectExtensions","isNullOrUndefined","validationRules","validationRule","AddressValidationRuleType","Required","componentDidMount","resetAddress","_request$channel","AddressLabelFunctionComponent","id","itemId","htmlFor","addressTypeValue","AddressDetailItemComponent","isNewLine","isShowLabel","Phone","labelText","excluded","required","metaData","requiredFieldRegEx","resourcesPrefix","maxLength","excludedTypes","requiredFields","_init","getItemFormat","_addItem","PhoneRegex","defaultRegex","County","Dropdown","StreetNumber","BuildingCompliment","Postbox","House_RU","Flat_RU","CountryOKSMCode_RU","nameKey","_validationRules","rule","optionalString","ruleType","keys","itemType","_validationRule","Format","regEx","isShowList","Item","isShowPrimaryButton","primaryButton","editButton","removeButton","Error","isShowError","AddressLists","ListAddress","isShowEmptyListMessage","emptyListMessage","primaryAddressList","otherAddressList","_ref4","AccountManagementAddressView","withModuleState","WrappedComponent","_super","ModuleState","_this","call","initializeState","_b","typeName","states","getModuleStates","updateModuleStates","__assign","_a","hasInitialized","isCancellable","isSubmitContainer","status","childIds","getModuleStateManager","moduleState","get","validate","isReady","isPending","isSkipped","isCancelAllowed","shouldSubmitContainer","hasModuleState","setIsRequired","update","setIsCancellable","setIsSubmitContainer","setHasError","onReady","onUpdating","onPending","onSkip","onDisable","getModule","moduleId","getModuleByTypeName","getModuleStateManagerByTypeName","init","moduleStates","values","_moduleState","modules","_validateLeaf","source","module","isMatch","_validateContainer","allMatched","skipSkippableItem","shouldEnableSinglePaymentAuthorizationCheckout","childId","_isPaymentSectionContainer","ArrayExtensions","hasElements","enableControl","__extends","prototype","AddressBillingCheckbox","isChecked","AddressAlertFunctionComponent","CheckoutPickupCartLines","moduleClassName","cartLines","itemTitle","isMobileCheck","isMobile","variant","VariantType","Browser","gridSettings","xs","w","sm","md","lg","xl","isMobileView","cartLine","isShowQty","quantity","lineId","Image","imageProps","productQuantityInfo","altText","defaultImageSettings","viewports","q","h","lazyload","quality","_data$featureState$re2","addressListSelectedAddress","multiplePickupStoreSwitchName","retailMultiplePickUpOptionEnabled","_initPickupGroup","pickupCartLines","_getCartLinesforDelivery","_this$props$data$chec","products","_getProductsByCartLines","checkout","checkoutCart","cart","ChannelId","line","product","x","ProductId","setState","shippingGroups","formatAddress","_data$featureState$re","_this$props$data$chec2","_this$props$data$chec3","CartLines","_isDelivery","_isNotPickupMode","DeliveryMode","FulfillmentStoreId","deliveryMode","_this$props$context$r","_featureState$result","pickupDeliveryModeCode","PickupDeliveryModeCode","channelDeliveryOptionConfig","_channelDeliveryOptio","pickupDeliveryMode","PickupDeliveryModeCodes","pickupMode","channelId","productInputs","ProductInput","apiSettings","getSimpleProducts","onSaveHandler","onCancelHandler","onSubmit","onCancelButtonHandler","_renderSelectAddress","onAddAddressHandler","_onAddressOptionChange","_onSelectAddress","addressRecordId","currentTarget","_isNewAddress","_updateModuleState","newAddress","twoLetterIsoRegionName","_getDefaultAddress","_getAddressFromCartExpressPaymentDetails","expressPaymentDetailsFromCartPage","tokenizedPaymentCard","isExpressAddressAppliedInCartPage","addressFromCartExpress","getExpressAddress","getAddressFromTokenizedPaymentCard","Country","threeLetterIsoRegionName","getThreeLetterIsoRegionName","NameOnCard","Address1","Address2","Zip","expressAddress","countryRegion","country","_country$ISOCode","ISOCode","toLowerCase","CountryRegionId","_initModuleState","_canShip","onEdit","checkoutState","defaultAddress","ShippingAddress","isExpressCheckoutApplied","shippingAddressFromExpressCheckout","isEmpty","Show","_setShippingAddress","updateHasShippingAddress","newHasShippingAddress","shippingAddress","_checkout$result$chec","_checkout$result$chec2","emailDeliveryModeCode","EmailDeliveryModeCode","hasInvoiceLine","_channelDeliveryOptio2","newShippingAddress","updateShippingAddress","catch","existingAddress","_address$Name","_address$Street","_address$StreetNumber","_address$City","_address$State","_address$ZipCode","_address$Phone","_address$ThreeLetterI","_address$AddressTypeV","_this$props$data$cart","_this$props$data$cart2","properties","ExtensionProperties","property","Key","Value","StringValue","JSON","parse","_this$props$data$chec4","_this$props$data$chec5","_address","_featureState$result2","headingImages","itemsText","singleItemText","imageSettings","cartlines","_line$cartLine$LineId","_line$product","_line$product$Primary","_line$product2","_line$product3","_line$cartLine$Quanti","LineId","src","PrimaryImageUrl","fallBackSrc","getFallbackImageUrl","ItemId","loadFailureBehavior","Quantity","itemText","lineImageProps","isRetailMultiplePickUpOptionEnabled","_renderShowAddress","showAddressSelectHandler","showAddOrUpdateAddressHandler","_this$props$data$chec6","computed","CheckoutState","_giftCards","_giftCardExtends","_loyaltyAmount","_guestCheckoutEmail","_isTermsAndConditionAccepted","_customerAccountAmount","defineProperty","_tokenizedPaymentCard","_tenderLine","_billingAddress","_shippingAddress","_cardPrefix","_loyaltyCardNumber","updateTokenizedPaymentCard","newTokenizedPaymentCard","updateTenderLine","newTenderLine","updateBillingAddress","newBillingAddress","updateCardPrefix","newCardPrefix","removeGiftCard","giftCardNumber","giftCard","Id","removeGiftCardExtend","addGiftCard","__spreadArrays","addGiftCardExtend","updateLoyaltyCardNumber","newLoyaltyCardNumber","updateLoyaltyAmount","newAmount","updateGuestCheckoutEmail","newGuestCheckoutEmail","updateTermsAndConditionsAcceptance","newIsTermsAndConditionAccepted","updateCustomerAccountAmount","BusinessAccountAddressView","AddressDropdownFunctionComponent","displayData","getDropdownItem","selectedValue","isSelected","AddressBillingHeading","_this$addUpdateAddres","Billing","_onSubmitAddress","isBillingAddressRequried","billingAddress","isBillingAddressSameAsShippingAddress","isBillingAddressSameAsShipping","isCartContainsItemsForShipping","_onBillingAddressSameAsShippingChange","_setBillingAddress","additionalProperties","removeBillingAddress","isShowSameAsShippingCheckbox","addressBillingAddressHeading","sameAsShippingCheckbox","addressSameAsShippingAddressAriaLabel","addressSameAsShippingAddressText","_this$selectedAddress","_request$channel2","_request$channel3","loyaltyAmount","giftCardExtends","reduce","count","Balance","_checkoutState$custom","customerAccountAmount","checkoutResult","paymentTenderType","isPaidByOtherPaymentSource","paymenTenderType","TotalAmount","getGiftCardTotalAmount","getLoyaltyAmount","getCustomerAccountAmount","_this$props$data$chec7","shouldPaidByCard","isPaymentVerificationRedirection","isCheckoutCallFailed","ModuleStatesCacheKey","getCacheKey","getCacheObjectType","dataCacheType","ctx","cacheKey","noBillingErrorMessage","setError","errorMessage","renderErrorMessage","addressTypeId","addressCount","multipleBillingErrorMessage","getButtonAriaLabel","addressName","getAddressList","showPrimaryButton","errorTitle","Heading","isSelectedAddress","isInvalidAsyncState","AddressErrorTitleComponent","AddressErrorMessageComponent","addressPrimaryButtonText","addressPrimaryButtonAriaLabel","addressEditButtonText","addressEditButtonAriaLabel","addressRemoveButtonText","addressRemoveButtonAriaLabel","getPrimaryAddressList","primaryAddresses","getOtherAddressList","otherAddresses","_heading$headingTag","editProps","addressEmptyListAddressMessage","countryRegionsInfo","addressMetaData","stateDefaultSelectionText","defaultStateText","dropdownData","getCountryFormat","getStateFormat","unshift","getAddressTypeFormat","_getCountryRegionInfo","propertyName","validationtor","isValid","_inputValidation","postalCode","selectedState","StateName","adminDistrict","addressLine","locality","district","formattedAddress","_validateRegEx","test","countryRegionInfo","_getAddressDisplayFormat","ShortName","addressPurpose","addressDisplayItem","AddressFormatLines","AddressTypeItem","_extendAddressDisplayFormat","nameDisplayItem","formatLine","AddressComponentNameValue","addressItem","NewLine","phoneDisplayItem","isPrimaryDisplayItem","marketISOCode","currentCountryRegion","parseRetailException","addressErrorMessageTitle","addressGenericErrorMessage","user","isAuthenticated","GetStateProvincesInput","getStateProvinceAction","updateLogisticsLocationRoleRecordId","submitCustomerAddress","addAddress","updateAddress","updatePrimaryAddress","addressAction","AddressManagementInput","execAddressAction","GetAddressPurposesInput","getAddressPurposesAction","purpose","LogisticsLocationRoleRecordId","AddressCheckboxFunctionComponent","autoFocus","shouldBeAutoFocused","getRequriedAttribute","getAddessItems","elementId","classname","AdressCheckboxComponent","AdressDropdownComponent","AddressLabelComponent","AddressAlertComponent","editAddressHeading","addAddressHeading","AddressErrorMessageFunctionComponent","_props$customerAddres","addressId","slice","invoiceAddress","AddressInputFunctionComponent","shouldUseAutoFocus","CheckoutStateInput","buildCacheKey","createObservableDataAction","inputData","AddressDetailItemFunctionComponent","mainClass"],"mappings":"09BA6DA,IAAMA,EAAN,cAAuCC,YAyBnCC,YAAmBC,GACfC,MAAMD,GAvBU,KAAAE,gBAA0B,MAYtC,KAAAC,eAAsC,GACtC,KAAAC,gBAAoC,GAE3B,KAAAC,mBAA6B,EAI7B,KAAAC,oCAA8C,4DACvD,KAAAC,8CAAyD,EA8BhD,KAAAC,sBAAwBC,UACrCC,KAAKC,sBACL,MAAMC,EAAUF,KAAKG,cAAcC,qBAAqBC,EAAQL,KAAKM,mBACrEC,YAAIP,KAAKQ,iBAAkB,CAAEC,OAAQ,KACrCF,YAAIP,KAAKQ,iBA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I3Q,K,kCCnCN,IAAKqC,EAOAxE,EAPZ,6EAAYwE,GACRA,EAAA,UACAA,EAAA,YACAA,EAAA,gBACAA,EAAA,YAJJ,CAAYA,MAAgB,KAO5B,SAAYxE,GACRA,EAAA,oBACAA,EAAA,kBACAA,EAAA,kBACAA,EAAA,kBAJJ,CAAYA,MAAW","file":"static/js/19.c269f0a06825f04962e7.chunk.js","sourcesContent":["/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\nimport { format as formatNotification, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { action, observable, reaction, set } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { AutoSuggest } from '../../common/address-autosuggest';\nimport { IAutoSuggestOptions } from '../../common/address-autosuggest.data';\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemType } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { AddressList, IAddressListProps } from '../../common/components/address-list';\nimport { IAccountManagementAddressData } from './account-management-address.data';\nimport { IAccountManagementAddressProps } from './account-management-address.props.autogenerated';\n\n/**\n * Account management address view state interface.\n */\nexport interface IAccountManagementAddressViewState {\n isShowAddresList: boolean;\n isShowAddOrUpdateAddress: boolean;\n}\n\n/**\n * Account management address view state interface.\n */\nexport interface IAccountManagementAddressViewProps extends React.Component> {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n customerAddresses: Address[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n viewState: IAccountManagementAddressViewState;\n AccountAddressManagement: IModuleProps;\n isUpdating: boolean;\n showAddressList: IAddressListProps;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n screenReaderNotification: React.ReactNode;\n infoMessageBar?: React.ReactNode;\n}\n\n/**\n *\n * Address component.\n * @extends {React.Component>}\n */\n@observer\nclass AccountManagementAddress extends React.Component> {\n @observable private currentOperation: AddressOperation;\n @observable private selectedAddress?: Address;\n @observable private countryRegionId: string = 'USA';\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n @observable private customerAddresses: Address[];\n @observable private addUpdateAddress: Address;\n @observable private validationError: object;\n @observable private addressActionResponse?: IAddressResponse;\n @observable private isUpdating?: boolean;\n @observable private hasError?: boolean;\n @observable private removeAddressData?: Address;\n\n private readonly addressCommon: AddressCommon;\n private addressFormat: AddressFormat;\n private countryRegions: CountryRegionInfo[] = [];\n private addressPurposes: AddressPurpose[] = [];\n private readonly resources: IAddressResource;\n private readonly defaultAddressType: number = 6; // Default to Home\n private readonly telemetryContent: ITelemetryContent;\n private autoSuggest?: AutoSuggest;\n\n private readonly asyncCustAddressCreationFeatureName: string = 'Dynamics.AX.Application.RetailAsyncAddressCreationFeature';\n private asyncCustomerAddressCreationFeatureIsEnabled?: boolean = false;\n\n public constructor(props: IAccountManagementAddressProps) {\n super(props);\n const { context, data, resources, telemetry } = this.props;\n\n this.resources = resources;\n this.currentOperation = AddressOperation.List;\n this.countryRegions = data.countryRegions.result || [];\n this.addressPurposes = data.addressPurposes.result || [];\n this.customerAddresses = data.address.result || [];\n this.addUpdateAddress = {};\n this.validationError = {};\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes\n );\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName, this.props.telemetry\n );\n }\n\n /**\n * On Suggestion Selected Function.\n * @param result - Microsoft.Maps.ISuggestionResult.\n */\n @action\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n this._clearAddressFields();\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\n set(this.addUpdateAddress, { Street: '' });\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\n set(this.addUpdateAddress, { CountyName: address.CountyName });\n set(this.addUpdateAddress, { City: address.City });\n set(this.addUpdateAddress, { State: address.State });\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\n\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\n setTimeout(() => {\n set(this.addUpdateAddress, { Street: address.Street });\n }, 0);\n\n };\n\n /**\n * Clear Address Fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId);\n addressFormatItem.forEach(format => {\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\n this.addressFormat[format.name] = '';\n }\n });\n this._clearValidation();\n };\n\n /**\n * Clear Validation Function.\n */\n @action\n private readonly _clearValidation = (): void => {\n this.validationError = {};\n };\n\n public async componentDidMount(): Promise {\n\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: {\n channel\n }\n }\n },\n config: {\n autoSuggestionEnabled,\n autoSuggestOptions\n }\n } = this.props;\n\n // Initializing data props\n this._dataInitialize(this.props);\n\n if (this.props.data.countryRegions.result !== undefined) {\n this._setDefaultCountryRegionId();\n }\n\n reaction(\n () => this.countryRegionId,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.currentOperation,\n () => {\n this._getStateProvinces();\n }\n );\n\n if (autoSuggestionEnabled) {\n\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\n this.autoSuggest = new AutoSuggest(telemetry, options, channel?.BingMapsApiKey, channel?.ChannelCountryRegionISOCode, channel?.DefaultLanguageId);\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.loadMapApi !== undefined && (\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update\n ),\n async () => {\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n );\n\n reaction(\n () => {\n this.props.data.storeSelectorStateManager.result?.isMapApiLoaded;\n },\n async () => {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n await this._attachMapAutoSuggest();\n }\n }\n );\n }\n }\n\n /**\n * Component did mount function.\n */\n public async componentDidUpdate(): Promise {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\n await this._attachMapAutoSuggest();\n }\n } else {\n this.autoSuggest?.disposeAutoSuggest();\n }\n }\n\n /**\n * Should component update function.\n * @param nextProps - Account management address props.\n * @param nextState - Next state.\n * @returns - True if component should update, false otherwise.\n */\n public shouldComponentUpdate(nextProps: IAccountManagementAddressProps,\n nextState: IAccountManagementAddressViewState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n\n }\n\n public render(): JSX.Element {\n const { renderView, config, resources, data } = this.props;\n const customerInformation = data.customerInformation.result;\n\n // Set the feature state value for 'Async Customer Address Creation'.\n this.asyncCustomerAddressCreationFeatureIsEnabled =\n data.featureState?.result?.find(feature => feature.Name === this.asyncCustAddressCreationFeatureName)?.IsEnabled || false;\n\n const viewProps = {\n ...this.props,\n infoMessageBar: (this.props.context.app?.config?.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\n (customerInformation?.IsAsyncCustomer || false) && (\n \n ),\n currentOperation: this.currentOperation,\n selectedAddress: this.selectedAddress,\n addUpdateAddress: this.addUpdateAddress,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n customerAddresses: this.customerAddresses,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n isUpdating: this.isUpdating,\n hasError: this.hasError,\n className: config.className,\n viewState: {\n isShowAddresList: this.currentOperation === AddressOperation.List,\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.List\n },\n AccountAddressManagement: {\n moduleProps: this.props,\n className: classnames('ms-account-management-address', config.className)\n },\n showAddressList: this._renderListAddress(),\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress(),\n screenReaderNotification: this.removeAddressData ? this._renderScreenReaderRemoveText(this.removeAddressData) : null\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Method data initialization.\n * @param props -The account management props.\n */\n private readonly _dataInitialize = (props: IAccountManagementAddressProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.address.result,\n () => {\n this.customerAddresses = data.address.result ?? [];\n }\n );\n };\n\n /**\n * Render Add Or Update Address Function.\n * @returns - AddressAddUpdate.\n */\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\n return AddressAddUpdate(\n {\n isUpdating: this.isUpdating,\n resources: this.resources,\n addressType: AddressType.Shipping,\n addressFormat: this.addressFormat.getAddressFormat((this.addUpdateAddress.ThreeLetterISORegionName) || this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n telemetryContent: this.telemetryContent,\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\n onSave: this._onAddressAddUpdateSubmit,\n onCancel: this._resetView\n }\n );\n };\n\n /**\n * Render List Address Function.\n * @returns - AddressList.\n */\n private readonly _renderListAddress = (): IAddressListProps => {\n const { config } = this.props;\n\n /**\n * Render Address title.\n * @param event - Msdyn365.ContentEditableEvent.\n */\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\n config.heading!.text = event.target.value;\n };\n const heading = config.heading && {\n text: config.heading.text,\n headingTag: config.heading.tag\n };\n\n return AddressList({\n isUpdating: this.isUpdating,\n selectedAddress: this.selectedAddress,\n addressFormat: this.addressFormat,\n addresses: this.customerAddresses,\n addressPurposes: this.addressPurposes,\n resources: this.resources,\n heading,\n primaryAddressSectionHeading: config.primaryAddressSectionHeading,\n otherAddressSectionHeading: config.otherAddressSectionHeading,\n contextRequest: this.props.context.request,\n telemetryContent: this.telemetryContent,\n handleLineItemHeadingChange,\n onEditAddress: this._goToEditAddress,\n onRemoveAddress: this._onRemoveAddress,\n onAddAddress: this._goToAddAddress,\n onUpdatePrimaryAddress: this._onSubmitUpdatePrimaryAddress,\n isAsyncCustomerAddressCreationFeatureEnabled: this.asyncCustomerAddressCreationFeatureIsEnabled || false,\n isAsyncCustomer: this.props.data.customerInformation.result?.IsAsyncCustomer || false,\n canRenderAsyncCustomerDataAsUnmodifiable: this.props.context.app?.config?.canRenderAsyncCustomerDataAsUnmodifiable || false\n });\n };\n\n /**\n * Attach Map Auto Suggest Function.\n */\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded) {\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\n }\n };\n\n /**\n * On Address Add Update Function.\n * @param name - String.\n * @param value - String | Boolean | Number.\n */\n private readonly onAddressAddUpdate = (name: string, value: string | boolean | number) => {\n set(this.addUpdateAddress, { [name]: value });\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\n };\n\n /**\n * On Address Add Update Input Change.\n * @param event - Input Change Event.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n if (event.target.type === 'checkbox') {\n this.onAddressAddUpdate(event.target.name, event.target.checked);\n } else {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n this.onAddressAddUpdate(event.target.name, value);\n }\n };\n\n /**\n * On Address Add Update Dropdown Change.\n * @param event - Dropdown Change Event.\n */\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\n if (event.target.name === AddressItemType[AddressItemType.AddressTypeValue]) {\n this.onAddressAddUpdate(event.target.name, +event.target.value);\n } else {\n this.onAddressAddUpdate(event.target.name, event.target.value);\n }\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n this._onCountryChange(event.target.value);\n }\n };\n\n /**\n * On Address Update Function.\n * @param response - Promise.\n * @param onSuccess - IAddressResponse.\n */\n private readonly _onAddressUpdate = (response: Promise, onSuccess: (response: IAddressResponse) => void): void => {\n\n this.isUpdating = true;\n response.then(\n (result: IAddressResponse) => {\n if (result.address) {\n this.hasError = false;\n onSuccess(result);\n } else {\n this.hasError = true;\n this.addressActionResponse = result;\n }\n this.isUpdating = false;\n },\n () => {\n this.hasError = true;\n this.isUpdating = false;\n }\n );\n };\n\n /**\n * On Address Add Update Submit Function.\n */\n private readonly _onAddressAddUpdateSubmit = (): void => {\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n return;\n }\n let response: Promise;\n if (this.addressCommon.isAuthenticatedFlow()) {\n response = this.currentOperation === AddressOperation.Update ? this.addressCommon.updateCustomerAddress(\n this.addUpdateAddress\n ) : this.addressCommon.addCustomerAddress(\n this.addUpdateAddress\n );\n } else {\n response = Promise.resolve({ address: this.addUpdateAddress });\n }\n\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\n };\n\n /**\n * On Country Change Function.\n * @param countryRegionId - String.\n */\n private readonly _onCountryChange = (countryRegionId: string) => {\n this.countryRegionId = countryRegionId;\n const twoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterISORegionName });\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterISORegionName);\n this._clearAddressFields();\n };\n\n /**\n * Get Address Format Exclude List Function.\n * @returns - Address Format Exclude List.\n */\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\n const { config } = this.props;\n const addressFormatExcludeList: AddressItemType[] = [];\n\n if (!config.showAddressType) {\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\n }\n\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\n\n return addressFormatExcludeList;\n };\n\n /**\n * Get State Provinces Function.\n */\n private readonly _getStateProvinces = (): void => {\n if (!this.countryRegionId || !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\n return;\n }\n\n this.addressCommon.getStateProvinces(this.countryRegionId).then(\n (result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n set(this.addUpdateAddress, { State: '' });\n }\n this.stateProvinceInfo = result;\n });\n };\n\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request && request.channel && request.channel.ChannelCountryRegionISOCode;\n\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\n }\n\n /**\n * Update CurrentOperation Function.\n * @param operation - AddressOperation.\n */\n private readonly _updateCurrentOperation = (operation: AddressOperation) => {\n this.currentOperation = operation;\n this._clearAddressFields();\n };\n\n /**\n * On Submit Update Primary Address Function.\n * @param address - Address.\n */\n private readonly _onSubmitUpdatePrimaryAddress = (address: Address): void => {\n this.selectedAddress = address;\n const response = this.addressCommon.updateCustomerPrimaryAddress(address);\n this._onAddressUpdate(response, this._onUpdatePrimaryAddressSuccess);\n };\n\n /**\n * Go To Edit Address Function.\n * @param address - Address.\n */\n private readonly _goToEditAddress = (address: Address): void => {\n this.addUpdateAddress = { ...address };\n this.countryRegionId = this.addUpdateAddress.ThreeLetterISORegionName || 'USA';\n this._updateCurrentOperation(AddressOperation.Update);\n };\n\n /**\n * On Remove Address Function.\n * @param address - Address.\n */\n private readonly _onRemoveAddress = (address: Address): void => {\n address.Deactivate = true;\n this.removeAddressData = address;\n const response = this.addressCommon.updateCustomerAddress(address);\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\n };\n\n /**\n * Renders Notification screen reader text for removed address.\n * @param address - Address input.\n * @returns Notification for removed address.\n */\n private readonly _renderScreenReaderRemoveText = (address: Address): React.ReactNode => {\n const notification = formatNotification(this.resources.removeAddressNotification!, `${address.Name!}`);\n return (\n
\n {notification}\n
\n );\n };\n\n /**\n * Go To Add Address Function.\n */\n private readonly _goToAddAddress = (): void => {\n this.addUpdateAddress = {};\n this._setDefaultCountryRegionId();\n set(this.addUpdateAddress, { ThreeLetterISORegionName: this.countryRegionId });\n set(this.addUpdateAddress, { AddressTypeValue: this.defaultAddressType });\n this._setDefaultCountryRegionId();\n this._updateCurrentOperation(AddressOperation.Add);\n };\n\n /**\n * On Add Or Update Success Function.\n * @param response - IAddressResponse.\n */\n private readonly _onAddOrUpdateSuccess = (response: IAddressResponse): void => {\n if (response.customerAddresses) {\n this.customerAddresses = response.customerAddresses;\n }\n this._resetView();\n };\n\n /**\n * On Update Primary Address Success Function.\n * @param response - IAddressResponse.\n */\n private readonly _onUpdatePrimaryAddressSuccess = (response: IAddressResponse): void => {\n if (response.customerAddresses) {\n this.customerAddresses = response.customerAddresses;\n }\n };\n\n /**\n * Reset view function.\n */\n private readonly _resetView = (): void => {\n this.selectedAddress = undefined;\n this._updateCurrentOperation(AddressOperation.List);\n };\n}\n\nexport default AccountManagementAddress;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IAddressSelectItem, IAddressSelectProps } from '../../common/components/address-select';\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutShippingAddressViewProps } from './checkout-shipping-address';\n\n/**\n * Address show component.\n * @param param0 - Root param.\n * @param param0.AddressDetail - Address detail.\n * @param param0.items - IAddressShowItem[].\n * @returns - Address Node.\n */\nconst AddressShow: React.FC = ({\n AddressDetail,\n items\n}) => {\n\n return (\n \n {items.map((item: IAddressShowItem) => {\n return (\n <>\n {item.description}\n \n );\n })}\n \n );\n};\n\n/**\n * Address Select Component.\n * @param param0 - Root param.\n * @param param0.SelectAddress - Select address.\n * @param param0.addButton - Add button.\n * @param param0.items - IAddressSelectItem[].\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns - SelectAddress Node.\n */\nconst AddressSelect: React.FC = ({\n SelectAddress,\n addButton,\n items,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n\n return (\n \n {addButton}\n {items.map((item: IAddressSelectItem) => {\n const SelectItem = item.SelectItem;\n return (\n {item.input}\n \n );\n })}\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Address Add Update Component.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - Error message.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns Address add update component node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n {label}\n {alert}\n {input}\n );\n })}\n {hasError && \n {error.title}\n {error.message}\n }\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Checkout Shipping Address View Component.\n * @param props - Props.\n * @returns - CheckoutShippingAddress Module.\n */\nconst CheckoutShippingAddressView: React.FC = props => {\n const { CheckoutShippingAddress, viewState, showAddress, showAddressSelect, showAddOrUpdateAddress, cartLineImages } = props;\n\n return (\n \n {cartLineImages}\n {viewState.isShowAddress && }\n {viewState.isShowAddresList && }\n {viewState.isShowAddOrUpdateAddress && }\n \n );\n};\n\nexport default CheckoutShippingAddressView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { AddressFormat } from '../address-format';\nimport { IAddressResource } from '../address-module.data';\nimport AddressButtonComponent from './address-button';\nimport AddressInputComponent from './address-input';\nimport { AddressShow, IAddressShowProps } from './address-show';\n\nexport interface IAddressSelectInputProps {\n hasExternalSubmitGroup?: boolean;\n addressFormat: AddressFormat;\n addresses: Address[];\n addressPurposes: AddressPurpose[];\n resources: IAddressResource;\n selectedAddress: Address;\n telemetryContent?: ITelemetryContent;\n onAddressOptionChange(event: React.ChangeEvent): void;\n onAddAddress(): void;\n onSave(): void;\n onCancel(): void;\n}\n\nexport interface IAddressSelectItem {\n key: number;\n SelectItem: INodeProps;\n input: React.ReactNode;\n showItems: IAddressShowProps;\n}\n\nexport interface IAddressSelectProps {\n SelectAddress: INodeProps;\n addButton: React.ReactNode;\n items: IAddressSelectItem[];\n isShowSaveButton: boolean;\n saveButton: React.ReactNode;\n isShowCancelButton: boolean;\n cancelButton: React.ReactNode;\n}\n\nconst getInput = (index: number, address: Address, props: IAddressSelectInputProps): React.ReactNode => {\n const { addresses, onAddressOptionChange, selectedAddress, resources } = props;\n\n const ichecked = address.RecordId === selectedAddress.RecordId;\n const additionalAttributes = {\n checked: ichecked,\n 'aria-checked': ichecked,\n 'aria-setsize': addresses.length,\n 'aria-posinset': index + 1,\n 'aria-label': resources.addressChangeCheckboxAriaLabel\n };\n\n return (\n \n );\n};\n\nconst getAddressSelectItems = (props: IAddressSelectInputProps): IAddressSelectItem[] => {\n const { addresses, addressFormat, addressPurposes } = props;\n\n return addresses.map((address, index) => {\n return {\n key: address.RecordId || 0,\n SelectItem: { className: 'msc-address-select__item' },\n input: getInput(index, address, props),\n showItems: AddressShow({ addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''), address, addressPurposes })\n };\n });\n};\n\nexport const AddressSelect = (props: IAddressSelectInputProps): IAddressSelectProps => {\n const { resources, onCancel, onSave, onAddAddress, hasExternalSubmitGroup } = props;\n\n return {\n SelectAddress: { className: 'msc-address-select' },\n addButton: (\n \n ),\n isShowSaveButton: !hasExternalSubmitGroup,\n saveButton: (\n \n ),\n isShowCancelButton: !hasExternalSubmitGroup,\n cancelButton: (\n \n ),\n items: getAddressSelectItems(props)\n };\n};\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { format as formatNotification, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport { action, observable, reaction, set } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\n\r\nimport { AutoSuggest } from '@msdyn365-commerce-modules/address';\r\nimport { IAutoSuggestOptions } from '@msdyn365-commerce-modules/address';\r\nimport { AddressCommon } from '@msdyn365-commerce-modules/address';\r\nimport { AddressFormat } from '@msdyn365-commerce-modules/address';\r\nimport { AddressItemType } from '@msdyn365-commerce-modules/address';\r\nimport { AddressMetaData } from '@msdyn365-commerce-modules/address';\r\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '@msdyn365-commerce-modules/address';\r\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '@msdyn365-commerce-modules/address';\r\nimport { AddressList, IAddressListProps } from '@msdyn365-commerce-modules/address';\r\nimport { IB2bAccountManagementAddressData } from './b2b-account-management-address.data';\r\nimport { IB2bAccountManagementAddressProps } from './b2b-account-management-address.props.autogenerated';\r\n\r\n/**\r\n * Account management address view state interface.\r\n */\r\nexport interface IAccountManagementAddressViewState {\r\n isShowAddresList: boolean;\r\n isShowAddOrUpdateAddress: boolean;\r\n}\r\n\r\n/**\r\n * Account management address view state interface.\r\n */\r\nexport interface IAccountManagementAddressViewProps\r\n 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 screenReaderNotification: React.ReactNode;\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\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private customerAddresses: Address[];\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private addressActionResponse?: IAddressResponse;\r\n\r\n @observable private isUpdating?: boolean;\r\n\r\n @observable private hasError?: boolean;\r\n\r\n @observable private removeAddressData?: Address;\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private readonly resources: IAddressResource;\r\n\r\n private readonly defaultAddressType: number = 6; // Default to Home\r\n\r\n private readonly telemetryContent: ITelemetryContent;\r\n\r\n private autoSuggest?: AutoSuggest;\r\n\r\n public constructor(props: IB2bAccountManagementAddressProps) {\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.countryRegions = data.countryRegions.result || [];\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.customerAddresses = data.address.result || [];\r\n this.addUpdateAddress = {};\r\n this.validationError = {};\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n // Filter out the Invoice address for the add/update form\r\n this.addressPurposes.filter((address: AddressPurpose) => address.AddressType !== 1)\r\n );\r\n this.telemetryContent = getTelemetryObject(\r\n this.props.context.request.telemetryPageName!,\r\n this.props.friendlyName,\r\n this.props.telemetry\r\n );\r\n }\r\n\r\n /**\r\n * On Suggestion Selected Function.\r\n * @param result - Microsoft.Maps.ISuggestionResult.\r\n */\r\n @action\r\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\r\n this._clearAddressFields();\r\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\r\n set(this.addUpdateAddress, { Street: '' });\r\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\r\n set(this.addUpdateAddress, { CountyName: address.CountyName });\r\n set(this.addUpdateAddress, { City: address.City });\r\n set(this.addUpdateAddress, { State: address.State });\r\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\r\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\r\n\r\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\r\n setTimeout(() => {\r\n set(this.addUpdateAddress, { Street: address.Street });\r\n }, 0);\r\n };\r\n\r\n /**\r\n * Clear Address Fields.\r\n */\r\n @action\r\n private readonly _clearAddressFields = (): void => {\r\n const addressFormatItem = this.addressFormat.getAddressFormat(\r\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n );\r\n addressFormatItem.forEach(format => {\r\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\r\n this.addressFormat[format.name] = '';\r\n }\r\n });\r\n this._clearValidation();\r\n };\r\n\r\n /**\r\n * Clear Validation Function.\r\n */\r\n @action\r\n private readonly _clearValidation = (): void => {\r\n this.validationError = {};\r\n };\r\n\r\n public async componentDidMount(): Promise {\r\n const {\r\n context: {\r\n telemetry,\r\n actionContext: {\r\n requestContext: { channel }\r\n }\r\n },\r\n config: { autoSuggestionEnabled, autoSuggestOptions }\r\n } = this.props;\r\n\r\n // Initializing data props\r\n this._dataInitialize(this.props);\r\n\r\n void this.props.data.countryRegions.then(() => {\r\n this._setDefaultCountryRegionId();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\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 if (autoSuggestionEnabled) {\r\n if (channel && !channel.BingMapsApiKey) {\r\n telemetry.error('BingMapsApiKey is missing.');\r\n return;\r\n }\r\n\r\n if (channel && !channel.BingMapsEnabled) {\r\n telemetry.error('Map is disabled from HQ.');\r\n return;\r\n }\r\n\r\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\r\n this.autoSuggest = new AutoSuggest(\r\n telemetry,\r\n options,\r\n channel?.BingMapsApiKey,\r\n channel?.ChannelCountryRegionISOCode,\r\n channel?.DefaultLanguageId\r\n );\r\n\r\n reaction(\r\n () =>\r\n this.props.data.storeSelectorStateManager.result?.loadMapApi !== undefined &&\r\n (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\r\n async () => {\r\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\r\n }\r\n );\r\n\r\n reaction(\r\n () => {\r\n this.props.data.storeSelectorStateManager.result?.isMapApiLoaded;\r\n },\r\n async () => {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n }\r\n );\r\n }\r\n }\r\n\r\n /**\r\n * Component did mount function.\r\n */\r\n public async componentDidUpdate(): Promise {\r\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\r\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\r\n await this._attachMapAutoSuggest();\r\n }\r\n } else {\r\n this.autoSuggest?.disposeAutoSuggest();\r\n }\r\n }\r\n\r\n /**\r\n * Should component update function.\r\n * @param nextProps - Account management address props.\r\n * @param nextState - Next state.\r\n * @returns - True if component should update, false otherwise.\r\n */\r\n public shouldComponentUpdate(\r\n nextProps: IB2bAccountManagementAddressProps,\r\n nextState: IAccountManagementAddressViewState\r\n ): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\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 screenReaderNotification: this.removeAddressData ? this._renderScreenReaderRemoveText(this.removeAddressData) : null\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The account management props.\r\n */\r\n private readonly _dataInitialize = (props: IB2bAccountManagementAddressProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.address.result,\r\n () => {\r\n this.customerAddresses = data.address.result ?? [];\r\n }\r\n );\r\n };\r\n\r\n /**\r\n * Render Add Or Update Address Function.\r\n * @returns - AddressAddUpdate.\r\n */\r\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\r\n return AddressAddUpdate({\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 defaultAddressType: this.defaultAddressType,\r\n selectedAddress: this.addUpdateAddress,\r\n validationError: this.validationError,\r\n addressActionResponse: this.addressActionResponse,\r\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\r\n this.resources.addressStateDefaultSelectionText,\r\n this.stateProvinceInfo\r\n ),\r\n telemetryContent: this.telemetryContent,\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 * Render List Address Function.\r\n * @returns - AddressList.\r\n */\r\n private readonly _renderListAddress = (): IAddressListProps => {\r\n const { config } = this.props;\r\n\r\n /**\r\n * Render Address ttitle.\r\n * @param event - Msdyn365.ContentEditableEvent.\r\n */\r\n const handleLineItemHeadingChange = (event: Msdyn365.ContentEditableEvent) => {\r\n config.heading!.text = event.target.value;\r\n };\r\n const heading = config.heading && {\r\n text: config.heading.text,\r\n headingTag: config.heading.tag\r\n };\r\n\r\n return AddressList({\r\n isUpdating: this.isUpdating,\r\n selectedAddress: this.selectedAddress,\r\n addressFormat: this.addressFormat,\r\n addresses: this.customerAddresses,\r\n addressPurposes: this.addressPurposes,\r\n resources: this.resources,\r\n heading,\r\n primaryAddressSectionHeading: config.primaryAddressSectionHeading,\r\n otherAddressSectionHeading: config.otherAddressSectionHeading,\r\n contextRequest: this.props.context.request,\r\n telemetryContent: this.telemetryContent,\r\n handleLineItemHeadingChange,\r\n onEditAddress: this._goToEditAddress,\r\n onRemoveAddress: this._onRemoveAddress,\r\n onAddAddress: this._goToAddAddress,\r\n onUpdatePrimaryAddress: this._onSubmitUpdatePrimaryAddress\r\n });\r\n };\r\n\r\n /**\r\n * Attach Map Auto Suggest Function.\r\n */\r\n private readonly _attachMapAutoSuggest = async (): Promise => {\r\n const {\r\n data: {\r\n storeSelectorStateManager: { result: storeSelectorStateManager }\r\n }\r\n } = this.props;\r\n\r\n if (storeSelectorStateManager?.isMapApiLoaded) {\r\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\r\n }\r\n };\r\n\r\n /**\r\n * On Address Add Update Function.\r\n * @param name - String.\r\n * @param value - String | Boolean | Number.\r\n */\r\n private readonly onAddressAddUpdate = (name: string, value: string | boolean | number) => {\r\n set(this.addUpdateAddress, { [name]: value });\r\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\r\n };\r\n\r\n /**\r\n * On Address Add Update Input Change.\r\n * @param event - Input Change Event.\r\n */\r\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\r\n if (event.target.type === 'checkbox') {\r\n this.onAddressAddUpdate(event.target.name, event.target.checked);\r\n } else {\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\r\n /**\r\n * On Address Add Update Dropdown Change.\r\n * @param event - Dropdown Change Event.\r\n */\r\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\r\n if (event.target.name === AddressItemType[AddressItemType.AddressTypeValue]) {\r\n this.onAddressAddUpdate(event.target.name, +event.target.value);\r\n } else {\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 /**\r\n * On Address Update Function.\r\n * @param response - Promise.\r\n * @param onSuccess - IAddressResponse.\r\n */\r\n private readonly _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 /**\r\n * On Address Add Update Submit Function.\r\n */\r\n private readonly _onAddressAddUpdateSubmit = (): void => {\r\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\r\n return;\r\n }\r\n let response: Promise;\r\n if (this.addressCommon.isAuthenticatedFlow()) {\r\n response =\r\n this.currentOperation === AddressOperation.Update\r\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\r\n : 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 /**\r\n * On Country Change Function.\r\n * @param countryRegionId - String.\r\n */\r\n private readonly _onCountryChange = (countryRegionId: string) => {\r\n this.countryRegionId = countryRegionId;\r\n const twoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\r\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterISORegionName });\r\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterISORegionName);\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * Get Address Format Exclude List Function.\r\n * @returns - Address Format Exclude List.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Get State Provinces Function.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n void this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n this.stateProvinceInfo = result;\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 /**\r\n * Update CurrentOperation Function.\r\n * @param operation - AddressOperation.\r\n */\r\n private readonly _updateCurrentOperation = (operation: AddressOperation) => {\r\n this.currentOperation = operation;\r\n this._clearAddressFields();\r\n };\r\n\r\n /**\r\n * On Submit Update Primary Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _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 /**\r\n * Go To Edit Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _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 /**\r\n * On Remove Address Function.\r\n * @param address - Address.\r\n */\r\n private readonly _onRemoveAddress = (address: Address): void => {\r\n address.Deactivate = true;\r\n this.removeAddressData = address;\r\n const response = this.addressCommon.updateCustomerAddress(address);\r\n this._onAddressUpdate(response, this._onAddOrUpdateSuccess);\r\n };\r\n\r\n /**\r\n * Renders Notification screen reader text for removed address.\r\n * @param address - Address input.\r\n * @returns Notification for removed address.\r\n */\r\n private readonly _renderScreenReaderRemoveText = (address: Address): React.ReactNode => {\r\n const notification = formatNotification(this.resources.removeAddressNotification!, `${address.Name!}`);\r\n return (\r\n
\r\n {notification}\r\n
\r\n );\r\n };\r\n\r\n /**\r\n * Go To Add Address Function.\r\n */\r\n private readonly _goToAddAddress = (): void => {\r\n this.addUpdateAddress = {};\r\n this._setDefaultCountryRegionId();\r\n set(this.addUpdateAddress, { ThreeLetterISORegionName: this.countryRegionId });\r\n set(this.addUpdateAddress, { AddressTypeValue: this.defaultAddressType });\r\n this._setDefaultCountryRegionId();\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n };\r\n\r\n /**\r\n * On Add Or Update Success Function.\r\n * @param response - IAddressResponse.\r\n */\r\n private readonly _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 /**\r\n * On Update Primary Address Success Function.\r\n * @param response - IAddressResponse.\r\n */\r\n private readonly _onUpdatePrimaryAddressSuccess = (response: IAddressResponse): void => {\r\n if (response.customerAddresses) {\r\n this.customerAddresses = response.customerAddresses;\r\n }\r\n };\r\n\r\n /**\r\n * Reset view function.\r\n */\r\n private readonly _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","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ITelemetry } from '@msdyn365-commerce/core';\nimport { IStoreSelectorStateManager } from '@msdyn365-commerce-modules/bopis-utilities';\n\nimport { IAutoSuggestOptions } from './address-autosuggest.data';\n\n/**\n *\n * Auto Suggest.\n */\nexport class AutoSuggest {\n public readonly excludedAddressFields: string[] = ['ThreeLetterISORegionName', 'Name', 'AddressTypeValue', 'Phone'];\n\n private readonly telemetry: ITelemetry;\n\n private readonly countryCode?: string;\n\n private readonly bingMapsApiKey?: string;\n\n private readonly defaultLanguageId?: string;\n\n private autoSuggestManager: Microsoft.Maps.AutosuggestManager | undefined;\n\n private autoSuggestOptions: IAutoSuggestOptions;\n\n constructor(telemetry: ITelemetry, autoSuggestOptions: IAutoSuggestOptions, BingMapsApiKey?: string, countryCode?: string, defaultLanguageId?: string) {\n this.telemetry = telemetry;\n this.autoSuggestOptions = autoSuggestOptions;\n this.bingMapsApiKey = BingMapsApiKey;\n this.countryCode = countryCode;\n this.defaultLanguageId = defaultLanguageId;\n }\n\n public attachAutoSuggest = (inputId: string, containerId: string, selectedSuggestionCallback: (result: Microsoft.Maps.ISuggestionResult) => void): void => {\n if (!this.autoSuggestManager) {\n Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', {\n callback: () => {\n const options = { ...this.autoSuggestOptions, countryCode: this.countryCode };\n this.autoSuggestManager = new Microsoft.Maps.AutosuggestManager(options);\n this.autoSuggestManager.attachAutosuggest(inputId, containerId, selectedSuggestionCallback);\n document.querySelector(inputId)?.setAttribute('role', 'combobox');\n setTimeout(() => {\n document.querySelector(inputId)?.setAttribute('type', 'text');\n }, 0);\n },\n errorCallback: () => {\n if (this.telemetry) {\n this.telemetry.debug('Unable to attach map auto suggest.');\n }\n },\n credentials: this.bingMapsApiKey\n });\n }\n };\n\n public changeAutoSuggestionCountryCode = (countryCode?: string): void => {\n if (this.autoSuggestManager) {\n this.autoSuggestOptions.countryCode = countryCode;\n this.autoSuggestManager.setOptions(this.autoSuggestOptions);\n }\n };\n\n public disposeAutoSuggest = (): void => {\n this.autoSuggestManager?.detachAutosuggest();\n this.autoSuggestManager?.dispose();\n this.autoSuggestManager = undefined;\n };\n\n public _loadMapAPI = async (storeSelectorStateManager: IStoreSelectorStateManager): Promise => {\n await storeSelectorStateManager.loadMapApi({\n key: this.bingMapsApiKey,\n lang: this.defaultLanguageId,\n market: this.countryCode\n });\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 IAddressButton {\n className: string;\n text: string;\n ariaLabel: string;\n disabled?: boolean;\n telemetryContent?: ITelemetryContent;\n role?: string;\n onClick(event: React.MouseEvent): void;\n}\n\n/**\n * Address button.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressButtonFunctionComponent: React.FC = (props: IAddressButton) => {\n const { className, text, ariaLabel, disabled: isDisabled, telemetryContent, onClick, role } = props;\n const payLoad = getPayloadObject('click', telemetryContent!, text);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n \n {text}\n \n );\n};\n\nexport default AddressButtonFunctionComponent;\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IAddressShowItem,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/checkout-billing-address/../../common/components/address-show';\r\nimport { ICheckoutBillingAddressViewProps } from './b2b-checkout-billing-address';\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\r\n return (\r\n \r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Checkout Billing Address View Component.\r\n * @param props - Props.\r\n * @returns - CheckoutBillingAddress Module.\r\n */\r\nconst CheckoutBillingAddressView: React.FC = props => {\r\n const { CheckoutBillingAddress, viewState, showAddress, error } = props;\r\n\r\n return (\r\n \r\n {viewState.isShowAddress && }\r\n {viewState.isError && error}\r\n \r\n );\r\n};\r\n\r\nexport default CheckoutBillingAddressView;\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport BusinessAccountAddress from './business-account-address';\nimport BusinessAccountAddressView from './business-account-address.view';\n\nexport * from './business-account-address';\nexport * from './business-account-address.data';\nexport { IBusinessAccountAddressConfig, IBusinessAccountAddressProps, IBusinessAccountAddressResources } from './business-account-address.props.autogenerated';\nexport * from './business-account-address.view';\n\nexport {\n BusinessAccountAddress,\n BusinessAccountAddressView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAdressErrorTitle {\n title: string;\n}\n\n/**\n * Address error title.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressErrorTitleFunctionComponent: React.FC = (props: IAdressErrorTitle) => {\n const { title } = props;\n\n return (\n

\n {title}\n

\n );\n};\n\nexport default AddressErrorTitleFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { observable, reaction, set } from 'mobx';\nimport * as React from 'react';\n\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemDisplayType, AddressItemType, AddressValidationRuleType, IAddressItem } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IBusinessAccountAddressData } from './business-account-address.data';\nimport { IBusinessAccountAddressProps } from './business-account-address.props.autogenerated';\n\n/**\n * Interface for IBusinessAccountAddressExtendedProps.\n */\nexport interface IBusinessAccountAddressExtendedProps extends IBusinessAccountAddressProps {\n hasError: boolean;\n isRequired: boolean;\n resetAddress: boolean;\n updateForm(errors: boolean, currentAddress?: Address): void;\n}\n\n/**\n * Interface for IBusinessAccountAddressState.\n */\nexport interface IBusinessAccountAddressState {\n countryId?: string;\n states?: StateProvinceInfo[];\n}\n\n/**\n * Interface for IBusinessAccountAddressViewProps.\n */\nexport interface IBusinessAccountAddressViewProps {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n addressListSelectedAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n customerAddresses: Address[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n BusinessAccountAddress: IModuleProps;\n isUpdating: boolean;\n hasError: boolean;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n}\n\n/**\n *\n * Address component.\n * @extends {React.Component, IBusinessAccountAddressState>}\n */\nclass BusinessAccountAddress extends React.Component {\n @observable private addUpdateAddress: Address;\n\n @observable private countryRegionId: string = 'USA';\n\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n\n @observable private readonly validationError: object;\n\n private readonly addressActionResponse?: IAddressResponse;\n\n private readonly isUpdating?: boolean;\n\n private readonly addressCommon: AddressCommon;\n\n private addressFormat: AddressFormat;\n\n private countryRegions: CountryRegionInfo[] = [];\n\n private addressPurposes: AddressPurpose[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly defaultAddressType: number = 8; // Default to Business\n\n private readonly shouldAutoFocus?: boolean = false;\n\n private readonly excludedList: AddressItemType[] = [AddressItemType.Name, AddressItemType.AddressTypeValue, AddressItemType.IsPrimary]; // Default to hiding Name and AddressType inputs\n\n private readonly telemetryContent: ITelemetryContent;\n\n public constructor(props: IBusinessAccountAddressExtendedProps) {\n super(props);\n\n const { context, data, resources, telemetry } = this.props;\n this.addUpdateAddress = {};\n this.resources = resources;\n this.countryRegions = data.countryRegions.result || [];\n this.addressPurposes = data.addressPurposes.result || [];\n this.stateProvinceInfo = data.countryStates.result || [];\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources },\n this.excludedList, props.isRequired ? undefined : []),\n this.addressPurposes\n );\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.validationError = {};\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n public componentDidMount(): void {\n // Initializing data props\n this._dataInitialize(this.props);\n\n this._setDefaultCountryRegionId();\n }\n\n public shouldComponentUpdate(nextProps: IBusinessAccountAddressExtendedProps, nextState: IBusinessAccountAddressState): 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 { renderView, config, hasError, resetAddress } = this.props;\n\n // Business-sign-up will pass this flag when cancel button is clicked\n if (resetAddress) {\n this._resetAddressFields();\n }\n\n const viewProps = {\n ...this.props,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n hasError,\n className: config.className,\n BusinessAccountAddress: {\n moduleProps: this.props,\n className: classnames('ms-business-account-address', config.className)\n },\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Reset Address.\n */\n public _resetAddressFields = () => {\n const addressFormat = this.addressFormat.getAddressFormat(this.countryRegionId);\n\n addressFormat.map(addressFormatItem => {\n switch (addressFormatItem.displayType) {\n case AddressItemDisplayType.Input:\n this.addUpdateAddress[addressFormatItem.name] = '';\n break;\n case AddressItemDisplayType.Checkbox:\n this.addUpdateAddress[addressFormatItem.name] = false;\n break;\n default:\n switch (addressFormatItem.type) {\n case AddressItemType.ThreeLetterISORegionName:\n this.addUpdateAddress[addressFormatItem.name] = this.countryRegionId;\n break;\n case AddressItemType.AddressTypeValue:\n this.addUpdateAddress[addressFormatItem.name] = this.defaultAddressType;\n break;\n case AddressItemType.State:\n this.addUpdateAddress[addressFormatItem.name] = '';\n break;\n default:\n this.addUpdateAddress[addressFormatItem.name] = undefined;\n }\n }\n });\n };\n\n /**\n * Method data initialization.\n * @param props -The account management props.\n */\n private readonly _dataInitialize = (props: IBusinessAccountAddressExtendedProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.countryStates.result,\n () => {\n this.stateProvinceInfo = data.countryStates.result ?? [];\n }\n );\n };\n\n // Set validationError and hasError to hide error messages since in the B2B\n // request form, no errors would visually show since user wont be able to submit\n // until form is filled and correct\n /**\n * Render Add Or Update Address Function.\n * @returns - AddressAddUpdate.\n */\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\n return AddressAddUpdate({\n isUpdating: this.isUpdating,\n resources: this.resources,\n addressType: AddressType.Company,\n addressFormat: this.addressFormat.getAddressFormat(this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n shouldAutoFocus: this.shouldAutoFocus,\n validationError: this.validationError,\n hasError: this.props.hasError,\n addressActionResponse: this.addressActionResponse,\n telemetryContent: this.telemetryContent,\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange\n });\n };\n\n /**\n * On Address Add Update Input Change Function.\n * @param event - Input event change function.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n this._updateAddress(event.target.name, event.target.value);\n };\n\n /**\n * On Address Add Update Dropdown Change Function.\n * @param event - Change dropdown event.\n */\n private readonly _onAddressAddUpdateDropdownChange = async (event: React.ChangeEvent): Promise => {\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n await this._updateCountryRegionId(event.target.value);\n } else {\n this._updateAddress(event.target.name, event.target.value);\n }\n };\n\n /**\n * Update Address Function.\n * @param name - String.\n * @param value - String.\n */\n private readonly _updateAddress = (name: string, value: string | number) => {\n const { updateForm, isRequired, resources } = this.props;\n let cleanValue = value;\n if (typeof (value) === 'string') {\n cleanValue = (value || '').replace(new RegExp('[<>]', 'gi'), '');\n }\n set(this.addUpdateAddress, { [name]: cleanValue });\n\n if (this._isEmpty()) {\n if (isRequired) {\n updateForm(true, undefined);\n } else {\n // Reset addressFormat as if address was NOT a required field\n this.addressFormat = new AddressFormat(this.countryRegions, new AddressMetaData({ ...resources }, this.excludedList, []), this.addressPurposes);\n updateForm(false, this.addUpdateAddress);\n }\n } else {\n // Get new addressFormat as if address was a required field\n this.addressFormat = new AddressFormat(this.countryRegions,\n new AddressMetaData({ ...resources },\n this.excludedList, undefined\n ),\n this.addressPurposes);\n\n // Verify with new rules\n if (this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n updateForm(false, this.addUpdateAddress);\n } else {\n updateForm(true, undefined);\n }\n }\n };\n\n /**\n * Is empty Function.\n * @returns - Boolean.\n */\n // Walk through array and check if valued is defined or value is not an empty string\n private readonly _isEmpty = () => {\n const addressFormat = this.addressFormat.getAddressFormat(this.countryRegionId);\n for (const addressFormatItem of addressFormat) {\n if (addressFormatItem.type !== AddressItemType.ThreeLetterISORegionName || this._isInputRequired(addressFormatItem)) {\n const addressItemValue = this.addUpdateAddress[addressFormatItem.name];\n\n // Check each input field, if value is defined and not an empty string --> address is not empty\n if (addressItemValue || (addressItemValue && addressItemValue !== '')) {\n return false;\n }\n }\n }\n\n return true;\n };\n\n /**\n * Is Input Required Function.\n * @param addressFormatItem - IAddressItem.\n * @returns - Boolean.\n */\n private readonly _isInputRequired = (addressFormatItem: IAddressItem): boolean => {\n if (ObjectExtensions.isNullOrUndefined(addressFormatItem) || !addressFormatItem.validationRules || addressFormatItem.validationRules.length === 0) {\n return false;\n }\n\n for (const validationRule of addressFormatItem.validationRules) {\n if (validationRule.type === AddressValidationRuleType.Required) {\n return false;\n }\n }\n\n return true;\n };\n\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request.channel?.ChannelCountryRegionISOCode;\n\n this._updateCountryRegionId(this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market));\n\n // Set default AddressType\n set(this.addUpdateAddress, { AddressTypeValue: this.defaultAddressType });\n }\n\n /**\n * Update Country Region Id Function.\n * @param value - String.\n */\n private readonly _updateCountryRegionId = async (value: string) => {\n this.countryRegionId = value;\n\n await this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n this._updateAddress('State', '');\n }\n\n this.stateProvinceInfo = result;\n });\n\n this._updateAddress('ThreeLetterISORegionName', this.countryRegionId);\n };\n}\n\nexport default BusinessAccountAddress;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAdressLabel {\n id: string;\n text: string;\n}\n\n/**\n * Address label.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressLabelFunctionComponent: React.FC = (props: IAdressLabel) => {\n const {\n id: itemId,\n text\n } = props;\n\n return (\n \n );\n};\n\nexport default AddressLabelFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { AddressItemType, IAddressItem } from '../address-format.data';\nimport AddressDetailItemComponent from './address-detail-item';\n\nexport interface IAddressShowItem {\n key: string;\n description: React.ReactNode;\n}\n\nexport interface IAddressShowProps {\n AddressDetail: INodeProps;\n items: IAddressShowItem[];\n}\n\nexport interface IAddressShowInputProps {\n addressFormat: IAddressItem[];\n address: Address;\n addressPurposes: AddressPurpose[];\n}\n\nexport const AddressShow = (props: IAddressShowInputProps): IAddressShowProps => {\n const { addressFormat, addressPurposes, address } = props;\n\n return {\n AddressDetail: { className: 'msc-address-detail' },\n items: addressFormat.map((item) => {\n if (item.name === AddressItemType[AddressItemType.AddressTypeValue]) {\n const addressType = addressPurposes.find((addressTypeValue) => addressTypeValue.AddressType.toString() === (address[item.name] || '').toString());\n if (addressType) {\n const value = addressType.Name || '';\n return {\n key: item.name,\n description: \n };\n }\n }\n return {\n key: item.name,\n description: \n };\n })\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { PhoneRegex } from '@msdyn365-commerce-modules/retail-actions';\n\nimport {\n AddressItemDisplayType, AddressItemType, AddressValidationRuleType, IAddressItem,\n IAddressValidationRule\n} from './address-format.data';\nimport { IAddressResource } from './address-module.data';\n\n/**\n * Address meta data.\n */\nexport class AddressMetaData {\n\n private readonly metaData: IAddressItem[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly requiredFieldRegEx: string = '\\\\S';\n\n private readonly resourcesPrefix: string = 'address';\n\n private readonly maxLength: number = 64;\n\n private readonly requiredFields: AddressItemType[];\n\n private readonly excludedTypes: AddressItemType[];\n\n constructor(resources: IAddressResource, excluded?: AddressItemType[], required?: AddressItemType[]) {\n this.resources = resources || {};\n this.excludedTypes = excluded || [];\n this.requiredFields = required !== undefined ? required : [AddressItemType.Name, AddressItemType.ZipCode, AddressItemType.City, AddressItemType.State, AddressItemType.ThreeLetterISORegionName, AddressItemType.Street];\n this._init();\n }\n\n public getItemFormat(id: number): IAddressItem | undefined {\n return this.metaData.find((item) => {\n return item.type === id;\n });\n }\n\n private _init(): void {\n this._addItem(AddressItemType.Name, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.Phone, AddressItemDisplayType.Input, PhoneRegex.defaultRegex);\n this._addItem(AddressItemType.ZipCode, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.City, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.County, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.State, AddressItemDisplayType.Dropdown);\n this._addItem(AddressItemType.ThreeLetterISORegionName, AddressItemDisplayType.Dropdown);\n this._addItem(AddressItemType.Street, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.DistrictName, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.StreetNumber, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.BuildingCompliment, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.Postbox, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.House_RU, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.Flat_RU, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.CountryOKSMCode_RU, AddressItemDisplayType.Input);\n this._addItem(AddressItemType.AddressTypeValue, AddressItemDisplayType.Dropdown);\n this._addItem(AddressItemType.IsPrimary, AddressItemDisplayType.Checkbox);\n }\n\n private _addItem(type: AddressItemType, displayType: AddressItemDisplayType, format?: string): void {\n if (this.excludedTypes.includes(type)) {\n return;\n }\n\n const nameKey = AddressItemType[type].replace('_', '');\n\n // Find out if currentItem is required field\n const validationRules = this._validationRules(type, nameKey, format);\n const isRequired = validationRules.some(rule => rule.type === AddressValidationRuleType.Required);\n\n // If no optional string is provided in resource file, use the original label text\n const optionalString = this.resources[`${this.resourcesPrefix}${nameKey}LabelOptional`] || this.resources[`${this.resourcesPrefix}${nameKey}Label`];\n const item: IAddressItem = {\n type,\n displayType,\n name: AddressItemType[type],\n label: isRequired ? this.resources[`${this.resourcesPrefix}${nameKey}Label`] : optionalString,\n maxLength: this.maxLength,\n validationRules,\n isNewLine: true\n };\n\n this.metaData.push(item);\n }\n\n private _validationRules(type: AddressItemType, name: string, format?: string): IAddressValidationRule[] {\n const validationRules: IAddressValidationRule[] = [];\n\n for (const ruleType of Object.keys(AddressValidationRuleType)) {\n const key = `${this.resourcesPrefix}${name}${ruleType}`;\n const message: string = this.resources[`${key}ErrorMessage`];\n switch (ruleType) {\n case AddressValidationRuleType.Required: {\n if (this.requiredFields.find((itemType: AddressItemType) => itemType === type)) {\n validationRules.push(this._validationRule(ruleType, this.requiredFieldRegEx, message));\n }\n break;\n }\n case AddressValidationRuleType.Format: {\n validationRules.push(this._validationRule(ruleType, format!, message));\n break;\n }\n default:\n }\n }\n return validationRules;\n }\n\n private _validationRule(type: AddressValidationRuleType, regEx: string, message: string): IAddressValidationRule {\n return {\n type,\n regEx,\n message\n };\n }\n\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport checkoutStateDataAction from './checkout-state-data-action';\n\nexport * from './checkout-state';\nexport * from './checkout-state-data-action';\nexport * from './module-state-manager';\n\nexport { checkoutStateDataAction };\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IAddressList, IAddressListItem, IAddressListProps } from '../../common/components/address-list';\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\nimport { IAccountManagementAddressViewProps } from './account-management-address';\n\n/**\n * Address show component.\n * @param param0 - Root param.\n * @param param0.AddressDetail - Address detail.\n * @param param0.items - IAddressShowItem[].\n * @returns - Address Node.\n */\nconst AddressShow: React.FC = ({\n AddressDetail,\n items\n}) => {\n\n return (\n \n {items.map((item: IAddressShowItem) => {\n return (\n <>\n {item.description}\n \n );\n })}\n \n );\n};\n\n/**\n * Address List Component.\n * @param param0 - Root param.\n * @param param0.List - Address list.\n * @param param0.isShowList - Boolean.\n * @param param0.heading - Address heading.\n * @param param0.items - IAddressListItem[].\n * @returns - AddressListComponent Node.\n */\nconst AddressList: React.FC = ({\n List,\n isShowList,\n heading,\n items\n}) => {\n\n if (!isShowList) {\n return null;\n }\n\n return (\n \n {heading}\n {items.map((item: IAddressListItem) => {\n const { Item, key, error, showItems, isShowPrimaryButton, primaryButton, editButton, removeButton } = item;\n const { Error, isShowError, title, message } = error;\n return (\n \n {isShowError && \n {title}\n {message}\n }\n {isShowPrimaryButton && primaryButton}\n {editButton}\n {removeButton}\n );\n })}\n \n );\n};\n\n/**\n * Address Lists Component.\n * @param param0 - Root param.\n * @param param0.ListAddress - List address.\n * @param param0.heading - List heading.\n * @param param0.isShowEmptyListMessage - Boolean.\n * @param param0.emptyListMessage - Empty list message.\n * @param param0.addButton - Add button.\n * @param param0.primaryAddressList - Primary address.\n * @param param0.otherAddressList - Other address.\n * @returns Address Lists Component Node.\n */\nconst AddressLists: React.FC = ({\n ListAddress,\n heading,\n isShowEmptyListMessage,\n emptyListMessage,\n addButton,\n primaryAddressList,\n otherAddressList\n}) => {\n\n return (\n \n {heading}\n {isShowEmptyListMessage && emptyListMessage}\n {addButton}\n \n \n \n );\n};\n\n/**\n * AddressAddUpdateComponent.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - Error message.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns Address add update component node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n {label}\n {alert}\n {input}\n );\n })}\n {hasError && \n {error.title}\n {error.message}\n }\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Account Management Address View Component.\n * @param props - Props.\n * @returns - AccountAddressManagement Module.\n */\nconst AccountManagementAddressView: React.FC = props => {\n const {\n AccountAddressManagement,\n infoMessageBar,\n viewState,\n showAddressList,\n showAddOrUpdateAddress,\n screenReaderNotification\n } = props;\n\n return (\n \n {infoMessageBar}\n {viewState.isShowAddresList && }\n {viewState.isShowAddOrUpdateAddress && }\n {screenReaderNotification}\n \n );\n};\n\nexport default AccountManagementAddressView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nexport enum AddressItemDisplayType {\n Input = 'Input',\n Dropdown = 'Dropdown',\n Checkbox = 'Checkbox'\n}\n\nexport enum AddressValidationRuleType {\n Required = 'Required',\n Format = 'Format'\n}\n\nexport enum AddressItemType {\n Name = 1001,\n Phone = 1002,\n IsPrimary = 1003,\n AddressTypeValue = 1004,\n ZipCode = 1,\n City = 2,\n County = 3,\n State = 4,\n ThreeLetterISORegionName = 5,\n Street = 6,\n DistrictName = 7,\n StreetNumber = 8,\n BuildingCompliment = 9,\n Postbox = 10,\n House_RU = 21,\n Flat_RU = 22,\n CountryOKSMCode_RU = 23\n}\n\nexport interface IAddressItem {\n name: string;\n type: AddressItemType;\n label: string;\n maxLength: number;\n displayType: AddressItemDisplayType;\n validationRules?: IAddressValidationRule[];\n isNewLine: boolean;\n}\n\nexport interface IAddressValidationRule {\n type: AddressValidationRuleType;\n regEx: string;\n message: string;\n}\n\nexport interface IAddressDropdownsData {\n [index: string]: { key?: string | number; value?: string }[];\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport CheckoutBillingAddress from './checkout-billing-address';\nimport CheckoutBillingAddressView from './checkout-billing-address.view';\n\nexport * from './checkout-billing-address';\nexport * from './checkout-billing-address.data';\nexport { ICheckoutBillingAddressConfig, ICheckoutBillingAddressProps, ICheckoutBillingAddressResources } from './checkout-billing-address.props.autogenerated';\nexport * from './checkout-billing-address.view';\n\nexport {\n CheckoutBillingAddress,\n CheckoutBillingAddressView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IModule } from '@msdyn365-commerce/core';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport isMatch from 'lodash/isMatch';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { getModuleStates, updateModuleStates } from './module-state';\nimport { IModuleState, IModuleStateManager, IModuleStateProps, IModuleStates } from './module-state.data';\n\nexport interface IProps extends IModule, IModuleStateProps {\n enableControl?: boolean;\n}\n\nconst sectionContainerModuleId = 'section-container';\nconst paymentInstrumentModuleId = 'payment-instrument';\n\nconst withModuleState =

(WrappedComponent: React.ComponentType

): React.ComponentType

=> {\n /**\n *\n * ModuleState component.\n * @extends {React.Component

}\n */\n @observer\n class ModuleState extends React.Component

{\n constructor(props: P) {\n super(props);\n this.initializeState();\n }\n\n public shouldComponentUpdate(nextProps: IModuleStateProps): boolean {\n if (this.props === nextProps) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element | null {\n const { id } = this.props;\n return ;\n }\n\n private readonly initializeState = (): void => {\n const { id, typeName, context } = this.props;\n const states = getModuleStates(context.actionContext);\n if (!states) {\n this.props.telemetry.error('withModuleState initializeState() - states not found');\n return;\n }\n\n if (states[id]) {\n // State has been initialized\n return;\n }\n\n updateModuleStates(\n {\n ...states,\n [id]: {\n id,\n typeName,\n hasInitialized: false,\n hasError: false,\n isRequired: true,\n isCancellable: true,\n isSubmitContainer: false,\n status: undefined,\n childIds: []\n }\n },\n context.actionContext\n );\n };\n\n /**\n * GetModuleStateManager\n * Get module state manager by id.\n * @param id\n */\n private readonly getModuleStateManager = (id: string): IModuleStateManager => {\n const moduleState = this.get()[id];\n return {\n ...moduleState!,\n hasInitialized: this.validate(id, { hasInitialized: true }, true), // All has initialized is initialized\n hasError: this.validate(id, { hasError: true }), // Partial has error is error\n isReady: this.validate(id, { status: 'ready' }, true, true), // All ready is ready (exclued disabled and skipped)\n isUpdating: this.validate(id, { status: 'updating' }), // Partial updating is updating\n isPending: this.validate(id, { status: 'pending' }), // Partial pending is pending\n isSkipped: this.validate(id, { status: 'skipped' }, true, true), // All skipped is skipped (exclued disabled)\n isDisabled: this.validate(id, { status: 'disabled' }, true), // All disabled is disabled\n isCancelAllowed: this.validate(id, { isCancellable: true }, true, true), // Partial not allowed is not allowed\n shouldSubmitContainer: this.validate(id, { isSubmitContainer: true }), // Partial submit is submit.\n hasExternalSubmitGroup: this.hasExternalSubmitGroup(),\n hasModuleState: this.hasModuleState(id),\n setIsRequired: (value: boolean): void => {\n this.update(id, { isRequired: value });\n },\n setIsCancellable: (value: boolean): void => {\n this.update(id, { isCancellable: value });\n },\n setIsSubmitContainer: (value: boolean): void => {\n this.update(id, { isSubmitContainer: value });\n },\n setHasError: (value: boolean): void => {\n this.update(id, { hasError: value });\n },\n onReady: (): void => {\n this.update(id, { status: 'ready' });\n },\n onUpdating: (): void => {\n this.update(id, { status: 'updating' });\n },\n onPending: (): void => {\n this.update(id, { status: 'pending' });\n },\n onSkip: (): void => {\n this.update(id, { status: 'skipped' });\n },\n onDisable: (): void => {\n this.update(id, { status: 'disabled' });\n },\n getModule: (moduleId: string): IModuleStateManager => this.getModuleStateManager(moduleId),\n getModuleByTypeName: (typeName: string): IModuleStateManager => this.getModuleStateManagerByTypeName(typeName),\n init: (options?: Partial): void => {\n if (moduleState?.hasInitialized) {\n // State has been initialized\n return;\n }\n this.update(id, {\n hasInitialized: true,\n ...options\n });\n }\n };\n };\n\n /**\n * GetModuleStateManagerByTypeName\n * Get module state manager by type name.\n * @param typeName\n */\n private readonly getModuleStateManagerByTypeName = (typeName: string): IModuleStateManager => {\n const moduleStates = getModuleStates(this.props.context.actionContext);\n const moduleState = Object.values(moduleStates).find(_moduleState => _moduleState?.typeName === typeName);\n return this.getModuleStateManager((moduleState && moduleState.id) || '');\n };\n\n /**\n * Get\n * Get all module states.\n */\n private readonly get = (): IModuleStates => {\n return getModuleStates(this.props.context.actionContext);\n };\n\n /**\n * Update\n * Update module state.\n * @param id\n * @param value\n */\n private readonly update = (id: string, value: Partial): void => {\n // Console.log('withModuleState - update', id, value);\n const modules = this.get();\n if (!modules[id]) {\n this.props.telemetry.error(`withModuleState update() - Module state with id ${id} is not found.`);\n return;\n }\n modules[id] = {\n ...modules[id]!,\n ...value\n };\n };\n\n private readonly _validateLeaf = (id: string, source: Partial): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n return isMatch(module, source);\n };\n\n private readonly _validateContainer = (\n id: string,\n source: Partial,\n allMatched?: boolean,\n skipSkippableItem?: boolean\n ): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n // Module doesn't has module state\n return !!allMatched;\n }\n\n if (skipSkippableItem && (module.status === 'disabled' || module.status === 'skipped')) {\n // Skip disabled or skipped modules\n return !!allMatched;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n let childIds = module.childIds;\n\n if (this.props.context.app.config.shouldEnableSinglePaymentAuthorizationCheckout) {\n // For new checkout flow, we bypass the isReady check for payment section container to enable the place order button.\n childIds = childIds.filter(childId => !this._isPaymentSectionContainer(childId));\n }\n\n // It is container module\n const method = allMatched ? 'every' : 'some';\n return childIds[method](childId => this._validateContainer(childId, source, allMatched, skipSkippableItem));\n };\n\n /**\n * Check if it is a section container with payment module.\n * @param moduleId -- The id of the module.\n * @returns If it is a section container with payment module.\n */\n private readonly _isPaymentSectionContainer = (moduleId: string): boolean => {\n if (!moduleId.includes(sectionContainerModuleId)) {\n return false;\n }\n\n const modules = this.get();\n const module = modules[moduleId];\n\n if (module && ArrayExtensions.hasElements(module.childIds.filter(childId => childId.includes(paymentInstrumentModuleId)))) {\n return true;\n }\n\n return false;\n };\n\n /**\n * Validate\n * Validate current module and all its child module match the provided condition.\n * @param id\n * @param source\n * @param allMatched\n * @param skipSkippableItem\n */\n private readonly validate = (id: string, source: Partial, allMatched?: boolean, skipSkippableItem?: boolean): boolean => {\n const modules = this.get();\n const module = modules[id];\n if (!module) {\n return false;\n }\n\n // It is leaf module\n if (!module.childIds || module.childIds.length === 0) {\n return this._validateLeaf(id, source);\n }\n\n // It is container module\n return this._validateContainer(id, source, allMatched, skipSkippableItem);\n };\n\n /**\n * HasExternalSubmitGroup\n * Module will use external submit group.\n */\n private readonly hasExternalSubmitGroup = (): boolean => {\n return !!this.props.enableControl;\n };\n\n /**\n * HasModuleState\n * Module is using module state manager.\n * @param id\n */\n private readonly hasModuleState = (id: string): boolean => {\n const modules = this.get();\n const module = modules[id];\n return !!module;\n };\n }\n\n return ModuleState;\n};\n\nexport default withModuleState;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport AddressInputComponent from './address-input';\n\nexport interface IAddressBillingCheckbox {\n isChecked: boolean;\n value: string;\n ariaLabel: string;\n text: string;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\nexport const AddressBillingCheckbox: React.FC = ({\n isChecked,\n value,\n ariaLabel,\n text,\n telemetryContent,\n onChange\n}) => {\n\n const additionalAttributes = {\n checked: isChecked,\n 'aria-checked': isChecked\n };\n\n return (\n \n );\n};\nexport default AddressBillingCheckbox;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAdressAlert {\n message?: string;\n}\n\n/**\n * Address alert.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressAlertFunctionComponent: React.FC = (props: IAdressAlert) => {\n const message = props.message;\n return (\n \n {\n message &&\n <>\n {message}\n \n }\n \n );\n};\n\nexport default AddressAlertFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IImageProps, IImageSettings, Image, IRequestContext } from '@msdyn365-commerce/core';\nimport { CartLine, SimpleProduct } from '@msdyn365-commerce/retail-proxy';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { ICheckoutShippingAddressResources } from '../checkout-shipping-address.props.autogenerated';\n\n/**\n * The cartline product interface.\n */\nexport interface ICartLineWithProduct {\n cartLine: CartLine;\n product?: SimpleProduct;\n}\n\n/**\n * The checkout shipping cartline interface.\n */\nexport interface ICheckoutShippingCartLineInfo {\n lineId: string;\n imageProps: IImageProps;\n quantity: number;\n}\n\n/**\n * The checkout shipping cartline props.\n */\nexport interface ICheckoutShippingCartLinesProps {\n moduleClassName: string;\n cartLines: ICheckoutShippingCartLineInfo[];\n title: string;\n itemTitle: string;\n resources: ICheckoutShippingAddressResources;\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention -- Following as per module\nexport const CheckoutPickupCartLines: React.FC = ({ moduleClassName, cartLines, title, itemTitle, resources }) => {\n const context = {\n gridSettings: {\n xs: { w: 767 },\n sm: { w: 991 },\n md: { w: 1199 },\n lg: { w: 1599 },\n xl: { w: 1600 }\n }\n } as unknown as IRequestContext;\n const isMobileCheck = isMobile({ variant: VariantType.Browser, context });\n const isMobileView = isMobileCheck === 'xs' || isMobileCheck === 'sm';\n\n if (!ArrayExtensions.hasElements(cartLines)) {\n return null;\n }\n const quantity = 1;\n return (\n

\n
\n
\n {title}\n
\n
\n {itemTitle}\n
\n
\n
\n {cartLines.map((cartLine: ICheckoutShippingCartLineInfo) => {\n const isShowQty = cartLine.quantity > quantity;\n let className = `${moduleClassName}__group-images-lines-product`;\n const role = 'text';\n if (isShowQty) {\n className = classnames(className, ' product-image-wide');\n }\n return (\n
\n \n {isMobileView ? isShowQty && \n {cartLine.quantity}\n
: isShowQty &&
}\n {!isMobileView && isShowQty && \n {format(resources.productQuantityInfo, cartLine.quantity, cartLine.imageProps.altText)}\n }\n\n
\n );\n })}\n \n \n );\n};\n\n/**\n * The checkout shipping cartline image settings.\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. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address, AddressPurpose, CartLine, CountryRegionInfo, SimpleProduct, StateProvinceInfo, TenderLine, TokenizedPaymentCard }\n from '@msdyn365-commerce/retail-proxy';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { getFallbackImageUrl, getSimpleProducts, ObjectExtensions, ProductInput } from '@msdyn365-commerce-modules/retail-actions';\nimport { format, getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { action, computed, observable, reaction, set } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { AutoSuggest } from '../../common/address-autosuggest';\nimport { IAutoSuggestOptions } from '../../common/address-autosuggest.data';\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemType } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { AddressSelect, IAddressSelectProps } from '../../common/components/address-select';\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutShippingAddressData } from './checkout-shipping-address.data';\nimport { ICheckoutShippingAddressProps } from './checkout-shipping-address.props.autogenerated';\nimport { CheckoutPickupCartLines, defaultImageSettings, ICartLineWithProduct, ICheckoutShippingCartLineInfo,\n ICheckoutShippingCartLinesProps } from './components/checkout-shipping-cartlines-images';\n\n/**\n * The checkout address props interface.\n */\nexport interface ICheckoutAddressProps extends ICheckoutShippingAddressProps, IModuleStateProps { }\n\n/**\n * The checkout shipping address view state.\n */\nexport interface ICheckoutShippingAddressViewState {\n isShowAddress: boolean;\n isShowAddresList: boolean;\n isShowAddOrUpdateAddress: boolean;\n}\n\n/**\n * The checkout shipping address state.\n */\nexport interface ICheckoutAddresState {\n shippingGroups: ICartLineWithProduct[];\n}\n\n/**\n * The checkout shipping address view props.\n */\nexport interface ICheckoutShippingAddressViewProps extends ICheckoutAddressProps {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n addressListSelectedAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n customerAddresses: Address[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n viewState: ICheckoutShippingAddressViewState;\n CheckoutShippingAddress: IModuleProps;\n isUpdating: boolean;\n hasError: boolean;\n showAddress: IAddressShowProps;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n cartLineImages?: React.ReactNode;\n showAddressSelect: IAddressSelectProps;\n showAddOrUpdateAddressHandler?(onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressAddUpdateProps;\n showAddressSelectHandler?(onAddAddressHandler?: () => void, onSaveHandler?: () => void, onCancelHandler?: () => void): IAddressSelectProps;\n}\n\n/**\n * IExpressPaymentDetail interface.\n */\ninterface IExpressPaymentDetails {\n email?: string;\n tenderLine?: TenderLine;\n tokenizedPaymentCard?: TokenizedPaymentCard;\n paymentTenderType?: string;\n address?: Address;\n isExpressCheckoutAppliedInCartPage: boolean;\n isExpressAddressAppliedInCartPage?: boolean;\n}\n\n/**\n *\n * Address component.\n * @extends {React.Component>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutShippingAddress extends React.Component {\n @observable private currentOperation: AddressOperation;\n\n @observable private selectedAddress?: Address;\n\n @observable private addUpdateAddress: Address;\n\n @observable private countryRegionId: string = 'USA';\n\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n\n @observable private customerAddresses: Address[] = [];\n\n @observable private validationError: object;\n\n @observable private addressActionResponse?: IAddressResponse;\n\n @observable private isUpdating?: boolean;\n\n @observable private hasError?: boolean;\n\n @observable private addressListSelectedAddress: Address = {};\n\n private readonly addressCommon: AddressCommon;\n\n private addressFormat!: AddressFormat;\n\n private countryRegions: CountryRegionInfo[] = [];\n\n private addressPurposes: AddressPurpose[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly defaultAddressType: number = 6; // Default to Home\n\n private readonly telemetryContent?: ITelemetryContent;\n\n private autoSuggest?: AutoSuggest;\n\n private readonly multiplePickupStoreSwitchName: string = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n\n private retailMultiplePickUpOptionEnabled?: boolean = false;\n\n public constructor(props: ICheckoutAddressProps) {\n super(props);\n this.state = { shippingGroups: [] };\n const { context, data, resources, telemetry } = this.props;\n\n this.addUpdateAddress = {};\n this.resources = resources;\n this.currentOperation = AddressOperation.List;\n this.countryRegions = data.countryRegions.result || [];\n this.addressPurposes = data.addressPurposes.result || [];\n this.customerAddresses = data.address.result || [];\n this.stateProvinceInfo = data.countryStates.result || [];\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes);\n this.validationError = {};\n this.retailMultiplePickUpOptionEnabled = data.featureState.result\n ?.find(feature => feature.Name === this.multiplePickupStoreSwitchName)?.IsEnabled;\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n }\n\n /**\n * Initialize pickup group.\n */\n @action\n private readonly _initPickupGroup = async (): Promise => {\n const pickupCartLines: CartLine[] = this._getCartLinesforDelivery();\n const cartLines: ICartLineWithProduct[] = [];\n\n try {\n const products = await this._getProductsByCartLines(this.props.data.checkout.result?.checkoutCart.cart.ChannelId || 0,\n pickupCartLines);\n for (const line of pickupCartLines) {\n const product: SimpleProduct | undefined = products.find(x => x.RecordId === line.ProductId);\n cartLines.push({ cartLine: line, product });\n }\n this.setState({ shippingGroups: cartLines });\n\n } catch (error) {\n this.props.telemetry.error(error);\n this.setState({ shippingGroups: [] });\n }\n };\n\n /**\n * On suggestion selected.\n * @param result - Suggestion result interface.\n */\n @action\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n this._clearAddressFields();\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\n const timeout = 0;\n set(this.addUpdateAddress, { Street: '' });\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\n set(this.addUpdateAddress, { CountyName: address.CountyName });\n set(this.addUpdateAddress, { City: address.City });\n set(this.addUpdateAddress, { State: address.State });\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\n\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\n setTimeout(() => {\n set(this.addUpdateAddress, { Street: address.Street });\n }, timeout);\n\n };\n\n /**\n * Method to clear address fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId);\n for (const formatAddress of addressFormatItem) {\n if (this.addUpdateAddress[formatAddress.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(formatAddress.name)) {\n this.addressFormat[formatAddress.name] = '';\n }\n }\n this._clearValidation();\n };\n\n /**\n * Method to clear validation.\n */\n @action\n private readonly _clearValidation = (): void => {\n this.validationError = {};\n };\n\n public get expressPaymentDetailsFromCartPage(): IExpressPaymentDetails | null {\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Explicitly check for null/undefined.\n const properties = this.props.data.cart?.result?.cart?.ExtensionProperties?.find(\n property => property.Key === 'expressPaymentDetails')?.Value?.StringValue ?? '';\n\n return properties ? JSON.parse(properties) as IExpressPaymentDetails : null;\n }\n\n public async componentDidMount(): Promise {\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: {\n channel\n }\n }\n },\n config: {\n autoSuggestionEnabled,\n autoSuggestOptions\n },\n resources\n } = this.props;\n\n // Initializing data props\n this._dataInitialize(this.props);\n\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\n this.addressPurposes);\n\n this.props.data.checkout.then(() => {\n this._setDefaultCountryRegionId();\n this._initModuleState();\n });\n\n reaction(\n () => this.countryRegionId,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.currentOperation,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result?.shippingAddressFromExpressCheckout,\n () => {\n if (!this.expressPaymentDetailsFromCartPage && this._canShip()) {\n let address = this.props.data.checkout.result?.shippingAddressFromExpressCheckout;\n\n if (address?.TwoLetterISORegionName) {\n const threeLetterIsoRegionName = this.getThreeLetterIsoRegionName(address.TwoLetterISORegionName);\n\n address = { ...address, ThreeLetterISORegionName: threeLetterIsoRegionName };\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n }\n\n this._updateCurrentOperation(AddressOperation.Add, address);\n this._onAddressAddUpdateSubmit();\n }\n }\n );\n\n if (autoSuggestionEnabled) {\n\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\n this.autoSuggest = new AutoSuggest(telemetry, options, channel?.BingMapsApiKey, channel?.ChannelCountryRegionISOCode, channel?.DefaultLanguageId);\n\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\n if (this.props.data.storeSelectorStateManager.result && (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.loadMapApi && (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update),\n async () => {\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n );\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\n async () => {\n await this._attachMapAutoSuggest();\n }\n );\n }\n await this._initPickupGroup();\n }\n\n public async componentDidUpdate(): Promise {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\n await this._attachMapAutoSuggest();\n }\n } else {\n this.autoSuggest?.disposeAutoSuggest();\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutAddressProps, nextState: ICheckoutAddresState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n\n }\n\n public render(): JSX.Element | null {\n if (!this._canShip()) {\n return null;\n }\n\n const { config, context, renderView, resources } = this.props;\n const { headingImages, itemsText, singleItemText } = resources;\n const { imageSettings } = config;\n\n // Line images\n const cartlines: ICheckoutShippingCartLineInfo[] = this.state.shippingGroups.filter(x => !ObjectExtensions.isNullOrUndefined(x.product)).map(line => ({\n lineId: line.cartLine.LineId ?? '',\n imageProps: {\n requestContext: context.actionContext.requestContext,\n className: 'ms-checkout-shipping-address__group-images-lines-line-image',\n altText: line.product?.Name,\n src: line.product?.PrimaryImageUrl ?? '',\n fallBackSrc: getFallbackImageUrl(line.product?.ItemId, context.actionContext.requestContext.apiSettings),\n gridSettings: context.request.gridSettings!,\n imageSettings: imageSettings ?? defaultImageSettings,\n loadFailureBehavior: 'empty'\n },\n quantity: line.cartLine.Quantity ?? 0\n })\n );\n\n const quantity = 1;\n const itemText = cartlines.length > quantity ? itemsText : singleItemText;\n\n const lineImageProps: ICheckoutShippingCartLinesProps = {\n moduleClassName: 'ms-checkout-shipping-address',\n cartLines: cartlines.filter(x => !ObjectExtensions.isNullOrUndefined(x)),\n itemTitle: `(${format(itemText, cartlines.length)})`,\n title: headingImages,\n resources: this.props.resources\n };\n\n const cartLineImages: React.ReactNode = ;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { featureState } = this.props.data;\n const isRetailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const viewProps = {\n ...this.props,\n currentOperation: this.currentOperation,\n selectedAddress: this.selectedAddress,\n addUpdateAddress: this.addUpdateAddress,\n addressListSelectedAddress: this.addressListSelectedAddress,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n customerAddresses: this.customerAddresses,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n isUpdating: this.isUpdating,\n hasError: this.hasError,\n className: config.className,\n viewState: {\n isShowAddress: this.currentOperation === AddressOperation.Show && this.selectedAddress,\n isShowAddresList: this.currentOperation === AddressOperation.List && this.customerAddresses.length > 0,\n isShowAddOrUpdateAddress:\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update\n },\n CheckoutShippingAddress: {\n moduleProps: this.props,\n className: classnames('ms-checkout-shipping-address', config.className)\n },\n showAddress: this._renderShowAddress(),\n\n /**\n * Show address select.\n * @param onAddAddressHandler - On add address click function.\n * @param onSaveHandler - On save click function.\n * @param onCancelHandler - On cancel click function.\n * @returns - Renders select address.\n */\n showAddressSelectHandler: (\n onAddAddressHandler?: () => void,\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ) => this._renderSelectAddress(onAddAddressHandler, onSaveHandler, onCancelHandler),\n\n /**\n * Show add/update address.\n * @param onSaveHandler - On save click function.\n * @param onCancelHandler - On cancel click function.\n * @returns - Renders select address.\n */\n showAddOrUpdateAddressHandler: (\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ) => this._renderAddOrUpdateAddress(onSaveHandler, onCancelHandler),\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress(),\n cartLineImages: isRetailMultiplePickUpOptionEnabled ? cartLineImages : undefined,\n showAddressSelect: this._renderSelectAddress()\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Method data initialization.\n * @param props -The checkout address properties.\n */\n private readonly _dataInitialize = (props: ICheckoutAddressProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.address.result,\n () => {\n this.customerAddresses = data.address.result ?? [];\n }\n );\n\n reaction(\n () => data.countryStates.result,\n () => {\n this.stateProvinceInfo = data.countryStates.result ?? [];\n }\n );\n\n reaction(\n () => data.featureState.result,\n () => {\n this.retailMultiplePickUpOptionEnabled =\n data.featureState.result?.find(feature => feature.Name === this.multiplePickupStoreSwitchName)?.IsEnabled;\n }\n );\n };\n\n /**\n * Method to get cart lines for delivery.\n * @returns The cart line collection.\n */\n private readonly _getCartLinesforDelivery = (): CartLine[] => {\n return this.props.data.checkout.result?.checkoutCart.cart.CartLines?.filter(line => this._isDelivery(line)) ?? [];\n };\n\n /**\n * Method to check cart line for delivery.\n * @param line -The cart line.\n * @returns True/false as per cart line delivery mode.\n */\n private readonly _isDelivery = (line: CartLine): boolean => {\n return this._isNotPickupMode(line.DeliveryMode) && (line.FulfillmentStoreId === undefined || line.FulfillmentStoreId === '');\n };\n\n /**\n * Method to check cart line for delivery.\n * @param deliveryMode -The delivery mode.\n * @returns True/false as per cart line delivery mode.\n */\n private readonly _isNotPickupMode = (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)?.IsEnabled;\n if (retailMultiplePickUpOptionEnabled && deliveryMode !== undefined) {\n const pickupDeliveryMode = channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.some(pickupMode => pickupMode !== deliveryMode);\n return pickupDeliveryMode !== undefined ? pickupDeliveryMode : false;\n }\n return deliveryMode !== undefined && pickupDeliveryModeCode !== undefined && (deliveryMode !== pickupDeliveryModeCode);\n };\n\n /**\n * Method to check cart line for delivery.\n * @param channelId - The channelId.\n * @param cartLines - Cart line collections.\n * @returns Collection of SimpleProduct.\n */\n private readonly _getProductsByCartLines = async (channelId: number, cartLines: CartLine[]): Promise => {\n const actionContext = this.props.context.actionContext;\n const productInputs = cartLines.filter(line => !ObjectExtensions.isNullOrUndefined(line.ProductId))\n .map(line => new ProductInput(line.ProductId || 0, actionContext.requestContext.apiSettings, channelId, undefined,\n actionContext.requestContext));\n return getSimpleProducts(productInputs, actionContext);\n };\n\n /**\n * Method to render add/update address.\n * @param onSaveHandler -- Handles onsave functionality.\n * @param onCancelHandler -- Handles oncancel functionality.\n * @returns Address app/update props.\n */\n private readonly _renderAddOrUpdateAddress = (\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ): IAddressAddUpdateProps => {\n const addressFormat = this.currentOperation === AddressOperation.Add && this.addressCommon.isAuthenticatedFlow() ? this.addressFormat : this.addressFormat;\n\n /**\n * On Cancel Button Function.\n */\n const onCancelButtonHandler = () => {\n this._resetView();\n onCancelHandler?.();\n };\n return AddressAddUpdate({\n isUpdating: this.isUpdating,\n resources: this.resources,\n addressType: AddressType.Shipping,\n addressFormat: addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n validationError: this.validationError,\n hasError: this.hasError,\n addressActionResponse: this.addressActionResponse,\n telemetryContent: this.telemetryContent,\n dropdownDisplayData: addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n\n /**\n * On Save Function.\n */\n onSave: () => {\n this.onSubmit();\n onSaveHandler?.();\n },\n\n onCancel: !this.selectedAddress && !this.addressCommon.isAuthenticatedFlow() ? () => {} : onCancelButtonHandler\n });\n };\n\n /**\n * Method to render select address.\n * @param onAddAddressHandler - To handle add address button click.\n * @param onSaveHandler - To handle save button click.\n * @param onCancelHandler - To handle cancel button click.\n * @returns Select address props.\n */\n private readonly _renderSelectAddress = (\n onAddAddressHandler?: () => void,\n onSaveHandler?: () => void,\n onCancelHandler?: () => void\n ): IAddressSelectProps => {\n\n /**\n * On Cancel Button Function.\n */\n const onCancelButtonHandler = () => {\n this._resetView();\n onCancelHandler?.();\n };\n return AddressSelect({\n addressFormat: this.addressFormat,\n addresses: this.customerAddresses,\n resources: this.resources,\n addressPurposes: this.addressPurposes,\n selectedAddress: this.addressListSelectedAddress,\n onAddressOptionChange: this._onAddressOptionChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n telemetryContent: this.telemetryContent,\n\n /**\n * On Add Address Function.\n */\n onAddAddress: () => {\n this._goToAddAddress();\n onAddAddressHandler?.();\n },\n\n /**\n * On Save Function.\n */\n onSave: () => {\n this._onSelectAddress();\n onSaveHandler?.();\n },\n\n onCancel: !this.selectedAddress ? () => {} : onCancelButtonHandler\n });\n };\n\n /**\n * Method to render show address.\n * @returns Show address props.\n */\n private _renderShowAddress(): IAddressShowProps | null {\n if (this.selectedAddress) {\n return AddressShow({\n address: this.selectedAddress,\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName || ''),\n addressPurposes: this.addressPurposes\n });\n }\n\n return null;\n }\n\n /**\n * Method to render map auto suggest.\n */\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded) {\n this.autoSuggest?.attachAutoSuggest('#shipping_addressstreet', '#shipping_addressstreet_container', this._onSuggestionSelected);\n }\n };\n\n /**\n * Method gets called on address option change.\n * @param event - To get current option.\n */\n private readonly _onAddressOptionChange = (event: React.ChangeEvent) => {\n const addressRecordId = event.currentTarget.value;\n const selectedAddress = this.customerAddresses.find(address => (address.RecordId || '').toString() === addressRecordId);\n if (selectedAddress) {\n this.addressListSelectedAddress = selectedAddress;\n }\n };\n\n /**\n * Method to render map auto suggest.\n * @param name - Address name field.\n * @param value - Address name value field.\n */\n private readonly onAddressAddUpdate = (name: string, value: string | boolean) => {\n set(this.addUpdateAddress, { [name]: value });\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\n };\n\n /**\n * Method to get called on address update change.\n * @param event - Input element.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n if (event.target.type === 'checkbox') {\n this.onAddressAddUpdate(event.target.name, event.target.checked);\n } else {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n this.onAddressAddUpdate(event.target.name, value);\n }\n };\n\n /**\n * Method to get called on address update dropdown change.\n * @param event - Select element.\n */\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\n this.onAddressAddUpdate(event.target.name, event.target.value);\n\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n this._onCountryChange(event.target.value);\n }\n };\n\n /**\n * Method to get called on address update submit.\n */\n private readonly _onAddressAddUpdateSubmit = (): void => {\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n return;\n }\n\n let response: Promise;\n if (this.addressCommon.isAuthenticatedFlow() && this._isNewAddress(this.addUpdateAddress)) {\n response =\n this.currentOperation === AddressOperation.Update ? this.addressCommon.updateCustomerAddress(\n this.addUpdateAddress\n ) : this.addressCommon.addCustomerAddress(\n this.addUpdateAddress\n );\n } else {\n response = Promise.resolve({ address: this.addUpdateAddress });\n }\n\n this.isUpdating = true;\n this._updateModuleState();\n\n response.then(\n (result: IAddressResponse) => {\n this.isUpdating = false;\n\n let newAddress = result.address;\n newAddress = { ...newAddress, ...this.addUpdateAddress };\n\n if (result.address) {\n this.hasError = false;\n if (result.customerAddresses) {\n this._onAddOrUpdateSuccess({ customerAddresses: result.customerAddresses, address: newAddress });\n } else {\n this._onAddOrUpdateSuccess({ address: newAddress });\n }\n } else {\n this.hasError = true;\n this.addressActionResponse = result;\n this._updateModuleState();\n }\n },\n () => {\n this.hasError = true;\n this.isUpdating = false;\n this._updateModuleState();\n }\n );\n };\n\n /**\n * Method to get called on country change.\n * @param countryRegionId - Country region id.\n */\n private readonly _onCountryChange = (countryRegionId: string) => {\n this.countryRegionId = countryRegionId;\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\n this._clearAddressFields();\n };\n\n /**\n * Method to get all address format exclude list.\n * @returns Collection of address items.\n */\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\n const { config } = this.props;\n const addressFormatExcludeList: AddressItemType[] = [];\n\n if (!config.showAddressType) {\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\n }\n\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\n\n return addressFormatExcludeList;\n };\n\n /**\n * Method to get all state/provinces.\n */\n private readonly _getStateProvinces = (): void => {\n if (\n !this.countryRegionId ||\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\n ) {\n return;\n }\n\n this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n set(this.addUpdateAddress, { State: '' });\n }\n\n this.stateProvinceInfo = result;\n });\n };\n\n /**\n * Method to set default country region id.\n */\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request.channel?.ChannelCountryRegionISOCode;\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\n }\n\n /**\n * Method to get default address region id.\n * @returns - Address object from existing addresses.\n */\n private readonly _getDefaultAddress = (): Address | undefined => {\n if (this.customerAddresses) {\n const primaryAddress = this.customerAddresses.find((address: Address) => address.IsPrimary);\n return primaryAddress || (this.customerAddresses.length > 0 ? this.customerAddresses[0] : undefined);\n }\n return undefined;\n };\n\n /**\n * Method to get address from express payment details from cart page.\n * @returns - Address.\n */\n private readonly _getAddressFromCartExpressPaymentDetails = (): Address | undefined => {\n if (this.expressPaymentDetailsFromCartPage) {\n const { tokenizedPaymentCard, address, isExpressAddressAppliedInCartPage } = this.expressPaymentDetailsFromCartPage;\n\n let addressFromCartExpress: Address | undefined;\n\n if (isExpressAddressAppliedInCartPage) {\n addressFromCartExpress = address ? this.getExpressAddress(address) : undefined;\n } else {\n addressFromCartExpress = tokenizedPaymentCard ? this.getAddressFromTokenizedPaymentCard(tokenizedPaymentCard) : undefined;\n }\n\n return addressFromCartExpress;\n }\n return undefined;\n };\n\n /**\n * Get address from tokenizedPaymentCard.\n * @param tokenizedPaymentCard -- The tokenizedPaymentCard from the payment.\n * @returns The address.\n */\n private readonly getAddressFromTokenizedPaymentCard = (tokenizedPaymentCard: TokenizedPaymentCard): Address => {\n const twoLetterIsoRegionName = tokenizedPaymentCard.Country;\n\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n\n const address: Address = {\n TwoLetterISORegionName: twoLetterIsoRegionName,\n Name: tokenizedPaymentCard.NameOnCard,\n Street: tokenizedPaymentCard.Address1,\n StreetNumber: tokenizedPaymentCard.Address2,\n City: tokenizedPaymentCard.City,\n State: tokenizedPaymentCard.State,\n ZipCode: tokenizedPaymentCard.Zip,\n Phone: tokenizedPaymentCard.Phone,\n ThreeLetterISORegionName: threeLetterIsoRegionName,\n AddressTypeValue: this.defaultAddressType\n };\n\n return address;\n };\n\n /**\n * Get address from expressAddress.\n * @param expressAddress -- The expressAddress.\n * @returns The address.\n */\n private readonly getExpressAddress = (expressAddress: Address): Address => {\n const twoLetterIsoRegionName = expressAddress.TwoLetterISORegionName;\n\n const threeLetterIsoRegionName = twoLetterIsoRegionName ? this.getThreeLetterIsoRegionName(twoLetterIsoRegionName) : undefined;\n\n if (threeLetterIsoRegionName && threeLetterIsoRegionName !== this.countryRegionId) {\n this._onCountryChange(threeLetterIsoRegionName);\n }\n\n const address: Address = {\n ...expressAddress,\n ThreeLetterISORegionName: threeLetterIsoRegionName,\n AddressTypeValue: this.defaultAddressType\n };\n\n return address;\n };\n\n /**\n * Get three letter ISO region name from two letter ISO region name.\n * @param twoLetterIsoRegionName -- The three letter ISO region name.\n * @returns The three letter ISO region name.\n */\n private readonly getThreeLetterIsoRegionName = (twoLetterIsoRegionName: string): string | undefined => {\n\n const countryRegion = this.countryRegions.find(country => {\n return (country.ISOCode?.toLowerCase() === twoLetterIsoRegionName.toLowerCase());\n });\n\n return countryRegion?.CountryRegionId;\n };\n\n /**\n * Method to initialize all module state.\n */\n private readonly _initModuleState = (): void => {\n this.props.moduleState.init({\n status: this._canShip() ? 'updating' : 'disabled',\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit\n });\n\n const checkoutState = this.props.data.checkout.result;\n\n if (this._canShip()) {\n let defaultAddress;\n\n if (checkoutState?.checkoutCart.cart.ShippingAddress) {\n defaultAddress = checkoutState.checkoutCart.cart.ShippingAddress;\n } else if (this._getAddressFromCartExpressPaymentDetails()) {\n defaultAddress = this._getAddressFromCartExpressPaymentDetails();\n } else if (this._getDefaultAddress()) {\n defaultAddress = this._getDefaultAddress();\n } else {\n defaultAddress = checkoutState?.isExpressCheckoutApplied ? checkoutState.shippingAddressFromExpressCheckout : undefined;\n }\n\n if (defaultAddress && !this.addressCommon.isEmpty(defaultAddress)) {\n this._updateCurrentOperation(AddressOperation.Show, defaultAddress);\n this._setShippingAddress(defaultAddress);\n this._updateModuleState();\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: true });\n } else {\n this._updateCurrentOperation(AddressOperation.Add);\n checkoutState?.updateHasShippingAddress({ newHasShippingAddress: false });\n }\n }\n };\n\n /**\n * Method get called on submit address.\n */\n private readonly onSubmit = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._onAddressAddUpdateSubmit();\n break;\n case AddressOperation.List:\n this._onSelectAddress();\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * Method get called on cancel.\n */\n private readonly onCancel = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._clearAddressFields();\n if (!(!this.selectedAddress && !this.addressCommon.isAuthenticatedFlow())) {\n this._resetView();\n }\n\n break;\n case AddressOperation.List:\n if (this.selectedAddress) {\n this._resetView();\n }\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * Method get called on edit address.\n */\n private readonly onEdit = (): void => {\n if (this.addressCommon.isAuthenticatedFlow() && this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.List, this.shippingAddress);\n } else if (this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.Update, this.shippingAddress);\n }\n\n this._updateModuleState();\n };\n\n /**\n * Method to check if checkout cartlines are available fro shipping.\n * @returns - True/false as per the delivery mode.\n */\n private readonly _canShip = (): boolean => {\n const { checkout, channelDeliveryOptionConfig } = this.props.data;\n const { request } = this.props.context;\n const pickupDeliveryModeCode = request && request.channel && request.channel.PickupDeliveryModeCode;\n const emailDeliveryModeCode = request && request.channel && request.channel.EmailDeliveryModeCode;\n if (!checkout.result || !request.channel || checkout.result.checkoutCart.isEmpty || checkout.result.checkoutCart.hasInvoiceLine) {\n return false;\n }\n\n // @ts-expect-error: Type-checker not realizing above request.channel check\n return this.retailMultiplePickUpOptionEnabled ? checkout.result.checkoutCart.cart.CartLines?.some(\n cartLine => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (cartLine.DeliveryMode !== channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLine.DeliveryMode) &&\n cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\n ) : checkout.result.checkoutCart.cart.CartLines?.some(\n cartLine => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (cartLine.DeliveryMode !== pickupDeliveryModeCode &&\n cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\n );\n };\n\n /**\n * Method get called on select address.\n */\n private readonly _onSelectAddress = () => {\n this._updateCurrentOperation(AddressOperation.Show, this.addressListSelectedAddress);\n this._setShippingAddress(this.addressListSelectedAddress);\n this._updateModuleState();\n };\n\n /**\n * Method get called on goto add address.\n */\n private readonly _goToAddAddress = () => {\n this._setDefaultCountryRegionId();\n this._updateCurrentOperation(AddressOperation.Add);\n };\n\n /**\n * Method get called on add/update success.\n * @param response - Retail api response.\n */\n private readonly _onAddOrUpdateSuccess = (response: IAddressResponse) => {\n if (response.customerAddresses) {\n this.customerAddresses = response.customerAddresses;\n }\n\n if (response.address) {\n this._updateCurrentOperation(AddressOperation.Show, response.address);\n this._setShippingAddress(response.address);\n this._updateModuleState();\n }\n };\n\n /**\n * Method get called on set Shipping Address.\n * @param address - Retail Api address result.\n */\n private readonly _setShippingAddress = (address: Address): void => {\n if (this.props.data.checkout.result) {\n const newShippingAddress = { ...address };\n\n if (address.ThreeLetterISORegionName && !newShippingAddress.TwoLetterISORegionName) {\n newShippingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\n }\n\n this.props.data.checkout.result.updateShippingAddress({ newShippingAddress });\n this.props.data.checkout.result.checkoutCart.updateShippingAddress({ newShippingAddress })\n .catch(error => {\n this.props.telemetry.error(error);\n });\n }\n };\n\n @computed private get shippingAddress(): Address | undefined {\n return this.props.data.checkout.result?.shippingAddress;\n }\n\n /**\n * Method get called on reset view.\n */\n private readonly _resetView = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._updateCurrentOperation(\n this.addressCommon.isAuthenticatedFlow() ? AddressOperation.List : AddressOperation.Show,\n this.shippingAddress\n );\n break;\n default:\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n }\n this._updateModuleState();\n };\n\n /**\n * Update current operation.\n * @param operation - The address operation.\n * @param selectedAddress - The selected address.\n */\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\n this.currentOperation = operation;\n this.selectedAddress = selectedAddress;\n\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n this.addUpdateAddress = { ...this.selectedAddress } || {};\n set(this.addUpdateAddress, {\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n });\n set(this.addUpdateAddress, {\n AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType\n });\n } else if (this.currentOperation === AddressOperation.List) {\n this.addressListSelectedAddress = { ...this.selectedAddress } || {};\n }\n };\n\n /**\n * Update module state.\n */\n private readonly _updateModuleState = () => {\n if (this.currentOperation === AddressOperation.Show) {\n this.props.moduleState.onReady();\n } else if (this.isUpdating) {\n this.props.moduleState.onPending();\n } else {\n this.props.moduleState.onUpdating();\n }\n };\n\n /**\n * Method to check if the customer already has the address.\n * @param address - The address.\n */\n private readonly _isNewAddress = (address: Address): boolean => {\n for (const existingAddress of this.customerAddresses) {\n if ((address.Name ?? '') === existingAddress.Name &&\n (address.Street ?? '') === existingAddress.Street &&\n (address.StreetNumber ?? '') === existingAddress.StreetNumber &&\n (address.City ?? '') === existingAddress.City &&\n (address.State ?? '') === existingAddress.State &&\n (address.ZipCode ?? '') === existingAddress.ZipCode &&\n (address.Phone ?? '') === existingAddress.Phone &&\n (address.ThreeLetterISORegionName ?? '') === existingAddress.ThreeLetterISORegionName &&\n (address.AddressTypeValue ?? '') === existingAddress.AddressTypeValue) {\n return false;\n }\n }\n\n return true;\n }\n}\n\nexport default CheckoutShippingAddress;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport CheckoutShippingAddress from './checkout-shipping-address';\nimport CheckoutShippingAddressView from './checkout-shipping-address.view';\n\nexport * from './checkout-shipping-address';\nexport * from './checkout-shipping-address.data';\nexport { ICheckoutShippingAddressConfig, ICheckoutShippingAddressProps, ICheckoutShippingAddressResources } from './checkout-shipping-address.props.autogenerated';\nexport * from './checkout-shipping-address.view';\n\nexport {\n CheckoutShippingAddress,\n CheckoutShippingAddressView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, GiftCard, TenderLine, TokenizedPaymentCard } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { action, computed, observable } from 'mobx';\n\n/**\n * State information related to what is needed to succesfully perform a checkout.\n */\nexport class CheckoutState {\n @observable private _tokenizedPaymentCard: TokenizedPaymentCard | undefined ;\n\n @computed public get tokenizedPaymentCard(): Readonly | undefined {\n return this._tokenizedPaymentCard;\n }\n\n @observable private _tenderLine: TenderLine | undefined;\n\n @computed public get tenderLine(): Readonly | undefined {\n return this._tenderLine;\n }\n\n @observable private _billingAddress: Address | undefined ;\n\n @computed public get billingAddress(): Readonly
| undefined {\n return this._billingAddress;\n }\n\n @observable private _shippingAddress: Address | undefined;\n\n @computed public get shippingAddress(): Readonly
| undefined {\n return this._shippingAddress;\n }\n\n @observable private _cardPrefix: string | undefined;\n\n @computed public get cardPrefix(): Readonly | undefined {\n return this._cardPrefix;\n }\n\n @observable private _giftCards: GiftCard[] = [];\n\n @computed public get giftCards(): readonly GiftCard[] {\n return this._giftCards;\n }\n\n @observable private _giftCardExtends: IGiftCardExtend[] = [];\n\n @computed public get giftCardExtends(): readonly IGiftCardExtend[] {\n return this._giftCardExtends;\n }\n\n @observable private _loyaltyCardNumber?: string;\n\n @computed public get loyaltyCardNumber(): Readonly | undefined {\n return this._loyaltyCardNumber;\n }\n\n @observable private _loyaltyAmount: number = 0;\n\n @computed public get loyaltyAmount(): Readonly | number {\n return this._loyaltyAmount;\n }\n\n @observable private _guestCheckoutEmail: string = '';\n\n @computed public get guestCheckoutEmail(): Readonly | string {\n return this._guestCheckoutEmail;\n }\n\n @observable private _isTermsAndConditionAccepted: boolean = false;\n\n @computed public get isTermsAndConditionAccepted(): Readonly | boolean {\n return this._isTermsAndConditionAccepted;\n }\n\n @observable private _customerAccountAmount: number = 0;\n\n @computed public get customerAccountAmount(): Readonly | number {\n return this._customerAccountAmount;\n }\n\n @action\n public updateTokenizedPaymentCard(newTokenizedPaymentCard: TokenizedPaymentCard): void {\n this._tokenizedPaymentCard = newTokenizedPaymentCard;\n }\n\n @action\n public updateTenderLine(newTenderLine: TenderLine | undefined): void {\n this._tenderLine = newTenderLine;\n }\n\n @action\n public updateShippingAddress(newShippingAddress: Address): void {\n this._shippingAddress = newShippingAddress;\n }\n\n @action\n public updateBillingAddress(newBillingAddress: Address): void {\n this._billingAddress = newBillingAddress;\n }\n\n @action\n public updateCardPrefix(newCardPrefix: string): void {\n this._cardPrefix = newCardPrefix;\n }\n\n @action\n public removeGiftCard(giftCardNumber: string): void {\n this._giftCards = this._giftCards.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public removeGiftCardExtend(giftCardNumber: string): void {\n this._giftCardExtends = this._giftCardExtends.filter(giftCard => giftCard.Id !== giftCardNumber);\n }\n\n @action\n public addGiftCard(giftCard: GiftCard): void {\n this._giftCards = [giftCard, ...this._giftCards];\n }\n\n @action\n public addGiftCardExtend(giftCard: IGiftCardExtend): void {\n this._giftCardExtends = [giftCard, ...this._giftCards];\n }\n\n @action\n public updateLoyaltyCardNumber(newLoyaltyCardNumber: string): void {\n this._loyaltyCardNumber = newLoyaltyCardNumber;\n }\n\n @action\n public updateLoyaltyAmount(newAmount: number): void {\n this._loyaltyAmount = newAmount;\n }\n\n @action\n public updateGuestCheckoutEmail(newGuestCheckoutEmail: string): void {\n this._guestCheckoutEmail = newGuestCheckoutEmail;\n }\n\n @action\n public updateTermsAndConditionsAcceptance(newIsTermsAndConditionAccepted: boolean): void {\n this._isTermsAndConditionAccepted = newIsTermsAndConditionAccepted;\n }\n\n @action\n public updateCustomerAccountAmount(newAmount: number): void {\n this._customerAccountAmount = newAmount;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IBusinessAccountAddressViewProps } from './business-account-address';\n\n/**\n * Address Add Update Component.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address Heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - IAddressError.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns - AddressForm Node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n \n {label}\n {hasError && alert}\n {input}\n \n );\n })}\n {hasError &&\n \n {error.title}\n {error.message}\n }\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Business Account Address View Component.\n * @param props - Props.\n * @returns - BusinessAccountAddress Module.\n */\nconst BusinessAccountAddressView: React.FC = props => {\n const { BusinessAccountAddress, showAddOrUpdateAddress } = props;\n\n return (\n \n \n \n );\n};\n\nexport default BusinessAccountAddressView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAdressDropdown {\n id: string;\n name: string;\n className: string;\n value: string | number;\n additionalAddributes?: object;\n displayData: { key?: string | number; value?: string }[];\n onChange(event: React.ChangeEvent): void;\n}\n\nconst getDropdownItem = (key?: string | number, value?: string, selectedValue?: string | number): React.ReactNode => {\n let isSelected: boolean;\n if (typeof (key) === 'number') {\n isSelected = key === selectedValue;\n } else {\n isSelected = typeof (selectedValue) === 'string' && (key || '').toLowerCase() === (selectedValue || '').toLowerCase();\n }\n\n return (\n \n );\n};\n\n/**\n * Address dropdown.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressDropdownFunctionComponent: React.FC = (props: IAdressDropdown) => {\n const {\n id: itemId,\n name,\n className,\n value,\n additionalAddributes,\n displayData,\n onChange\n } = props;\n\n return (\n \n {displayData && displayData.map(item => (\n getDropdownItem(item.key, item.value, value)\n ))}\n \n );\n};\n\nexport default AddressDropdownFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAddressBillingHeading {\n text: string;\n}\n\nexport const AddressBillingHeading: React.FC = ({\n text\n}) => (\n

\n {text}\n

\n);\n\nexport default IAddressBillingHeading;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\nimport { getTelemetryObject, IModuleProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport { action, computed, observable, reaction, set } from 'mobx';\nimport { observer } from 'mobx-react';\nimport * as React from 'react';\n\nimport { AutoSuggest } from '../../common/address-autosuggest';\nimport { IAutoSuggestOptions } from '../../common/address-autosuggest.data';\nimport { AddressCommon } from '../../common/address-common';\nimport { AddressFormat } from '../../common/address-format';\nimport { AddressItemType } from '../../common/address-format.data';\nimport { AddressMetaData } from '../../common/address-meta-data';\nimport { AddressOperation, AddressType, IAddressResource, IAddressResponse } from '../../common/address-module.data';\nimport { AddressAddUpdate, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { AddressBillingCheckbox } from '../../common/components/address-billing-checkbox';\nimport { AddressBillingHeading } from '../../common/components/address-billing-heading';\nimport { AddressShow, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutBillingAddressData } from './checkout-billing-address.data';\nimport { ICheckoutBillingAddressProps } from './checkout-billing-address.props.autogenerated';\n\n/**\n * Props interface.\n */\nexport interface IProps extends ICheckoutBillingAddressProps, IModuleStateProps { }\n\n/**\n * Checkout billing address view state interface.\n */\nexport interface ICheckoutBillingAddressViewState {\n isShowAddress: boolean;\n isShowAddOrUpdateAddress: boolean;\n isShowSameAsShippingCheckbox: boolean;\n}\n\n/**\n * Checkout billing address view props interface.\n */\nexport interface ICheckoutBillingAddressViewProps extends IProps {\n className: string;\n currentOperation: AddressOperation;\n selectedAddress?: Address;\n addUpdateAddress: Address;\n countryRegionId: string;\n stateProvinceInfo?: StateProvinceInfo[];\n validationError: object;\n addressActionResponse?: IAddressResponse;\n viewState: ICheckoutBillingAddressViewState;\n CheckoutBillingAddress: IModuleProps;\n sameAsShippingCheckbox: React.ReactNode;\n heading: React.ReactNode;\n showAddress: IAddressShowProps;\n showAddOrUpdateAddress: IAddressAddUpdateProps;\n}\n\n/**\n *\n * CheckoutBillingAddress component.\n * @extends {React.PureComponent>}\n */\n// @ts-expect-error\n@withModuleState\n@observer\nclass CheckoutBillingAddress extends React.Component {\n\n @observable private currentOperation: AddressOperation;\n\n @observable private isBillingAddressSameAsShipping: boolean;\n\n @observable private selectedAddress?: Address;\n\n @observable private addUpdateAddress: Address;\n\n @observable private countryRegionId: string = 'USA';\n\n @observable private stateProvinceInfo?: StateProvinceInfo[];\n\n @observable private validationError: object;\n\n @observable private readonly addressActionResponse?: IAddressResponse;\n\n private readonly addressCommon: AddressCommon;\n\n private addressFormat: AddressFormat;\n\n private countryRegions: CountryRegionInfo[] = [];\n\n private addressPurposes: AddressPurpose[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly defaultAddressType: number = 6; // Default to Home\n\n // private addRenderRef: React.RefObject;\n private readonly telemetryContent?: ITelemetryContent;\n\n private autoSuggest?: AutoSuggest;\n\n public constructor(props: IProps) {\n super(props);\n const { context, data, resources, telemetry } = this.props;\n\n this.addUpdateAddress = {};\n this.validationError = {};\n this.isBillingAddressSameAsShipping = false;\n this.resources = resources;\n this.currentOperation = AddressOperation.List;\n this.addressPurposes = data.addressPurposes.result || [];\n this.countryRegions = data.countryRegions.result || [];\n this.stateProvinceInfo = data.countryStates.result || [];\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources },\n this._getAddressFormatExcludeList()\n ),\n this.addressPurposes);\n this.telemetryContent = getTelemetryObject(this.props.context.request.telemetryPageName!, this.props.friendlyName, this.props.telemetry);\n\n // This.addRenderRef = React.createRef();\n }\n\n /**\n * On suggestion selected.\n * @param result - The suggestion result.\n */\n @action\n private readonly _onSuggestionSelected = async (result: Microsoft.Maps.ISuggestionResult): Promise => {\n this._clearAddressFields();\n const address = this.addressFormat.getTranformedAddress(result, this.stateProvinceInfo);\n set(this.addUpdateAddress, { Street: '' });\n set(this.addUpdateAddress, { ZipCode: address.ZipCode });\n set(this.addUpdateAddress, { CountyName: address.CountyName });\n set(this.addUpdateAddress, { City: address.City });\n set(this.addUpdateAddress, { State: address.State });\n set(this.addUpdateAddress, { DistrictName: address.DistrictName });\n set(this.addUpdateAddress, { FullAddress: address.FullAddress });\n\n // Bing autosuggest put the complete address in the Street input box. Updating the street input box to show only street address.\n setTimeout(() => {\n set(this.addUpdateAddress, { Street: address.Street });\n }, 0);\n\n };\n\n /**\n * Clear address fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId);\n addressFormatItem.forEach(format => {\n if (this.addUpdateAddress[format.name] !== undefined && !this.autoSuggest?.excludedAddressFields.includes(format.name)) {\n this.addressFormat[format.name] = '';\n }\n });\n this._clearValidation();\n };\n\n /**\n * Clear validation.\n */\n @action\n private readonly _clearValidation = (): void => {\n this.validationError = {};\n };\n\n public async componentDidMount(): Promise {\n\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: {\n channel\n }\n }\n },\n config: {\n autoSuggestionEnabled,\n autoSuggestOptions\n }\n } = this.props;\n\n // Initializing data props\n this._dataInitialize(this.props);\n\n this.props.data.checkout.then(() => {\n this._setDefaultCountryRegionId();\n this._initModuleState();\n });\n\n reaction(\n () => this.countryRegionId,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.currentOperation,\n () => {\n this._getStateProvinces();\n }\n );\n\n reaction(\n () => this.props.data.checkout.result && this.props.data.checkout.result.shippingAddress,\n shippingAddress => {\n if (this.props.moduleState.isUpdating) {\n if (shippingAddress && this.isBillingAddressSameAsShipping) {\n this.isBillingAddressSameAsShipping = true;\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\n } else if (shippingAddress && this.isBillingAddressSameAsShipping) {\n this._updateCurrentOperation(AddressOperation.Show, shippingAddress);\n }\n }\n }\n );\n\n reaction(\n () => this.isBillingAddressRequried,\n isBillingAddressRequried => {\n if (isBillingAddressRequried) {\n if (this.props.moduleState.isDisabled) {\n this.onEdit();\n }\n } else {\n this.props.data.checkout.result?.removeBillingAddress({});\n this.props.moduleState.onDisable();\n }\n }\n );\n\n if (autoSuggestionEnabled) {\n\n if (channel && !channel.BingMapsApiKey) {\n telemetry.error('BingMapsApiKey is missing.');\n return;\n }\n\n if (channel && !channel.BingMapsEnabled) {\n telemetry.error('Map is disabled from HQ.');\n return;\n }\n\n const options: IAutoSuggestOptions = { ...autoSuggestOptions };\n this.autoSuggest = new AutoSuggest(telemetry, options, channel?.BingMapsApiKey, channel?.ChannelCountryRegionISOCode, channel?.DefaultLanguageId);\n\n // Customer doesn't have any address. Then add view will be loaded directly. Code for the same to handle that\n if (this.props.data.storeSelectorStateManager.result && (\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update\n )) {\n await this.autoSuggest._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.loadMapApi && (\n this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update\n ),\n async () => {\n await this.autoSuggest?._loadMapAPI(await this.props.data.storeSelectorStateManager);\n }\n );\n\n reaction(\n () => this.props.data.storeSelectorStateManager.result?.isMapApiLoaded,\n async () => {\n await this._attachMapAutoSuggest();\n }\n );\n }\n }\n\n public async componentDidUpdate(): Promise {\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n if (this.props.data.storeSelectorStateManager.result?.isMapApiLoaded) {\n await this._attachMapAutoSuggest();\n }\n } else {\n this.autoSuggest?.disposeAutoSuggest();\n }\n }\n\n public shouldComponentUpdate(nextProps: ICheckoutBillingAddressProps, nextState: ICheckoutBillingAddressViewState): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n\n }\n\n public render(): JSX.Element | null {\n if (!(this.isBillingAddressRequried)) {\n return null;\n }\n\n const { resources } = this.props;\n\n const { renderView, config } = this.props;\n\n const viewProps = {\n ...this.props,\n currentOperation: this.currentOperation,\n selectedAddress: this.selectedAddress,\n addUpdateAddress: this.addUpdateAddress,\n countryRegionId: this.countryRegionId,\n stateProvinceInfo: this.stateProvinceInfo,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n className: config.className,\n viewState: {\n isShowAddress: this.selectedAddress && this.currentOperation === AddressOperation.Show,\n isShowAddOrUpdateAddress: this.currentOperation !== AddressOperation.Show,\n isShowSameAsShippingCheckbox: this.isCartContainsItemsForShipping && this.props.moduleState.isUpdating\n },\n CheckoutBillingAddress: {\n moduleProps: this.props,\n className: classnames('ms-checkout-billing-address', config.className)\n },\n heading: ,\n\n sameAsShippingCheckbox: (\n \n ),\n showAddress: this._renderShowAddress(),\n showAddOrUpdateAddress: this._renderAddOrUpdateAddress()\n };\n\n return renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * On address update.\n * @param name - Name.\n * @param value - Value.\n */\n private readonly onAddressAddUpdate = (name: string, value: string) => {\n set(this.addUpdateAddress, { [name]: value });\n this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId, name);\n };\n\n /**\n * Method data initialization.\n * @param props -The checkout address properties.\n */\n private readonly _dataInitialize = (props: IProps): void => {\n const { data } = props;\n\n reaction(\n () => data.countryRegions.result,\n () => {\n this.countryRegions = data.countryRegions.result ?? [];\n }\n );\n\n reaction(\n () => data.addressPurposes.result,\n () => {\n this.addressPurposes = data.addressPurposes.result ?? [];\n }\n );\n\n reaction(\n () => data.countryStates.result,\n () => {\n this.stateProvinceInfo = data.countryStates.result ?? [];\n }\n );\n };\n\n /**\n * Render add or update address function.\n * @returns - Address add update props.\n */\n private readonly _renderAddOrUpdateAddress = (): IAddressAddUpdateProps => {\n return AddressAddUpdate(\n {\n resources: this.resources,\n addressType: AddressType.Billing,\n addressFormat: this.addressFormat.getAddressFormat((this.addUpdateAddress.ThreeLetterISORegionName) ?? this.countryRegionId),\n defaultCountryRegionId: this.countryRegionId,\n defaultAddressType: this.defaultAddressType,\n selectedAddress: this.addUpdateAddress,\n validationError: this.validationError,\n addressActionResponse: this.addressActionResponse,\n dropdownDisplayData: this.addressFormat.getPrefilledAddressDropdownData(\n this.resources.addressStateDefaultSelectionText,\n this.stateProvinceInfo\n ),\n telemetryContent: this.telemetryContent,\n onInputChange: this._onAddressAddUpdateInputChange,\n onDropdownChange: this._onAddressAddUpdateDropdownChange,\n hasExternalSubmitGroup: this.props.moduleState.hasExternalSubmitGroup,\n onSave: this._onSubmitAddress,\n onCancel: this._resetView\n }\n );\n };\n\n private _renderShowAddress(): IAddressShowProps | null {\n if (this.selectedAddress) {\n return AddressShow(\n { address: this.selectedAddress, addressFormat: this.addressFormat.getAddressFormat(\n this.selectedAddress.ThreeLetterISORegionName ?? ''\n ),\n addressPurposes: this.addressPurposes\n }\n );\n }\n\n return null;\n }\n\n /**\n * On country region change function.\n * @param countryRegionId - Country region Id.\n */\n private readonly _onCountryChange = (countryRegionId: string) => {\n this.countryRegionId = countryRegionId;\n const twoLetterIsoRegionName = this.addressFormat.getTwoLetterISORegionName(countryRegionId);\n set(this.addUpdateAddress, { ThreeLetterISORegionName: countryRegionId });\n set(this.addUpdateAddress, { TwoLetterISORegionName: twoLetterIsoRegionName });\n this.autoSuggest?.changeAutoSuggestionCountryCode(twoLetterIsoRegionName);\n this._clearAddressFields();\n };\n\n /**\n * Gets address format for exclude list.\n * @returns - Address item type.\n */\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\n const { config } = this.props;\n const addressFormatExcludeList: AddressItemType[] = [];\n\n if (!config.showAddressType) {\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\n }\n\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\n\n return addressFormatExcludeList;\n };\n\n /**\n * Attach map auto suggest.\n */\n private readonly _attachMapAutoSuggest = async (): Promise => {\n const {\n data: {\n storeSelectorStateManager: { result: storeSelectorStateManager }\n }\n } = this.props;\n\n if (storeSelectorStateManager?.isMapApiLoaded) {\n this.autoSuggest?.attachAutoSuggest('#billing_addressstreet', '#billing_addressstreet_container', this._onSuggestionSelected);\n }\n };\n\n /**\n * On address add update input change.\n * @param event - The event.\n */\n private readonly _onAddressAddUpdateInputChange = (event: React.ChangeEvent): void => {\n const value = (event.target.value || '').replace(new RegExp('[<>]', 'gi'), '');\n this.onAddressAddUpdate(event.target.name, value);\n };\n\n /**\n * On address add update dropdown change.\n * @param event - The event.\n */\n private readonly _onAddressAddUpdateDropdownChange = (event: React.ChangeEvent): void => {\n this.onAddressAddUpdate(event.target.name, event.target.value);\n\n if (event.target.name === AddressItemType[AddressItemType.ThreeLetterISORegionName]) {\n this._onCountryChange(event.target.value);\n }\n };\n\n /**\n * Gets state provinces.\n */\n private readonly _getStateProvinces = (): void => {\n if (!this.countryRegionId || !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)) {\n return;\n }\n\n this.addressCommon.getStateProvinces(this.countryRegionId).then(\n (result: StateProvinceInfo[]) => {\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\n\n // Reset state if selected state not found in the list.\n if (!stateInfo) {\n set(this.addUpdateAddress, { State: '' });\n }\n this.stateProvinceInfo = result;\n });\n };\n\n /**\n * Initialize module state.\n */\n private readonly _initModuleState = (): void => {\n this.props.moduleState.init({\n status: this.isBillingAddressRequried ? 'updating' : 'disabled',\n onEdit: this.onEdit,\n onCancel: this.onCancel,\n onSubmit: this.onSubmit\n });\n\n const { billingAddress, isBillingAddressSameAsShippingAddress } = this.props.data.checkout.result ?? {};\n\n if (this.isBillingAddressRequried) {\n if (billingAddress) {\n this.isBillingAddressSameAsShipping = isBillingAddressSameAsShippingAddress ?? false;\n this._updateCurrentOperation(AddressOperation.Show, billingAddress);\n this._updateModuleState();\n } else if (this.isCartContainsItemsForShipping) {\n this.isBillingAddressSameAsShipping = true;\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this.isBillingAddressSameAsShipping = false;\n this._updateCurrentOperation(AddressOperation.Add);\n }\n }\n };\n\n /**\n * Sets default country region Id.\n */\n private _setDefaultCountryRegionId(): void {\n const { request } = this.props.context;\n const market = request.channel?.ChannelCountryRegionISOCode;\n\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\n }\n\n /**\n * On change - Billing address same as shipping.\n * @param event - The event.\n */\n private readonly _onBillingAddressSameAsShippingChange = (event: React.ChangeEvent) => {\n this.isBillingAddressSameAsShipping = event.currentTarget.checked;\n\n if (this.isBillingAddressSameAsShipping && this.shippingAddress) {\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\n }\n };\n\n @computed private get isCartContainsItemsForShipping(): boolean {\n const { request } = this.props.context;\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\n const retailMultiplePickUpOptionEnabled = featureState.result\n ?.find(feature => feature.Name === multiplePickupStoreSwitchName)?.IsEnabled;\n\n const pickupDeliveryModeCode = request.channel?.PickupDeliveryModeCode;\n const emailDeliveryModeCode = request.channel?.EmailDeliveryModeCode;\n\n // If hasInvoiceLine is true, there are only invoices no items in cart and return false here\n return this.props.data.checkout.result?.checkoutCart.hasInvoiceLine ? false : (retailMultiplePickUpOptionEnabled ? (\n (this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(\n cartLine => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (cartLine.DeliveryMode !== channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(deliveryMode => deliveryMode === cartLine.DeliveryMode) && cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\n ) : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(\n cartLine => ((cartLine.DeliveryMode && cartLine.DeliveryMode !== '') ? (cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode) : cartLine)\n ));\n }\n\n @computed private get billingAddress(): Address | undefined {\n return this.props.data.checkout.result?.billingAddress;\n }\n\n @computed private get shippingAddress(): Address | undefined {\n return this.props.data.checkout.result?.shippingAddress;\n }\n\n @computed private get getLoyaltyAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\n }\n\n @computed private get getGiftCardTotalAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n if (!checkoutState || !checkoutState.giftCardExtends) {\n return 0;\n }\n return checkoutState.giftCardExtends.reduce(\n (count: number, giftCard: IGiftCardExtend) => {\n return count + (giftCard.Balance || 0);\n },\n 0);\n }\n\n @computed private get getCustomerAccountAmount(): number {\n const checkoutState = this.props.data.checkout.result;\n const defaultAmount = 0;\n\n return checkoutState?.customerAccountAmount ?? defaultAmount;\n }\n\n @computed private get shouldPaidByCard(): boolean {\n const {\n data: {\n checkout\n },\n config\n } = this.props;\n if (!checkout.result) {\n return false;\n }\n\n const checkoutResult = checkout.result;\n const cart = checkoutResult.checkoutCart.cart;\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\n return false;\n }\n\n const { paymentTenderType, tokenizedPaymentCard } = checkoutResult;\n const isPaidByOtherPaymentSource = config.paymenTenderType !== paymentTenderType && tokenizedPaymentCard;\n\n // Use payment card when it is not free or gift card balance + Loyalty amount can not cover the total amount\n const amountDue = (cart.TotalAmount || 0) - this.getGiftCardTotalAmount - this.getLoyaltyAmount - this.getCustomerAccountAmount;\n\n return amountDue > 0 && !isPaidByOtherPaymentSource;\n }\n\n @computed private get isBillingAddressRequried(): boolean {\n return this.shouldPaidByCard && (!this.props.data.checkout?.result?.isPaymentVerificationRedirection ||\n !!this.props.data.checkout?.result?.isCheckoutCallFailed);\n }\n\n /**\n * On submit address.\n */\n private readonly _onSubmitAddress = (): void => {\n if (!this.addressFormat.validateAddressFormat(this.addUpdateAddress, this.validationError, this.countryRegionId)) {\n this.props.moduleState.setHasError(true);\n return;\n }\n\n this._setBillingAddress(this.addUpdateAddress);\n this._updateCurrentOperation(AddressOperation.Show, this.addUpdateAddress);\n this._updateModuleState();\n };\n\n /**\n * On submit.\n */\n private readonly onSubmit = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._onSubmitAddress();\n break;\n case AddressOperation.Show:\n if (this.selectedAddress) {\n this._setBillingAddress(this.selectedAddress);\n this._updateCurrentOperation(AddressOperation.Show, this.selectedAddress);\n this._updateModuleState();\n }\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * On cancel.\n */\n private readonly onCancel = (): void => {\n switch (this.currentOperation) {\n case AddressOperation.Add:\n case AddressOperation.Update:\n this._resetView();\n this._clearAddressFields();\n break;\n case AddressOperation.Show:\n this._resetView();\n break;\n default:\n this.props.telemetry.error('Invalid operation');\n }\n };\n\n /**\n * On edit.\n */\n private readonly onEdit = (): void => {\n if (this.isBillingAddressSameAsShipping && this.shippingAddress && this.isCartContainsItemsForShipping) {\n this._updateCurrentOperation(AddressOperation.Show, this.shippingAddress);\n } else {\n this._updateCurrentOperation(AddressOperation.Add, this.billingAddress);\n }\n this.props.moduleState.onUpdating();\n };\n\n /**\n * Sets billing address.\n * @param address - The address.\n */\n private readonly _setBillingAddress = (address: Address): void => {\n if (this.props.data.checkout.result) {\n const newBillingAddress = { ...address };\n\n if (address.ThreeLetterISORegionName && !newBillingAddress.TwoLetterISORegionName) {\n newBillingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(address.ThreeLetterISORegionName);\n }\n\n this.props.data.checkout.result.updateBillingAddress(\n {\n newBillingAddress,\n additionalProperties: {\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShipping\n } });\n }\n };\n\n /**\n * Reset view.\n */\n private readonly _resetView = () => {\n this._updateCurrentOperation(AddressOperation.Show, this.billingAddress);\n this._updateModuleState();\n };\n\n /**\n * Update current operation.\n * @param operation - Address operation\n * @param selectedAddress - The selected address.\n */\n private readonly _updateCurrentOperation = (operation: AddressOperation, selectedAddress?: Address) => {\n this.currentOperation = operation;\n this.selectedAddress = selectedAddress;\n\n if (this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update) {\n this.addUpdateAddress = { ...this.selectedAddress } || {};\n set(this.addUpdateAddress, { ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId });\n set(this.addUpdateAddress, { AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType });\n }\n };\n\n /**\n * Updates the module state.\n */\n private readonly _updateModuleState = () => {\n if (this.currentOperation === AddressOperation.Show) {\n this.props.moduleState.onReady();\n } else {\n this.props.moduleState.onUpdating();\n }\n };\n}\n\nexport default CheckoutBillingAddress;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, IActionContext, IActionInput } from '@msdyn365-commerce/core';\n\nimport { IModuleStates } from './module-state.data';\n\n/**\n * GetModulesInput.\n */\nexport class ModuleStatesCacheKey implements IActionInput {\n public getCacheKey = () => 'ModuleState';\n\n public getCacheObjectType = () => 'ModuleState';\n\n public dataCacheType = (): CacheType => 'none';\n}\n\nexport function getModuleStates(ctx: IActionContext): IModuleStates {\n const cacheKey = new ModuleStatesCacheKey();\n\n let moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n if (moduleStates) {\n return moduleStates;\n }\n ctx.update(cacheKey, {});\n moduleStates = ctx.get(cacheKey.getCacheObjectType(), cacheKey.getCacheKey());\n return moduleStates;\n}\n\nexport function updateModuleStates(value: IModuleStates, ctx: IActionContext): void {\n const cacheKey = new ModuleStatesCacheKey();\n ctx.update(cacheKey, value);\n}\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { IGiftCardExtend } from '@msdyn365-commerce/global-state';\r\nimport { Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo } from '@msdyn365-commerce/retail-proxy';\r\nimport { IModuleStateProps, withModuleState } from '@msdyn365-commerce-modules/checkout-utilities';\r\nimport { IModuleProps } from '@msdyn365-commerce-modules/utilities';\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 {\r\n AddressBillingHeading,\r\n AddressCommon,\r\n AddressFormat,\r\n AddressItemType,\r\n AddressMetaData,\r\n AddressOperation,\r\n AddressShow,\r\n IAddressAddUpdateProps,\r\n IAddressResponse,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address';\r\nimport { IB2bCheckoutBillingAddressData } from './b2b-checkout-billing-address.data';\r\nimport { IB2bCheckoutBillingAddressProps } from './b2b-checkout-billing-address.props.autogenerated';\r\n\r\n/**\r\n * Props interface.\r\n */\r\nexport interface IProps extends IB2bCheckoutBillingAddressProps, IModuleStateProps {}\r\n\r\nexport interface ICheckoutState {\r\n errorMessage: string | undefined;\r\n}\r\n\r\n/**\r\n * Checkout billing address view state interface.\r\n */\r\nexport interface ICheckoutBillingAddressViewState {\r\n isShowAddress: boolean;\r\n isError: boolean;\r\n}\r\n\r\n/**\r\n * Checkout billing address view props interface.\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 error: React.ReactNode;\r\n}\r\n\r\n/**\r\n *\r\n * CheckoutBillingAddress component.\r\n * @extends {React.PureComponent>}\r\n */\r\n// @ts-expect-error\r\n@withModuleState\r\n@observer\r\nclass CheckoutBillingAddress extends React.Component {\r\n @observable private currentOperation: AddressOperation;\r\n\r\n @observable private isBillingAddressSameAsShipping: boolean;\r\n\r\n @observable private selectedAddress?: Address;\r\n\r\n @observable private addUpdateAddress: Address;\r\n\r\n @observable private countryRegionId: string = 'USA';\r\n\r\n @observable private stateProvinceInfo?: StateProvinceInfo[];\r\n\r\n @observable private validationError: object;\r\n\r\n @observable private readonly addressActionResponse?: IAddressResponse;\r\n\r\n private readonly addressCommon: AddressCommon;\r\n\r\n private addressFormat: AddressFormat;\r\n\r\n private countryRegions: CountryRegionInfo[] = [];\r\n\r\n private addressPurposes: AddressPurpose[] = [];\r\n\r\n private addresses: Address[];\r\n\r\n private readonly defaultAddressType: number = 6; // Default to Home\r\n\r\n public constructor(props: IProps) {\r\n super(props);\r\n this.state = { errorMessage: undefined };\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.currentOperation = AddressOperation.List;\r\n this.addressPurposes = data.addressPurposes.result || [];\r\n this.addresses = data.address.result || [];\r\n this.countryRegions = data.countryRegions.result || [];\r\n this.stateProvinceInfo = data.countryStates.result || [];\r\n this.addressCommon = new AddressCommon(context, resources, telemetry);\r\n this.addressFormat = new AddressFormat(\r\n this.countryRegions,\r\n new AddressMetaData({ ...resources }, this._getAddressFormatExcludeList()),\r\n this.addressPurposes\r\n );\r\n }\r\n\r\n public async componentDidMount(): Promise {\r\n // Initializing data props\r\n\r\n this._dataInitialize(this.props);\r\n\r\n void this.props.data.checkout.then(() => {\r\n this._setDefaultCountryRegionId();\r\n this._initModuleState();\r\n });\r\n\r\n reaction(\r\n () => this.countryRegionId,\r\n () => {\r\n this._getStateProvinces();\r\n }\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._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) {\r\n this.props.data.checkout.result?.removeBillingAddress({});\r\n this.props.moduleState.onDisable();\r\n }\r\n }\r\n );\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: IProps, nextState: ICheckoutState): boolean {\r\n if (this.state === nextState && this.props.data === nextProps.data) {\r\n return false;\r\n }\r\n return true;\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 const { renderView, config } = this.props;\r\n\r\n const viewProps = {\r\n ...this.props,\r\n currentOperation: this.currentOperation,\r\n selectedAddress: this.props.moduleState.hasError ? undefined : this.selectedAddress,\r\n addUpdateAddress: this.props.moduleState.hasError ? undefined : 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 && !this.props.moduleState.hasError,\r\n isError: this.props.moduleState.hasError\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 showAddress: this._renderShowAddress(),\r\n error: this.renderErrorMessage()\r\n };\r\n\r\n return renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n /**\r\n * Method data initialization.\r\n * @param props -The checkout address properties.\r\n */\r\n private readonly _dataInitialize = (props: IProps): void => {\r\n const { data } = props;\r\n\r\n reaction(\r\n () => data.countryRegions.result,\r\n () => {\r\n this.countryRegions = data.countryRegions.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.addressPurposes.result,\r\n () => {\r\n this.addressPurposes = data.addressPurposes.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.countryStates.result,\r\n () => {\r\n this.stateProvinceInfo = data.countryStates.result ?? [];\r\n }\r\n );\r\n\r\n reaction(\r\n () => data.address.result,\r\n () => {\r\n this.addresses = data.address.result ?? [];\r\n }\r\n );\r\n\r\n this._setBillingAddress();\r\n };\r\n\r\n private _renderShowAddress(): IAddressShowProps | null {\r\n if (this.selectedAddress) {\r\n return AddressShow({\r\n address: this.selectedAddress,\r\n addressFormat: this.addressFormat.getAddressFormat(this.selectedAddress.ThreeLetterISORegionName ?? ''),\r\n addressPurposes: this.addressPurposes\r\n });\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Gets address format for exclude list.\r\n * @returns - Address item type.\r\n */\r\n private readonly _getAddressFormatExcludeList = (): AddressItemType[] => {\r\n const { config } = this.props;\r\n const addressFormatExcludeList: AddressItemType[] = [];\r\n\r\n if (!config.showAddressType) {\r\n addressFormatExcludeList.push(AddressItemType.AddressTypeValue);\r\n }\r\n\r\n addressFormatExcludeList.push(AddressItemType.IsPrimary);\r\n\r\n return addressFormatExcludeList;\r\n };\r\n\r\n /**\r\n * Gets state provinces.\r\n */\r\n private readonly _getStateProvinces = (): void => {\r\n if (\r\n !this.countryRegionId ||\r\n !(this.currentOperation === AddressOperation.Add || this.currentOperation === AddressOperation.Update)\r\n ) {\r\n return;\r\n }\r\n\r\n void this.addressCommon.getStateProvinces(this.countryRegionId).then((result: StateProvinceInfo[]) => {\r\n const stateInfo = result.some(state => state.StateId === this.addUpdateAddress.State);\r\n\r\n // Reset state if selected state not found in the list.\r\n if (!stateInfo) {\r\n set(this.addUpdateAddress, { State: '' });\r\n }\r\n this.stateProvinceInfo = result;\r\n });\r\n };\r\n\r\n /**\r\n * Initialize module state.\r\n */\r\n private readonly _initModuleState = (): void => {\r\n this.props.moduleState.init({\r\n status: this.isBillingAddressRequried ? 'updating' : 'disabled'\r\n });\r\n\r\n const { billingAddress, isBillingAddressSameAsShippingAddress } = this.props.data.checkout.result ?? {};\r\n\r\n if (this.isBillingAddressRequried) {\r\n if (billingAddress) {\r\n this.isBillingAddressSameAsShipping = isBillingAddressSameAsShippingAddress ?? false;\r\n this._updateCurrentOperation(AddressOperation.Show, billingAddress);\r\n this._updateModuleState();\r\n } else if (this.isCartContainsItemsForShipping) {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Show, undefined);\r\n\r\n const {\r\n resources: { noBillingErrorMessage }\r\n } = this.props;\r\n\r\n this.setError(noBillingErrorMessage, true);\r\n } else {\r\n this.isBillingAddressSameAsShipping = false;\r\n this._updateCurrentOperation(AddressOperation.Add);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Sets default country region Id.\r\n */\r\n private _setDefaultCountryRegionId(): void {\r\n const { request } = this.props.context;\r\n const market = request.channel?.ChannelCountryRegionISOCode;\r\n\r\n this.countryRegionId = this.addressCommon.getDefaultCountryRegionId(this.countryRegionId, this.countryRegions, market);\r\n }\r\n\r\n @computed private get isCartContainsItemsForShipping(): boolean {\r\n const { request } = this.props.context;\r\n const multiplePickupStoreSwitchName = 'Dynamics.AX.Application.RetailMultiplePickupDeliveryModeFeature';\r\n const { channelDeliveryOptionConfig, featureState } = this.props.data;\r\n const retailMultiplePickUpOptionEnabled = featureState.result?.find(feature => feature.Name === multiplePickupStoreSwitchName)\r\n ?.IsEnabled;\r\n\r\n const pickupDeliveryModeCode = request.channel?.PickupDeliveryModeCode;\r\n const emailDeliveryModeCode = request.channel?.EmailDeliveryModeCode;\r\n\r\n // If hasInvoiceLine is true, there are only invoices no items in cart and return false here\r\n return this.props.data.checkout.result?.checkoutCart.hasInvoiceLine\r\n ? false\r\n : retailMultiplePickUpOptionEnabled\r\n ? ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !==\r\n channelDeliveryOptionConfig.result?.PickupDeliveryModeCodes?.find(\r\n deliveryMode => deliveryMode === cartLine.DeliveryMode\r\n ) && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n )\r\n : ((this.props.data.checkout.result && this.props.data.checkout.result.checkoutCart.cart.CartLines) || []).some(cartLine =>\r\n cartLine.DeliveryMode && cartLine.DeliveryMode !== ''\r\n ? cartLine.DeliveryMode !== pickupDeliveryModeCode && cartLine.DeliveryMode !== emailDeliveryModeCode\r\n : cartLine\r\n );\r\n }\r\n\r\n @computed private get getLoyaltyAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n return checkoutState?.loyaltyAmount ? checkoutState.loyaltyAmount : 0;\r\n }\r\n\r\n @computed private get getGiftCardTotalAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n if (!checkoutState || !checkoutState.giftCardExtends) {\r\n return 0;\r\n }\r\n return checkoutState.giftCardExtends.reduce((count: number, giftCard: IGiftCardExtend) => {\r\n return count + (giftCard.Balance || 0);\r\n }, 0);\r\n }\r\n\r\n @computed private get getCustomerAccountAmount(): number {\r\n const checkoutState = this.props.data.checkout.result;\r\n const defaultAmount = 0;\r\n\r\n return checkoutState?.customerAccountAmount ?? defaultAmount;\r\n }\r\n\r\n @computed private get shouldPaidByCard(): boolean {\r\n const {\r\n data: { checkout },\r\n config\r\n } = this.props;\r\n if (!checkout.result) {\r\n return false;\r\n }\r\n\r\n const checkoutResult = checkout.result;\r\n const cart = checkoutResult.checkoutCart.cart;\r\n if (!cart || !cart.CartLines || cart.CartLines.length === 0) {\r\n return false;\r\n }\r\n\r\n const { paymentTenderType, tokenizedPaymentCard } = checkoutResult;\r\n const isPaidByOtherPaymentSource = config.paymenTenderType !== paymentTenderType && tokenizedPaymentCard;\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 - this.getCustomerAccountAmount;\r\n\r\n return amountDue > 0 && !isPaidByOtherPaymentSource;\r\n }\r\n\r\n @computed private get isBillingAddressRequried(): boolean {\r\n return this.shouldPaidByCard;\r\n }\r\n\r\n private readonly setError = (errorMessage: string | undefined, hasError: boolean): void => {\r\n this.props.moduleState.setHasError(hasError);\r\n this.setState({ errorMessage });\r\n };\r\n\r\n private renderErrorMessage = (): React.ReactNode => (\r\n
\r\n

{this.state.errorMessage}

\r\n
\r\n );\r\n\r\n /**\r\n * Sets billing address.\r\n * @param address - The address.\r\n */\r\n private readonly _setBillingAddress = (): void => {\r\n if (this.props.data.checkout.result) {\r\n const addressTypeId = 1;\r\n const addressCount = this.addresses.filter((address: Address) => address.AddressTypeValue === addressTypeId).length;\r\n\r\n // Only set billing address if there is one Invoice address\r\n if (addressCount === 1) {\r\n const address = this.addresses.find(address => address.AddressTypeValue === addressTypeId);\r\n this.selectedAddress = address ? address : this.selectedAddress;\r\n\r\n const newBillingAddress: Address = { ...address };\r\n\r\n if (address?.ThreeLetterISORegionName && !newBillingAddress.TwoLetterISORegionName) {\r\n newBillingAddress.TwoLetterISORegionName = this.addressFormat.getTwoLetterISORegionName(\r\n address?.ThreeLetterISORegionName\r\n );\r\n }\r\n\r\n void this.props.data.checkout.result.updateBillingAddress({\r\n newBillingAddress,\r\n additionalProperties: {\r\n isBillingAddressSameAsShippingAddress: this.isBillingAddressSameAsShipping\r\n }\r\n });\r\n\r\n this.setError(undefined, false);\r\n } else {\r\n // Remove the billing address and set appropriate error message\r\n this.selectedAddress = undefined;\r\n void this.props.data.checkout.result.removeBillingAddress({\r\n additionalProperties: {\r\n isBillingAddressSameAsShippingAddress: false\r\n }\r\n });\r\n\r\n const {\r\n resources: { noBillingErrorMessage, multipleBillingErrorMessage }\r\n } = this.props;\r\n\r\n this.setError(addressCount === 0 ? noBillingErrorMessage : multipleBillingErrorMessage, true);\r\n }\r\n }\r\n };\r\n\r\n /**\r\n * Update current operation.\r\n * @param operation - Address operation\r\n * @param selectedAddress - The selected address.\r\n */\r\n private readonly _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, {\r\n ThreeLetterISORegionName: this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\r\n });\r\n set(this.addUpdateAddress, { AddressTypeValue: this.addUpdateAddress.AddressTypeValue || this.defaultAddressType });\r\n }\r\n };\r\n\r\n /**\r\n * Updates the module state.\r\n */\r\n private readonly _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","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { Address, AddressPurpose } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Heading as HeadingData } from '@msdyn365-commerce-modules/data-types';\nimport { Heading, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { AddressFormat } from '../address-format';\nimport { IAddressResource, IAddressResponse } from '../address-module.data';\nimport AddressButtonComponent from './address-button';\nimport AddressErrorMessageComponent from './address-error-message';\nimport AddressErrorTitleComponent from './address-error-title';\nimport { AddressShow, IAddressShowProps } from './address-show';\n\nexport interface IAddressListError {\n Error: INodeProps;\n isShowError: boolean;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface IAddressListItem {\n Item: INodeProps;\n key: number;\n error: IAddressListError;\n showItems: IAddressShowProps;\n isShowPrimaryButton: boolean;\n primaryButton: React.ReactNode;\n editButton: React.ReactNode;\n removeButton: React.ReactNode;\n}\n\nexport interface IAddressList {\n List: INodeProps;\n isShowList: boolean;\n heading: React.ReactNode;\n items: IAddressListItem[];\n}\n\nexport interface IAddressListProps {\n ListAddress: INodeProps;\n heading: React.ReactNode;\n isShowEmptyListMessage: boolean;\n emptyListMessage: React.ReactNode;\n addButton: React.ReactNode;\n primaryAddressList: IAddressList;\n otherAddressList: IAddressList;\n}\n\nexport interface IAddressListInputProps {\n isUpdating?: boolean;\n selectedAddress?: Address;\n addressFormat: AddressFormat;\n addresses: Address[];\n addressPurposes: AddressPurpose[];\n heading?: HeadingData;\n primaryAddressSectionHeading?: HeadingData;\n otherAddressSectionHeading?: HeadingData;\n addressActionResponse?: IAddressResponse;\n resources: IAddressResource;\n contextRequest: Msdyn365.IRequestContext;\n telemetryContent?: ITelemetryContent;\n handleLineItemHeadingChange?(event: Msdyn365.ContentEditableEvent): void;\n onAddAddress(): void;\n onEditAddress(address?: Address): void;\n onRemoveAddress(address?: Address): void;\n onUpdatePrimaryAddress(address: Address): void;\n canRenderAsyncCustomerDataAsUnmodifiable?: boolean;\n isAsyncCustomer?: boolean;\n isAsyncCustomerAddressCreationFeatureEnabled?: boolean;\n}\n\nconst getButtonAriaLabel = (ariaLabel: string, addressName?: string): string => {\n return ariaLabel.replace('{addressName}', addressName || '');\n};\n\nconst getAddressList = (className: string, addresses: Address[], showPrimaryButton: boolean, props: IAddressListInputProps, heading?: HeadingData): IAddressList => {\n const { resources, isUpdating, addressActionResponse, selectedAddress, addressFormat, onEditAddress, onRemoveAddress, onUpdatePrimaryAddress, addressPurposes, telemetryContent } = props;\n const { errorTitle = null, errorMessage = null } = addressActionResponse || {};\n\n return {\n List: { className },\n isShowList: addresses.length > 0,\n heading: heading && ,\n items: addresses.map(\n (address: Address): IAddressListItem => {\n const isSelectedAddress = selectedAddress && selectedAddress.RecordId === address.RecordId;\n const isShowError = isSelectedAddress && errorTitle && errorMessage;\n\n // Disable 'primary', 'edit', and 'remove' buttons if the customer IS EITHER async OR async address creation feature is enabled.\n // Conversely, these buttons can only be enabled when the customer is NOT async AND the address creation feature is disabled.\n const isInvalidAsyncState: boolean =\n (props.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\n (props.isAsyncCustomer || false || props.isAsyncCustomerAddressCreationFeatureEnabled || false);\n\n return {\n Item: { className: `${className}-list` },\n key: address.RecordId || 0,\n showItems: AddressShow({\n addressFormat: addressFormat.getAddressFormat(address.ThreeLetterISORegionName || ''),\n address,\n addressPurposes\n }),\n error: {\n Error: { className: `${className}-error` },\n isShowError: !!isShowError,\n title: ,\n message: \n },\n isShowPrimaryButton: showPrimaryButton,\n\n primaryButton: (\n {\n onUpdatePrimaryAddress(address);\n }\n }}\n />\n ),\n editButton: (\n {\n onEditAddress(address);\n },\n role: 'link'\n }}\n />\n ),\n removeButton: (\n {\n onRemoveAddress(address);\n },\n role: 'link'\n }\n }\n />\n )\n };\n })\n };\n};\n\nconst getPrimaryAddressList = (props: IAddressListInputProps): IAddressList => {\n const { addresses, primaryAddressSectionHeading } = props;\n const primaryAddresses = addresses.filter((address: Address) => address.IsPrimary);\n return getAddressList('msc-address-list__primary', primaryAddresses, false, props, primaryAddressSectionHeading);\n};\n\nconst getOtherAddressList = (props: IAddressListInputProps): IAddressList => {\n const { addresses, otherAddressSectionHeading } = props;\n const otherAddresses = addresses.filter((address: Address) => !address.IsPrimary);\n return getAddressList('msc-address-list__primary', otherAddresses, true, props, otherAddressSectionHeading);\n};\n\nexport const AddressList = (props: IAddressListInputProps): IAddressListProps => {\n const { addresses, heading, resources, onAddAddress, telemetryContent, handleLineItemHeadingChange } = props;\n const headingComponent = heading?.text && (\n {\n // Required\n }, requestContext: props.contextRequest }}\n />\n );\n\n return {\n ListAddress: { className: 'ms-address-list' },\n heading: headingComponent,\n isShowEmptyListMessage: addresses.length === 0,\n emptyListMessage:

\n {resources.addressEmptyListAddressMessage}\n

,\n addButton: (\n \n ),\n primaryAddressList: getPrimaryAddressList(props),\n otherAddressList: getOtherAddressList(props)\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport {\n Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { get, set } from 'mobx';\n\nimport {\n AddressItemType, IAddressDropdownsData, IAddressItem, IAddressValidationRule\n} from './address-format.data';\nimport { AddressMetaData } from './address-meta-data';\n\n/**\n *\n * Retail Service Address format parser.\n */\nexport class AddressFormat {\n private readonly countryRegionsInfo?: CountryRegionInfo[];\n\n private readonly addressPurposes?: AddressPurpose[];\n\n private readonly addressMetaData: AddressMetaData;\n\n constructor(countryRegionsInfo: CountryRegionInfo[], addressMetaData: AddressMetaData, addressPurposes: AddressPurpose[]) {\n this.countryRegionsInfo = countryRegionsInfo;\n this.addressMetaData = addressMetaData;\n this.addressPurposes = addressPurposes;\n }\n\n public getAddressFormat(countryRegionId: string): IAddressItem[] {\n const countryRegionInfo = this._getCountryRegionInfo(countryRegionId);\n if (countryRegionInfo) {\n return this._getAddressDisplayFormat(countryRegionInfo);\n }\n return [];\n }\n\n public getCountryFormat(): { key?: string; value?: string }[] {\n return (this.countryRegionsInfo || []).map(countryRegion => {\n return {\n key: countryRegion.CountryRegionId,\n value: countryRegion.ShortName\n };\n });\n }\n\n public getStateFormat(stateProvinceInfo?: StateProvinceInfo[]): { key?: string; value?: string }[] {\n return (stateProvinceInfo || []).map(state => {\n return {\n key: state.StateId,\n value: state.StateName\n };\n });\n }\n\n public getAddressTypeFormat(): { key?: number; value?: string }[] {\n return (this.addressPurposes || []).map(addressPurpose => {\n return {\n key: addressPurpose.AddressType,\n value: addressPurpose.Name\n };\n });\n }\n\n public getPrefilledAddressDropdownData = (stateDefaultSelectionText: string, stateProvinceInfo?: StateProvinceInfo[]): IAddressDropdownsData => {\n const defaultStateText = {\n key: '',\n value: stateDefaultSelectionText\n };\n const dropdownData: IAddressDropdownsData = {};\n\n dropdownData[AddressItemType[AddressItemType.ThreeLetterISORegionName]] = this.getCountryFormat();\n dropdownData[AddressItemType[AddressItemType.State]] = this.getStateFormat(stateProvinceInfo);\n dropdownData[AddressItemType[AddressItemType.State]].unshift(defaultStateText);\n dropdownData[AddressItemType[AddressItemType.AddressTypeValue]] = this.getAddressTypeFormat();\n\n return dropdownData;\n };\n\n public getTwoLetterISORegionName = (countryRegionId: string): string | undefined => {\n const countryRegionInfo = this._getCountryRegionInfo(countryRegionId);\n\n return countryRegionInfo!.ISOCode;\n };\n\n public validateAddressFormat = (address: Address, validationError: Address, countryRegionId: string, propertyName?: string): boolean => {\n let isValid: boolean = true;\n let validationtor;\n const addressFormat = this.getAddressFormat((address.ThreeLetterISORegionName) || countryRegionId);\n\n addressFormat.forEach(addressFormatItem => {\n if (!propertyName || (propertyName && addressFormatItem.name === propertyName)) {\n validationtor = this._inputValidation(addressFormatItem, validationError, address);\n if (validationtor !== undefined) {\n isValid = validationtor;\n }\n }\n });\n\n return isValid;\n };\n\n public getTranformedAddress = (result: Microsoft.Maps.ISuggestionResult, stateProvinceInfo?: StateProvinceInfo[]): Address => {\n const address: Address = {};\n\n // Zip Code\n if (result.address.postalCode !== undefined) {\n address.ZipCode = result.address.postalCode;\n } else {\n address.ZipCode = '';\n }\n\n // State\n if (stateProvinceInfo) {\n const selectedState = stateProvinceInfo.find(state => state.StateName === result.address.adminDistrict);\n if (!selectedState) {\n address.State = '';\n address.StateName = result.address.adminDistrict;\n } else {\n address.State = selectedState.StateId;\n address.StateName = selectedState.StateName;\n }\n }\n\n // Street\n if (result.address.addressLine !== undefined) {\n address.Street = result.address.addressLine;\n } else {\n address.Street = ' ';\n }\n\n // City\n if (result.address.locality !== undefined) {\n address.City = result.address.locality;\n } else {\n address.City = '';\n }\n\n // District\n if (result.address.district !== undefined) {\n address.DistrictName = result.address.district;\n address.CountyName = result.address.district;\n } else {\n address.DistrictName = '';\n }\n\n // Formatted Address\n address.FullAddress = result.address.formattedAddress;\n\n return address;\n };\n\n private _inputValidation(addressFormatItem: IAddressItem, validationError: Address, address: Address): boolean | undefined {\n set(validationError, { [addressFormatItem.name]: null });\n for (const validationRule of (addressFormatItem.validationRules || [])) {\n if (!this._validateRegEx(address, addressFormatItem.name, validationRule)) {\n set(validationError, { [addressFormatItem.name]: validationRule.message });\n return false;\n }\n }\n return undefined;\n }\n\n private readonly _validateRegEx = (address: Address, propertyName: string, validationRule: IAddressValidationRule): boolean => {\n if (validationRule.regEx && validationRule.regEx.length > 0) {\n const regex = new RegExp(validationRule.regEx);\n return regex.test(get(address, propertyName) as string || '');\n }\n return true;\n };\n\n private _getCountryRegionInfo(countryRegionId: string): CountryRegionInfo | undefined {\n return (this.countryRegionsInfo || []).find(countryRegion => {\n return ((countryRegion.CountryRegionId || '').toLowerCase() === countryRegionId.toLowerCase());\n });\n }\n\n private _getAddressDisplayFormat(countryRegionInfo: CountryRegionInfo): IAddressItem[] {\n const addressDisplayItem: IAddressItem[] = [];\n\n if (countryRegionInfo && countryRegionInfo.AddressFormatLines) {\n const AddressTypeItem = this._extendAddressDisplayFormat(AddressItemType.AddressTypeValue, true);\n if (AddressTypeItem) {\n addressDisplayItem.push(AddressTypeItem);\n }\n\n const nameDisplayItem = this._extendAddressDisplayFormat(AddressItemType.Name, true);\n if (nameDisplayItem) {\n addressDisplayItem.push(nameDisplayItem);\n }\n\n countryRegionInfo.AddressFormatLines.forEach(formatLine => {\n if (formatLine.AddressComponentNameValue) {\n const addressItem = this.addressMetaData.getItemFormat(formatLine.AddressComponentNameValue);\n if (addressItem) {\n addressItem.isNewLine = formatLine.NewLine || false;\n addressDisplayItem.push(addressItem);\n }\n }\n });\n\n const phoneDisplayItem = this._extendAddressDisplayFormat(AddressItemType.Phone, false);\n if (phoneDisplayItem) {\n addressDisplayItem.push(phoneDisplayItem);\n }\n\n const isPrimaryDisplayItem = this._extendAddressDisplayFormat(AddressItemType.IsPrimary, false);\n if (isPrimaryDisplayItem) {\n addressDisplayItem.push(isPrimaryDisplayItem);\n }\n }\n\n return addressDisplayItem;\n }\n\n private _extendAddressDisplayFormat(type: AddressItemType, isNewLine: boolean): IAddressItem | undefined {\n const addressItem = this.addressMetaData.getItemFormat(type);\n if (addressItem) {\n addressItem.isNewLine = isNewLine;\n }\n return addressItem;\n }\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { IActionInput, ICoreContext, IObservableAction, ITelemetry } from '@msdyn365-commerce/core';\nimport {\n Address, AddressPurpose, CountryRegionInfo, StateProvinceInfo\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n addAddress, AddressManagementInput, ArrayExtensions,\n updateAddress, updatePrimaryAddress } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { getAddressPurposesAction, GetAddressPurposesInput } from '../actions/get-address-purposes';\nimport { getStateProvinceAction, GetStateProvincesInput } from '../actions/get-state-provinces';\nimport { IAddressResource, IAddressResponse } from './address-module.data';\n\n/**\n *\n * Address common.\n */\nexport class AddressCommon {\n\n private readonly context: ICoreContext;\n\n private readonly resources: IAddressResource;\n\n private readonly telemetry: ITelemetry;\n\n constructor(context: ICoreContext, resources: IAddressResource, telemetry: ITelemetry) {\n this.context = context;\n this.resources = resources;\n this.telemetry = telemetry;\n }\n\n public getDefaultCountryRegionId = (countryRegionId: string, countryRegions: CountryRegionInfo[], market?: string): string => {\n const marketISOCode = market || 'US';\n const currentCountryRegion = countryRegions.find(countryRegion => (countryRegion.ISOCode || '') === marketISOCode);\n return (currentCountryRegion && currentCountryRegion.CountryRegionId) || countryRegionId;\n };\n\n public parseRetailException = (resources: IAddressResource): IAddressResponse => {\n return {\n errorTitle: resources.addressErrorMessageTitle,\n errorMessage: resources.addressGenericErrorMessage\n };\n };\n\n public isAuthenticatedFlow = (): boolean => {\n return this.context.request.user.isAuthenticated;\n };\n\n public getStateProvinces = async (countryRegionId: string): Promise => {\n let response: StateProvinceInfo[] = [];\n if (this.context && this.context.actionContext) {\n try {\n const input = new GetStateProvincesInput(countryRegionId, this.context.request.apiSettings);\n response = await getStateProvinceAction(input, this.context.actionContext);\n } catch (error) {\n if (this.telemetry) {\n this.telemetry.error(`Error encountered ${error}`);\n this.telemetry.debug('Unable to get state provinces');\n }\n }\n }\n return Promise.resolve(response);\n };\n\n // For any address, check for common requried field else treat it as invalid\\empty address.\n public isEmpty = (address: Address): boolean => {\n if (address && address.ThreeLetterISORegionName && (address.State || address.City)) {\n return false;\n }\n\n return true;\n };\n\n public addCustomerAddress = async (address: Address): Promise => {\n await this.updateLogisticsLocationRoleRecordId(address);\n return this.submitCustomerAddress(addAddress, address);\n };\n\n public updateCustomerAddress = async (address: Address): Promise => {\n await this.updateLogisticsLocationRoleRecordId(address);\n return this.submitCustomerAddress(updateAddress, address);\n };\n\n public updateCustomerPrimaryAddress = async (address: Address): Promise => {\n return this.submitCustomerAddress(updatePrimaryAddress, address);\n };\n\n private readonly submitCustomerAddress = async (addressAction: IObservableAction, address: Address): Promise => {\n address.AddressTypeValue = address.AddressTypeValue || 7; // 7 sets it to HOME by default\n\n const input = new AddressManagementInput(address);\n return this.execAddressAction(addressAction, input, address);\n };\n\n private readonly execAddressAction = async (addressAction: IObservableAction, input: IActionInput | IActionInput[], address: Address): Promise => {\n let response: IAddressResponse = {};\n\n if (this.context && this.context.actionContext) {\n try {\n const addresses = await addressAction(input, this.context.actionContext);\n if (addresses.length > 0) {\n response.address = address.RecordId ? address : addresses[addresses.length - 1];\n } else {\n response.address = address;\n }\n response.customerAddresses = addresses;\n } catch (error) {\n if (this.telemetry) {\n this.telemetry.error(`Error encountered ${error}`);\n this.telemetry.debug('Unable to exec address action');\n }\n response = this.parseRetailException(this.resources);\n }\n }\n return Promise.resolve(response);\n };\n\n /**\n * Function to get the address purposes and update the LogisticsLocationRoleRecordId to update the address type.\n * @param address - Address object.\n * @returns Returns void.\n */\n private readonly updateLogisticsLocationRoleRecordId = async (address: Address): Promise => {\n let addressPurposes: AddressPurpose[] = [];\n try {\n const input: GetAddressPurposesInput = new GetAddressPurposesInput(this.context.request.apiSettings);\n addressPurposes = await getAddressPurposesAction(input, this.context.actionContext);\n } catch (error) {\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions -- Supparsing the any type for error.\n this.telemetry.error(`Error encountered ${error}`);\n this.telemetry.debug('Unable to get address purposes');\n }\n if (ArrayExtensions.hasElements(addressPurposes)) {\n const addressPurpose: AddressPurpose | undefined = addressPurposes.find(purpose => purpose.AddressType === address.AddressTypeValue);\n if (addressPurpose) {\n address.LogisticsLocationRoleRecordId = addressPurpose.RecordId;\n }\n }\n };\n}\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport AccountManagementAddress from './account-management-address';\nimport AccountManagementAddressView from './account-management-address.view';\n\nexport * from './account-management-address';\nexport * from './account-management-address.data';\nexport * from './account-management-address.props.autogenerated';\nexport * from './account-management-address.view';\n\nexport {\n AccountManagementAddress,\n AccountManagementAddressView\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IAddressAddItem, IAddressAddUpdateProps } from '../../common/components/address-add';\nimport { IAddressShowItem, IAddressShowProps } from '../../common/components/address-show';\nimport { ICheckoutBillingAddressViewProps } from './checkout-billing-address';\n\n/**\n * Address show component.\n * @param param0 - Root param.\n * @param param0.AddressDetail - Address detail.\n * @param param0.items - IAddressShowItem[].\n * @returns - Address Node.\n */\nconst AddressShow: React.FC = ({\n AddressDetail,\n items\n}) => {\n\n return (\n \n {items.map((item: IAddressShowItem) => {\n return (\n <>\n {item.description}\n \n );\n })}\n \n );\n};\n\n/**\n * Address Add Update Component.\n * @param param0 - Root param.\n * @param param0.AddressForm - Address form.\n * @param param0.heading - Address Heading.\n * @param param0.items - IAddressAddItem[].\n * @param param0.hasError - Boolean.\n * @param param0.error - IAddressError.\n * @param param0.isShowSaveButton - Boolean.\n * @param param0.saveButton - Save button.\n * @param param0.isShowCancelButton - Boolean.\n * @param param0.cancelButton - Cancel button.\n * @returns - AddressForm Node.\n */\nconst AddressAddUpdate: React.FC = ({\n AddressForm,\n heading,\n items,\n hasError,\n error,\n isShowSaveButton,\n saveButton,\n isShowCancelButton,\n cancelButton\n}) => {\n\n return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n {label}\n {alert}\n {input}\n );\n })}\n {hasError && \n {error.title}\n {error.message}\n }\n {isShowSaveButton && saveButton}\n {isShowCancelButton && cancelButton}\n \n );\n};\n\n/**\n * Checkout Billing Address View Component.\n * @param props - Props.\n * @returns - CheckoutBillingAddress Module.\n */\nconst CheckoutBillingAddressView: React.FC = props => {\n const { CheckoutBillingAddress, viewState, heading, sameAsShippingCheckbox, showAddress, showAddOrUpdateAddress } = props;\n\n return (\n \n {heading}\n {viewState.isShowSameAsShippingCheckbox && sameAsShippingCheckbox}\n {viewState.isShowAddress && }\n {viewState.isShowAddOrUpdateAddress && }\n \n );\n};\n\nexport default CheckoutBillingAddressView;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport withModuleState from './with-module-state';\n\nexport * from './module-state';\nexport * from './module-state.data';\n\nexport { withModuleState };\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 IAdressCheckbox {\n id?: string;\n name?: string;\n className: string;\n type: string;\n isChecked: boolean;\n autoFocus?: boolean;\n additionalAddributes?: object;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n * Address checkbox.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressCheckboxFunctionComponent: React.FC = (props: IAdressCheckbox) => {\n const {\n id: itemId,\n name,\n className,\n type,\n isChecked,\n additionalAddributes,\n telemetryContent,\n autoFocus: shouldBeAutoFocused,\n onChange\n } = props;\n\n const payLoad = getPayloadObject('click', telemetryContent!, name!);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n \n );\n};\n\nexport default AddressCheckboxFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { Heading as HeadingData } from '@msdyn365-commerce-modules/data-types';\nimport { Heading, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classname from 'classnames';\nimport { get } from 'mobx';\nimport * as React from 'react';\n\nimport {\n AddressItemDisplayType, AddressItemType, AddressValidationRuleType, IAddressDropdownsData,\n IAddressItem, IAddressValidationRule\n} from '../address-format.data';\nimport { AddressType, IAddressResource, IAddressResponse } from '../address-module.data';\nimport AddressAlertComponent from './address-alert';\nimport AddressButtonComponent from './address-button';\nimport AdressCheckboxComponent from './address-checkbox';\nimport AdressDropdownComponent from './address-dropdown';\nimport AddressErrorMessageComponent from './address-error-message';\nimport AddressErrorTitleComponent from './address-error-title';\nimport AddressInputComponent from './address-input';\nimport AddressLabelComponent from './address-label';\n\nexport interface IAddressAddInputProps {\n isUpdating?: boolean;\n hasError?: boolean;\n hasExternalSubmitGroup?: boolean;\n addressType: AddressType;\n addressFormat: IAddressItem[];\n defaultCountryRegionId: string;\n defaultAddressType: number;\n selectedAddress?: Address;\n dropdownDisplayData: IAddressDropdownsData;\n resources: IAddressResource;\n addressActionResponse?: IAddressResponse;\n addAddressHeading?: HeadingData;\n editAddressHeading?: HeadingData;\n validationError?: object;\n telemetryContent?: ITelemetryContent;\n shouldAutoFocus?: boolean;\n onInputChange(event: React.ChangeEvent): void;\n onDropdownChange(event: React.ChangeEvent): void;\n onSave?(): void;\n onCancel?(): void;\n}\n\nexport interface IAddressError {\n AddressError: INodeProps;\n title: React.ReactNode;\n message: React.ReactNode;\n}\n\nexport interface IAddressAddItem {\n key: string;\n AddressItem: INodeProps;\n label: React.ReactNode;\n alert: React.ReactNode;\n input: React.ReactNode;\n}\n\nexport interface IAddressAddUpdateProps {\n AddressForm: INodeProps;\n heading: React.ReactNode;\n items: IAddressAddItem[];\n hasError: boolean;\n error: IAddressError;\n isShowSaveButton: boolean;\n saveButton: React.ReactNode;\n isShowCancelButton: boolean;\n cancelButton: React.ReactNode;\n}\n\nconst getRequriedAttribute = (validationRules?: IAddressValidationRule[]): object => {\n const requriedRule = (validationRules || []).find(validationRule => {\n return validationRule.type === AddressValidationRuleType.Required;\n });\n\n return requriedRule ? { 'aria-required': true } : {};\n};\n\nconst getAddessItems = (selectedAddress: Address, props: IAddressAddInputProps): IAddressAddItem[] => {\n const { addressFormat, addressType, dropdownDisplayData, defaultCountryRegionId, defaultAddressType, validationError = {}, onInputChange, onDropdownChange, shouldAutoFocus } = props;\n\n return addressFormat.map((addressFormatItem, index) => {\n const elementId = `${addressType.toLowerCase()}_address${addressFormatItem.name.toLowerCase()}`;\n const errorMessage = get(validationError, addressFormatItem.name);\n const className = classname('msc-address-form__item', `msc-address-form__item-${addressFormatItem.name.toLowerCase()}`, { 'msc-address-form__item-newline': addressFormatItem.isNewLine, 'address-form__item-invalid': errorMessage });\n let input;\n\n if (addressFormatItem.displayType === AddressItemDisplayType.Input) {\n input = (\n \n );\n } else if (addressFormatItem.displayType === AddressItemDisplayType.Checkbox) {\n input = (\n \n );\n } else {\n const displayData = dropdownDisplayData[addressFormatItem.name];\n let selectedValue = selectedAddress[addressFormatItem.name];\n\n if (addressFormatItem.type === AddressItemType.ThreeLetterISORegionName) {\n selectedValue = selectedValue || defaultCountryRegionId;\n }\n\n if (addressFormatItem.type === AddressItemType.AddressTypeValue) {\n selectedValue = selectedValue || defaultAddressType;\n }\n\n input = (\n \n );\n }\n\n return {\n key: addressFormatItem.name,\n AddressItem: { className, id: `${elementId}_container` },\n label: ,\n alert: ,\n input\n };\n });\n};\n\nexport const AddressAddUpdate = (props: IAddressAddInputProps): IAddressAddUpdateProps => {\n const { editAddressHeading, addAddressHeading, selectedAddress = {}, resources, hasError, onCancel, onSave, hasExternalSubmitGroup, isUpdating, addressActionResponse, telemetryContent } = props;\n const heading = selectedAddress.RecordId ? editAddressHeading : addAddressHeading;\n\n return {\n AddressForm: { className: 'msc-address-form' },\n heading: heading && ,\n items: getAddessItems(selectedAddress, props),\n isShowSaveButton: !hasExternalSubmitGroup,\n saveButton: onSave && (\n \n ),\n isShowCancelButton: !hasExternalSubmitGroup,\n cancelButton: onCancel && (\n \n ),\n hasError: hasError || false,\n error: {\n AddressError: { className: 'msc-address-form__error' },\n title: addressActionResponse && addressActionResponse.errorTitle && ,\n message: addressActionResponse && addressActionResponse.errorMessage && \n }\n };\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { AutoSuggest } from './common/address-autosuggest';\nimport { IAutoSuggestOptions } from './common/address-autosuggest.data';\n\nexport * from './actions/get-country-regions';\nexport * from './actions/get-country-state';\nexport * from './actions/get-state-provinces';\nexport * from './common';\nexport * from './modules/account-management-address';\nexport * from './modules/business-account-address';\nexport * from './modules/checkout-billing-address';\nexport * from './modules/checkout-shipping-address';\n\n/**\n * Exporting.\n */\nexport {\n AutoSuggest,\n IAutoSuggestOptions\n};\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport * as React from 'react';\n\nexport interface IAdressErrorMessage {\n message: string;\n}\n\n/**\n * Address error message.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressErrorMessageFunctionComponent: React.FC = (props: IAdressErrorMessage) => {\n const { message } = props;\n\n return (\n

\n {message}\n

\n );\n};\n\nexport default AddressErrorMessageFunctionComponent;\n","/*--------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * See License.txt in the project root for license information.\r\n *--------------------------------------------------------------*/\r\n\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nimport {\r\n IAddressAddItem,\r\n IAddressAddUpdateProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-add';\r\nimport {\r\n IAddressList,\r\n IAddressListItem,\r\n IAddressListProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-list';\r\nimport {\r\n IAddressShowItem,\r\n IAddressShowProps\r\n} from '@msdyn365-commerce-modules/address/src/modules/account-management-address/../../common/components/address-show';\r\nimport { IAccountManagementAddressViewProps } from '@msdyn365-commerce-modules/address/src/modules/account-management-address/./account-management-address';\r\n// import { AddressDetailItemComponent } from '@msdyn365-commerce-modules/address/src/common/components/address-detail-item';\r\n\r\n/**\r\n * Address show component.\r\n * @param param0 - Root param.\r\n * @param param0.AddressDetail - Address detail.\r\n * @param param0.items - IAddressShowItem[].\r\n * @returns - Address Node.\r\n */\r\nconst AddressShow: React.FC = ({ AddressDetail, items }) => {\r\n return (\r\n \r\n {items.map((item: IAddressShowItem) => {\r\n return <>{item.description};\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Address List Component.\r\n * @param param0 - Root param.\r\n * @param param0.List - Address list.\r\n * @param param0.isShowList - Boolean.\r\n * @param param0.heading - Address heading.\r\n * @param param0.items - IAddressListItem[].\r\n * @returns - AddressListComponent Node.\r\n */\r\nconst AddressList: React.FC = ({ List, isShowList, heading, items }) => {\r\n if (!isShowList) {\r\n return null;\r\n }\r\n\r\n return (\r\n \r\n {heading}\r\n {items.map((item: IAddressListItem) => {\r\n const { Item, key, error, showItems, isShowPrimaryButton, primaryButton, editButton, removeButton } = item;\r\n const { Error, isShowError, title, message } = error;\r\n\r\n // const component = showItems.items.find(address => address.key === \"AddressTypeValue\")?.description;\r\n\r\n return (\r\n \r\n \r\n {isShowError && (\r\n \r\n {title}\r\n {message}\r\n \r\n )}\r\n {isShowPrimaryButton && primaryButton}\r\n {editButton}\r\n {removeButton}\r\n \r\n );\r\n })}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Address Lists Component.\r\n * @param param0 - Root param.\r\n * @param param0.ListAddress - List address.\r\n * @param param0.heading - List heading.\r\n * @param param0.isShowEmptyListMessage - Boolean.\r\n * @param param0.emptyListMessage - Empty list message.\r\n * @param param0.addButton - Add button.\r\n * @param param0.primaryAddressList - Primary address.\r\n * @param param0.otherAddressList - Other address.\r\n * @returns Address Lists Component Node.\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 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\n/**\r\n * AddressAddUpdateComponent.\r\n * @param param0 - Root param.\r\n * @param param0.AddressForm - Address form.\r\n * @param param0.heading - Address heading.\r\n * @param param0.items - IAddressAddItem[].\r\n * @param param0.hasError - Boolean.\r\n * @param param0.error - Error message.\r\n * @param param0.isShowSaveButton - Boolean.\r\n * @param param0.saveButton - Save button.\r\n * @param param0.isShowCancelButton - Boolean.\r\n * @param param0.cancelButton - Cancel button.\r\n * @returns Address add update component node.\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 return (\r\n \r\n {heading}\r\n {items.map((item: IAddressAddItem) => {\r\n const { AddressItem, key, label, alert, input } = item;\r\n return (\r\n \r\n {label}\r\n {alert}\r\n {input}\r\n \r\n );\r\n })}\r\n {hasError && (\r\n \r\n {error.title}\r\n {error.message}\r\n \r\n )}\r\n {isShowSaveButton && saveButton}\r\n {isShowCancelButton && cancelButton}\r\n \r\n );\r\n};\r\n\r\n/**\r\n * Account Management Address View Component.\r\n * @param props - Props.\r\n * @returns - AccountAddressManagement Module.\r\n */\r\nconst AccountManagementAddressView: React.FC = props => {\r\n const { AccountAddressManagement, viewState, showAddressList, showAddOrUpdateAddress, screenReaderNotification } = props;\r\n\r\n // Remove buttons from Invoice address\r\n const invoiceAddressId = 1;\r\n const addressId = props.customerAddresses.slice().find(address => address.AddressTypeValue === invoiceAddressId)?.RecordId;\r\n const invoiceAddress = showAddressList.otherAddressList.items.find(address => address.key === addressId);\r\n if (invoiceAddress) {\r\n invoiceAddress.editButton = undefined;\r\n invoiceAddress.primaryButton = undefined;\r\n invoiceAddress.removeButton = undefined;\r\n }\r\n\r\n return (\r\n \r\n {viewState.isShowAddresList && }\r\n {viewState.isShowAddOrUpdateAddress && }\r\n {screenReaderNotification}\r\n \r\n );\r\n};\r\n\r\nexport default AccountManagementAddressView;\r\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt 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 IAdressInput {\n id?: string;\n name?: string;\n className: string;\n type: string;\n value: string;\n maxLength?: number;\n autoFocus?: boolean;\n additionalAddributes?: object;\n telemetryContent?: ITelemetryContent;\n onChange(event: React.ChangeEvent): void;\n}\n\n/**\n * Address input.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressInputFunctionComponent: React.FC = (props: IAdressInput) => {\n const {\n id: itemId,\n name,\n className,\n type,\n value,\n maxLength,\n additionalAddributes,\n autoFocus: shouldUseAutoFocus,\n telemetryContent,\n onChange\n } = props;\n\n const payLoad = getPayloadObject('click', telemetryContent!, name!);\n const attributes = getTelemetryAttributes(telemetryContent!, payLoad);\n return (\n \n );\n};\n\nexport default AddressInputFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { CacheType, createObservableDataAction, IAction, IActionContext, IActionInput, IAny, ICommerceApiSettings, ICreateActionContext, IGeneric } from '@msdyn365-commerce/core';\nimport { buildCacheKey } from '@msdyn365-commerce-modules/retail-actions';\n\nimport { CheckoutState } from './checkout-state';\n\n/**\n * CheckoutState - action input.\n */\nexport class CheckoutStateInput implements IActionInput {\n private readonly apiSettings: ICommerceApiSettings;\n\n constructor(apiSettings: ICommerceApiSettings) {\n this.apiSettings = apiSettings;\n }\n\n public getCacheKey = () => buildCacheKey('CheckoutState', this.apiSettings);\n\n public getCacheObjectType = () => 'CheckoutState';\n\n public dataCacheType = (): CacheType => 'request';\n}\n\n/**\n * CheckoutState - action.\n * @param input\n * @param ctx\n */\nexport async function checkoutStateAction(input: CheckoutStateInput, ctx: IActionContext): Promise {\n return new CheckoutState();\n}\n\n/**\n * CheckoutState - create new input for create action.\n * @param inputData\n */\nconst createInput = (inputData: ICreateActionContext>): IActionInput => {\n return new CheckoutStateInput(inputData.requestContext.apiSettings);\n};\n\n/**\n * CheckoutState - create action.\n */\nexport const checkoutStateActionDataAction = createObservableDataAction({\n action: >checkoutStateAction,\n input: createInput\n});\n\nexport default checkoutStateActionDataAction;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport classname from 'classnames';\nimport * as React from 'react';\n\nexport interface IAddressDetailItem {\n isNewLine: boolean;\n isShowLabel: boolean;\n labelText: string;\n name: string;\n value: string;\n}\n\n/**\n * Address details item.\n * @param props - Configuration of the functional component.\n * @returns React functional component.\n */\nexport const AddressDetailItemFunctionComponent: React.FC = (props: IAddressDetailItem) => {\n const {\n isNewLine,\n isShowLabel,\n labelText,\n name,\n value\n } = props;\n\n const className = `msc-address-detail__item msc-address-detail__item-${name.toLowerCase()}`;\n const isEmpty = !(value && value.length > 0);\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 });\n return (\n \n {\n isShowLabel && <>\n \n {labelText}\n \n \n \n }\n {value}\n \n );\n};\n\nexport default AddressDetailItemFunctionComponent;\n","/*--------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * See License.txt in the project root for license information.\n *--------------------------------------------------------------*/\n\nimport { Address } from '@msdyn365-commerce/retail-proxy';\nimport { Heading } from '@msdyn365-commerce-modules/data-types';\n\nexport enum AddressOperation {\n Add = 'Add',\n Show = 'Show',\n Update = 'Update',\n List = 'List'\n}\n\nexport enum AddressType {\n Shipping = 'Shipping',\n Billing = 'Billing',\n Invoice = 'Invoice',\n Company = 'Company'\n}\n\nexport interface IDropdownDisplayData {\n [index: string]: { key?: string; value?: string }[];\n}\n\nexport interface IAddressResponse {\n errorTitle?: string;\n errorMessage?: string;\n customerAddresses?: Address[];\n address?: Address;\n}\n\nexport interface IAddressConfig {\n heading?: Heading;\n primaryAddressSectionHeading?: Heading;\n otherAddressSectionHeading?: Heading;\n addAddressHeading?: Heading;\n editAddressHeading?: Heading;\n}\n\nexport interface IAddressResource {\n addressChangeCheckboxAriaLabel: string;\n addressAddButtonText: string;\n addressAddButtonAriaLabel: string;\n addressPrimaryButtonText: string;\n addressPrimaryButtonAriaLabel: string;\n addressEditButtonText: string;\n addressEditButtonAriaLabel: string;\n addressRemoveButtonText: string;\n addressRemoveButtonAriaLabel: string;\n addressSaveButtonText: string;\n addressSaveButtonAriaLabel: string;\n addressCancelButtonText: string;\n addressCancelButtonAriaLabel: string;\n addressStateDefaultSelectionText: string;\n addressNameLabel: string;\n addressNameLabelOptional?: string;\n addressNameRequiredErrorMessage: string;\n addressPhoneLabel: string;\n addressPhoneLabelOptional?: string;\n addressPhoneRequiredErrorMessage: string;\n addressZipCodeLabel: string;\n addressZipCodeLabelOptional?: string;\n addressZipCodeRequiredErrorMessage: string;\n addressCityLabel: string;\n addressCityLabelOptional?: string;\n addressCityRequiredErrorMessage: string;\n addressCountyLabel: string;\n addressCountyLabelOptional?: string;\n addressCountyRequiredErrorMessage: string;\n addressStateLabel: string;\n addressStateLabelOptional?: string;\n addressStateRequiredErrorMessage: string;\n addressThreeLetterISORegionNameLabel: string;\n addressThreeLetterISORegionNameLabelOptional?: string;\n addressThreeLetterISORegionNameRequiredErrorMessage: string;\n addressStreetRequiredErrorMessage: string;\n addressDistrictLabel: string;\n addressDistrictLabelOptional?: string;\n addressDistrictNameLabel: string;\n addressDistrictNameLabelOptional?: string;\n addressDistrictRequiredErrorMessage: string;\n addressStreetNumberLabel: string;\n addressStreetNumberLabelOptional?: string;\n addressStreetNumberRequiredErrorMessage: string;\n addressBuildingComplimentLabel: string;\n addressBuildingComplimentLabelOptional?: string;\n addressBuildingComplimentRequiredErrorMessage: string;\n addressPostboxLabel: string;\n addressPostboxLabelOptional?: string;\n addressPostboxRequiredErrorMessage: string;\n addressHouseRULabel: string;\n addressHouseRULabelOptional?: string;\n addressHouseRURequiredErrorMessage: string;\n addressFlatRULabel: string;\n addressFlatRULabelOptional?: string;\n addressFlatRURequiredErrorMessage: string;\n addressCountryOKSMCodeRULabel: string;\n addressCountryOKSMCodeRURequiredErrorMessage: string;\n addressErrorMessageTitle: string;\n addressGenericErrorMessage: string;\n addressEmptyListAddressMessage: string;\n removeAddressNotification?: string;\n}\n"],"sourceRoot":""}