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OmK,kBACpCzL,EAAMC,QAAQgL,IAAI3J,OAAOoK,2CAChCX,EAAK,uBAAyB/K,EAAMC,QAAQgL,IAAI3J,OAAOoK,0CAEvD1L,EAAMsB,OAAOqK,uBACbZ,EAAK,6BAA+B/K,EAAMsB,OAAOqK,uBAC1C3L,EAAMC,QAAQgL,IAAI3J,OAAOsK,gDAChCb,EAAK,6BAA+B/K,EAAMC,QAAQgL,IAAI3J,OAAOsK,+CAE7D5L,EAAMsB,OAAOuK,sBACbd,EAAK,yBAA2B/K,EAAMsB,OAAOuK,qBAE7C7L,EAAMsB,OAAOwK,mBACbf,EAAK,uBAAyB/K,EAAMsB,OAAOwK,kBAE3C9L,EAAMsB,OAAOyK,wBACbhB,EAAK,4BAA8B/K,EAAMsB,OAAOyK,4BAELrD,IAA3C1I,EAAMsB,OAAO0K,4BACbjB,EAAK,gCAAkC/K,EAAMsB,OAAO0K,2BAEjDjB,CAAI,EAIakB,CAAYjM,GAgBpC,OAXAqK,EAAAA,WAAgB,KAAK,IAAA6B,EAAAC,EAAAC,EACjB,MAAMC,EAAiB,QAAXH,EAAGzG,gBAAQ,IAAAyG,OAAA,EAARA,EAAUI,cAAc,UACvCD,EAAOE,KAAO,kBACdF,EAAOG,IAAMxM,EAAMsB,OAAOkL,KAAOxM,EAAMC,QAAQgL,IAAI3J,OAAOmL,2BAC1DJ,EAAOK,GAAK,iCACZC,OAAOC,KAAK7B,GAAM8B,SAAQC,IACtBT,EAAOU,aAAaD,EAAG/B,EAAK+B,GAAG,IAE3B,QAARX,EAAA1G,gBAAQ,IAAA0G,GAAM,QAANC,EAARD,EAAUa,YAAI,IAAAZ,GAAdA,EAAgBa,YAAYZ,EAAO,GACpC,IAEI,IACV","sources":["webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/helpers/constants.ts?f7d4","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/proactive-chat-trigger.ts?abbc","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/cart-amount-trigger.ts?2618","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/cart-number-of-items-trigger.ts?f906","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/cart-specific-product-trigger.ts?3777","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/date-range-trigger.ts?9e10","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/from-specific-page-trigger.ts?519b","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/page-visit-trigger.ts?0f25","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/specific-country-region-trigger.ts?9736","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/specific-page-trigger.ts?1b0d","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/triggers/wait-on-time-trigger.ts?6968","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/proactive/index.ts?8d6b","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/helpers/chat.ts?5bd6","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/msdyn365-cs-chat-connector.tsx?5279","webpack://Msdyn365.Commerce.Online/./src/modules/msdyn365-cs-chat-connector/msdyn365-cs-chat-connector.view.tsx?5c92"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nexport enum ProactiveChatNames {\n CartAmount = 'Cart Total Amount',\n DateRange = 'Date Range',\n FromSpecificPage = 'From Specific Page',\n NumberOfItems = 'Cart Number of Items',\n PageVisits = 'Page Visits',\n SpecificMarket = 'Specific Market',\n SpecificPage = 'Specific Page',\n SpecificProduct = 'Specific Product',\n WaitOnTime = 'Wait on Time'\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IChatContext, TContextProvider } from '../../../interfaces';\nimport { IProactiveChatTrigger, IWindow } from '../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\n\n/**\n * ProactiveChatTrigger class.\n * Checks if proactive chat should be triggered, starts the chat and sets context.\n */\nexport default abstract class ProactiveChatTrigger implements IProactiveChatTrigger {\n public props: IMsdyn365CsChatConnectorViewProps;\n public context: IChatContext;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n this.props = props;\n this.context = context;\n }\n\n /**\n * Triggers the proactive chat if proactive chat validation passes.\n * @returns {Promise} True if proactive chat is triggered.\n */\n public async startChat(): Promise {\n if (await this.validate()) {\n ((window)).contextProvider = this.getContextProvider();\n\n this.props.context.telemetry.debug('Chat widget \"lcw:ready\" event listener has been triggered for proactive chat.');\n ((window)).Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(this.getContextProvider());\n\n const message = this.getMessage();\n this.props.context.telemetry.debug(`Starting proactive chat with message: '${message}'.`);\n ((window)).Microsoft.Omnichannel.LiveChatWidget.SDK.startProactiveChat({ message: message }, false);\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} Chat context.\n */\n public abstract getContextProvider(): TContextProvider;\n\n /**\n * Generates chat welcome message to be used if proactive chat is triggered.\n * @returns {string} Chat welcome message.\n */\n public abstract getMessage(): string;\n\n /**\n * Validate specific trigger conditions if proactive chat should be initiated.\n * @returns {Promise} True if proactive chat should be triggered.\n */\n public abstract validate(): Promise;\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { ICartAmountContext, IChatContext, TContextProvider } from '../../../interfaces';\nimport { ProactiveChatNames } from '../../helpers';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartAmountTrigger class.\n * Proactive chat is triggered if cart amount is in preset boundaries (config.proactiveOnCartAmountMin, config.proactiveOnCartAmountMax).\n */\nexport default class CartAmountTrigger extends ProactiveChatTrigger {\n private min?: number;\n private max?: number;\n private totalInCart: number = 0;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.min = this.props.config.proactiveOnCartAmountMin;\n this.max = this.props.config.proactiveOnCartAmountMax;\n\n this.props.context.telemetry.debug(\n `[Chat][${CartAmountTrigger.name}] Cart amount proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\n );\n }\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: the total amount in the cart should be within the min and max values.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n const cart = await this._getCart();\n if (cart.isEmpty) {\n this.props.context.telemetry.debug(`[Chat][${CartAmountTrigger.name}] Cart was empty. Validation returning 'false'.`);\n return false;\n }\n\n this.totalInCart = cart.cart.TotalAmount || 0;\n\n let retVal: boolean = false;\n if (this.min) {\n if (this.max) {\n retVal = this.min <= this.totalInCart && this.totalInCart <= this.max;\n } else {\n retVal = this.min <= this.totalInCart;\n }\n } else if (this.max) {\n retVal = this.totalInCart <= this.max;\n }\n\n this.props.context.telemetry.debug(\n `[Chat][${CartAmountTrigger.name}] Validation result: '${retVal}'; Cart total: '${this.totalInCart}'.`\n );\n return retVal;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): ICartAmountContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.CartAmount,\n isDisplayable: true\n },\n eCommerceCustProactiveShoppingCartAmount: {\n value: this.totalInCart,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnCartAmountMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Gets the cart.\n * @returns {Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { ICartNumberOfItemsContext, IChatContext, TContextProvider } from '../../../interfaces';\nimport { ProactiveChatNames } from '../../helpers';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartNumberOfItemsTrigger class.\n * Proactive chat is triggered if Cart Number of Items is in preset boundaries (config.proactiveOnCartNoOfItemsMin, config.proactiveOnCartNoOfItemsMax).\n */\nexport default class CartNumberOfItemsTrigger extends ProactiveChatTrigger {\n private min?: number;\n private max?: number;\n private numberOfItems: number = 0;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.min = this.props.config.proactiveOnCartNoOfItemsMin;\n this.max = this.props.config.proactiveOnCartNoOfItemsMax;\n\n this.props.context.telemetry.debug(\n `[${CartNumberOfItemsTrigger.name}] Cart number of items proactive chat initialized with min: '${this.min}'; max: '${this.max}'.`\n );\n }\n\n /**\n * Validates whether the conditions are met to trigger proactive chat: the number of items in the cart should be within the min and max values.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n const cart = await this._getCart();\n if (cart.isEmpty) {\n this.props.context.telemetry.debug(`[Chat][${CartNumberOfItemsTrigger.name}] Cart was empty. Validation returning 'false'.`);\n return false;\n }\n\n this.numberOfItems = cart.cart.TotalItems || 0;\n\n let retVal: boolean = false;\n if (this.min) {\n if (this.max) {\n retVal = this.min <= this.numberOfItems && this.numberOfItems <= this.max;\n } else {\n retVal = this.min <= this.numberOfItems;\n }\n } else if (this.max) {\n retVal = this.numberOfItems <= this.max;\n }\n\n this.props.context.telemetry.debug(\n `[${CartNumberOfItemsTrigger.name}] Validation result: '${retVal}'; Number of items in cart: '${this.numberOfItems}'.`\n );\n return retVal;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): ICartNumberOfItemsContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.NumberOfItems,\n isDisplayable: true\n },\n eCommerceCustProactiveShoppingCartNumberOfItems: {\n value: this.numberOfItems,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnCartNoOfItemsMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Gets the cart.\n * @returns {Promise} The cart.\n */\n private async _getCart(): Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { getCartState, ICartState } from '@msdyn365-commerce/global-state';\nimport { ICartSpecificProductContext, TContextProvider } from '../../../interfaces';\nimport { ProactiveChatNames } from '../../helpers';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * CartSpecificProductTrigger class.\n * Proactive chat is triggered if a Product in the Cart is in preset list of products (config.proactiveOnCartSpecificProductList).\n */\nexport default class CartSpecificProductTrigger extends ProactiveChatTrigger {\n private product: string = '';\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: the cart contains the specified product to trigger proactice chat.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n let isValid = false;\n const cart = await this._getCart();\n if (!cart.isEmpty) {\n if (cart.cart.CartLines) {\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Number of cart line items was '${cart.cart.CartLines?.length}'`\n );\n\n for (let i = 0; i < cart.cart.CartLines?.length; i++) {\n if (cart.cart.CartLines[i]) {\n if (this.props.config.proactiveOnCartSpecificProductList) {\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Number of cart specific products was configured for proactive chat was '${this.props.config.proactiveOnCartSpecificProductList?.length}'`\n );\n\n // Find first item, from user-defined list of products, that matches the cart lines' itemId in the cart.\n for (let j = 0; j < (this.props.config.proactiveOnCartSpecificProductList?.length || 0); j++) {\n if (\n this.props.config.proactiveOnCartSpecificProductList &&\n cart.cart.CartLines[i].ItemId &&\n this.props.config.proactiveOnCartSpecificProductList[j] === cart.cart.CartLines[i].ItemId\n ) {\n this.product = cart.cart.CartLines[i].ItemId || '';\n this.props.context.telemetry.debug(\n `[${CartSpecificProductTrigger.name}] Matched cart line item ID '${cart.cart.CartLines[i].ItemId}' against user-defined list of specific products for proactive chat.`\n );\n isValid = true;\n break;\n }\n }\n }\n } else {\n // Rest of the CartLines are undefined\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart did not contain any cart lines.`);\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Cart was empty.`);\n }\n\n this.props.context.telemetry.debug(`[Chat][${CartSpecificProductTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): ICartSpecificProductContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.SpecificProduct,\n isDisplayable: true\n },\n eCommerceCustProactiveShoppingCartSpecificProduct: {\n value: this.product,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnCartSpecificProductMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Gets the cart.\n * @returns {Promise} The cart.\n */\n private async _getCart(): Promise {\n return getCartState(this.props.context.actionContext);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/constants';\nimport { IChatContext, IDateRangeContext, TContextProvider } from '../../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * DateRangeTrigger class.\n * Proactive chat is triggered if current date is in preset date boundaries (config.proactiveOnDateRangeStart, config.proactiveOnDateRangeEnd).\n */\nexport default class DateRangeTrigger extends ProactiveChatTrigger {\n private start?: Date;\n private end?: Date;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.start = this._toDate(this.props.config.proactiveOnDateRangeStart);\n this.end = this._toDate(this.props.config.proactiveOnDateRangeEnd);\n\n this.props.context.telemetry.debug(\n `[${DateRangeTrigger.name}] Proactive chat initialized with startDate: '${this.start}'; max: '${this.end}'.`\n );\n }\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: current time is within the start and end time.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n const now = new Date();\n now.setHours(0, 0, 0, 0);\n\n let retVal: boolean = false;\n if (this.start) {\n if (this.end) {\n retVal = this.start.getTime() <= now.getTime() && now.getTime() <= this.end.getTime();\n } else {\n retVal = this.start.getTime() <= now.getTime();\n }\n } else if (this.end) {\n retVal = now.getTime() <= this.end.getTime();\n }\n\n this.props.context.telemetry.debug(\n `[${DateRangeTrigger.name}] Validation result: '${retVal}'; Current date used to compare: '${now}'.`\n );\n return retVal;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): IDateRangeContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.DateRange,\n isDisplayable: true\n },\n eCommerceCustProactiveFromDate: {\n value: this.start ? this.start.toUTCString() : '',\n isDisplayable: true\n },\n eCommerceCustProactiveToDate: {\n value: this.end ? this.end.toUTCString() : '',\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnDateRangeMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Converts string(us-en) to date.\n * @param {string} [date] The date to convert (mm/dd/yyyy).\n * @returns {Date | undefined} The date or undefined.\n */\n private _toDate(date?: string): Date | undefined {\n if (date) {\n const dateParts = date.split('/');\n return new Date(+dateParts[2], +dateParts[1] - 1, +dateParts[0]);\n } else {\n return undefined;\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 { ProactiveChatNames } from '../../helpers/constants';\nimport { IFromSpecificPageTriggerContext, TContextProvider } from '../../../interfaces';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * FromSpecificPageTrigger class.\n * Proactive chat is triggered if user has come from specific page (the one listed in config.proactiveOnFromSpecificPageList).\n */\nexport default class FromSpecificPageTrigger extends ProactiveChatTrigger {\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: the user has come from a specific page.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n let isValid = false;\n if (this.props.config.proactiveOnFromSpecificPageList) {\n this.props.context.telemetry.debug(\n `[${FromSpecificPageTrigger.name}] Number of items in user-defined list of 'From Specific Page' was '${this.props.config.proactiveOnFromSpecificPageList?.length}'.`\n );\n\n for (let i = 0; i < (this.props.config.proactiveOnFromSpecificPageList?.length || 0); i++) {\n const fromSpecificPageTrimmed: string = this.props.config.proactiveOnFromSpecificPageList[i].trim();\n\n this.props.context.telemetry.debug(\n `[Chat][${FromSpecificPageTrigger.name}] Current page URL: '${window.document.referrer}'.`\n );\n this.props.context.telemetry.debug(\n `[${FromSpecificPageTrigger.name}] Current item from user-defined list of 'From Specific Page': '${fromSpecificPageTrimmed}'.`\n );\n\n if (window.document.referrer.indexOf(fromSpecificPageTrimmed) > -1) {\n isValid = true;\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(\n `[Chat][${FromSpecificPageTrigger.name}] User-defined 'From Specific Page' list was undefined.`\n );\n }\n\n this.props.context.telemetry.debug(`[Chat][${FromSpecificPageTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): IFromSpecificPageTriggerContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.FromSpecificPage,\n isDisplayable: true\n },\n eCommerceCustProactiveCameFromPage: {\n value: window.document.referrer,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnFromSpecificPageMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICookieContext } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/ICookieContext';\nimport { ProactiveChatNames } from '../../helpers/constants';\nimport { IChatContext, IPageVisitContext, TContextProvider } from '../../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * PageVisitTrigger class.\n * Proactive chat is triggered if user has visited current page for (config.proactiveOnPageVisitNumber) or more times.\n */\nexport default class PageVisitTrigger extends ProactiveChatTrigger {\n private visitCounter: number = 0;\n private cookieName: string = 'TimesPageVisited';\n private expdate: Date;\n private cookies: ICookieContext;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.cookies = this.props.context.request.cookies;\n this.expdate = new Date();\n\n // Set expiry date to 365 days.\n this.expdate.setTime(this.expdate.getTime() + 24 * 60 * 60 * 1000 * 365);\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie expiry date set to: '${this.expdate}'.`);\n\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Cookie context is given: '${this.cookies.isConsentGiven()}'.`);\n if (this.cookies.isConsentGiven()) {\n this.cookies.setConsentCookie();\n }\n\n this._updateVisitCounter();\n }\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: current page count is great than or equal to threshold.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n let retVal: boolean = false;\n\n if (this.props.config.proactiveOnPageVisitNumber) {\n retVal = this.visitCounter >= this.props.config.proactiveOnPageVisitNumber;\n }\n\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Validation result: '${retVal}'.`);\n return retVal;\n }\n\n /**\n * Resets the page visit counter cookie to zero.\n */\n public clear(): void {\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Clearing cookie for page visit counter.`);\n this.cookies.set(this.cookieName, 0, {\n domain: window.location.hostname,\n path: window.location.pathname,\n expires: this.expdate\n });\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): IPageVisitContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.PageVisits,\n isDisplayable: true\n },\n eCommerceCustProactiveNumberOfVisits: {\n value: this.visitCounter,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnPageVisitMessage || this.props.config.proactiveDefaultMessage;\n }\n\n /**\n * Increments the page visit counter by one.\n */\n private _updateVisitCounter(): void {\n this.visitCounter = this.cookies.get(this.cookieName).value || 0;\n\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter BEFORE update: '${this.visitCounter}.`);\n ++this.visitCounter;\n this.props.context.telemetry.debug(`[Chat][${PageVisitTrigger.name}] Page visit counter AFTER update: '${this.visitCounter}.`);\n\n this.cookies.set(this.cookieName, this.visitCounter, {\n domain: window.location.hostname,\n path: window.location.pathname,\n expires: this.expdate\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 { ProactiveChatNames } from '../../helpers/constants';\nimport { IExtendedRequest } from '../../interfaces';\nimport { IChatContext, ISpecificLocationTriggerContext, TContextProvider } from '../../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * SpecificPageTrigger class.\n * Proactive chat is triggered if user geographically belongs to the list of country codes: (config.proactiveOnSpecificCountryRegionCountry).\n */\nexport default class SpecificCountryRegionTrigger extends ProactiveChatTrigger {\n private customerCountryCode: string;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n this.customerCountryCode = (this.props.context.request).suggestedMarket || 'n/a';\n this.props.context.telemetry.debug(\n `[${SpecificCountryRegionTrigger.name}] Customer country code set to: '${this.customerCountryCode}.'`\n );\n }\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: user geographically belongs to the list of country codes.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n const retVal: boolean = this.props.config.proactiveOnSpecificCountryRegionCountry\n ? this.props.config.proactiveOnSpecificCountryRegionCountry.indexOf(this.customerCountryCode) > -1\n : false;\n\n this.props.context.telemetry.debug(`[Chat][${SpecificCountryRegionTrigger.name}] Validation returning '${retVal}'.`);\n return retVal;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} Chat context.\n */\n public getContextProvider(): TContextProvider {\n return (): ISpecificLocationTriggerContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustCountryCode: {\n value: this.props.config.proactiveOnSpecificCountryRegionCountry || '',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.SpecificMarket,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Generates chat welcome message to be used if proactive chat is triggered.\n * @returns {string} Chat welcome message.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnSpecificCountryRegionMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/constants';\nimport { ISpecificPageTriggerContext, TContextProvider } from '../../../interfaces';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * SpecificPageTrigger class.\n * Proactive chat is triggered if current page is listed in config.proactiveOnSpecificPageList.\n */\nexport default class SpecificPageTrigger extends ProactiveChatTrigger {\n private specificPageName: string = '';\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: current page is listed in the proactive chat list of pages.\n * @returns {Promise} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n let isValid = false;\n if (this.props.config.proactiveOnSpecificPageList) {\n this.props.context.telemetry.debug(\n `[${SpecificPageTrigger.name}] Number of items in user-defined list of 'Specific Pages' was '${this.props.config.proactiveOnSpecificPageList?.length}'.`\n );\n\n for (let i = 0; i < (this.props.config.proactiveOnSpecificPageList?.length || 0); i++) {\n const specificPageTrimmed: string = this.props.config.proactiveOnSpecificPageList[i].trim();\n\n this.props.context.telemetry.debug(`[] Current location URL: ${window.location.href}.`);\n this.props.context.telemetry.debug(`[] Current item from user-defined list of 'Specific Page': ${specificPageTrimmed}.`);\n\n if (window.location.href.indexOf(specificPageTrimmed) > -1) {\n this.specificPageName = specificPageTrimmed;\n isValid = true;\n break;\n }\n }\n } else {\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] User-defined 'Specific Page' list was undefined.`);\n }\n\n this.props.context.telemetry.debug(`[Chat][${SpecificPageTrigger.name}] Validation returning '${isValid}'.`);\n return isValid;\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): ISpecificPageTriggerContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.SpecificPage,\n isDisplayable: true\n },\n eCommerceCustProactivePage: {\n value: this.specificPageName,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnSpecificPageMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ProactiveChatNames } from '../../helpers/constants';\nimport { IWindow } from '../../interfaces';\nimport { IChatContext, IWaitOnTimeContext, TContextProvider } from '../../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../../msdyn365-cs-chat-connector';\nimport ProactiveChatTrigger from './proactive-chat-trigger';\n\n/**\n * WaitOnTimeTrigger class.\n * Proactive chat is triggered if user stays on current page for more than (config.proactiveOnWaitTimeSeconds) seconds.\n */\nexport default class WaitOnTimeTrigger extends ProactiveChatTrigger {\n private waitTimeInMilliseconds: number | undefined;\n\n /**\n * Class constructor.\n * @param {IMsdyn365CsChatConnectorViewProps} props The chat connector view properties.\n * @param {IChatContext} context The context.\n */\n constructor(props: IMsdyn365CsChatConnectorViewProps, context: IChatContext) {\n super(props, context);\n if (this.props.config.proactiveOnWaitTimeSeconds && !isNaN(this.props.config.proactiveOnWaitTimeSeconds)) {\n this.waitTimeInMilliseconds = Number(this.props.config.proactiveOnWaitTimeSeconds) * 1000;\n this.props.context.telemetry.debug(\n `[Chat][${WaitOnTimeTrigger.name}] Wait time (ms) set to: '${this.waitTimeInMilliseconds}'.`\n );\n }\n }\n\n /**\n * Validates whether the condition(s) is met to trigger proactive chat: user stays on page longer than the specific time.\n * @returns {IContextProvider} True if condition is met. Otherwise, false.\n */\n public async validate(): Promise {\n const retVal: boolean = this.waitTimeInMilliseconds !== undefined;\n this.props.context.telemetry.debug(`[Chat][${WaitOnTimeTrigger.name}] Validation returning '${retVal}'.`);\n return retVal;\n }\n\n /**\n * Starts the chat by configuring the LiveChatWidget SDK code.\n * @returns {Promise} True when the chat has started. Otherwise, false.\n */\n public async startChat(): Promise {\n if (await this.validate()) {\n ((window)).contextProvider = this.getContextProvider();\n\n this.props.context.telemetry.debug(\n `[${WaitOnTimeTrigger.name}] Chat widget \"lcw:ready\" event listener has been triggered within proactive chat.`\n );\n ((window)).Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(this.getContextProvider());\n const message = this.getMessage();\n\n this.props.context.telemetry.debug(\n `[${WaitOnTimeTrigger.name}] Starting wait on-time proactive chat with '${this.waitTimeInMilliseconds}' (ms) delay and message: '${message}'.`\n );\n setTimeout(() => {\n ((window)).Microsoft.Omnichannel.LiveChatWidget.SDK.startProactiveChat({ message: message }, false);\n }, this.waitTimeInMilliseconds);\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Gets the context.\n * @returns {TContextProvider} The context.\n */\n public getContextProvider(): TContextProvider {\n return (): IWaitOnTimeContext => {\n return {\n ...this.context,\n eCommerceCustIsProactiveChat: {\n value: 'True',\n isDisplayable: true\n },\n eCommerceCustProactiveType: {\n value: ProactiveChatNames.WaitOnTime,\n isDisplayable: true\n },\n eCommerceCustProactiveTimeOnPage: {\n value: this.waitTimeInMilliseconds ? this.waitTimeInMilliseconds : 0,\n isDisplayable: true\n }\n };\n };\n }\n\n /**\n * Gets the message to be displayed when proactive chat is triggered.\n * @returns {string} The message to be displayed when proactive chat is triggered.\n */\n public getMessage(): string {\n return this.props.config.proactiveOnWaitTimeMessage || this.props.config.proactiveDefaultMessage;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport CartAmountTrigger from './triggers/cart-amount-trigger';\nimport CartNumberOfItemsTrigger from './triggers/cart-number-of-items-trigger';\nimport CartSpecificProductTrigger from './triggers/cart-specific-product-trigger';\nimport DateRangeTrigger from './triggers/date-range-trigger';\nimport FromSpecificPageTrigger from './triggers/from-specific-page-trigger';\nimport PageVisitTrigger from './triggers/page-visit-trigger';\nimport SpecificCountryRegionTrigger from './triggers/specific-country-region-trigger';\nimport SpecificPageTrigger from './triggers/specific-page-trigger';\nimport WaitOnTimeTrigger from './triggers/wait-on-time-trigger';\n\ntype ProactiveChat =\n | typeof DateRangeTrigger\n | typeof SpecificPageTrigger\n | typeof FromSpecificPageTrigger\n | typeof PageVisitTrigger\n | typeof SpecificCountryRegionTrigger\n | typeof CartAmountTrigger\n | typeof CartNumberOfItemsTrigger\n | typeof CartSpecificProductTrigger\n | typeof WaitOnTimeTrigger;\n\n/**\n * List of proactive chat validators in order of validation (first proactive chat that pass validation is triggered, the rest are ommited).\n */\nexport const ProactiveTriggers: ProactiveChat[] = [\n DateRangeTrigger,\n SpecificPageTrigger,\n FromSpecificPageTrigger,\n PageVisitTrigger,\n SpecificCountryRegionTrigger,\n CartAmountTrigger,\n CartNumberOfItemsTrigger,\n CartSpecificProductTrigger,\n WaitOnTimeTrigger\n];\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { IRequestContextUser } from '@msdyn365-commerce/core-internal/dist/types/interfaces/context/IRequestContext';\nimport { IWindow } from '../interfaces';\nimport { IChatContext } from '../../interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from '../msdyn365-cs-chat-connector';\nimport { ProactiveTriggers } from '../proactive';\n\n/**\n * Chat class - generates chat context, and checks for proactive triggers, starts the chat.\n */\nexport default class Chat {\n public props: IMsdyn365CsChatConnectorViewProps;\n private user: IRequestContextUser;\n constructor(props: IMsdyn365CsChatConnectorViewProps) {\n this.props = props;\n this.user = props.context.request.user;\n }\n\n /**\n * Generates chat context, and checks for proactive triggers, starts the chat.\n */\n public async run(): Promise {\n try {\n const chatContext = this._getContext();\n const chatHasStarted: boolean = await this._proactiveCheck(chatContext);\n ((window)).contextProvider = () => {\n return chatContext;\n };\n\n this.props.context.telemetry.debug(`[Chat] Proactive chat was started: '${chatHasStarted}'.`);\n if (!chatHasStarted) {\n this.props.context.telemetry.debug('[Chat] Chat widget \"lcw:ready\" event listener has been triggered.');\n ((window)).Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(() => chatContext);\n }\n } catch (e) {\n // Use ?debug=true to see telemetry\n // If previous block fails, chat will still be available (no need to display any errors to user)\n this.props.telemetry.exception(e as Error);\n }\n }\n\n /**\n * Generates default chat context.\n * @returns {IChatContext} The chat context.\n */\n private _getContext(): IChatContext {\n return {\n Name: {\n value: this.user.name ? this.user.name : '',\n isDisplayable: true\n },\n AccountNumber: {\n value: this.user.customerAccountNumber ? this.user.customerAccountNumber : '',\n isDisplayable: true\n },\n Email: {\n value: this.user.emailAddress ? this.user.emailAddress : '',\n isDisplayable: true\n },\n IsB2b: {\n value: this.user.isB2b ? this.user.isB2b : 'false',\n isDisplayable: true\n },\n CurrentPageURL: {\n value: window.location.href,\n isDisplayable: true\n }\n };\n }\n\n /**\n * Validates proactive triggers to check if proactive chat should be initialized.\n * @param {IChatContext} chatContext The chat context.\n * @returns {Promise} The result of whether the chat has started.\n */\n private async _proactiveCheck(chatContext: IChatContext): Promise {\n let isChatStarted = false;\n const proactiveChatEnabled: boolean = this.props.config.proactiveChatEnabled;\n\n this.props.context.telemetry.debug(`[Chat] Proactive chat was enabled: '${proactiveChatEnabled}'.`);\n if (proactiveChatEnabled) {\n for (let i = 0; i < ProactiveTriggers.length; i++) {\n const proactive = new ProactiveTriggers[i](this.props, chatContext);\n // Only first detected proactive trigger gets executed\n if (await proactive.startChat()) {\n this.props.context.telemetry.debug(`[Chat] Proactive chat detected: '${proactive.constructor.name}'.`);\n isChatStarted = true;\n break;\n }\n }\n }\n return isChatStarted;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport Chat from './helpers/chat';\nimport { IMsdyn365CsChatConnectorData } from './interfaces';\nimport { IMsdyn365CsChatConnectorProps } from './msdyn365-cs-chat-connector.props.autogenerated';\n\n/**\n * Provides options for chat connector view.\n */\nexport interface IMsdyn365CsChatConnectorViewProps extends IMsdyn365CsChatConnectorProps {\n // Do nothing. Keeps lint happy.\n}\n\n/**\n * Msdyn365CsChatConnector component.\n * @augments {React.PureComponent>}\n */\nexport default class Msdyn365CsChatConnector extends React.PureComponent> {\n constructor(props: IMsdyn365CsChatConnectorProps) {\n super(props);\n if (msdyn365Commerce.isBrowser && typeof window !== 'undefined') {\n window.addEventListener('lcw:error', (errorEvent: object) => {\n // Handle LiveChat SDK error event\n this.props.telemetry.error('lcw:error', errorEvent);\n });\n\n window.addEventListener('lcw:ready', () => {\n const chat: Chat = new Chat(this.props);\n chat.run().catch(e => {\n this.props.telemetry.error(e);\n });\n });\n }\n }\n\n public componentDidMount(): void {}\n\n public render(): JSX.Element | null {\n return this.props.renderView(this.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 * as React from 'react';\nimport { IChatData } from './interfaces';\nimport { IMsdyn365CsChatConnectorViewProps } from './msdyn365-cs-chat-connector';\n\n/**\n * Returns data parameters for Omnichannel chat script.\n * @param {IMsdyn365CsChatConnectorViewProps} props The properties.\n * @returns {IChatData} Chat data.\n */\nconst getChatData = (props: IMsdyn365CsChatConnectorViewProps): IChatData => {\n const data: IChatData = {\n 'data-app-id': props.config.dataAppId || props.context.app.config.msDyn365CsChatConnectorDataAppId,\n 'data-org-id': props.config.dataOrgId || props.context.app.config.msDyn365CsChatConnectorDataOrgId,\n 'data-org-url': props.config.dataOrgUrl || props.context.app.config.msDyn365CsChatConnectorDataOrgUrl\n };\n if (props.config.dataHideChatButton !== undefined) {\n data['data-hide-chat-button'] = props.config.dataHideChatButton;\n } else if (props.context.app.config.msDyn365CsChatConnectorDataHideChatButton) {\n data['data-hide-chat-button'] = props.context.app.config.msDyn365CsChatConnectorDataHideChatButton;\n }\n if (props.config.dataColorOverride) {\n data['data-color-override'] = props.config.dataColorOverride;\n } else if (props.context.app.config.msDyn365CsChatConnectorDataColorOverride) {\n data['data-color-override'] = props.context.app.config.msDyn365CsChatConnectorDataColorOverride;\n }\n if (props.config.dataFontFamilyOverride) {\n data['data-font-family-override'] = props.config.dataFontFamilyOverride;\n } else if (props.context.app.config.msDyn365CsChatConnectorDataFontFamilyOverride) {\n data['data-font-family-override'] = props.context.app.config.msDyn365CsChatConnectorDataFontFamilyOverride;\n }\n if (props.config.dataEnableTelemetry) {\n data['data-enable-telemetry'] = props.config.dataEnableTelemetry;\n }\n if (props.config.dataOpenInWindow) {\n data['data-open-in-window'] = props.config.dataOpenInWindow;\n }\n if (props.config.dataEnableLcwAutofill) {\n data['data-enable-lcw-autofill'] = props.config.dataEnableLcwAutofill;\n }\n if (props.config.dataSuggestedActionLayout !== undefined) {\n data['data-suggested-action-layout'] = props.config.dataSuggestedActionLayout;\n }\n return data;\n};\n\nexport default (props: IMsdyn365CsChatConnectorViewProps) => {\n const data: IChatData = getChatData(props);\n\n // we cannot use server rendering here, because OCCS fires 'lcw:ready' event ASAP when initialized\n // and by the time when execution comes to Msdyn365CsChatConnector, that event is already fired\n // thus, we can only add OCCS script to DOM on client side to control execution flow.\n React.useEffect(() => {\n const script = document?.createElement('script');\n script.type = 'text/javascript';\n script.src = props.config.src || props.context.app.config.msDyn365CsChatConnectorSrc;\n script.id = 'Microsoft_Omnichannel_LCWidget';\n Object.keys(data).forEach(k => {\n script.setAttribute(k, data[k]);\n });\n document?.body?.appendChild(script);\n }, []);\n\n return null;\n};\n"],"names":["ProactiveChatNames","ProactiveChatTrigger","constructor","props","context","this","async","validate","window","contextProvider","getContextProvider","telemetry","debug","Microsoft","Omnichannel","LiveChatWidget","SDK","setContextProvider","message","getMessage","startProactiveChat","CartAmountTrigger","super","totalInCart","min","config","proactiveOnCartAmountMin","max","proactiveOnCartAmountMax","name","cart","_getCart","isEmpty","TotalAmount","retVal","_objectSpread","eCommerceCustIsProactiveChat","value","isDisplayable","eCommerceCustProactiveType","CartAmount","eCommerceCustProactiveShoppingCartAmount","proactiveOnCartAmountMessage","proactiveDefaultMessage","getCartState","actionContext","CartNumberOfItemsTrigger","numberOfItems","proactiveOnCartNoOfItemsMin","proactiveOnCartNoOfItemsMax","TotalItems","NumberOfItems","eCommerceCustProactiveShoppingCartNumberOfItems","proactiveOnCartNoOfItemsMessage","CartSpecificProductTrigger","product","isValid","CartLines","_cart$cart$CartLines","length","i","_cart$cart$CartLines2","proactiveOnCartSpecificProductList","_this$props$config$pr","j","_this$props$config$pr2","ItemId","SpecificProduct","eCommerceCustProactiveShoppingCartSpecificProduct","proactiveOnCartSpecificProductMessage","DateRangeTrigger","start","_toDate","proactiveOnDateRangeStart","end","proactiveOnDateRangeEnd","now","Date","setHours","getTime","DateRange","eCommerceCustProactiveFromDate","toUTCString","eCommerceCustProactiveToDate","proactiveOnDateRangeMessage","date","dateParts","split","FromSpecificPageTrigger","proactiveOnFromSpecificPageList","fromSpecificPageTrimmed","trim","document","referrer","indexOf","FromSpecificPage","eCommerceCustProactiveCameFromPage","proactiveOnFromSpecificPageMessage","PageVisitTrigger","visitCounter","cookieName","cookies","request","expdate","setTime","isConsentGiven","setConsentCookie","_updateVisitCounter","proactiveOnPageVisitNumber","clear","set","domain","location","hostname","path","pathname","expires","PageVisits","eCommerceCustProactiveNumberOfVisits","proactiveOnPageVisitMessage","get","SpecificCountryRegionTrigger","customerCountryCode","suggestedMarket","proactiveOnSpecificCountryRegionCountry","eCommerceCustCountryCode","SpecificMarket","proactiveOnSpecificCountryRegionMessage","SpecificPageTrigger","specificPageName","proactiveOnSpecificPageList","specificPageTrimmed","href","SpecificPage","eCommerceCustProactivePage","proactiveOnSpecificPageMessage","WaitOnTimeTrigger","proactiveOnWaitTimeSeconds","isNaN","waitTimeInMilliseconds","Number","undefined","setTimeout","WaitOnTime","eCommerceCustProactiveTimeOnPage","proactiveOnWaitTimeMessage","ProactiveTriggers","Chat","user","chatContext","_getContext","chatHasStarted","_proactiveCheck","e","exception","Name","AccountNumber","customerAccountNumber","Email","emailAddress","IsB2b","isB2b","CurrentPageURL","isChatStarted","proactiveChatEnabled","proactive","startChat","Msdyn365CsChatConnector","React","msdyn365Commerce","addEventListener","errorEvent","error","run","catch","componentDidMount","render","renderView","data","dataAppId","app","msDyn365CsChatConnectorDataAppId","dataOrgId","msDyn365CsChatConnectorDataOrgId","dataOrgUrl","msDyn365CsChatConnectorDataOrgUrl","dataHideChatButton","msDyn365CsChatConnectorDataHideChatButton","dataColorOverride","msDyn365CsChatConnectorDataColorOverride","dataFontFamilyOverride","msDyn365CsChatConnectorDataFontFamilyOverride","dataEnableTelemetry","dataOpenInWindow","dataEnableLcwAutofill","dataSuggestedActionLayout","getChatData","_document","_document2","_document2$body","script","createElement","type","src","msDyn365CsChatConnectorSrc","id","Object","keys","forEach","k","setAttribute","body","appendChild"],"sourceRoot":""}