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A,EADAF,EAF4B,GACC,OAIlBvrB,EAAAA,EAAAA,QAAOsrB,EAAcC,GAEpC,MAAM7qB,GAAQV,EAAAA,EAAAA,QAAOqrB,EAAWE,GAG1B9pB,GAAUC,EAAAA,EAAAA,kBAAiB,QAAStyB,EAAMiyB,iBAAmB,YAAa,IAC1EM,GAAaC,EAAAA,EAAAA,wBAAuBxyB,EAAMiyB,iBAAmBI,GAC7DxW,EAA6B,CAC/BygC,WAAYx6C,EAAO,UAAY,UAEnC,OACIlC,EAAAA,cAAA,MAAAud,OAAAC,OAAA,CAAKrL,UAAU,gBAAgBJ,KAAK,SAAQ,aAAa2f,EAAOrP,MAAOqP,GAAWiB,GAC9E3yB,EAAAA,cAAA,OAAKmS,UAAU,uBAAsB,iBAAa8J,MAAOA,GACpDwgC,GAEH,IAIDE,EAAsExL,EAAAA,GAAiByL,wBAGlG,gXAAUp6C,CAAA,CAAI6uC,UAAW+K,GA5CM,CAAC,IA8ClC","sources":["webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/pva-chat-connector.tsx?def7","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/proactive-chat-trigger.ts?734c","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/cart-amount-trigger.ts?742f","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/cart-number-of-items-trigger.ts?d5f8","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/cart-specific-product-trigger.ts?2cd6","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/helpers/consts.ts?02a5","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/date-range-trigger.ts?8bfc","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/from-specific-page-trigger.ts?fd6f","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/page-visits-trigger.ts?cce7","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/specific-CountryRegion-trigger.ts?e87a","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/specific-page-trigger.ts?6e03","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/triggers/wait-on-time-trigger.ts?d898","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/proactive/index.ts?36a2","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/helpers/ContextProvider.ts?4518","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/helpers/StyleComposers.ts?0192","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/helpers/CommerceChatStore.ts?5b45","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/components/ChatCore.tsx?a412","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/components/Chat.tsx?1581","webpack://venchi-ecommerce-msdyn365/./src/modules/pva-chat-connector/pva-chat-connector.view.tsx?3d5c","webpack://venchi-ecommerce-msdyn365/./src/themes/venchi/views/order-details.view.tsx?d810","webpack://venchi-ecommerce-msdyn365/./src/themes/venchi/views/ratings-histogram.view.tsx?62be","webpack://venchi-ecommerce-msdyn365/./src/common/address-autosuggest.ts?f5a2","webpack://venchi-ecommerce-msdyn365/./src/common/address-common.ts?cf4b","webpack://venchi-ecommerce-msdyn365/./src/common/address-format.data.ts?6cbf","webpack://venchi-ecommerce-msdyn365/./src/common/address-format.ts?4f04","webpack://venchi-ecommerce-msdyn365/./src/common/address-meta-data.ts?c6e6","webpack://venchi-ecommerce-msdyn365/./src/common/address-module.data.ts?697a","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-checkbox.tsx?eb1a","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-add.tsx?e6a6","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-alert.tsx?10d1","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-button.tsx?7f7b","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-detail-item.tsx?5209","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-dropdown.tsx?f24b","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-error-message.tsx?89ad","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-error-title.tsx?3926","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-input.tsx?8073","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-label.tsx?6864","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-list.tsx?a628","webpack://venchi-ecommerce-msdyn365/./src/common/components/address-show.tsx?3f60","webpack://venchi-ecommerce-msdyn365/./src/modules/account-management-address/account-management-address.tsx?27e7","webpack://venchi-ecommerce-msdyn365/./src/modules/account-management-address/account-management-address.view.tsx?8c9f","webpack://venchi-ecommerce-msdyn365/./src/modules/business-account-address/business-account-address.tsx?299e","webpack://venchi-ecommerce-msdyn365/./src/modules/business-account-address/business-account-address.view.tsx?5078","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/components/sign-up-button.tsx?e1d9","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/components/sign-up-error.tsx?7f8a","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/components/sign-up-input.tsx?5bbe","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/components/sign-up-label.tsx?4988","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/components/sign-up-radio-button.tsx?f8c1","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/business-sign-up.tsx?13a2","webpack://venchi-ecommerce-msdyn365/./src/modules/business-sign-up/business-sign-up.view.tsx?e2f8","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/components/search-bar.tsx?63c1","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/components/data-grid.tsx?ddec","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/components/business-partner-users-table.tsx?c677","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/components/business-partners-table.tsx?8b1d","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/business-partners.tsx?57a6","webpack://venchi-ecommerce-msdyn365/./src/modules/business-partners/business-partners.view.tsx?b34e","webpack://venchi-ecommerce-msdyn365/./src/modules/footer-category/footer-category.tsx?e0bd","webpack://venchi-ecommerce-msdyn365/./src/modules/footer-category/footer-category.view.tsx?fdce","webpack://venchi-ecommerce-msdyn365/./src/modules/order-history-with-search-and-filters/components/order-history-with-search-and-filters-view-mode-selector.component.tsx?6452","webpack://venchi-ecommerce-msdyn365/./src/modules/subscribe/subscribe.tsx?9fea","webpack://venchi-ecommerce-msdyn365/./src/modules/subscribe/subscribe.view.tsx?19c8","webpack://venchi-ecommerce-msdyn365/./src/modules/tab-item/tab-item.tsx?b1b8","webpack://venchi-ecommerce-msdyn365/./src/modules/tab-item/tab-item.view.tsx?ee3b","webpack://venchi-ecommerce-msdyn365/./src/modules/tab/tab.tsx?9ac6","webpack://venchi-ecommerce-msdyn365/./src/modules/tab/tab.view.tsx?a99d","webpack://venchi-ecommerce-msdyn365/./src/modules/tile-list-item/components/links.tsx?c969","webpack://venchi-ecommerce-msdyn365/./src/modules/tile-list-item/tile-list-item.tsx?114a","webpack://venchi-ecommerce-msdyn365/./src/modules/tile-list-item/tile-list-item.view.tsx?19a8","webpack://venchi-ecommerce-msdyn365/./src/modules/adventureworks/views/components/carticon.component.tsx?3c7c"],"sourcesContent":["/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\nimport { isOboRequest } from '@msdyn365-commerce/core-internal';\r\nimport { IPvaChatConnectorData } from './pva-chat-connector.data';\r\nimport { IPvaChatConnectorConfig, IPvaChatConnectorProps } from './pva-chat-connector.props.autogenerated';\r\n\r\nexport interface IPvaChatConnectorViewProps extends IPvaChatConnectorProps {\r\n config: IPvaChatConnectorConfig;\r\n}\r\n\r\n/**\r\n * PvaChatConnector component\r\n * @extends {React.PureComponent>}\r\n */\r\nclass PvaChatConnector extends React.PureComponent> {\r\n // Loads CDN version of Botframework-Webchat library\r\n public componentDidMount(): void {\r\n if (isOboRequest(this.props.context.request)) {\r\n return;\r\n }\r\n\r\n const url = this.props.config.botFrameworkCDNURL || this.props.context.app.config.pvaChatConnectorBotFrameworkCDNURL;\r\n const script = document.createElement('script');\r\n script.src = url;\r\n script.async = true;\r\n script.crossOrigin = 'anonymous';\r\n document.body.appendChild(script);\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (isOboRequest(this.props.context.request)) {\r\n return null;\r\n }\r\n\r\n return this.props.renderView(this.props);\r\n }\r\n}\r\n\r\nexport default PvaChatConnector;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IProactiveChatTrigger } from '../../interfaces';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\n\r\n/**\r\n * ProactiveChatTrigger class - checks if Proactive Chat should be triggered, starts the chat and sets context\r\n */\r\nabstract class ProactiveChatTrigger implements IProactiveChatTrigger {\r\n public props: IPvaChatConnectorViewProps;\r\n public context: IChatContext;\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n this.props = props;\r\n this.context = context;\r\n }\r\n\r\n /**\r\n * Generates Chat Context with included properties related to Proactive Chat\r\n * @returns TContextProvider - Chat Context\r\n */\r\n public abstract getContextProvider(): TContextProvider;\r\n\r\n /**\r\n * Generates chat welcome message to be used if Proactive Chat is triggered\r\n * @returns string - chat welcome message\r\n */\r\n public abstract getMessage(): string;\r\n\r\n /**\r\n * Validate specific trigger conditions if Proactive Chat should be initiated\r\n * @returns boolean (TRUE if Proactive Chat should be triggered)\r\n */\r\n public abstract validate(): Promise;\r\n}\r\n\r\nexport default ProactiveChatTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n// @ts-ignore\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * CartAmountTrigger class - proactive chat is triggered if cArt amount is in preset boundaries (config.proactiveOnCartAmountMin, config.proactiveOnCartAmountMax)\r\n */\r\nclass CartAmountTrigger extends ProactiveChatTrigger {\r\n private min?: number;\r\n private max?: number;\r\n private totalInCart: number = 0;\r\n\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n this.min = this.props.config.proactiveOnCartAmountMin;\r\n this.max = this.props.config.proactiveOnCartAmountMax;\r\n this.props.context.telemetry.debug(\r\n `[Chat][${CartAmountTrigger.name}] Cart amount proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\r\n );\r\n }\r\n\r\n public async validate(): Promise {\r\n const cart = await this._getCart();\r\n if (cart.isEmpty) {\r\n this.props.context.telemetry.debug(`[Chat][${CartAmountTrigger.name}] Cart was empty. Validation returning 'false'.`);\r\n return false;\r\n }\r\n\r\n this.totalInCart = cart.cart.TotalAmount || 0;\r\n let retVal = false;\r\n if (this.min) {\r\n if (this.max) {\r\n retVal = this.min <= this.totalInCart && this.totalInCart <= this.max;\r\n } else {\r\n retVal = this.min <= this.totalInCart;\r\n }\r\n } else {\r\n if (this.max) {\r\n retVal = this.totalInCart <= this.max;\r\n } else {\r\n retVal = false;\r\n }\r\n }\r\n this.props.context.telemetry.debug(\r\n `[Chat][${CartAmountTrigger.name}] Validation result: '${retVal}'; Cart total: '${this.totalInCart}'.`\r\n );\r\n return retVal;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: 'Cart Amount',\r\n eCommerceCustProactiveShoppingCartAmount: `${this.totalInCart}`\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnCartAmountMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n\r\n private async _getCart(): Promise {\r\n return getCartState(this.props.context.actionContext);\r\n }\r\n}\r\n\r\nexport default CartAmountTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n// @ts-ignore\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * CartNumberOfItemsTrigger class - proactive chat is triggered if Cart Number of Items is in preset boundaries (config.proactiveOnCartNoOfItemsMin, config.proactiveOnCartNoOfItemsMax)\r\n */\r\nclass CartNumberOfItemsTrigger extends ProactiveChatTrigger {\r\n private min?: number;\r\n private max?: number;\r\n private numberOfItems: number = 0;\r\n\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n this.min = this.props.config.proactiveOnCartNoOfItemsMin;\r\n this.max = this.props.config.proactiveOnCartNoOfItemsMax;\r\n\r\n this.props.context.telemetry.debug(\r\n `[${CartNumberOfItemsTrigger.name}] Cart number of items proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\r\n );\r\n }\r\n\r\n public async validate(): Promise {\r\n const cart = await this._getCart();\r\n if (cart.isEmpty) {\r\n this.props.context.telemetry.debug(`[Chat][${CartNumberOfItemsTrigger.name}] Cart was empty. Validation returning 'false'.`);\r\n return false;\r\n }\r\n\r\n this.numberOfItems = cart.cart.TotalItems || 0;\r\n\r\n let retVal = false;\r\n if (this.min) {\r\n if (this.max) {\r\n retVal = this.min <= this.numberOfItems && this.numberOfItems <= this.max;\r\n } else {\r\n retVal = this.min <= this.numberOfItems;\r\n }\r\n } else {\r\n if (this.max) {\r\n retVal = this.numberOfItems <= this.max;\r\n } else {\r\n retVal = false;\r\n }\r\n }\r\n this.props.context.telemetry.debug(\r\n `[${CartNumberOfItemsTrigger.name}] Validation result: '${retVal}'; Number of items in cart: '${this.numberOfItems}'.`\r\n );\r\n return retVal;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: 'Cart Number of Items',\r\n eCommerceCustProactiveShoppingCartNumberOfItems: `${this.numberOfItems}`\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnCartNoOfItemsMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n\r\n private async _getCart(): Promise {\r\n return getCartState(this.props.context.actionContext);\r\n }\r\n}\r\n\r\nexport default CartNumberOfItemsTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n// @ts-ignore\r\n/* eslint-disable no-duplicate-imports */\r\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\r\nimport { TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * CartSpecificProductTrigger class - proactive chat is triggered if a Product in the Cart is in preset list of products (config.proactiveOnCartSpecificProductList)\r\n */\r\nclass CartSpecificProductTrigger extends ProactiveChatTrigger {\r\n private product: string = '';\r\n\r\n public async validate(): Promise {\r\n let isValid = false;\r\n const cart = await this._getCart();\r\n if (!cart.isEmpty) {\r\n if (cart.cart.CartLines) {\r\n this.props.context.telemetry.debug(\r\n `[${CartSpecificProductTrigger.name}] Number of cart line items was '${cart.cart.CartLines?.length}'`\r\n );\r\n for (let i = 0; i < cart.cart.CartLines?.length; i++) {\r\n if (cart.cart.CartLines[i]) {\r\n if (this.props.config.proactiveOnCartSpecificProductList) {\r\n this.props.context.telemetry.debug(\r\n `[${CartSpecificProductTrigger.name}] Number of cart specific products was configured for proactive chat was '${this.props.config.proactiveOnCartSpecificProductList?.length}'`\r\n );\r\n // Find first item, from user-defined list of products, that matches the cart lines' itemId in the cart.\r\n for (let j = 0; j < (this.props.config.proactiveOnCartSpecificProductList?.length || 0); j++) {\r\n if (\r\n this.props.config.proactiveOnCartSpecificProductList &&\r\n cart.cart.CartLines[i].ItemId &&\r\n this.props.config.proactiveOnCartSpecificProductList[j] === cart.cart.CartLines[i].ItemId\r\n ) {\r\n this.props.context.telemetry.debug(\r\n `[${CartSpecificProductTrigger.name}] Matched cart line item ID '${cart.cart.CartLines[i].ItemId}' against user-defined list of specific products for proactive chat.`\r\n );\r\n isValid = true;\r\n break;\r\n }\r\n }\r\n }\r\n } else {\r\n // Rest of the CartLines are undefined\r\n break;\r\n }\r\n }\r\n } else {\r\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart did not contain any cart lines.`);\r\n }\r\n } else {\r\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart was empty.`);\r\n }\r\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Validation returning '${isValid}'.`);\r\n return isValid;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: 'Cart Specific Product',\r\n eCommerceCustProactiveShoppingCartSpecificProduct: `${this.product}`\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnCartSpecificProductMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n\r\n private async _getCart(): Promise {\r\n return getCartState(this.props.context.actionContext);\r\n }\r\n}\r\n\r\nexport default CartSpecificProductTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nexport enum ProactiveChatNames {\r\n DateRange = 'Date Range',\r\n FromSpecificPage = 'From Specific Page',\r\n PageVisits = 'Page Visits',\r\n SpecificLocation = 'Specific Location',\r\n SpecificPage = 'Specific Page',\r\n WaitOnTime = 'Wait On Time'\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * DateRangeTrigger class - proactive chat is triggered if current date is in preset date boundaries (config.proactiveOnDateRangeStart, config.proactiveOnDateRangeEnd)\r\n */\r\nclass DateRangeTrigger extends ProactiveChatTrigger {\r\n private start?: Date;\r\n private end?: Date;\r\n\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n this.start = this._toDate(this.props.config.proactiveOnDateRangeStart);\r\n this.end = this._toDate(this.props.config.proactiveOnDateRangeEnd);\r\n\r\n this.props.context.telemetry.debug(\r\n `[${DateRangeTrigger.name}] Proactive chat initialized with startDate: '${this.start}'; max: '${this.end}'.`\r\n );\r\n }\r\n\r\n public async validate(): Promise {\r\n const now = new Date();\r\n now.setHours(0, 0, 0, 0);\r\n\r\n let retVal = false;\r\n if (this.start) {\r\n if (this.end) {\r\n retVal = this.start.getTime() <= now.getTime() && now.getTime() <= this.end.getTime();\r\n } else {\r\n retVal = this.start.getTime() <= now.getTime();\r\n }\r\n } else if (this.end) {\r\n retVal = now.getTime() <= this.end.getTime();\r\n }\r\n\r\n this.props.context.telemetry.debug(\r\n `[${DateRangeTrigger.name}] Validation result: '${retVal}'; Current date used to compare: '${now}'.`\r\n );\r\n return retVal;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: ProactiveChatNames.DateRange,\r\n eCommerceCustProactiveFromDate: this.start ? this.start.toUTCString() : '',\r\n eCommerceCustProactiveToDate: this.end ? this.end.toUTCString() : ''\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnDateRangeMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n\r\n /**\r\n * Converts string(us-en) to date\r\n * @param date string (mm/dd/yyyy)\r\n * @returns Date or undefined\r\n */\r\n private _toDate(date?: string): Date | undefined {\r\n if (date) {\r\n const dateParts = date.split('/');\r\n return new Date(+dateParts[2], +dateParts[1] - 1, +dateParts[0]);\r\n } else {\r\n return undefined;\r\n }\r\n }\r\n}\r\n\r\nexport default DateRangeTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * FromSpecificPageTrigger class - proactive chat is triggered if user has come from specific page (the one listed in config.proactiveOnFromSpecificPageList)\r\n */\r\nclass FromSpecificPageTrigger extends ProactiveChatTrigger {\r\n public async validate(): Promise {\r\n let isValid = false;\r\n if (this.props.config.proactiveOnFromSpecificPageList) {\r\n this.props.context.telemetry.debug(\r\n `[${FromSpecificPageTrigger.name}] Number of items in user-defined list of 'From Specific Page' was '${this.props.config.proactiveOnFromSpecificPageList?.length}'.`\r\n );\r\n for (let i = 0; i < (this.props.config.proactiveOnFromSpecificPageList?.length || 0); i++) {\r\n const fromSpecificPageTrimmed: string = this.props.config.proactiveOnFromSpecificPageList[i].trim();\r\n this.props.context.telemetry.debug(\r\n `[Chat][${FromSpecificPageTrigger.name}] Current page URL: '${window.document.referrer}'.`\r\n );\r\n this.props.context.telemetry.debug(\r\n `[${FromSpecificPageTrigger.name}] Current item from user-defined list of 'From Specific Page': '${fromSpecificPageTrimmed}'.`\r\n );\r\n\r\n if (window.document.referrer.indexOf(fromSpecificPageTrimmed) > -1) {\r\n isValid = true;\r\n break;\r\n }\r\n }\r\n } else {\r\n this.props.context.telemetry.debug(\r\n `[Chat][${FromSpecificPageTrigger.name}] User-defined 'From Specific Page' list was undefined.`\r\n );\r\n }\r\n this.props.context.telemetry.debug(`[Chat][${FromSpecificPageTrigger.name}] Validation returning '${isValid}'.`);\r\n return isValid;\r\n }\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: ProactiveChatNames.FromSpecificPage,\r\n eCommerceCustProactiveCameFromPage: window.document.referrer\r\n };\r\n };\r\n }\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnFromSpecificPageMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n}\r\n\r\nexport default FromSpecificPageTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ICookieContext } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/ICookieContext';\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * PageVisitTrigger class - proactive chat is triggered if user has visited current page for (config.proactiveOnPageVisitNumber) or more times\r\n */\r\nclass PageVisitTrigger extends ProactiveChatTrigger {\r\n public visits: number = 0;\r\n private cookieName: string = 'TimesPageVisited';\r\n private expdate: Date;\r\n private cookies: ICookieContext;\r\n\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n this.cookies = this.props.context.request.cookies;\r\n this.expdate = new Date();\r\n // Set expiry date to 365 days.\r\n this.expdate.setTime(this.expdate.getTime() + 24 * 60 * 60 * 1000 * 365);\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie expiry date set to: '${this.expdate}'.`);\r\n\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie context is given: '${this.cookies.isConsentGiven()}'.`);\r\n if (this.cookies.isConsentGiven()) {\r\n this.cookies.setConsentCookie();\r\n }\r\n\r\n this._updateVisitCounter();\r\n }\r\n\r\n public async validate(): Promise {\r\n let retVal: boolean = false;\r\n\r\n if (this.props.config.proactiveOnPageVisitNumber) {\r\n retVal = this.visits >= this.props.config.proactiveOnPageVisitNumber;\r\n }\r\n\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Validation result: '${retVal}'.`);\r\n return retVal;\r\n }\r\n\r\n public clear(): void {\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Clearing cookie for page visit counter.`);\r\n this.cookies.set(this.cookieName, 0, {\r\n domain: window.location.hostname,\r\n path: window.location.pathname,\r\n expires: this.expdate\r\n });\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: ProactiveChatNames.PageVisits,\r\n eCommerceCustProactiveNumberOfVisits: `${this.visits}`\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnPageVisitMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n\r\n private _updateVisitCounter(): void {\r\n this.visits = this.cookies.get(this.cookieName).value || 0;\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter BEFORE update: '${this.visits}.`);\r\n ++this.visits;\r\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter AFTER update: '${this.visits}.`);\r\n\r\n this.cookies.set(this.cookieName, this.visits, {\r\n domain: window.location.hostname,\r\n path: window.location.pathname,\r\n expires: this.expdate\r\n });\r\n }\r\n}\r\n\r\nexport default PageVisitTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { IExtendedRequest } from '../../interfaces';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * SpecificPageTrigger class - proactive chat is triggered if user geographically uses the website from specific country/regions(config.proactiveOnSpecificCountryRegionCountry)\r\n */\r\nclass SpecificCountryRegionTrigger extends ProactiveChatTrigger {\r\n private customerCountryCode: string;\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n this.customerCountryCode = (this.props.context.request).suggestedMarket || 'n/a';\r\n this.props.context.telemetry.debug(\r\n `[${SpecificCountryRegionTrigger.name}] Customer country code set to: '${this.customerCountryCode}.'`\r\n );\r\n }\r\n\r\n public async validate(): Promise {\r\n const retVal: boolean = this.props.config.proactiveOnSpecificLocation\r\n ? this.props.config.proactiveOnSpecificLocation.toLowerCase().indexOf(this.customerCountryCode.toLowerCase()) > -1\r\n : false;\r\n this.props.context.telemetry.debug(`[Chat][${SpecificCountryRegionTrigger.name}] Validation returning '${retVal}'.`);\r\n return retVal;\r\n }\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveCountryCode: this.props.config.proactiveOnSpecificLocation || '',\r\n eCommerceCustProactiveType: ProactiveChatNames.SpecificLocation\r\n };\r\n };\r\n }\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnSpecificCountryRegionMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n}\r\n\r\nexport default SpecificCountryRegionTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * SpecificPageTrigger class - proactive chat is triggered if current page is listed in config.proactiveOnSpecificPageList\r\n */\r\nclass SpecificPageTrigger extends ProactiveChatTrigger {\r\n public async validate(): Promise {\r\n let isValid = false;\r\n if (this.props.config.proactiveOnSpecificPageList) {\r\n this.props.context.telemetry.debug(\r\n `[${SpecificPageTrigger.name}] Number of items in user-defined list of 'Specific Pages' was '${this.props.config.proactiveOnSpecificPageList?.length}'.`\r\n );\r\n for (let i = 0; i < (this.props.config.proactiveOnSpecificPageList?.length || 0); i++) {\r\n const specificPageTrimmed: string = this.props.config.proactiveOnSpecificPageList[i].trim();\r\n this.props.context.telemetry.debug(`[] Current location URL: ${window.location.href}.`);\r\n this.props.context.telemetry.debug(`[] Current item from user-defined list of 'Specific Page': ${specificPageTrimmed}.`);\r\n if (window.location.href.indexOf(specificPageTrimmed) > -1) {\r\n isValid = true;\r\n break;\r\n }\r\n }\r\n } else {\r\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] User-defined 'Specific Page' list was undefined.`);\r\n }\r\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] Validation returning '${isValid}'.`);\r\n return isValid;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: ProactiveChatNames.SpecificPage\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnSpecificPageMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n}\r\n\r\nexport default SpecificPageTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { ProactiveChatNames } from '../../helpers/consts';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../../pva-chat-connector';\r\nimport ProactiveChatTrigger from './proactive-chat-trigger';\r\n\r\n/**\r\n * WaitOnTimeTrigger - proactive chat is triggered if user stays on current page for more than (config.proactiveOnWaitTimeSeconds) seconds\r\n */\r\nclass WaitOnTimeTrigger extends ProactiveChatTrigger {\r\n private waitTimeInMilliseconds: number | undefined;\r\n\r\n constructor(props: IPvaChatConnectorViewProps, context: IChatContext) {\r\n super(props, context);\r\n if (this.props.config.proactiveOnWaitTimeSeconds && !isNaN(this.props.config.proactiveOnWaitTimeSeconds)) {\r\n this.waitTimeInMilliseconds = Number(this.props.config.proactiveOnWaitTimeSeconds) * 1000;\r\n this.props.context.telemetry.debug(\r\n `[Chat][${WaitOnTimeTrigger.name}] Wait time (ms) set to: '${this.waitTimeInMilliseconds}'.`\r\n );\r\n }\r\n }\r\n\r\n public async validate(): Promise {\r\n const retVal: boolean = this.waitTimeInMilliseconds !== undefined;\r\n this.props.context.telemetry.debug(`[Chat][${WaitOnTimeTrigger.name}] Validation returning '${retVal}'.`);\r\n return retVal;\r\n }\r\n\r\n public getContextProvider(): TContextProvider {\r\n const triggerTime = Date.now() + (this.waitTimeInMilliseconds || 0);\r\n return () => {\r\n return triggerTime > Date.now()\r\n ? this.context\r\n : {\r\n ...this.context,\r\n eCommerceCustIsProactiveChat: 'True',\r\n eCommerceCustProactiveType: ProactiveChatNames.WaitOnTime,\r\n eCommerceCustProactiveTimeOnPage: `${this.waitTimeInMilliseconds ? this.waitTimeInMilliseconds : 0}`\r\n };\r\n };\r\n }\r\n\r\n public getMessage(): string {\r\n // @TODO: Add message processing if needed\r\n return this.props.config.proactiveOnWaitTimeMessage || this.props.config.proactiveDefaultMessage;\r\n }\r\n}\r\n\r\nexport default WaitOnTimeTrigger;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport CartAmountTrigger from './triggers/cart-amount-trigger';\r\nimport CartNumberOfItemsTrigger from './triggers/cart-number-of-items-trigger';\r\nimport CartSpecificProductTrigger from './triggers/cart-specific-product-trigger';\r\nimport DateRangeTrigger from './triggers/date-range-trigger';\r\nimport FromSpecificPageTrigger from './triggers/from-specific-page-trigger';\r\nimport PageVisitTrigger from './triggers/page-visits-trigger';\r\nimport SpecificCountryRegionTrigger from './triggers/specific-CountryRegion-trigger';\r\nimport SpecificPageTrigger from './triggers/specific-page-trigger';\r\nimport WaitOnTimeTrigger from './triggers/wait-on-time-trigger';\r\n\r\ntype ProactiveChat =\r\n | typeof DateRangeTrigger\r\n | typeof SpecificPageTrigger\r\n | typeof FromSpecificPageTrigger\r\n | typeof PageVisitTrigger\r\n | typeof SpecificCountryRegionTrigger\r\n | typeof CartAmountTrigger\r\n | typeof CartNumberOfItemsTrigger\r\n | typeof CartSpecificProductTrigger\r\n | typeof WaitOnTimeTrigger;\r\n\r\n/**\r\n * List of Proactive Chat Validators in order of validation (first proactive chat that pass validation is triggered, the rest are ommited)\r\n */\r\nexport const ProactiveTriggers: ProactiveChat[] = [\r\n DateRangeTrigger,\r\n SpecificPageTrigger,\r\n FromSpecificPageTrigger,\r\n PageVisitTrigger,\r\n SpecificCountryRegionTrigger,\r\n CartAmountTrigger,\r\n CartNumberOfItemsTrigger,\r\n CartSpecificProductTrigger,\r\n WaitOnTimeTrigger\r\n];\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IRequestContextUser } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/IRequestContext';\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { ProactiveTriggers } from '../proactive';\r\nimport ProactiveChatTrigger from '../proactive/triggers/proactive-chat-trigger';\r\nimport { IPvaChatConnectorViewProps } from '../pva-chat-connector';\r\nimport { IProactiveData } from './../interfaces';\r\nimport { IChatContext, TContextProvider } from '@msdyn365-commerce-modules/chat';\r\n\r\n/**\r\n *\r\n * ContextProvider class - generates chat context, and checks for proactive triggers\r\n */\r\nclass ContextProvider {\r\n public data: IProactiveData;\r\n public props: IPvaChatConnectorViewProps;\r\n private user: IRequestContextUser;\r\n private userId: string;\r\n private context: IChatContext;\r\n private provider: TContextProvider | undefined;\r\n\r\n constructor(props: IPvaChatConnectorViewProps) {\r\n this.props = props;\r\n this.user = this.props.context.request.user;\r\n this.userId = `dl_${uuidv4()}`;\r\n this.context = this._getContext();\r\n // Proactive Chat related data\r\n this.data = {\r\n enabled: false,\r\n timeout: this.props.config.proactiveOnWaitTimeSeconds || 0,\r\n message: this.props.config.proactiveDefaultMessage\r\n };\r\n }\r\n\r\n /**\r\n * Executes Proactive Chat validation\r\n * @returns TContextProvider - a function returning IChatContext object\r\n */\r\n public async init(): Promise {\r\n try {\r\n await this._proactiveCheck();\r\n } catch (e) {\r\n // Use ?debug=true to see telemetry\r\n // If previous block fails, chat will still be available (no need to display any errors to user)\r\n this.props.telemetry.exception(e);\r\n }\r\n return this.provider || this._getProvider();\r\n }\r\n\r\n /**\r\n * Returns TContextProvider - a function returning IChatContext object\r\n */\r\n private _getProvider(): TContextProvider {\r\n return () => {\r\n return {\r\n eCommerceOperatingUnitNumber: this.props.context.request.apiSettings.oun,\r\n eCommerceBaseUrl: this.props.context.request.apiSettings.baseUrl,\r\n eCommerceDataAreaId: this.props.context.request.channel?.InventLocationDataAreaId,\r\n UserId: this.userId,\r\n // eCommerceCust...\r\n AccountNumber: this.user.customerAccountNumber ? this.user.customerAccountNumber : 'N/A',\r\n Email: this.user.emailAddress ? this.user.emailAddress : 'N/A',\r\n FirstName: this.user.firstName ? this.user.firstName : this.props.config.anonymousUserName,\r\n LastName: this.user.lastName ? this.user.lastName : 'N/A',\r\n Name: this.user.name ? this.user.name : this.props.config.anonymousUserName,\r\n eCommerceCustPageURL: window.location.href,\r\n eCommerceCustChatType: 'pva',\r\n // Proactive chat\r\n eCommerceCustIsProactiveChat: 'False',\r\n eCommerceCustProactiveType: 'N/A',\r\n // Date Range\r\n eCommerceCustProactiveFromDate: 'N/A',\r\n eCommerceCustProactiveToDate: 'N/A',\r\n // From Specific Page\r\n eCommerceCustProactiveCameFromPage: 'N/A',\r\n // No. Page Visits\r\n eCommerceCustProactiveNumberOfVisits: 'N/A',\r\n // Specific CountryRegion\r\n eCommerceCustProactiveCountryCode: 'N/A',\r\n // Specific Page => eCommerceCustPageURL\r\n // eCommerceCustProactiveSpecificPage: 'N/A',\r\n // Wait On Time\r\n eCommerceCustProactiveTimeOnPage: 'N/A',\r\n // Shopping cart amount\r\n eCommerceCustProactiveShoppingCartAmount: 'N/A',\r\n // Shopping cart number of items\r\n eCommerceCustProactiveShoppingCartNumberOfItems: 'N/A',\r\n // Shopping cart specific product\r\n eCommerceCustProactiveShoppingCartSpecificProduct: 'N/A'\r\n };\r\n };\r\n }\r\n\r\n /**\r\n * Returns default IChatContext object\r\n */\r\n private _getContext(): IChatContext {\r\n return this._getProvider()();\r\n }\r\n\r\n /**\r\n * Validates proactive triggers to check if proactive chat should be initialized\r\n */\r\n private async _proactiveCheck(): Promise {\r\n if (this.props.config.proactiveChatEnabled) {\r\n for (let i = 0; i < ProactiveTriggers.length; i++) {\r\n const proactive = new ProactiveTriggers[i](this.props, this.context);\r\n // Only first detected proactive trigger gets executed\r\n if (await this._isProactive(proactive)) {\r\n this.props.context.telemetry.debug(`First detected proactive trigger to be executed: ${proactive}`);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Validates if proactive chat should be triggered for given ProactiveTrigger\r\n * @param proactive ProactiveChatTrigger\r\n * @returns boolean\r\n */\r\n private async _isProactive(proactive: ProactiveChatTrigger): Promise {\r\n this.data.enabled = await proactive.validate();\r\n if (this.data.enabled) {\r\n this.provider = proactive.getContextProvider();\r\n this.data.message = proactive.getMessage();\r\n }\r\n return this.data.enabled;\r\n }\r\n}\r\n\r\nexport default ContextProvider;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/**\r\n * Style generating functions\r\n */\r\n/* eslint-disable no-duplicate-imports */\r\nimport { IAvatarStyling, IBubbleStyling, IChatCustomStyle, IChatStyling, IOtherStyling, ISuggestedActionStyling } from '../interfaces';\r\nimport { IPvaChatConnectorConfig } from '../pva-chat-connector.props.autogenerated';\r\n\r\nconst getChatWrapperStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n position: config.position || 'inherit',\r\n top: config.top ? config.top : 'inherit',\r\n right: config.right ? config.right : 'inherit',\r\n bottom: config.bottom ? config.bottom : 'inherit',\r\n left: config.left ? config.left : 'inherit',\r\n zIndex: 1000,\r\n display: 'flex',\r\n justifyContent: 'flex-end'\r\n };\r\n};\r\n\r\nconst getMaximizedChatWrapperStyle = (config: IPvaChatConnectorConfig, isMobileDevice: boolean): React.CSSProperties => {\r\n if (isMobileDevice) {\r\n return {\r\n height: '90%',\r\n width: '100%',\r\n bottom: '0.5em',\r\n right: '0',\r\n padding: '5px'\r\n };\r\n }\r\n return {\r\n height: config.chatHeight ? config.chatHeight : '80%',\r\n width: config.chatWidth ? config.chatWidth : 'inherit'\r\n };\r\n};\r\n\r\nconst getChatButtonStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n display: 'flex',\r\n alignItems: 'center',\r\n backgroundColor: config.startChatButtonBackgroundColor || 'white',\r\n color: config.startChatButtonTextColor || 'inherit',\r\n borderColor: config.startChatButtonBorderColor || 'inherit',\r\n borderRadius: config.startChatButtonBorderRadius || '0px',\r\n borderStyle: config.startChatButtonBorderStyle || 'solid',\r\n borderWidth: config.startChatButtonBorderWidth ? config.startChatButtonBorderWidth : '0px',\r\n padding: config.storeLogoURL ? '2px 20px 2px 2px' : '10px 20px 10px 20px',\r\n cursor: 'pointer',\r\n outlineStyle: 'none',\r\n alignSelf: 'flex-end',\r\n boxShadow: '0 0 4px rgba(102,102,102,.5)',\r\n WebkitBoxShadow: '0 0 4px rgba(102,102,102,.5)',\r\n MozBoxShadow: '0 0 4px rgba(102,102,102,.5)'\r\n };\r\n};\r\n\r\nconst getButtonStoreLogoStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n backgroundColor: config.headerBackgroundColor || 'inherit',\r\n color: config.headerTextColor || 'inherit',\r\n borderRadius: '50%',\r\n padding: '11px',\r\n width: '30px',\r\n height: '30px',\r\n marginRight: '12px',\r\n borderStyle: 'solid',\r\n borderWidth: '1px',\r\n boxSizing: 'content-box'\r\n };\r\n};\r\n\r\nconst getChatStoreLogoStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n backgroundColor: config.headerBackgroundColor || 'inherit',\r\n color: config.headerTextColor || 'inherit',\r\n borderRadius: '50%',\r\n padding: '11px',\r\n width: '30px',\r\n height: '30px',\r\n margin: '5px 12px 5px 5px',\r\n alignSelf: 'center',\r\n borderStyle: 'solid',\r\n borderWidth: '1px',\r\n boxSizing: 'content-box'\r\n };\r\n};\r\n\r\nconst getChatMessagesStyle = (config: IPvaChatConnectorConfig, minimized: boolean): React.CSSProperties => {\r\n return {\r\n display: minimized ? 'none' : 'block',\r\n backgroundColor: config.backgroundColor || 'White',\r\n height: '100%',\r\n width: '100%',\r\n boxSizing: 'border-box',\r\n position: 'relative'\r\n };\r\n};\r\n\r\nconst getChatMessageHeader = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n backgroundColor: config.headerBackgroundColor || 'inherit',\r\n backgroundImage: `url(\"${config.headerBackgroundImageURL}\")` || 'none',\r\n color: config.headerTextColor || 'inherit',\r\n backgroundRepeat: 'no-repeat',\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n flexDirection: 'row',\r\n width: '100%',\r\n position: 'absolute',\r\n top: config.chatHeaderHeight ? `-${config.chatHeaderHeight}` : '',\r\n height: config.chatHeaderHeight,\r\n borderColor: config.headerBackgroundColor ? config.headerBackgroundColor : 'inherit',\r\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\r\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\r\n };\r\n};\r\n\r\nconst getMinimizeButtonStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n borderTop: 'none',\r\n borderLeft: 'none',\r\n borderRight: 'none',\r\n borderBottom: `solid 2px ${config.headerTextColor || 'White'}`,\r\n backgroundColor: 'transparent',\r\n padding: '5px 10px 3px 10px',\r\n cursor: 'pointer',\r\n outlineStyle: 'none',\r\n marginTop: '7px',\r\n marginRight: '7px'\r\n };\r\n};\r\n\r\nconst getCloseButtonStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n border: 'none',\r\n color: config.headerTextColor || 'White',\r\n backgroundColor: 'transparent',\r\n padding: '0px 0px 0px 7px',\r\n cursor: 'pointer',\r\n outlineStyle: 'none',\r\n marginTop: '7px',\r\n marginRight: '7px'\r\n };\r\n};\r\n\r\nconst getChatMessageContent = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n height: '100%',\r\n width: '100%',\r\n borderColor: config.chatBorderColor ? config.chatBorderColor : 'inherit',\r\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\r\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\r\n };\r\n};\r\n\r\nconst getProactiveWrapperStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n flexDirection: 'column',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n backgroundColor: config.backgroundColor || 'White'\r\n };\r\n};\r\n\r\nconst getProactiveMessageHeader = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n backgroundColor: config.headerBackgroundColor || 'inherit',\r\n backgroundImage: `url(\"${config.headerBackgroundImageURL}\")` || 'none',\r\n color: config.headerTextColor || 'inherit',\r\n backgroundRepeat: 'no-repeat',\r\n display: 'flex',\r\n alignItems: 'flex-start',\r\n flexDirection: 'row',\r\n boxSizing: 'border-box',\r\n width: '100%',\r\n height: config.chatHeaderHeight,\r\n borderColor: config.headerBackgroundColor ? config.headerBackgroundColor : 'inherit',\r\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\r\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\r\n };\r\n};\r\n\r\nconst getProactiveMessageContent = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n width: '100%',\r\n padding: '10px 20px',\r\n boxSizing: 'border-box',\r\n borderColor: config.chatBorderColor ? config.chatBorderColor : 'inherit',\r\n borderStyle: config.chatBorderStyle ? config.chatBorderStyle : 'none',\r\n borderWidth: config.chatBorderWidth ? config.chatBorderWidth : '0px'\r\n };\r\n};\r\n\r\nconst getProactiveButtonStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n config.chatHeaderHeight = config.chatHeaderHeight || '70px';\r\n return {\r\n color: config.headerTextColor || 'inherit',\r\n cursor: 'pointer',\r\n padding: '5px 10px',\r\n outline: 'none',\r\n border: 'none',\r\n backgroundColor: config.headerBackgroundColor || 'inherit',\r\n borderRadius: '25px'\r\n };\r\n};\r\n\r\nconst getRedDotStyle = (config: IPvaChatConnectorConfig): React.CSSProperties => {\r\n return {\r\n background: 'Red',\r\n borderRadius: '50%',\r\n height: '5px',\r\n width: '5px',\r\n position: 'absolute',\r\n right: '10px',\r\n bottom: '33px'\r\n };\r\n};\r\n\r\n/**\r\n * Generates styles for the chat wrapper, and proactive chat parts\r\n * @param config IPvaChatConnectorConfig\r\n * @param minimized boolean\r\n * @returns IChatCustomStyle\r\n */\r\nexport const getChatStyling = (config: IPvaChatConnectorConfig, minimized: boolean, isMobileDevice: boolean): IChatCustomStyle => {\r\n return {\r\n ChatWrapperStyle: getChatWrapperStyle(config),\r\n MaximizedChatWrapperStyle: getMaximizedChatWrapperStyle(config, isMobileDevice),\r\n ChatButtonStyle: getChatButtonStyle(config),\r\n ButtonStoreLogoStyle: getButtonStoreLogoStyle(config),\r\n ChatStoreLogoStyle: getChatStoreLogoStyle(config),\r\n ChatMessagesStyle: getChatMessagesStyle(config, minimized),\r\n ChatMessageHeader: getChatMessageHeader(config),\r\n MinimizeButtonStyle: getMinimizeButtonStyle(config),\r\n CloseButtonStyle: getCloseButtonStyle(config),\r\n ChatMessageContent: getChatMessageContent(config),\r\n ProactiveWrapperStyle: getProactiveWrapperStyle(config),\r\n ProactiveMessageHeader: getProactiveMessageHeader(config),\r\n ProactiveMessageContent: getProactiveMessageContent(config),\r\n ProactiveButtonStyle: getProactiveButtonStyle(config),\r\n RedDotStyle: getRedDotStyle(config)\r\n };\r\n};\r\n\r\nconst fontFormat = (font?: string): string | undefined => {\r\n if (font && font.length > 0) {\r\n const arr = font.split(',');\r\n for (let i = 0; i < arr.length; i++) {\r\n arr[i] = `'${arr[i].trim()}'`;\r\n }\r\n font = arr.join(', ');\r\n } else {\r\n font = \"'Calibri', 'Helvetica Neue', 'Arial', 'sans-serif'\";\r\n }\r\n\r\n return font;\r\n};\r\n\r\nconst getBubbleStyling = (config: IPvaChatConnectorConfig): IBubbleStyling => {\r\n return {\r\n bubbleBackground: config.bubbleBackground || 'White',\r\n bubbleTextColor: config.bubbleTextColor || 'Black',\r\n bubbleBorderColor: config.bubbleBorderColor || '#e6e6e6',\r\n bubbleBorderRadius: config.bubbleBorderRadius || '2',\r\n bubbleBorderStyle: config.bubbleBorderStyle || 'solid',\r\n bubbleBorderWidth: config.bubbleBorderWidth || '1',\r\n bubbleFromUserBackground: config.bubbleFromUserBackground || 'White',\r\n bubbleFromUserTextColor: config.bubbleFromUserTextColor || 'Black',\r\n bubbleFromUserBorderColor: config.bubbleFromUserBorderColor || '#e6e6e6',\r\n bubbleFromUserBorderRadius: config.bubbleFromUserBorderRadius || '2',\r\n bubbleFromUserBorderStyle: config.bubbleFromUserBorderStyle || 'solid',\r\n bubbleFromUserBorderWidth: config.bubbleFromUserBorderWidth || '1'\r\n };\r\n};\r\n\r\n// eslint-disable-next-line complexity\r\nconst getOtherStyling = (config: IPvaChatConnectorConfig): IOtherStyling => {\r\n return {\r\n groupTimestamp: config.groupTimestamp || true,\r\n sendTimeout: config.sendTimeout || '20000',\r\n sendTimeoutForAttachments: config.sendTimeoutForAttachments || '120000',\r\n timestampColor: config.timestampColor || 'undefined',\r\n timestampFormat: config.timestampFormat || 'undefined',\r\n notificationDebounceTimeout: config.notificationDebounceTimeout || '400',\r\n hideToaster: config.hideToaster || true,\r\n toasterHeight: config.toasterHeight || '32',\r\n toasterMaxHeight: config.toasterMaxHeight || '32 * 5',\r\n toasterSingularMaxHeight: config.toasterSingularMaxHeight || '50',\r\n toastFontSize: config.toastFontSize || '87.5%',\r\n toastIconWidth: config.toastIconWidth || '36',\r\n toastSeparatorColor: config.toastSeparatorColor || '#E8EAEC',\r\n toastTextPadding: config.toastTextPadding || '6',\r\n toastErrorBackgroundColor: config.toastErrorBackgroundColor || '#FDE7E9',\r\n toastErrorColor: config.toastErrorColor || '#A80000',\r\n toastInfoBackgroundColor: config.toastInfoBackgroundColor || '#CEF1FF',\r\n toastInfoColor: config.toastInfoColor || '#105E7D',\r\n toastSuccessBackgroundColor: config.toastSuccessBackgroundColor || '#DFF6DD',\r\n toastSuccessColor: config.toastSuccessColor || '#107C10',\r\n toastWarnBackgroundColor: config.toastWarnBackgroundColor || '#FFF4CE',\r\n toastWarnColor: config.toastWarnColor || '#3B3A39',\r\n typingAnimationBackgroundImage: config.typingAnimationBackgroundImage || 'undefined',\r\n typingAnimationDuration: config.typingAnimationDuration || '5000',\r\n typingAnimationHeight: config.typingAnimationHeight || '20',\r\n typingAnimationWidth: config.typingAnimationWidth || '64',\r\n videoHeight: config.videoHeight || '270',\r\n markdownExternalLinkIconImage:\r\n config.markdownExternalLinkIconImage ||\r\n 'url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0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5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==)',\r\n markdownRespectCRLF: config.markdownRespectCRLF || 'true',\r\n internalLiveRegionFadeAfter: config.internalLiveRegionFadeAfter || '1000',\r\n accent: config.accent || '#0063B1',\r\n subtle: config.subtle || '#767676'\r\n };\r\n};\r\n\r\nconst getAvatarStyling = (config: IPvaChatConnectorConfig): IAvatarStyling => {\r\n return {\r\n avatarBorderRadius: config.avatarBorderRadius || '50%',\r\n avatarSize: config.avatarSize || '40',\r\n botAvatarBackgroundColor: config.botAvatarBackgroundColor || 'undefined',\r\n botAvatarImage: config.botAvatarImage || '',\r\n botAvatarInitials: config.botAvatarInitials || '',\r\n userAvatarBackgroundColor: config.userAvatarBackgroundColor || 'undefined',\r\n userAvatarImage: config.userAvatarImage || '',\r\n userAvatarInitials: config.userAvatarInitials || '',\r\n showAvatarInGroup: config.showAvatarInGroup || 'status'\r\n };\r\n};\r\n\r\nconst getSuggestedActionStyling = (config: IPvaChatConnectorConfig): ISuggestedActionStyling => {\r\n return {\r\n suggestedActionLayout: config.suggestedActionLayout || 'carousel',\r\n suggestedActionBackground: config.suggestedActionBackground || 'White',\r\n suggestedActionTextColor: config.suggestedActionTextColor || '',\r\n suggestedActionBorderColor: config.suggestedActionBorderColor || '',\r\n suggestedActionBorderRadius: config.suggestedActionBorderRadius || '0',\r\n suggestedActionBorderStyle: config.suggestedActionBorderStyle || 'solid',\r\n suggestedActionBorderWidth: config.suggestedActionBorderWidth || '2',\r\n suggestedActionDisabledBorderStyle: config.suggestedActionDisabledBorderStyle || 'solid',\r\n suggestedActionDisabledBorderWidth: config.suggestedActionDisabledBorderWidth || '2',\r\n suggestedActionDisabledTextColor: config.suggestedActionDisabledTextColor || '',\r\n suggestedActionHeight: config.suggestedActionHeight || '40',\r\n suggestedActionImageHeight: config.suggestedActionImageHeight || '20',\r\n suggestedActionsCarouselFlipperCursor: config.suggestedActionsCarouselFlipperCursor || '',\r\n suggestedActionsCarouselFlipperBoxWidth: config.suggestedActionsCarouselFlipperBoxWidth || '40',\r\n suggestedActionsCarouselFlipperSize: config.suggestedActionsCarouselFlipperSize || '20',\r\n suggestedActionsFlowMaxHeight: config.suggestedActionsFlowMaxHeight || '',\r\n suggestedActionsStackedHeight: config.suggestedActionsStackedHeight || '',\r\n suggestedActionsStackedOverflow: config.suggestedActionsStackedOverflow || '2',\r\n suggestedActionsStackedLayoutButtonMaxHeight: config.suggestedActionsStackedLayoutButtonMaxHeight || '',\r\n suggestedActionsStackedLayoutButtonTextWrap: config.suggestedActionsStackedLayoutButtonTextWrap || false\r\n };\r\n};\r\n\r\n/**\r\n * Generates style options for the Botframework-WebChat widget\r\n * @param config IPvaChatConnectorConfig\r\n * @returns IChatStyling\r\n */\r\nexport const getChatStyleOptions = (config: IPvaChatConnectorConfig): IChatStyling => {\r\n const bubbleStyling = getBubbleStyling(config);\r\n const avatarStyling = getAvatarStyling(config);\r\n const suggestedActionStyling = getSuggestedActionStyling(config);\r\n const otherStyling = getOtherStyling(config);\r\n return {\r\n hideUploadButton: true,\r\n primaryFont: fontFormat(config.primaryFont),\r\n backgroundColor: config.backgroundColor || 'White',\r\n ...bubbleStyling,\r\n ...avatarStyling,\r\n ...suggestedActionStyling,\r\n ...otherStyling\r\n };\r\n};\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport React from 'react';\r\nimport { IAction, IDispatch, INext } from '../interfaces';\r\nimport { TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../pva-chat-connector';\r\n\r\nexport class CommerceChatStore {\r\n private props: IPvaChatConnectorViewProps;\r\n private setNewMessageAction: React.Dispatch>;\r\n private provider?: TContextProvider;\r\n\r\n /**\r\n * Gets conversation token\r\n * @param props IPvaChatConnectorViewProps\r\n */\r\n public static async getDirectLineToken(props: IPvaChatConnectorViewProps): Promise {\r\n if (props.config.powervaDirectlineTokenURL && props.config.botID && props.config.tenantID) {\r\n // use direct line token url, bot id and tenant id from module config to get conversation token\r\n const url = `${props.config.powervaDirectlineTokenURL}?botId=${props.config.botID}&tenantId=${props.config.tenantID}`;\r\n const options = { method: 'GET' };\r\n return fetch(url, options)\r\n .then(r => r.json())\r\n .then(r => {\r\n if (r.token) {\r\n return r.token;\r\n } else {\r\n throw r;\r\n }\r\n });\r\n }\r\n\r\n // use direct line token url, bot id and tenant id from app config to get conversation token\r\n const url = `${props.context.app.config.pvaChatConnectorPowervaDirectlineTokenURL}?botId=${props.context.app.config.pvaChatConnectorBotID}&tenantId=${props.context.app.config.pvaChatConnectorTenantID}`;\r\n const options = {\r\n method: 'GET'\r\n };\r\n return fetch(url, options)\r\n .then(r => r.json())\r\n .then(r => {\r\n if (r.token) {\r\n return r.token;\r\n } else {\r\n throw r;\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Creates a new instance of commerce store for WebChat\r\n * @param props IPvaChatConnectorViewProps\r\n * @param provider TContextProvider\r\n * @param setNewMessage React.Dispatch>\r\n */\r\n constructor(\r\n props: IPvaChatConnectorViewProps,\r\n provider: TContextProvider | undefined,\r\n setNewMessage: React.Dispatch>\r\n ) {\r\n this.props = props;\r\n this.provider = provider;\r\n this.setNewMessageAction = setNewMessage;\r\n }\r\n\r\n /**\r\n * Handles custom chat actions\r\n * @param param0 {\r\n * dispatch: IDispatch;\r\n * next: INext;\r\n * action: IAction;\r\n * }\r\n */\r\n public async actionHandler({ dispatch, next, action }: { dispatch: IDispatch; next: INext; action: IAction }): Promise {\r\n const atype = action.type;\r\n\r\n switch (atype) {\r\n case 'DIRECT_LINE/CONNECT_FULFILLED': {\r\n // sets language\r\n dispatch({\r\n type: 'WEB_CHAT/SEND_EVENT',\r\n payload: {\r\n name: 'webchat/join',\r\n value: { language: window.navigator.language }\r\n }\r\n });\r\n break;\r\n }\r\n case 'DIRECT_LINE/INCOMING_ACTIVITY': {\r\n const activity = action.payload.activity;\r\n if (activity?.from?.role === 'bot') {\r\n // Sets flag for new message (will be use to indicate new messages from bot when chat is minimized)\r\n this.setNewMessageAction(true);\r\n }\r\n break;\r\n }\r\n case 'DIRECT_LINE/POST_ACTIVITY_FULFILLED': {\r\n switch (action.payload.activity.name) {\r\n case 'webchat/join':\r\n {\r\n if (this.provider !== undefined) {\r\n // Sets Chat Context\r\n dispatch({\r\n type: 'WEB_CHAT/SEND_EVENT',\r\n payload: {\r\n name: 'pvaSetContext',\r\n value: this.provider()\r\n }\r\n });\r\n }\r\n }\r\n break;\r\n case 'pvaSetContext':\r\n {\r\n if (this.props.config.triggerQuery) {\r\n // Initialize chat after Chat Context is set\r\n dispatch({\r\n type: 'WEB_CHAT/SEND_MESSAGE_BACK',\r\n payload: {\r\n text: this.props.config.triggerQuery\r\n }\r\n });\r\n }\r\n }\r\n break;\r\n default: {\r\n // default nothing\r\n }\r\n }\r\n break;\r\n }\r\n default: {\r\n // default nothing\r\n }\r\n }\r\n\r\n return next(action);\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport React, { FunctionComponent, useMemo, useState } from 'react';\r\nimport { getChatStyleOptions } from '../helpers/StyleComposers';\r\nimport { IChatCoreProps, IAction, IDispatch } from '../interfaces';\r\nimport { CommerceChatStore } from '../helpers/CommerceChatStore';\r\nimport { IPvaChatConnectorConfig } from '../pva-chat-connector.props.autogenerated';\r\n\r\n/**\r\n * Just a core Chat component\r\n * @param props\r\n */\r\n\r\nconst TermsAndConditionsLink = ({ href }: { href?: string }) => {\r\n return (\r\n

\r\n By using this bot, you agree to these \r\n \r\n terms and conditions\r\n \r\n

\r\n );\r\n};\r\n\r\nconst CustomWebChat = ({ config }: { config: IPvaChatConnectorConfig }) => {\r\n const { Components } = window.WebChat;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nconst ChatCore: FunctionComponent = (props: IChatCoreProps) => {\r\n const { Components } = window.WebChat;\r\n\r\n const [userId, setUserId] = useState('');\r\n useMemo(() => {\r\n if (props.provider) {\r\n const ctx = props.provider();\r\n if (ctx.UserId) {\r\n setUserId(typeof ctx.UserId === 'string' ? ctx.UserId : ctx.UserId.value.toString());\r\n }\r\n }\r\n }, [props.provider]);\r\n\r\n const directLine = useMemo(() => {\r\n return window.WebChat.createDirectLine({ token: props.directLineToken });\r\n }, [props.directLineToken]);\r\n\r\n const commerceChatStore = useMemo(() => {\r\n if (directLine && props.provider) {\r\n return new CommerceChatStore(props.config, props.provider, props.setNewMessage);\r\n }\r\n return undefined;\r\n }, [props.provider, directLine]);\r\n\r\n const store = useMemo(() => {\r\n return window.WebChat.createStore(\r\n {},\r\n ({ dispatch }: { dispatch: IDispatch }) => (next: (action: IAction) => IDispatch) => (action: IAction) => {\r\n commerceChatStore?.actionHandler({ dispatch, next, action });\r\n }\r\n );\r\n }, [commerceChatStore]);\r\n const styleOptions = getChatStyleOptions(props.config.config);\r\n\r\n return props.directLineToken !== '' ? (\r\n \r\n \r\n \r\n ) : (\r\n

Please wait while we are connecting.

\r\n );\r\n};\r\n\r\nexport default ChatCore;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport React, { FunctionComponent, useEffect, useState } from 'react';\r\nimport { isMobile, VariantType } from '@msdyn365-commerce-modules/utilities';\r\nimport ContextProvider from '../helpers/ContextProvider';\r\nimport { getChatStyling } from '../helpers/StyleComposers';\r\nimport { TContextProvider } from '@msdyn365-commerce-modules/chat';\r\nimport { IPvaChatConnectorViewProps } from '../pva-chat-connector';\r\nimport { CommerceChatStore } from '../helpers';\r\nimport ChatCore from './ChatCore';\r\n\r\nconst INVALID_TOKEN = 'INVALID_TOKEN';\r\nconst CLOSE_IMG_DATA =\r\n 'M443.6,387.1L312.4,255.4l131.5-130c5.4-5.4,5.4-14.2,0-19.6l-37.4-37.6c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4 L256,197.8L124.9,68.3c-2.6-2.6-6.1-4-9.8-4c-3.7,0-7.2,1.5-9.8,4L68,105.9c-5.4,5.4-5.4,14.2,0,19.6l131.5,130L68.4,387.1 c-2.6,2.6-4.1,6.1-4.1,9.8c0,3.7,1.4,7.2,4.1,9.8l37.4,37.6c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1L256,313.1l130.7,131.1 c2.7,2.7,6.2,4.1,9.8,4.1c3.5,0,7.1-1.3,9.8-4.1l37.4-37.6c2.6-2.6,4.1-6.1,4.1-9.8C447.7,393.2,446.2,389.7,443.6,387.1z';\r\n\r\n/**\r\n * Outer chat component, displays chat button, and proactive chat, and handles custom actions\r\n * @param props IPvaChatConnectorViewProps\r\n */\r\nconst Chat: FunctionComponent = (props: IPvaChatConnectorViewProps) => {\r\n const [loaded, setLoaded] = useState(false); // loaded & minimized are needed as ChatWidget should not be removed from DOM (it resets chat)\r\n const [minimized, setMinimized] = useState(true);\r\n const [newMessage, setNewMessage] = useState(false); // TODO: use this to indicate new message in minimized chat\r\n const [token, setToken] = useState(''); // holds conversation token for WebChat\r\n const [isProactive, setIsProactive] = useState(false); // if proactive chat is triggered\r\n const [proactiveMessage, setProactiveMessage] = useState(props.config.proactiveDefaultMessage);\r\n const [closed, setClosed] = useState(false);\r\n const [provider, setProvider] = useState();\r\n const isMobileDevice =\r\n isMobile({ variant: VariantType.Browser, context: props.context.request }) === 'xs' ||\r\n isMobile({ variant: VariantType.Viewport, context: props.context.request }) === 'xs';\r\n const chatStyle = getChatStyling(props.config, minimized, isMobileDevice); // generates chat style objects based on configuration\r\n const handleMaximizeButtonClick = () => {\r\n setLoaded(true);\r\n setMinimized(false);\r\n setNewMessage(false);\r\n };\r\n const handleMinimizeButtonClick = () => {\r\n setMinimized(true);\r\n setNewMessage(false);\r\n };\r\n const handleCloseButtonClick = () => {\r\n setClosed(true);\r\n setLoaded(false);\r\n setMinimized(true);\r\n setNewMessage(false);\r\n setIsProactive(false);\r\n };\r\n useEffect(() => {\r\n if (loaded) {\r\n CommerceChatStore.getDirectLineToken(props)\r\n .then(directLineToken => {\r\n setToken(directLineToken);\r\n })\r\n .catch(e => {\r\n setToken(INVALID_TOKEN);\r\n props.telemetry.exception(e);\r\n });\r\n }\r\n }, [loaded]);\r\n useEffect(() => {\r\n (async () => {\r\n const contextProvider = new ContextProvider(props); // Generates context (provider) and checks for proactive chat triggers\r\n const prov = await contextProvider.init();\r\n if (contextProvider.data.enabled) {\r\n props.context.telemetry.debug(`[Chat] Proactive chat was enabled: '${contextProvider.data.enabled}'.`);\r\n // if proactive chat is triggered\r\n const timeout = contextProvider.data.timeout * 1000; // timeout is there only for WaitOnTime trigger\r\n setTimeout(() => {\r\n if (!loaded) {\r\n props.context.telemetry.debug(`[Chat] Proactive chat was loaded: ${loaded}.`);\r\n setProactiveMessage(contextProvider.data.message);\r\n setIsProactive(true);\r\n }\r\n }, timeout);\r\n }\r\n setProvider(() => prov);\r\n })().catch(e => props.telemetry.exception(e));\r\n }, []);\r\n useEffect(() => {\r\n if (closed) {\r\n setClosed(false);\r\n }\r\n }, [token, provider]);\r\n const isValidToken = (): boolean => {\r\n return `${token}` !== INVALID_TOKEN;\r\n };\r\n return (\r\n \r\n {minimized && (!isProactive || (isProactive && loaded)) && (\r\n \r\n )}\r\n {minimized && isProactive && !loaded && (\r\n
\r\n
\r\n {props.config.storeLogoURL && (\r\n logo\r\n )}\r\n
\r\n
\r\n
\r\n

{proactiveMessage}

\r\n \r\n
\r\n
\r\n )}\r\n {loaded && isValidToken() && (\r\n
\r\n
\r\n {props.config.storeLogoURL && (\r\n logo\r\n )}\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n )}\r\n {!isValidToken() &&
{props.config.unableToLoadChatMessage}
}\r\n
\r\n );\r\n};\r\n\r\nexport default Chat;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\n/* eslint-disable no-duplicate-imports */\r\nimport * as React from 'react';\r\nimport Chat from './components/Chat';\r\nimport { IPvaChatConnectorViewProps } from './pva-chat-connector';\r\n\r\nexport default (props: IPvaChatConnectorViewProps) => {\r\n // Only for CDN loading check, won't be needed with npm package of Botframework-WebChat\r\n const [loaded, setLoaded] = React.useState(false);\r\n\r\n // Just to verify that CDN Chat Widget js lib is loaded\r\n // Remove this block if moving to npm package of Botframework-WebChat\r\n const interval = setInterval(() => {\r\n const t = typeof window;\r\n if (t !== 'undefined' && window.WebChat) {\r\n setLoaded(true);\r\n clearInterval(interval);\r\n }\r\n }, 100);\r\n\r\n return
{loaded && }
;\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport {\r\n IGroup,\r\n IGroupDelivery,\r\n IGroups,\r\n IHelp,\r\n IOrderDetailsViewProps,\r\n IOrderInformation,\r\n IOrderSummary,\r\n IPaymentMethods,\r\n ISalesLine\r\n} from '@msdyn365-commerce-modules/order-management';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport { SalesOrder } from '@msdyn365-commerce/retail-proxy';\r\nimport * as React from 'react';\r\nimport { IOrderDetailsProps, IOrderDetailsResources } from '../definition-extensions/order-details.ext.props.autogenerated';\r\n\r\nexport const OrderInfomation: React.FC = ({\r\n orderInformationProps,\r\n salesId,\r\n receiptId,\r\n createdDate,\r\n count,\r\n amount,\r\n channelReferenceId,\r\n channelName,\r\n channelAddress,\r\n salesOrder,\r\n resources\r\n}) => {\r\n // @ts-ignore\r\n const customTrackingUrl = salesOrder?.ExtensionProperties?.filter((tracking: { Key: string }) => tracking.Key === 'tranckingURL_CAP')[0]?.Value.StringValue;\r\n // @ts-ignore\r\n const customTrackingCarrier = salesOrder?.ExtensionProperties?.filter((tracking: { Key: string }) => tracking.Key === 'tranckingCarrier_CAP')[0]?.Value.StringValue;\r\n\r\n return (\r\n \r\n \r\n {channelName}\r\n {channelAddress}\r\n {salesId}\r\n {receiptId}\r\n {createdDate}\r\n {count}\r\n {amount}\r\n {channelReferenceId}\r\n \r\n {customTrackingUrl && \r\n
{resources.shippingInformation}
\r\n
\r\n

{resources.shippedWith} {customTrackingCarrier}

\r\n \r\n
\r\n
}\r\n
\r\n )\r\n};\r\n\r\nexport const SalesLine: React.FC = ({ salesLineProps, salesLine, buyAgainButton }) => (\r\n \r\n {salesLine}\r\n {buyAgainButton}\r\n \r\n);\r\n\r\nexport const GroupDelivery: React.FC = ({ deliveryProps, heading, count, trackingInfo, shippedStatusCheck }) => (\r\n \r\n {heading}\r\n {count}\r\n {/* shippedStatusCheck === 'shipped' ? null : trackingInfo */}\r\n \r\n);\r\n\r\nexport const Group: React.FC = ({ groupProps, delivery, address, salesLinesProps, salesLines }) => (\r\n \r\n {delivery && }\r\n \r\n {salesLines && (\r\n \r\n {salesLines.map(salesLine => (\r\n \r\n {salesLine.data.deliveryType === 'ship' && salesLine.data.shipment ? salesLine.trackingInfo : null}\r\n \r\n {salesLine.salesStatus}\r\n \r\n ))}\r\n \r\n )}\r\n {!delivery.showTimeslot && address}\r\n {delivery.showTimeslot && (\r\n \r\n {address}\r\n {delivery.pickupDateTimeslot}\r\n \r\n )}\r\n \r\n \r\n);\r\n\r\nexport const Groups: React.FC = ({ groupsProps, groups }) => (\r\n \r\n {groups.map((group, index) => (\r\n \r\n ))}\r\n \r\n);\r\n\r\nconst _renderCustomTaxLine = (taxAmount: number): JSX.Element | null => {\r\n //const { estimatedTaxLabel, yetToBeCalculatedText} = props.resources;\r\n\r\n return (\r\n
\r\n

\r\n Tax\r\n \r\n {taxAmount}\r\n \r\n

\r\n
\r\n )\r\n}\r\n\r\nexport const OrderSummary: React.FC = ({\r\n orderSummaryProps,\r\n heading,\r\n subtotal,\r\n shipping,\r\n tax,\r\n totalAmount,\r\n earnedPoints,\r\n ...other\r\n}) => {\r\n // @ts-ignore\r\n const locale = other.locale;\r\n // @ts-ignore\r\n const taxAmount = other.taxAmount;\r\n \r\n return (\r\n \r\n {heading}\r\n {subtotal}\r\n {shipping}\r\n {locale.toLowerCase() == 'en-gb' && taxAmount > 0 ? _renderCustomTaxLine(taxAmount) : tax}\r\n {totalAmount}\r\n {earnedPoints}\r\n \r\n );\r\n};\r\n\r\nexport const Payment: React.FC = ({ paymentMethodsProps, title, methods }) => (\r\n \r\n {title}\r\n {methods}\r\n \r\n);\r\n\r\nexport const Help: React.FC = ({ helpProps, needHelpLabel, helpLineNumberLabel, contactNumber }) => (\r\n \r\n {needHelpLabel}\r\n {helpLineNumberLabel}\r\n {contactNumber}\r\n \r\n);\r\n\r\nconst OrderDetailsView: React.FC> = ({\r\n salesOrder,\r\n moduleProps,\r\n heading,\r\n alert,\r\n loading,\r\n orderInfomation,\r\n orderSummary,\r\n payment,\r\n help,\r\n groups,\r\n resources\r\n}) => {\r\n // prettier-ignore\r\n // @ts-ignore\r\n const customTrackingNumber = salesOrder?.ExtensionProperties?.filter((tracking: { Key: string }) => tracking.Key === 'trackingId_CAP')[0]?.Value.StringValue;\r\n // prettier-ignore\r\n // @ts-ignore\r\n const customTrackingStatus = salesOrder?.ExtensionProperties?.filter((tracking: { Key: string }) => tracking.Key === 'trakingStatus_CAP')[0]?.Value.StringValue;\r\n const locale = moduleProps.moduleProps.context.request.locale;\r\n // @ts-ignore\r\n const salesOrderData = moduleProps?.moduleProps?.data?.orderHydration?.result?.salesOrder;\r\n const taxAmount = salesOrderData?.TaxAmount;\r\n const extraOrdersSummaryEu = {\r\n locale: locale,\r\n taxAmount: taxAmount\r\n };\r\n\r\n return (\r\n \r\n {heading}\r\n {alert}\r\n {loading}\r\n {orderInfomation && }\r\n {groups && }\r\n \r\n {orderSummary && }\r\n {payment && }\r\n \r\n {help && }\r\n \r\n );\r\n};\r\n\r\nexport default OrderDetailsView;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\nimport { IHistogramItemViewProps, IRatingsHistogramViewProps } from '@msdyn365-commerce-modules/ratings-reviews';\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\n\r\nconst RatingsHistogramView: React.FC = props => {\r\n const { /* heading, */ histogramItems, histogramProps, moduleProps } = props;\r\n // @ts-ignore\r\n const title = props.resources.ratingReviewsText ?? '';\r\n return (\r\n \r\n

{title}

\r\n {_averageRating(props)}\r\n \r\n {histogramItems.map((item, index) => {\r\n return histogramItem(item, 5 - index);\r\n })}\r\n \r\n
\r\n );\r\n};\r\n\r\nconst getStar = (star: number, value: number): string => {\r\n if (star - value <= 0) return '__star';\r\n else if (star - value > 0 && star - value < 1) return '__half-star';\r\n else return '__empty-star';\r\n};\r\n\r\nconst _renderStars = (value: number, className?: string) => {\r\n return (\r\n \r\n );\r\n};\r\n\r\nconst _averageRating = (props: IRatingsHistogramViewProps) => {\r\n // @ts-ignore\r\n const avRating = props?.averageRating?.props?.avgRating ?? 0;\r\n // @ts-ignore\r\n const totalReviews = props?.averageNumber?.props?.summary?.reviewsCount ?? 0;\r\n const ratingsLabel = props?.resources?.ratingReviewsText ?? '';\r\n return (\r\n
\r\n
\r\n {props.context.cultureFormatter.formatNumber(avRating)}\r\n /5\r\n
\r\n
\r\n {`${totalReviews} ${ratingsLabel}`}\r\n {_renderStars(avRating, 'heading')}\r\n
\r\n
\r\n );\r\n};\r\n\r\nconst histogramItem = (props: IHistogramItemViewProps, starsNumber: number) => {\r\n return (\r\n \r\n {/* {props.starLabel} */}\r\n {_renderStars(starsNumber, 'histogram')}\r\n {props.bar}\r\n {/* {props.percentage} */}\r\n \r\n );\r\n};\r\n\r\nexport default RatingsHistogramView;\r\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE 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(\n telemetry: ITelemetry,\n autoSuggestOptions: IAutoSuggestOptions,\n BingMapsApiKey?: string,\n countryCode?: string,\n defaultLanguageId?: string\n ) {\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 = (\n inputId: string,\n containerId: string,\n selectedSuggestionCallback: (result: Microsoft.Maps.ISuggestionResult) => void\n ): 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 // eslint-disable-next-line @typescript-eslint/naming-convention\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IActionInput, ICoreContext, IObservableAction, ITelemetry } from '@msdyn365-commerce/core';\nimport {\n Address,\n AddressPurpose,\n CountryRegionInfo,\n StateProvinceInfo\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport {\n addAddress,\n AddressManagementInput,\n ArrayExtensions,\n updateAddress,\n updatePrimaryAddress\n} 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 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 (\n addressAction: IObservableAction,\n address: Address\n ): 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 (\n addressAction: IObservableAction,\n input: IActionInput | IActionInput[],\n address: Address\n ): 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(\n purpose => purpose.AddressType === address.AddressTypeValue\n );\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\nexport enum AddressItemDisplayType {\n Input = 'Input',\n Dropdown = 'Dropdown',\n Checkbox = 'Checkbox'\n}\n\nexport enum AddressValidationRuleType {\n Required = 'Required',\n Format = 'Format',\n MaxLength = 'MaxLength'\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport {\n Address,\n AddressPurpose,\n CountryRegionInfo,\n StateProvinceInfo\n} from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { get, set } from 'mobx';\n\nimport { AddressItemType, IAddressDropdownsData, IAddressItem, IAddressValidationRule } 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.Description\n };\n });\n }\n\n public getPrefilledAddressDropdownData = (\n stateDefaultSelectionText: string,\n stateProvinceInfo?: StateProvinceInfo[]\n ): 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 = (\n address: Address,\n validationError: Address,\n countryRegionId: string,\n propertyName?: string\n ): 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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { PhoneRegex } from '@msdyn365-commerce-modules/retail-actions';\n\nimport {\n AddressItemDisplayType,\n AddressItemType,\n AddressValidationRuleType,\n 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 private readonly metaData: IAddressItem[] = [];\n\n private readonly resources: IAddressResource;\n\n private readonly requiredFieldRegEx: string = '\\\\S';\n\n private readonly maxLengthRegEx: string = '^.{0,20}$';\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 =\n required !== undefined\n ? required\n : [\n AddressItemType.AddressTypeValue,\n AddressItemType.Name,\n AddressItemType.ZipCode,\n AddressItemType.City,\n AddressItemType.State,\n AddressItemType.ThreeLetterISORegionName,\n AddressItemType.Street\n ];\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 =\n 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 case AddressValidationRuleType.MaxLength: {\n if (type === AddressItemType.Phone) {\n validationRules.push(this._validationRule(ruleType, this.maxLengthRegEx, message));\n }\n\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 * 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 Multiple = 'Multiple'\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 addressAddNewButtonText?: string;\n addressAddNewButtonAriaLabel?: 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 addressPhoneMaxLengthErrorMessage?: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 addressProductImage?: string;\n addressProductNumberText?: string;\n addressProductText?: string;\n addressProductUnitPriceText?: string;\n addressProductUOMText?: string;\n addressProductQuantityText?: string;\n addressProductActionsText?: string;\n addressSelectAllRowsText?: string;\n addressProductAddressText?: string;\n addressShipMultipleText?: string;\n addressShipMultipleAriaLabel?: string;\n saveAndContinueBtnLabel?: string;\n addressShipSingleText?: string;\n addressShipSingleAriaLabel?: string;\n clearSelectionButtonText?: string;\n clearSelectionButtonAriaLabel?: string;\n chooseAddressForSelectedItemsText?: string;\n chooseAddressForSelectedItemsAriaLabel?: string;\n noAddressSelectedAriaLabel?: string;\n unavailableProductErrorMessage?: string;\n outOfStockProductErrorMessage?: string;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface 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.\n * All rights reserved. See LICENSE 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,\n AddressItemType,\n AddressValidationRuleType,\n IAddressDropdownsData,\n IAddressItem,\n 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 {\n addressFormat,\n addressType,\n dropdownDisplayData,\n defaultCountryRegionId,\n defaultAddressType,\n validationError = {},\n onInputChange,\n onDropdownChange,\n shouldAutoFocus\n } = 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()}`, {\n 'msc-address-form__item-newline': addressFormatItem.isNewLine,\n 'address-form__item-invalid': errorMessage\n });\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 {\n editAddressHeading,\n addAddressHeading,\n selectedAddress = {},\n resources,\n hasError,\n onCancel,\n onSave,\n hasExternalSubmitGroup,\n isUpdating,\n addressActionResponse,\n telemetryContent\n } = 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 \n ),\n message: addressActionResponse && addressActionResponse.errorMessage && (\n \n )\n }\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * 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 {message && <>{message}}\n \n );\n};\n\nexport default AddressAlertFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface 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 );\n};\n\nexport default AddressButtonFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE 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 { isNewLine, isShowLabel, labelText, name, value } = 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\n ? `msc-address-detail__item msc-address-detail__item-address-detail_${labelText}`\n : classname(className, { 'msc-address-detail__item-empty': isEmpty, 'msc-address-detail__item-newline': isNewLine });\n return (\n \n {isShowLabel && (\n <>\n {labelText}\n \n \n )}\n {value}\n \n );\n};\n\nexport default AddressDetailItemFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IAdressDropdown {\n id: string;\n name: string;\n className: string;\n value: string | number;\n additionalAddributes?: object;\n recordId?: string;\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 { id: itemId, name, className, value, additionalAddributes, displayData, onChange, recordId } = props;\n\n return (\n \n {displayData && displayData.map(item => getDropdownItem(item.key, item.value, value))}\n \n );\n};\n\nexport default AddressDropdownFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface 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

{message}

;\n};\n\nexport default AddressErrorMessageFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface 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

{title}

;\n};\n\nexport default AddressErrorTitleFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface 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.\n * All rights reserved. See LICENSE 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 { id: itemId, text } = props;\n\n return (\n \n );\n};\n\nexport default AddressLabelFunctionComponent;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as Msdyn365 from '@msdyn365-commerce/core';\nimport { 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 isEditAsyncCustomerFeatureEnabled?: boolean;\n}\n\nconst getButtonAriaLabel = (ariaLabel: string, addressName?: string): string => {\n return ariaLabel.replace('{addressName}', addressName || '');\n};\n\nconst getAddressList = (\n className: string,\n addresses: Address[],\n showPrimaryButton: boolean,\n props: IAddressListInputProps,\n heading?: HeadingData\n): IAddressList => {\n const {\n resources,\n isUpdating,\n addressActionResponse,\n selectedAddress,\n addressFormat,\n onEditAddress,\n onRemoveAddress,\n onUpdatePrimaryAddress,\n addressPurposes,\n telemetryContent\n } = 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 and edit async customer feature is disabled.\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.isEditAsyncCustomerFeatureEnabled || false\n ? false\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 },\n requestContext: props.contextRequest\n }}\n />\n );\n\n // IF the 'Edit async customer' feature is enabled. we won't be disabling the button in this scenario.\n // ELSE disable the 'Add' button only when the customer is async AND the 'Async Address Creation' feature is disabled.\n const disableAddButton: boolean =\n props.isEditAsyncCustomerFeatureEnabled || false\n ? false\n : (props.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\n (props.isAsyncCustomer || false) &&\n !(props.isAsyncCustomerAddressCreationFeatureEnabled || false);\n\n return {\n ListAddress: { className: 'ms-address-list' },\n heading: headingComponent,\n isShowEmptyListMessage: addresses.length === 0,\n emptyListMessage:

{resources.addressEmptyListAddressMessage}

,\n addButton: (\n \n ),\n primaryAddressList: getPrimaryAddressList(props),\n otherAddressList: getOtherAddressList(props)\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE 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(\n addressTypeValue => addressTypeValue.AddressType.toString() === (address[item.name] || '').toString()\n );\n if (addressType) {\n const addressTypeDescription = addressType.Description || '';\n return {\n key: item.name,\n description: (\n \n )\n };\n }\n }\n return {\n key: item.name,\n description: (\n \n )\n };\n })\n };\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\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 readonly editAsyncCustomerFeatureName: string = 'Dynamics.AX.Application.RetailEnableAsyncCustomerEditFeature';\n\n private asyncCustomerAddressCreationFeatureIsEnabled?: boolean = false;\n private isEditAsyncCustomerFeatureEnabled: 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,\n this.props.telemetry\n );\n }\n\n public async componentDidMount(): Promise {\n const {\n context: {\n telemetry,\n actionContext: {\n requestContext: { channel }\n }\n },\n config: { autoSuggestionEnabled, autoSuggestOptions }\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 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(\n telemetry,\n options,\n channel?.BingMapsApiKey,\n channel?.ChannelCountryRegionISOCode,\n channel?.DefaultLanguageId\n );\n\n reaction(\n () =>\n this.props.data.storeSelectorStateManager.result?.loadMapApi !== undefined &&\n (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 () => {\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(\n nextProps: IAccountManagementAddressProps,\n nextState: IAccountManagementAddressViewState\n ): boolean {\n if (this.state === nextState && this.props.data === nextProps.data) {\n return false;\n }\n return true;\n }\n\n public render(): JSX.Element {\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 this.isEditAsyncCustomerFeatureEnabled =\n data.featureState?.result?.find(feature => feature.Name === this.editAsyncCustomerFeatureName)?.IsEnabled || false;\n\n const viewProps = {\n ...this.props,\n infoMessageBar: (this.props.context.app?.config?.canRenderAsyncCustomerDataAsUnmodifiable || false) &&\n !this.isEditAsyncCustomerFeatureEnabled &&\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 * 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 * Clear Address Fields.\n */\n @action\n private readonly _clearAddressFields = (): void => {\n const addressFormatItem = this.addressFormat.getAddressFormat(\n this.addUpdateAddress.ThreeLetterISORegionName || this.countryRegionId\n );\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 /**\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 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 * 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 isEditAsyncCustomerFeatureEnabled: this.isEditAsyncCustomerFeatureEnabled\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 const formattedValue = name === 'Phone' ? value.toString().trim() : value;\n set(this.addUpdateAddress, { [name]: formattedValue });\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 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 =\n this.currentOperation === AddressOperation.Update\n ? this.addressCommon.updateCustomerAddress(this.addUpdateAddress)\n : this.addressCommon.addCustomerAddress(this.addUpdateAddress);\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 (\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 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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { 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 = ({ AddressDetail, items }) => {\n return (\n \n {items.map((item: IAddressShowItem) => {\n return <>{item.description};\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 = ({ List, isShowList, heading, items }) => {\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 \n {isShowError && (\n \n {title}\n {message}\n \n )}\n {isShowPrimaryButton && primaryButton}\n {editButton}\n {removeButton}\n \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 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 return (\n \n {heading}\n {items.map((item: IAddressAddItem) => {\n const { AddressItem, key, label, alert, input } = item;\n return (\n \n {label}\n {alert}\n {input}\n \n );\n })}\n {hasError && (\n \n {error.title}\n {error.message}\n \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.\n * All rights reserved. See LICENSE 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 = 0; // Default to None (This value set in HQ as 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 }, this.excludedList, props.isRequired ? undefined : []),\n this.addressPurposes\n );\n this.addressCommon = new AddressCommon(context, resources, telemetry);\n this.validationError = {};\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\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 // eslint-disable-next-line @typescript-eslint/naming-convention\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(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this.excludedList, []),\n this.addressPurposes\n );\n updateForm(false, this.addUpdateAddress);\n }\n } else {\n // Get new addressFormat if address was a required field\n this.addressFormat = new AddressFormat(\n this.countryRegions,\n new AddressMetaData({ ...resources }, this.excludedList, this.props.isRequired ? undefined : []),\n this.addressPurposes\n );\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 (\n ObjectExtensions.isNullOrUndefined(addressFormatItem) ||\n !addressFormatItem.validationRules ||\n addressFormatItem.validationRules.length === 0\n ) {\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { 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 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 )}\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.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Button, getPayloadObject, getTelemetryAttributes, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nexport interface IBusinessSignUpButtonProps {\n id?: string;\n className: string;\n text: string;\n ariaLabel: string;\n disabled?: boolean;\n link?: string;\n telemetryContent: ITelemetryContent;\n onClick?(event: React.MouseEvent): void;\n}\n\nexport const SignUpButton: React.FC = ({\n id,\n className,\n text,\n ariaLabel,\n telemetryContent,\n disabled,\n link,\n onClick\n}) => {\n const payLoad = getPayloadObject('click', telemetryContent, text);\n const attributes = getTelemetryAttributes(telemetryContent, payLoad);\n return (\n \n {text}\n \n );\n};\n\nexport default SignUpButton;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nexport interface IBusinessSignUpErrorProps {\n id?: string;\n className: string;\n type?: string;\n message?: string;\n}\n\nexport const SignUpError: React.FC = ({ id, className, type = 'page', message }) => {\n const errorClassName = `${className}__${type}-error`;\n\n return (\n \n

{message}

\n
\n );\n};\n\nexport default SignUpError;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { INodeProps } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { InputType } from '../business-sign-up';\n\nexport interface IBusinessSignUpInputProps {\n id?: string;\n type: InputType;\n value?: string;\n pattern?: string;\n className: string;\n maxLength?: string;\n isRequired: boolean;\n fieldReference?: React.RefObject;\n onChange?(event: React.ChangeEvent): void;\n}\n\nexport interface IBusinessSignUpInput {\n key: string;\n AddressItem: INodeProps;\n label: React.ReactNode;\n alert: React.ReactNode;\n input: React.ReactNode;\n}\n\nconst GetMaxLength = (maxLength?: string): number | undefined => {\n if (maxLength) {\n const parsedMaxLength = Number.parseInt(maxLength, 10);\n if (!isNaN(parsedMaxLength)) {\n return parsedMaxLength;\n }\n }\n\n return undefined;\n};\n\nexport const SignUpInput: React.FC = ({\n id,\n type,\n value,\n pattern,\n className,\n maxLength,\n isRequired,\n onChange,\n fieldReference\n}) => {\n if (type === InputType.TextArea) {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nexport default SignUpInput;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IBusinessSignUpLabelProps {\n id: string;\n forId: string;\n className: string;\n text: string;\n}\n\nexport const SignUpLabel: React.FC = ({ id, forId, className, text }) => (\n \n);\n\nexport default SignUpLabel;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport * as React from 'react';\n\nexport interface IBusinessSignUpRadioButtonProps {\n id: string;\n isRequired: boolean;\n options: IBusinessSignUpRadioButtonOptionProps[];\n}\n\nexport interface IBusinessSignUpRadioButtonOptionProps {\n id: string;\n name: string;\n value: string;\n label: string;\n className: string;\n onChange(event: React.ChangeEvent): void;\n}\n\nexport const BusinessSignUpRadioButtonOption: React.FC = props => {\n const { id, name, value, label, className, onChange } = props;\n return (\n
\n \n \n
\n );\n};\n\nexport default BusinessSignUpRadioButtonOption;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent, getUrlSync, RichTextComponent, Text } from '@msdyn365-commerce/core';\nimport { Address, BusinessPartnerProspect } from '@msdyn365-commerce/retail-proxy';\nimport { createProspectAsync } from '@msdyn365-commerce/retail-proxy/dist/DataActions/BusinessPartnersDataActions.g';\nimport { EmailRegex } from '@msdyn365-commerce-modules/retail-actions';\nimport { getTelemetryObject, IModuleProps, INodeProps, ITelemetryContent } from '@msdyn365-commerce-modules/utilities';\nimport classnames from 'classnames';\nimport * as React from 'react';\n\nimport { IBusinessSignUpConfig, IBusinessSignUpProps } from './business-sign-up.props.autogenerated';\nimport { SignUpButton, SignUpError, SignUpInput, SignUpLabel } from './components';\nimport { IBusinessSignUpRadioButtonOptionProps, BusinessSignUpRadioButtonOption } from './components/sign-up-radio-button';\n\nexport interface IBusinessSignUpExtendedProps extends IBusinessSignUpProps {\n formItems?: IFormItem[];\n}\n\nexport interface IBusinessSignUpItem {\n wrapper: INodeProps;\n isAddressInput?: boolean;\n id: string;\n label: React.ReactNode;\n errorMessage: React.ReactNode;\n input?: React.ReactNode;\n}\n\nexport interface IBusinessState {\n isReady: boolean;\n formItems: IFormItem[];\n addressHasErrors: boolean;\n showAddressErrors: boolean;\n hasSubmitErrors: boolean;\n}\n\nexport interface IBusinessSignUpLocalAccount {\n FormWrapper: INodeProps;\n items: IBusinessSignUpItem[];\n buttons: React.ReactNode[];\n errorMessage: React.ReactNode[];\n disclaimer: React.ReactNode;\n}\n\nexport interface IBusinessSignUpViewProps {\n className: string;\n businessSignUp: IModuleProps;\n ContainerWrapper: INodeProps;\n heading: React.ReactNode;\n businessSignUpForm: IBusinessSignUpLocalAccount;\n formItems: IFormItem[];\n}\n\nexport interface IFormItem {\n id: string;\n type: InputType;\n label: string;\n value: string;\n maxChars?: string;\n isRequired: boolean;\n pattern?: string;\n address?: Address;\n customClass?: string;\n fieldReference?: React.RefObject;\n radioButtonOptions?: IBusinessSignUpRadioButtonOptionProps[];\n radioButtonGroupClass?: string;\n}\n\nexport enum InputType {\n // eslint-disable-next-line @typescript-eslint/no-shadow -- Text enum doesn't override the imported Text\n Text = 'text',\n Address = 'address',\n Email = 'email',\n TextArea = 'textarea',\n RadioButton = 'radiobutton'\n}\n\nexport enum InputID {\n FirstName = 'FirstName',\n LastName = 'LastName',\n Email = 'CompanyEmail',\n CompanyName = 'CompanyName',\n Address = 'CompanyAddress',\n JobTitle = 'JobTitle',\n Size = 'CompanySize',\n Department = 'Department',\n Comment = 'Comment',\n ProspectType = 'ProspectType'\n}\n\nexport const renderInputSection = (\n inputs: IFormItem[],\n className: string,\n needToReset: boolean,\n onInputChange: (event: React.ChangeEvent) => void,\n showErrors: boolean,\n addressForm?: React.ReactNode,\n updateAddress?: (errors: boolean, currAddress?: Address) => void\n): IBusinessSignUpItem[] => {\n return inputs.map((element, index) => {\n const {\n id,\n type,\n label,\n maxChars,\n isRequired,\n pattern,\n customClass,\n value,\n fieldReference,\n radioButtonOptions,\n radioButtonGroupClass\n } = element;\n\n const baseSignUpItem: IBusinessSignUpItem = {\n wrapper: {\n className: classnames(className, `${className}-${id}`, customClass)\n },\n id,\n label: ,\n errorMessage: \n };\n\n if (type === InputType.Address) {\n if (addressForm) {\n baseSignUpItem.isAddressInput = true;\n baseSignUpItem.input = (\n <>\n {React.cloneElement(addressForm as React.ReactElement, {\n updateForm: updateAddress,\n hasError: showErrors,\n isRequired: isRequired === undefined ? false : isRequired,\n resetAddress: needToReset\n })}\n \n );\n } else {\n // If the address slot is not filled, remove this input from the form\n inputs.splice(index, 1);\n }\n } else if (type === InputType.RadioButton) {\n baseSignUpItem.input = (\n
\n {radioButtonOptions &&\n radioButtonOptions.map((element, index) => {\n return ;\n })}\n
\n );\n } else {\n baseSignUpItem.input = (\n \n );\n }\n\n return baseSignUpItem;\n });\n};\n\n/**\n *\n * Business Request Form Modules\n * Form that a business can use to submit a request to become a partner with Microsoft.\n * @extends {React.Component>}\n */\nclass BusinessSignUp extends React.Component {\n private readonly moduleClassName: string = 'ms-business-sign-up';\n private readonly prospectRadioButtonName: string = 'business-sign-up-radio-button';\n\n // Used as default data\n // eslint-disable-next-line @typescript-eslint/member-ordering\n public BusinessSignUpDefaultInputs: IFormItem[] = [\n {\n id: InputID.ProspectType,\n type: InputType.RadioButton,\n label: this.props.resources.prospectTypeLabel,\n value: '',\n isRequired: true,\n customClass: 'width-100',\n radioButtonGroupClass: 'radio-option-container',\n radioButtonOptions: [\n {\n id: `${InputID.ProspectType}-buyer`,\n name: this.prospectRadioButtonName,\n value: '1', // Buyer\n label: this.props.resources.prospectTypeBuyerLabel,\n className: `${this.moduleClassName}__form-item-radio-button-option`,\n onChange: this._onInputChange.bind(this)\n },\n {\n id: `${InputID.ProspectType}-seller`,\n name: this.prospectRadioButtonName,\n value: '2', // Seller\n className: `${this.moduleClassName}__form-item-radio-button-option`,\n label: this.props.resources.prospectTypeSellerLabel,\n onChange: this._onInputChange.bind(this)\n }\n ]\n },\n {\n id: InputID.FirstName,\n type: InputType.Text,\n label: this.props.resources.firstNameLabel,\n value: '',\n isRequired: true,\n customClass: 'width-25'\n },\n {\n id: InputID.LastName,\n type: InputType.Text,\n label: this.props.resources.lastNameLabel,\n value: '',\n isRequired: true,\n customClass: 'width-25'\n },\n {\n id: InputID.Email,\n type: InputType.Email,\n label: this.props.resources.emailAddressLabel,\n value: '',\n isRequired: true,\n pattern: EmailRegex.defaultRegex.source,\n customClass: 'width-50'\n },\n {\n id: InputID.CompanyName,\n type: InputType.Text,\n label: this.props.resources.companyLabel,\n value: '',\n isRequired: true,\n customClass: 'width-50'\n },\n {\n id: InputID.Department,\n type: InputType.Text,\n label: this.props.resources.departmentLabel,\n value: '',\n isRequired: false,\n customClass: 'width-50'\n },\n {\n id: InputID.JobTitle,\n type: InputType.Text,\n label: this.props.resources.jobTitleLabel,\n value: '',\n isRequired: false,\n customClass: 'width-50'\n },\n {\n id: InputID.Size,\n type: InputType.Text,\n label: this.props.resources.companySizeLabel,\n value: '',\n isRequired: false,\n customClass: 'width-50'\n },\n {\n id: InputID.Address,\n type: InputType.Address,\n label: this.props.resources.companyAddressLabel,\n value: '',\n isRequired: false,\n customClass: 'width-100'\n },\n {\n id: InputID.Comment,\n type: InputType.TextArea,\n label: this.props.resources.commentLabel,\n value: '',\n isRequired: false,\n customClass: 'width-100'\n }\n ];\n\n private readonly formChildReference: React.RefObject = React.createRef();\n\n private needsToReset: boolean = false;\n\n private readonly telemetryContent: ITelemetryContent;\n\n constructor(props: IBusinessSignUpExtendedProps) {\n super(props);\n\n this.state = {\n isReady: false,\n formItems: this.props.formItems || this._addedReference(),\n addressHasErrors: false,\n showAddressErrors: false,\n hasSubmitErrors: false\n };\n this.telemetryContent = getTelemetryObject(\n this.props.context.request.telemetryPageName!,\n this.props.friendlyName,\n this.props.telemetry\n );\n }\n\n public componentDidMount(): void {\n this.formChildReference.current?.focus();\n }\n\n public shouldComponentUpdate(nextProps: IBusinessSignUpExtendedProps, nextState: IBusinessState): 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 {\n const { config } = this.props;\n const { formItems } = this.state;\n const { className, heading } = config;\n\n const viewProps = {\n ...this.props,\n businessSignUp: {\n moduleProps: this.props,\n className: classnames(this.moduleClassName, className)\n },\n ContainerWrapper: {\n className: `${this.moduleClassName}__container`\n },\n heading: (\n \n ),\n businessSignUpForm: this._renderForm(),\n formItems\n };\n\n return this.props.renderView(viewProps) as React.ReactElement;\n }\n\n /**\n * Handle the heading change event.\n * @param event - Content Editable Event.\n */\n public handleHeadingChange = (event: ContentEditableEvent): void => {\n this.props.config.heading.text = event.target.value;\n };\n\n private _renderForm(): IBusinessSignUpLocalAccount {\n const { config, resources, slots } = this.props;\n const { showAddressErrors, hasSubmitErrors, isReady, formItems } = this.state;\n const {\n signUpButtonArialabel,\n signUpButtonText,\n cancelButtonArialabel,\n cancelButtonText,\n errorMessage,\n partialAddressErrorMessage\n } = resources;\n const addressForm = (slots && slots.addressSlot && slots.addressSlot.length > 0 && slots.addressSlot[0]) || undefined;\n\n const form = {\n FormWrapper: {\n className: `${this.moduleClassName}__form `\n },\n items: renderInputSection(\n formItems,\n `${this.moduleClassName}__form-item`,\n this.needsToReset,\n this._onInputChange.bind(this),\n showAddressErrors,\n addressForm,\n this._onAddressChange\n ),\n buttons: [\n ,\n \n ],\n errorMessage: [\n hasSubmitErrors && ,\n showAddressErrors && (\n \n )\n ],\n disclaimer: config.disclaimer && (\n \n )\n };\n\n if (this.needsToReset) {\n this.needsToReset = false;\n }\n\n return form;\n }\n\n private _onInputChange(event: React.ChangeEvent): void {\n const newForm = this.state.formItems;\n newForm.forEach(item => {\n if (item.type === InputType.RadioButton && event.target.name === this.prospectRadioButtonName) {\n item.value = event.target.value;\n } else if (item.id === event.target.id) {\n item.value = event.target.value;\n }\n });\n\n // Check if form is ready, update state object with latest values, values have changed so reset hasSubmitErrros\n this.setState({\n isReady: this._isFormReady(),\n formItems: newForm,\n hasSubmitErrors: false\n });\n }\n\n private _addedReference(): IFormItem[] {\n const newFormFields = this.BusinessSignUpDefaultInputs;\n newFormFields[0].fieldReference = this.formChildReference;\n return newFormFields;\n }\n\n private readonly _onAddressChange = (errors: boolean, currentAddress?: Address): void => {\n // Find address item\n const newForm = this.state.formItems;\n const addressItem = newForm.find(item => {\n return item.type === InputType.Address;\n });\n\n // If found --> set to currentAddress\n if (addressItem) {\n addressItem.address = currentAddress;\n\n // Update state with new values and set errors to false if address is not required field\n this.setState(\n {\n formItems: newForm,\n addressHasErrors: errors,\n showAddressErrors: false\n },\n () => {\n this.setState({ isReady: this._isFormReady() });\n }\n );\n }\n };\n\n private readonly _isFormReady = (): boolean => {\n const { formItems } = this.state;\n\n for (const currentInput of formItems) {\n // Will return FALSE if:\n // - input field is required\n // IF is address AND addressHasErrors === true\n // ELSE value is undefined OR empty\n // OR\n // - pattern provided and value does not match pattern\n\n if (currentInput.isRequired) {\n if (currentInput.type === InputType.Address) {\n if (this.state.addressHasErrors) {\n return false;\n }\n } else if (currentInput.value === undefined || currentInput.value === '') {\n return false;\n }\n }\n if (currentInput.pattern !== undefined && currentInput.value.match(currentInput.pattern) === null) {\n return false;\n }\n }\n\n return true;\n };\n\n private readonly _onSubmit = (event: React.MouseEvent) => {\n if (this.state.addressHasErrors) {\n this.setState({\n showAddressErrors: true\n });\n\n event.preventDefault();\n return;\n }\n\n const { config, context } = this.props;\n\n // Check for matching id and if not empty\n const firstName = this._getItem(InputID.FirstName);\n const lastName = this._getItem(InputID.LastName);\n const companyName = this._getItem(InputID.CompanyName);\n const companyEmail = this._getItem(InputID.Email);\n const companyAddress = this._getItem(InputID.Address, true);\n const jobTitle = this._getItem(InputID.JobTitle);\n const department = this._getItem(InputID.Department);\n const companySize = this._getItem(InputID.Size);\n const comments = this._getItem(InputID.Comment);\n const prospectType = this._getItem(InputID.ProspectType);\n\n // API gets email as part of the address object, but I do not use the email input from the address component, thus we need to copy it over\n if (companyEmail && companyEmail.value && companyAddress && companyAddress.address) {\n companyAddress.address.Email = companyEmail.value;\n }\n\n const newPartner: BusinessPartnerProspect = {\n FirstName: firstName && firstName.value,\n LastName: lastName && lastName.value,\n CompanyName: companyName && companyName.value,\n Address: companyAddress && companyAddress.address && companyAddress.address,\n JobTitle: jobTitle && jobTitle.value,\n Department: department && department.value,\n CompanySize: (companySize && Number.parseInt(companySize.value, 10)) || 0,\n Comments: comments && comments.value,\n ProspectTypeValue: (prospectType && Number.parseInt(prospectType.value, 10)) || 0\n };\n\n this.setState({\n isReady: false\n });\n\n // Create business partner request\n createProspectAsync({ callerContext: context.actionContext }, newPartner)\n .then(() => {\n const successPageURL =\n (config.confirmationLink && config.confirmationLink.linkUrl && config.confirmationLink.linkUrl.destinationUrl) ||\n getUrlSync('home', this.props.context.actionContext) ||\n '';\n window.location.href = successPageURL;\n })\n .catch(() => {\n this.setState({\n hasSubmitErrors: true\n });\n });\n };\n\n private readonly _onCancel = () => {\n // Reset values of the form\n const cleanForm = this.state.formItems;\n cleanForm.forEach(input => {\n input.value = '';\n });\n\n // Set reset flag so address input will get reset on next renderInputSection() call\n this.needsToReset = true;\n\n this.setState({\n isReady: false,\n formItems: cleanForm,\n addressHasErrors: true,\n showAddressErrors: false,\n hasSubmitErrors: false\n });\n };\n\n private readonly _getItem = (id: string, isAddress: boolean = false) => {\n if (isAddress) {\n return this.state.formItems.find(item => {\n return item.id === id && item.address;\n });\n }\n return this.state.formItems.find(item => {\n return item.id === id && item.value !== '';\n });\n };\n}\n\nexport default BusinessSignUp;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\nimport * as React from 'react';\n\nimport { IBusinessSignUpItem, IBusinessSignUpViewProps } from './business-sign-up';\n\nconst BusinessSignUpItem: React.FC = ({ wrapper, label, errorMessage, input, isAddressInput }) => {\n // Hide label and error message if rendering address section\n return (\n \n {!isAddressInput && label}\n {!isAddressInput && errorMessage}\n {input}\n \n );\n};\n\nconst BusinesSignUpView: React.FC = props => {\n const { businessSignUp, ContainerWrapper, heading, businessSignUpForm } = props;\n\n const { FormWrapper, buttons, items, errorMessage, disclaimer } = businessSignUpForm;\n\n return (\n \n \n {heading}\n \n {items &&\n items.map((item: IBusinessSignUpItem) => {\n return ;\n })}\n {errorMessage &&\n errorMessage.map((error: React.ReactNode, index: number) => {\n return {error};\n })}\n {buttons &&\n buttons.map((button: React.ReactNode, index: number) => {\n return {button};\n })}\n {disclaimer}\n \n \n \n );\n};\n\nexport default BusinesSignUpView;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport React from 'react';\nimport { KeyCodes } from '@msdyn365-commerce-modules/utilities';\n\nexport interface ISearchBarProps {\n className: string;\n searchPlaceholderLabel: string;\n onSearch(searchText: string): void;\n}\n\nexport interface ISearchBarState {\n searchText: string;\n}\n\nexport class SearchBar extends React.Component {\n constructor(props: ISearchBarProps) {\n super(props);\n this.state = {\n searchText: ''\n };\n }\n\n public render(): JSX.Element {\n const { className, searchPlaceholderLabel } = this.props;\n return (\n
\n \n
\n );\n }\n\n private readonly onSearchTextChange = (ev: React.ChangeEvent): void => {\n this.setState({\n searchText: ev.target.value\n });\n };\n\n private readonly onSearch = (): void => {\n this.props.onSearch(this.state.searchText);\n };\n\n private readonly handleKeyUp = (event: React.KeyboardEvent): void => {\n if (event.keyCode === KeyCodes.Enter) {\n this.onSearch();\n }\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { CommerceException } from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\nimport { ArrayExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport { Alert, Button } from '@msdyn365-commerce-modules/utilities';\nimport React from 'react';\n\nimport { moduleClassName } from '../business-partners';\nimport { IBusinessPartnersResources } from '../business-partners.props.autogenerated';\nimport { SearchBar } from './search-bar';\n\n/**\n * Props of DataGrid component.\n */\nexport interface IDataGridProps extends IComponentProps {\n className: string;\n pageSize?: number;\n searchPlaceholderLabel: string;\n defaultSorting?: ISortingInfo;\n resources: IBusinessPartnersResources;\n columns: IDataGridColumn[];\n loadData(): Promise;\n}\n\n/**\n * State of DataGrid component.\n */\nexport interface IDataGridState {\n data: Tdata[];\n paging: IPagingInfo;\n filter: IFilterInfo;\n sorting?: ISortingInfo;\n isLoading: boolean;\n errorMessage: string;\n}\n\nexport interface IPagingInfo {\n index: number;\n}\n\nexport interface IFilterInfo {\n searchText: string;\n}\n\nexport interface ISortingInfo {\n fieldName: string;\n ascending: boolean;\n}\n\n/**\n * Column definition of DataGrid component.\n */\nexport interface IDataGridColumn {\n /**\n * A unique key for identifying the column.\n */\n reactKey: string;\n\n /**\n * Name to render on the column header.\n */\n name: string;\n\n /**\n * Class name added to table cell.\n */\n className?: string;\n\n /**\n * The field to pull the text value from for the column.Can be unset if a custom `onRender` method is provided.\n */\n fieldName?: string;\n\n /**\n * Whether the user can search this column by text.\n */\n isSearchable?: boolean;\n\n /**\n * Custom renderer for cell content, instead of the default text rendering.\n */\n onRender?(item: Tdata): JSX.Element;\n\n /**\n * Event when the table cell is clicked.\n */\n onClick?(item: Tdata): void;\n}\n\nconst defaultPageSize = 10;\n\n/**\n * DataGrid component encapsulates common table functionalities.\n */\nexport class DataGrid extends React.Component, IDataGridState> {\n constructor(props: IDataGridProps) {\n super(props);\n this.state = {\n data: [],\n sorting: props.defaultSorting,\n paging: { index: 0 },\n filter: { searchText: '' },\n isLoading: true,\n errorMessage: ''\n };\n }\n\n public componentDidMount(): void {\n this.loadDataInternal();\n }\n\n public shouldComponentUpdate(nextProps: Readonly>, nextState: Readonly>): boolean {\n return (\n this.props.id !== nextProps.id ||\n this.props.columns !== nextProps.columns ||\n this.state.data !== nextState.data ||\n this.state.paging !== nextState.paging ||\n this.state.filter !== nextState.filter ||\n this.state.isLoading !== nextState.isLoading ||\n this.state.errorMessage !== nextState.errorMessage\n );\n }\n\n public render(): JSX.Element | null {\n const data = this.getDataToDisplay();\n const hasMore = this.hasMore();\n if (this.state.errorMessage) {\n return {this.state.errorMessage};\n }\n if (this.state.isLoading) {\n return {this.props.resources.loadingLabel};\n }\n if (!ArrayExtensions.hasElements(data)) {\n return (\n <>\n \n

{this.props.resources.noDataMessage}

\n \n );\n }\n return (\n <>\n \n \n {this.renderGridHeader()}\n {data.map((item, index) => this.renderGridRow(item, index))}\n
\n {hasMore && (\n
\n \n
\n )}\n \n );\n }\n\n /**\n * Renders the TH header in the table.\n * @returns - Header react node.\n */\n private readonly renderGridHeader = () => {\n const className = `${this.props.className}__header`;\n const rowClassName = `${className}__row`;\n return (\n \n \n {this.props.columns.map(column => (\n \n {column.name}\n \n ))}\n \n \n );\n };\n\n /**\n * Renders table row.\n * @param item - Data item for this row.\n * @param index - Index of the row.\n * @returns - Row react node.\n */\n private readonly renderGridRow = (item: Tdata, index: number) => {\n const rowClassName = `${this.props.className}__row`;\n return (\n \n {this.props.columns.map(column => {\n let cell: JSX.Element = <>;\n if (column.onRender) {\n cell = column.onRender(item);\n } else if (column.fieldName) {\n cell = {((item as unknown) as { [key: string]: string })[column.fieldName]};\n }\n return (\n column.onClick?.(item)}>\n {cell}\n \n );\n })}\n \n );\n };\n\n /**\n * Load data for the table.\n * @returns Promise.\n */\n private readonly loadDataInternal = async () => {\n if (!this.props.context.actionContext.requestContext.user.isAuthenticated) {\n this.setState({\n isLoading: false\n });\n return;\n }\n try {\n const result = await this.props.loadData();\n this.setState({\n isLoading: false,\n data: result\n });\n } catch (e) {\n this.setState({\n isLoading: false,\n errorMessage: (e as { data: CommerceException })?.data?.LocalizedMessage || this.props.resources.genericErrorMessage\n });\n }\n };\n\n private readonly onSearch = (searchText: string): void => {\n this.setState({\n paging: { index: 0 },\n filter: { searchText }\n });\n };\n\n private readonly loadMore = (): void => {\n this.setState({\n paging: { index: this.state.paging.index + 1 }\n });\n };\n\n private readonly sortData = (): Tdata[] => {\n const sorting = this.state.sorting;\n if (!sorting) {\n return this.state.data;\n }\n const { fieldName, ascending } = sorting;\n return this.state.data.sort((item1: Tdata, item2: Tdata) => {\n let value1 = ((item1 as unknown) as { [key: string]: string })[fieldName];\n let value2 = ((item2 as unknown) as { [key: string]: string })[fieldName];\n if (typeof value1 === 'string' && typeof value2 === 'string') {\n value1 = value1.toLowerCase();\n value2 = value2.toLowerCase();\n }\n const compareResult = value1 > value2 ? 1 : value1 < value2 ? -1 : 0;\n return ascending ? compareResult : compareResult * -1;\n });\n };\n\n private readonly filterData = (): Tdata[] => {\n const column = this.props.columns.find(c => c.isSearchable);\n const searchText = this.state.filter.searchText;\n return this.sortData().filter(item => {\n if (!column?.fieldName || !searchText) {\n return true;\n }\n const columnValue = ((item as unknown) as { [key: string]: string })[column.fieldName];\n return columnValue && columnValue.toLowerCase().indexOf(searchText.trim().toLowerCase()) >= 0;\n });\n };\n\n private readonly getDataToDisplay = (): Tdata[] => {\n const itemsCount = (this.props.pageSize || defaultPageSize) * (this.state.paging.index + 1);\n const filteredItems = this.filterData();\n return filteredItems.slice(0, itemsCount);\n };\n\n private readonly hasMore = (): boolean => {\n const itemsCount = (this.props.pageSize || defaultPageSize) * (this.state.paging.index + 1);\n const filteredItems = this.filterData();\n return filteredItems.length > itemsCount;\n };\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IComponentProps } from '@msdyn365-commerce/core';\nimport { ObjectExtensions } from '@msdyn365-commerce-modules/retail-actions';\nimport React, { ReactNode } from 'react';\nimport { isMobile, Node, VariantType } from '@msdyn365-commerce-modules/utilities';\n\nimport { BusinessPartner, BusinessPartnerUser, BusinessPartnersDataActions } from '@msdyn365-commerce/retail-proxy';\nimport { IBusinessPartnersResources } from '../business-partners.props.autogenerated';\nimport { DataGrid, IDataGridColumn } from './data-grid';\n\n/**\n * View model of business partner user, used to display.\n */\nexport interface IBusinessPartnerUserViewModel extends BusinessPartnerUser {\n name: string;\n spendingLimit: ReactNode;\n}\n\n/**\n * Props of BusinessPartnerUsersTable.\n */\nexport interface IBusinessPartnerUsersTableProps extends IComponentProps {\n className: string;\n pageSize?: number;\n businessPartner: BusinessPartner;\n resources: IBusinessPartnersResources;\n onSelect(businessPartnerUser: BusinessPartnerUser): void;\n}\n\n/**\n * BusinessPartnerUsersTable component.\n */\nexport class BusinessPartnerUsersTable extends React.Component {\n public shouldComponentUpdate(nextProps: Readonly): boolean {\n return this.props.id !== nextProps.id;\n }\n\n public render(): JSX.Element {\n return (\n \n );\n }\n\n /**\n * Get column definition of the table.\n * @returns - Columns.\n */\n private readonly getColumns = (): IDataGridColumn[] => {\n const isMobileDevice = isMobile({ variant: VariantType.Viewport, context: this.props.context.request }) === 'xs';\n\n return [\n {\n reactKey: 'name',\n name: this.props.resources.businessUserTableNameHeadingText,\n isSearchable: true,\n fieldName: 'name',\n onClick: this.props.onSelect,\n onRender: (data: IBusinessPartnerUserViewModel) => {data.name}\n },\n {\n reactKey: 'email',\n name: this.props.resources.businessUserTableEmailHeadingText,\n fieldName: 'Email',\n onClick: this.props.onSelect\n },\n {\n reactKey: 'spendingLimit',\n name: this.props.resources.businessUserTableSpendingLimitHeadingText,\n className: `${this.props.className}__row__column-with-number`,\n fieldName: 'spendingLimit',\n onClick: !isMobileDevice ? this.props.onSelect : undefined\n }\n ];\n };\n\n /**\n * Call retail proxy to get business partner users.\n * @returns - Business partner users view model.\n */\n private readonly getBusinessPartnerUsers = async (): Promise => {\n const businessPartners = await BusinessPartnersDataActions.getUsersAsync(\n {\n callerContext: this.props.context.actionContext,\n bypassCache: 'get',\n queryResultSettings: {}\n },\n this.props.businessPartner.BusinessPartnerId\n );\n return businessPartners\n .filter(user => user.StatusValue === 1)\n .map(user => {\n return {\n ...user,\n name: `${user.FirstName} ${user.LastName}`,\n spendingLimit: (\n \n {!ObjectExtensions.isNullOrUndefined(user.SpendingLimit)\n ? this.props.context.cultureFormatter.formatCurrency(user.SpendingLimit.toString())\n : ''}\n {!ObjectExtensions.isNullOrUndefined(user.SpendingLimit) && user.SpendingLimit === 0 ? (\n \n