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W,GAC3G,QAASF,KAAaC,GAMbrC,EAAoBuC,GAEzB,CACIA,EAAQC,QAAUb,EAAeY,EAAQC,QACzCD,EAAQE,OAASd,EAAeY,EAAQE,MAAO,SAC/CF,EAAQG,QAAUf,EAAeY,EAAQG,OAAQ,UACjDH,EAAQI,OAAShB,EAAeY,EAAQI,MAAO,UACjDC,OAAOC,SAGJpB,EAAY,IAAIqB,IAAoB,CAC7C,CAAC,MAAO,YACR,CAAC,MAAO,YACR,CAAC,QAAS,YACV,CAAC,OAAQ,YACT,CAAC,MAAO,YACR,CAAC,SAAU","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","webpack://Msdyn365.Commerce.Online/./src/components/container-background-image/container-background-image-helper.ts?ce2e","webpack://Msdyn365.Commerce.Online/./src/components/container-background-image/container-backgroud-image.tsx?e863","webpack://Msdyn365.Commerce.Online/./src/components/base-components.tsx?daec","webpack://Msdyn365.Commerce.Online/./src/modules/default-container-2-slots/default-container-2-slots.tsx?8065","webpack://Msdyn365.Commerce.Online/./src/modules/default-container-3-slots/default-container-3-slots.tsx?ac77","webpack://Msdyn365.Commerce.Online/./src/modules/default-container/default-container.tsx?01c3","webpack://Msdyn365.Commerce.Online/./src/utils/classnames.ts?a0ff"],"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","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport msdyn365Commerce, {\n constructViewportInformationForImage,\n getImageResizeUrl,\n getLargestGridSettingViewportName,\n getMinMaxWidth,\n IAny,\n IGeneric,\n IViewPort,\n Viewport\n} from '@msdyn365-commerce/core-internal';\nimport { cloneDeep as _cloneDeep } from 'lodash';\nimport {\n BackgroundImageRepeat,\n BackgroundImageSize,\n IBackgroundImageAttributes,\n IBackgroundImageLazyloadAttributes,\n IBackgroundImageProps,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst getBackgroundRepeatProperty = (size: string | undefined, repeat: string | undefined): BackgroundImageRepeat => {\n if (!size || size === 'cover') {\n return 'no-repeat';\n }\n switch (repeat) {\n case 'noRepeat':\n return 'no-repeat';\n case 'repeat':\n return 'repeat';\n default:\n return 'no-repeat';\n }\n};\n\nconst getBackgroundSizeProperty = (size: string | undefined): BackgroundImageSize => {\n switch (size) {\n case 'cover':\n return 'cover';\n case 'contain':\n return 'contain';\n case 'default':\n default:\n return undefined;\n }\n};\n\nconst getDefaultViewports = (): IViewPort => {\n return {\n xs: {\n w: 800,\n h: 600\n },\n sm: {\n w: 1200,\n h: 900\n },\n md: {\n w: 1600,\n h: 900\n },\n lg: {\n w: 1600,\n h: 700\n },\n xl: {\n w: 1600,\n h: 700\n }\n };\n};\n\nconst getAuthoringViewport = (moduleName: string | undefined, layout: string | undefined): IViewPort | undefined => {\n if (!msdyn365Commerce.isBrowser) {\n return;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const authoringHelper = (window as any)._msdyn365.authoringHelper;\n if (!authoringHelper) {\n return;\n }\n\n // if authoring helper is setup, component is rendering from site builder. Build viewport based on layout selected.\n return constructViewportInformationForImage(moduleName, layout, 'backgroundImage', authoringHelper?.themeSettings) as IViewPort;\n};\n\nexport const buildBackgroundImageStylesByViewport = (props: IBackgroundImageProps): IGeneric => {\n const { containerType, image, request, configs } = props;\n\n const gridSettings = request.gridSettings ?? {};\n const imageSettings = image.imageSettings;\n\n const styles: IGeneric = {};\n\n const largestGridSettingViewportName = getLargestGridSettingViewportName(gridSettings);\n if (largestGridSettingViewportName && imageSettings) {\n // in site builder the layout may change, so use authoring viewports.\n const authoringViewPorts = getAuthoringViewport(containerType, configs?.layout);\n const imgSettings = {\n ...imageSettings,\n viewports: { ..._cloneDeep(authoringViewPorts || imageSettings.viewports || getDefaultViewports()) }\n };\n\n // Skip resizing width and height for background images.\n const skipWidthAndHeightSettings = true;\n Object.keys(imgSettings.viewports).map(vp => {\n const viewport = vp as Viewport;\n const minMaxWidth = getMinMaxWidth(gridSettings, imgSettings, viewport, largestGridSettingViewportName);\n const urlSrc = getImageResizeUrl(\n image.src,\n imgSettings.viewports[viewport],\n imgSettings,\n skipWidthAndHeightSettings,\n image?.externalProvider,\n request?.apiSettings\n );\n styles[viewport] = {\n maxWidth: minMaxWidth.max,\n minWidth: minMaxWidth.min,\n minHeight: imgSettings.viewports[viewport]?.h,\n backgroundImage: urlSrc,\n backgroundRepeat: getBackgroundRepeatProperty(configs?.size, configs?.repeat),\n backgroundSize: getBackgroundSizeProperty(configs?.size),\n backgroundPosition: 'center center'\n };\n });\n }\n\n return styles;\n};\n\nexport const setStyleAttribute = (currentStyle: IBackgroundImageStyle): IGeneric => {\n let style: IGeneric = {};\n if (currentStyle) {\n style = { ...currentStyle };\n style['minWidth'] = undefined;\n style['width'] = '100%';\n if (currentStyle.backgroundImage) {\n style['backgroundImage'] = `url('${currentStyle.backgroundImage}')`;\n }\n }\n return style;\n};\n\nexport const getBackgroundImageLazyloadAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined,\n styles: IGeneric\n): IBackgroundImageLazyloadAttributes => {\n const attributes = {\n role: 'img',\n className: `${className} lazyload`,\n 'data-bgset': getDataBgSetAttribute(styles)\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n // On lazyload, lazysizes plugin should pick which background image to use based on data-bgset attribute.\n attributes['style']['backgroundImage'] = undefined;\n }\n return attributes;\n};\n\nexport const getBackgroundImageAttributes = (\n className: string,\n currentStyle: IBackgroundImageStyle | undefined\n): IBackgroundImageAttributes => {\n const attributes = {\n role: 'img',\n className\n };\n\n if (currentStyle) {\n attributes['style'] = setStyleAttribute(currentStyle);\n }\n return attributes;\n};\n\nexport const getBgSetMinMaxWidthAttribute = (style: IBackgroundImageStyle): string => {\n if (style.maxWidth) {\n return `[(max-width: ${style.maxWidth}px)]`;\n }\n return '';\n};\n\nexport const getDataBgSetAttribute = (styles: IGeneric): string => {\n const dataBgSetAttributes: string[] = [];\n Object.keys(styles).map(vp => {\n if (styles[vp].backgroundImage) {\n dataBgSetAttributes.push(`${styles[vp].backgroundImage} ${getBgSetMinMaxWidthAttribute(styles[vp])}`);\n }\n });\n\n return dataBgSetAttributes.join(' | ');\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport msdyn365Commerce, { getLargestGridSettingViewportName, IGeneric, isAuthoringEditEnabled } from '@msdyn365-commerce/core-internal';\nimport * as React from 'react';\nimport { isEqual as _isEqual } from 'lodash';\nimport {\n buildBackgroundImageStylesByViewport,\n getBackgroundImageAttributes,\n getBackgroundImageLazyloadAttributes\n} from './container-background-image-helper';\nimport {\n IBackgroundImageAttributes,\n IBackgroundImageProps,\n IBackgroundImageState,\n IBackgroundImageStyle\n} from './container-background-image-interfaces';\n\nconst BACKGROUND_IMAGE_CLASS_NAME = 'ms-container-background-image';\n\n/**\n * BackgroundImage component\n * @extends {React.PureComponent}\n */\nexport class BackgroundImage extends React.PureComponent {\n private stylesByViewport: IGeneric;\n private currentStyle: IBackgroundImageStyle | undefined;\n private mounted: boolean;\n\n constructor(props: IBackgroundImageProps, state: IBackgroundImageState) {\n super(props);\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this._onChangeHandler = this._onChangeHandler.bind(this);\n this.currentStyle = this._getCurrentStyle();\n this.mounted = false;\n this._componentResize = this._componentResize.bind(this);\n this._getCurrentStyle = this._getCurrentStyle.bind(this);\n this.state = { updateAttributes: false };\n }\n\n public componentDidMount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.addEventListener('resize', this._componentResize);\n this.mounted = true;\n this._componentResize();\n }\n }\n\n public componentWillUnmount(): void {\n if (msdyn365Commerce.isBrowser) {\n window.removeEventListener('resize', this._componentResize);\n this.mounted = false;\n }\n }\n\n public shouldComponentUpdate(nextProps: IBackgroundImageProps, nextState: { updateAttributes: boolean }): boolean {\n if (\n this.state !== nextState ||\n this.props.request?.gridSettings !== nextProps.request?.gridSettings ||\n this.props.configs.repeat !== nextProps.configs.repeat ||\n this.props.configs.size !== nextProps.configs.size ||\n this.props.configs.layout !== nextProps.configs.layout ||\n this.props.image?.imageSettings !== nextProps.image?.imageSettings ||\n this.props.image?.src !== nextProps.image?.src\n ) {\n return true;\n }\n return false;\n }\n\n public render(): JSX.Element | null {\n const { children } = this.props;\n\n try {\n this.stylesByViewport = buildBackgroundImageStylesByViewport(this.props);\n this.currentStyle = this._getCurrentStyle();\n\n if (this.currentStyle) {\n const backgroundImageClassName = isAuthoringEditEnabled(this.props.request)\n ? `${BACKGROUND_IMAGE_CLASS_NAME} ms-editable-field enabled`\n : BACKGROUND_IMAGE_CLASS_NAME;\n const processedAtributes = this._processAttributes(\n backgroundImageClassName,\n this.currentStyle,\n this.stylesByViewport,\n this._isLazyload()\n );\n const attributes = this._getAttributes(processedAtributes);\n const eventHandlers = isAuthoringEditEnabled(this.props.request) ? { onDoubleClick: this._onChangeHandler } : {};\n\n if (this.state.updateAttributes) {\n // Update component with the latest attributes.\n return (\n
\n {children}\n
\n );\n } else if (this._isLazyload()) {\n // On lazyload, only include the class name on the first render.\n return (\n
\n {children}\n
\n );\n } else {\n // On lazyload disabled, render the default attributes from server side.\n return (\n
\n {children}\n
\n );\n }\n } else {\n // in no style is found, return the container content.\n return <>{children};\n }\n } catch {\n // in case of any failure, return the container content.\n return <>{children};\n }\n }\n\n private _processAttributes(\n className: string,\n currentStyle: IBackgroundImageStyle,\n stylesByViewport: IGeneric,\n lazyLoad: boolean\n ) {\n if (lazyLoad) {\n return getBackgroundImageLazyloadAttributes(className, currentStyle, stylesByViewport);\n } else {\n return getBackgroundImageAttributes(className, currentStyle);\n }\n }\n\n private _getAttributes(processedAtributes: IBackgroundImageAttributes) {\n return { ...processedAtributes, style: { ...processedAtributes?.style } };\n }\n\n private _onChangeHandler(event: React.SyntheticEvent | { target: { value: string } }): void {\n if (event.target === (event as React.SyntheticEvent).currentTarget) {\n const binding: any = this.props.image;\n const eventTarget: any = event.target;\n binding.$type = eventTarget.value;\n }\n }\n\n private _componentResize(): void {\n if (msdyn365Commerce.isBrowser) {\n const selectedStyle = this._getCurrentStyle();\n\n if (this.mounted || (selectedStyle && !_isEqual(this.currentStyle, selectedStyle))) {\n this.setState({ updateAttributes: true });\n }\n }\n }\n\n private _getCurrentStyle(): IBackgroundImageStyle | undefined {\n if (msdyn365Commerce.isBrowser) {\n const winInnerWidth: number = window.innerWidth;\n let selectedStyle: IBackgroundImageStyle | undefined;\n Object.keys(this.stylesByViewport).map(vp => {\n if (\n (this.stylesByViewport[vp]?.minWidth || this.stylesByViewport[vp]?.maxWidth) &&\n (this.stylesByViewport[vp]?.minWidth || 0) <= winInnerWidth &&\n winInnerWidth <= (this.stylesByViewport[vp]?.maxWidth || Number.MAX_SAFE_INTEGER)\n ) {\n selectedStyle = this.stylesByViewport[vp];\n }\n });\n return selectedStyle;\n } else {\n return this._getDefaultStyle();\n }\n }\n\n private _isLazyload(): boolean {\n // Lazyload by default if nothing is specified\n return !this.props.image?.imageSettings?.disableLazyLoad;\n }\n\n private _getDefaultStyle(): IBackgroundImageStyle | undefined {\n const { request } = this.props;\n const largestGridSettingViewportName = getLargestGridSettingViewportName(request.gridSettings ?? {});\n return this.stylesByViewport[largestGridSettingViewportName];\n }\n\n private _getDefaultAttributes(): IBackgroundImageAttributes {\n const style = this._getDefaultStyle();\n const processedAtributes = style\n ? this._processAttributes(BACKGROUND_IMAGE_CLASS_NAME, style, this.stylesByViewport, this._isLazyload())\n : {};\n return this._getAttributes(processedAtributes);\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent, IImageData, IRequestContext, Text } from '@msdyn365-commerce/core';\nimport * as React from 'react';\nimport { BackgroundImage } from './container-background-image/container-backgroud-image';\n\n/**\n * Heading options\n */\nexport interface IHeadingComponentProps {\n /**\n * Heading text\n */\n headingText?: string;\n /**\n * Heading tag (h1, h2, h3, h4, h5, h6)\n */\n tag?: HeadingTag;\n /**\n * Heading text size (sm, md, lg, xl)\n */\n textSize?: TextSize;\n\n requestContext: IRequestContext;\n\n handleTextChange(event: ContentEditableEvent): string;\n}\n\nexport type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';\nexport type TextSize = 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Container class options\n */\nexport interface IContainerProps {\n /**\n * CSS class name\n */\n className?: string;\n /**\n * Bootstrap supported container types\n */\n containerType?: string;\n /**\n * type name\n */\n typeName?: string;\n /**\n * id of container\n */\n id?: string;\n /**\n * React children\n */\n children: React.ReactNode;\n /**\n * Request context\n */\n request?: IRequestContext;\n /**\n * background image\n */\n backgroundImage?: IImageData;\n /**\n * background image repeat property\n */\n backgroundImageRepeat?: string;\n /**\n * background image size property\n */\n backgroundImageSize?: string;\n /**\n * module layout property\n */\n moduleLayout?: string;\n}\n\nconst getContainerType = (containerType: string | undefined) => {\n switch (containerType) {\n case 'container':\n return 'container';\n case 'fluid':\n default:\n return 'fluid';\n }\n};\n\n/**\n * HOC to create bootstrap container div. If no container type is specified children are rendered.\n * @param options IContainerClasses\n */\nexport const Container: React.SFC = (props: IContainerProps): JSX.Element => {\n const {\n containerType,\n className,\n typeName,\n id,\n children,\n backgroundImage,\n request,\n backgroundImageRepeat,\n backgroundImageSize,\n moduleLayout\n } = props;\n const customClassName = className ? ` ${className}` : '';\n\n let containerContent = children;\n if (containerType) {\n containerContent =
{containerContent}
;\n }\n\n if (backgroundImage && backgroundImage.src && backgroundImage.imageSettings && request) {\n containerContent = (\n \n {containerContent}\n \n );\n }\n\n return containerType ? (\n
{containerContent}
\n ) : (\n
{containerContent}
\n );\n};\n\nexport const HeadingComponent = (props: IHeadingComponentProps & { className: string }): JSX.Element | null => {\n const { tag, headingText, textSize, className } = props;\n const Tag = tag || 'h2';\n const classNameWithHeading = textSize ? `heading ${textSize} ${className}` : `heading ${className}`;\n return (\n (headingText && (\n \n )) ||\n null\n );\n};\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent } from '@msdyn365-commerce/core';\nimport { LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React, { ReactNode } from 'react';\nimport { Container, HeadingComponent, IHeadingComponentProps } from '../../components/base-components';\nimport { getColClassArray, showErrors } from '../../utils/classnames';\nimport { IDefaultContainer2SlotsData } from './default-container-2-slots.data';\nimport { IDefaultContainer2SlotsProps } from './default-container-2-slots.props.autogenerated';\n\ninterface IColSizes {\n left: string[];\n right: string[];\n}\n\n/**\n * Default container that displays 2 modules\n * CoreComponent component\n * @extends {React.PureComponent>}\n */\nclass Default2SlotContainer extends React.PureComponent> {\n constructor(props: IDefaultContainer2SlotsProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { slots, telemetry, context, config, data } = this.props;\n telemetry.log(LogLevel.Debug, \"Default 2 Slot Container rendering for '{id}/{typeName}'\", {\n values: [this.props.id, this.props.typeName]\n });\n\n const content = slots && slots.content;\n const slotsClassNames = this._getColClassName();\n if (content && content.length > 2) {\n telemetry.log(LogLevel.Warning, 'Default 2 Slot Container passed more than 2 slots');\n }\n const heading = config.heading || data.heading;\n const headingProps: IHeadingComponentProps = {\n ...heading,\n handleTextChange: this.handleTextChange,\n requestContext: this.props.context.request\n };\n return (\n \n {heading && }\n {content && content[0] &&
{content[0]}
}\n {content && content[1] &&
{content[1]}
}\n <>\n {showErrors(context) &&\n content &&\n content.slice(2, content.length - 1).map((slot: ReactNode, index: number) => {\n return (\n
\n
\n
\n Slot exceeded maximum number of slots supported by container. (2)\n
\n
\n
\n );\n })}\n \n \n );\n }\n\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.headingText = event.target.value);\n /**\n * Captures left and right column classnames from this.props.config. Returns col if no options specified.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public _getColClassName = (): IColSizes => {\n const { config } = this.props;\n\n const classNames = getColClassArray(config);\n\n if (!classNames.length) {\n return {\n left: ['col'],\n right: ['col']\n };\n }\n\n return classNames.reduce(\n (memo: IColSizes, [left, right]: string[]) => {\n memo.left.push(left);\n memo.right.push(right);\n return memo;\n },\n { left: [], right: [] }\n );\n };\n}\n\nexport default Default2SlotContainer;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent } from '@msdyn365-commerce/core';\nimport { LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport React, { ReactNode } from 'react';\nimport { Container, HeadingComponent, IHeadingComponentProps } from '../../components/base-components';\nimport { getColClassArray, showErrors } from '../../utils/classnames';\nimport { IDefaultContainer3SlotsData } from './default-container-3-slots.data';\nimport { IDefaultContainer3SlotsProps } from './default-container-3-slots.props.autogenerated';\n\ninterface IColSizes {\n left: string[];\n center: string[];\n right: string[];\n}\n\n/**\n *\n * CoreComponent component\n * @extends {React.PureComponent>}\n */\nclass Default3SlotContainer extends React.PureComponent> {\n constructor(props: IDefaultContainer3SlotsProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { slots, telemetry, context, config, data } = this.props;\n\n const slotsClassNames = this._getColClassName();\n const content = slots && slots.content;\n\n telemetry.log(LogLevel.Debug, \"Default 3 Slot Container rendering for '{id}/{typeName}'\", {\n values: [this.props.id, this.props.typeName]\n });\n if (content && content.length > 3) {\n telemetry.log(LogLevel.Warning, 'Default 3 Slot Container passed more than 3 slots');\n }\n const heading = config.heading || data.heading;\n const headingProps: IHeadingComponentProps = {\n ...heading,\n handleTextChange: this.handleTextChange,\n requestContext: this.props.context.request\n };\n return (\n \n {heading && }\n {content && content[0] &&
{content[0]}
}\n {content && content[1] &&
{content[1]}
}\n {content && content[2] &&
{content[2]}
}\n <>\n {showErrors(context) &&\n content &&\n content.slice(2, content.length - 1).map((slot: ReactNode, index: number) => {\n return (\n
\n
\n
\n Slot exceeded maximum number of slots supported by container. (3)\n
\n
\n
\n );\n })}\n \n \n );\n }\n\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.headingText = event.target.value);\n /**\n * Captures left and right column classnames from this.props.config. Returns col if no options specified.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n public _getColClassName = (): IColSizes => {\n const { config } = this.props;\n\n const classNames = getColClassArray(config);\n\n if (!classNames.length) {\n return {\n left: ['col'],\n center: ['col'],\n right: ['col']\n };\n }\n\n return classNames.reduce(\n (memo: IColSizes, [left, center, right]: string[]) => {\n memo.left.push(left);\n memo.center.push(center);\n memo.right.push(right);\n return memo;\n },\n { left: [], center: [], right: [] }\n );\n };\n}\n\nexport default Default3SlotContainer;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ContentEditableEvent } from '@msdyn365-commerce/core';\nimport { LogLevel } from '@msdyn365-commerce/telemetry-internal';\nimport * as React from 'react';\nimport { Container, HeadingComponent, IHeadingComponentProps } from '../../components/base-components';\nimport { colWidths } from '../../utils/classnames';\nimport { IDefaultContainerData } from './default-container.data';\nimport { childrenWidth as childrenWidthEnum, IDefaultContainerProps, layout as layoutEnum } from './default-container.props.autogenerated';\n\n/**\n *\n * CoreComponent component\n * @extends {React.PureComponent>}\n */\nclass DefaultContainer extends React.PureComponent> {\n constructor(props: IDefaultContainerProps) {\n super(props);\n }\n\n public render(): JSX.Element {\n const { slots, telemetry, config, data } = this.props;\n telemetry.log(LogLevel.Debug, \"Default Container rendering for '{id}/{typeName}'\", {\n values: [this.props.id, this.props.typeName]\n });\n\n const heading = config.heading || data.heading;\n const headingProps: IHeadingComponentProps = {\n ...heading,\n handleTextChange: this.handleTextChange,\n requestContext: this.props.context.request\n };\n\n return (\n \n {heading && }\n {slots &&\n slots.content &&\n slots.content.map((children: React.ReactNode, index: number) => {\n return (\n
\n {children}\n
\n );\n })}\n \n );\n }\n\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.headingText = event.target.value);\n\n private _getChildColClassName(): string {\n const {\n config: { layout, childrenWidth }\n } = this.props;\n switch (layout) {\n case layoutEnum.flow:\n return childrenWidth === childrenWidthEnum.auto ? 'col-12 col-md' : this._getWidthClass(childrenWidth);\n case layoutEnum.stacked:\n default:\n return 'col-12';\n }\n }\n\n private _getWidthClass(s?: childrenWidthEnum): string {\n return colWidths.get(s || childrenWidthEnum.four) || 'col-12';\n }\n}\n\nexport default DefaultContainer;\n","/*!\n * Copyright (c) Microsoft Corporation.\n * All rights reserved. See LICENSE in the project root for license information.\n */\n\nimport { ICoreContext } from '@msdyn365-commerce/core';\nimport * as twoSlots from '../modules/default-container-2-slots/default-container-2-slots.props.autogenerated';\nimport * as threeSlots from '../modules/default-container-3-slots/default-container-3-slots.props.autogenerated';\n\nconst sizePattern = /col(_(\\d|auto){1,2}){2,}/;\n\nexport interface IShowErrorOptions {\n isDebug?: boolean;\n isEditor?: boolean;\n}\n\nexport interface IViewPortOptions {\n xsmall?: threeSlots.xsmall | twoSlots.xsmall;\n small?: threeSlots.small | twoSlots.small;\n medium?: threeSlots.medium | twoSlots.medium;\n large?: threeSlots.large | twoSlots.large;\n}\n\nconst translatePrefix = (prefix: `large` | `medium` | `small` | `xsmall` | undefined) => {\n switch (prefix && prefix.toLowerCase()) {\n case 'large':\n return 'lg';\n case 'medium':\n return 'md';\n case 'small':\n return 'sm';\n case 'xsmall':\n default:\n return '';\n }\n};\n\n/**\n * converts config option and size to bootstrap col class name\n * If size is auto or config option is invalid col-auto will be returned\n * If size is xsmall or size is invalid col-{config} will be returned\n * @param config configuration option e.g. col_12_12\n * @param size bootstrap gridsize\n */\nexport const getColumnSizes = (config: string, size?: `large` | `medium` | `small` | `xsmall`): string[] | boolean => {\n if (!sizePattern.exec(config)) {\n return false;\n }\n const cols = config.split('_').slice(1);\n const translatedSize = translatePrefix(size);\n const sizePrefix = (translatedSize && `-${translatedSize}`) || '';\n return cols.map((colWidth: string) => `col${sizePrefix}-${colWidth}`);\n};\n\nexport const showErrors = (context?: ICoreContext): Boolean => {\n const { isDebug, isEditor }: IShowErrorOptions = (context && context.request && context.request.params) || {};\n return !!isDebug || !!isEditor;\n};\n\n/**\n * Converts viewport configuration into a two dimensional array of class names\n */\nexport const getColClassArray = (options: IViewPortOptions): string[][] =>\n (\n [\n options.xsmall && getColumnSizes(options.xsmall),\n options.small && getColumnSizes(options.small, 'small'),\n options.medium && getColumnSizes(options.medium, 'medium'),\n options.large && getColumnSizes(options.large, 'large')\n ].filter(Boolean)\n );\n\nexport const colWidths = new Map([\n ['one', 'col-md-1'],\n ['two', 'col-md-2'],\n ['three', 'col-md-3'],\n ['four', 'col-md-4'],\n ['six', 'col-md-6'],\n ['twelve', 'col-md-12']\n]);\n"],"names":["ProactiveChatNames","ProactiveChatTrigger","constructor","props","context","this","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","eCommerceCustIsProactiveChat","value","isDisplayable","eCommerceCustProactiveType","CartAmount","eCommerceCustProactiveShoppingCartAmount","proactiveOnCartAmountMessage","proactiveDefaultMessage","getCartState","actionContext","CartNumberOfItemsTrigger","numberOfItems","proactiveOnCartNoOfItemsMin","proactiveOnCartNoOfItemsMax","TotalItems","NumberOfItems","eCommerceCustProactiveShoppingCartNumberOfItems","proactiveOnCartNoOfItemsMessage","CartSpecificProductTrigger","product","isValid","CartLines","length","i","proactiveOnCartSpecificProductList","j","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","script","createElement","type","src","msDyn365CsChatConnectorSrc","id","Object","keys","forEach","k","setAttribute","body","appendChild","getBackgroundRepeatProperty","size","repeat","getBackgroundSizeProperty","buildBackgroundImageStylesByViewport","containerType","image","configs","gridSettings","imageSettings","styles","largestGridSettingViewportName","getLargestGridSettingViewportName","authoringViewPorts","moduleName","layout","authoringHelper","_msdyn365","constructViewportInformationForImage","themeSettings","getAuthoringViewport","imgSettings","viewports","xs","w","h","sm","md","lg","xl","skipWidthAndHeightSettings","map","vp","viewport","minMaxWidth","getMinMaxWidth","urlSrc","getImageResizeUrl","externalProvider","apiSettings","maxWidth","minWidth","minHeight","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","setStyleAttribute","currentStyle","style","getDataBgSetAttribute","dataBgSetAttributes","push","join","BACKGROUND_IMAGE_CLASS_NAME","BackgroundImage","state","stylesByViewport","_onChangeHandler","bind","_getCurrentStyle","mounted","_componentResize","updateAttributes","componentWillUnmount","removeEventListener","shouldComponentUpdate","nextProps","nextState","children","backgroundImageClassName","isAuthoringEditEnabled","processedAtributes","_processAttributes","_isLazyload","attributes","_getAttributes","eventHandlers","onDoubleClick","className","_getDefaultAttributes","lazyLoad","role","getBackgroundImageLazyloadAttributes","getBackgroundImageAttributes","event","target","currentTarget","binding","eventTarget","$type","selectedStyle","setState","winInnerWidth","innerWidth","MAX_SAFE_INTEGER","_getDefaultStyle","disableLazyLoad","getContainerType","Container","typeName","backgroundImageRepeat","backgroundImageSize","moduleLayout","customClassName","containerContent","HeadingComponent","tag","headingText","textSize","Tag","classNameWithHeading","Text","text","editProps","onEdit","handleTextChange","requestContext","Default2SlotContainer","heading","_getColClassName","classNames","getColClassArray","reduce","memo","left","right","slots","log","LogLevel","values","content","slotsClassNames","headingProps","msdyn365__moduleLayout","showErrors","slice","slot","index","key","Default3SlotContainer","center","DefaultContainer","_getChildColClassName","childrenWidth","_getWidthClass","s","colWidths","sizePattern","getColumnSizes","exec","cols","translatedSize","prefix","toLowerCase","translatePrefix","sizePrefix","colWidth","isDebug","isEditor","params","options","xsmall","small","medium","large","filter","Boolean","Map"],"sourceRoot":""}