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C,eAApB,OAC2BxC,OAAOuC,aAAaC,gBAAkB,IACtCA,I,MCtC3BE,EAAOC,QAAU3F,O,OCAjB0F,EAAOC,QAAUC,W","sources":["webpack://mattressfirm/./src/Utilities/analytics/clickTrack.ts?bce2","webpack://mattressfirm/./src/Utilities/analytics/htmlToText.ts?c3c7","webpack://mattressfirm/./src/Utilities/analytics/promotionClickTrack.ts?a0bd","webpack://mattressfirm/./src/Utilities/analytics/utagCaller.ts?3814","webpack://mattressfirm/./src/Utilities/plp-url-utils.ts?728b","webpack://mattressfirm/./src/modules/mfrm-rest-assured-promise/mfrm-rest-assured-promise.tsx?8c2b","webpack://mattressfirm/./src/modules/mfrm-rest-assured-promise/mfrm-rest-assured-promise.view.tsx?ebe1","webpack://mattressfirm/./src/modules/mfrm-rest-assured-promise/analytics.ts?29fb","webpack://mattressfirm/./lib/mfrm-rest-assured-promise/module-registration.js?1e2b","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { callUtagLink } from \"./utagCaller\";\r\n\r\nexport interface IUtagPromoConfig {\r\n promotion_impression_name?: string[];\r\n promotion_impression_id?: string[];\r\n promotion_impression_creative?: string[];\r\n promotion_impression_position?: (string | undefined)[];\r\n promotion_name?: string[];\r\n promotion_id?: string[];\r\n promotion_creative?: string[];\r\n promotion_position?: (string | undefined)[];\r\n}\r\n\r\nexport interface IUtagGeneralConfig {\r\n enhanced_action?: string | undefined;\r\n}\r\nexport interface ICustomerConfig {\r\n customer_email?: string;\r\n}\r\nexport interface IProductConfig {\r\n product_id?: string[];\r\n product_name?: string[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n product_list_name?: string[];\r\n product_position?: (number | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n checkout_step?: string;\r\n}\r\nexport interface IProductImpressionConfig {\r\n product_impression_brand?: (string | undefined)[];\r\n product_impression_list_name?: (string | undefined)[];\r\n product_impression_id?: string[];\r\n product_impression_name?: string[];\r\n product_impression_category?: string[];\r\n product_impression_variant?: (string | undefined)[];\r\n product_impression_position?: number[];\r\n product_impression_price?: number[];\r\n}\r\nexport interface IAnalyticsConfiguration {\r\n event?: string | null;\r\n eventName?: string | null;\r\n eventCategory?: string | null;\r\n eventAction?: string | null;\r\n eventLabel?: string | null;\r\n eventType?: string | null;\r\n eventNoninteraction?: string;\r\n enhancedAction?: string | null;\r\n searchTerm?: string | undefined | null;\r\n searchType?: string | undefined | null;\r\n generalConfig?: IUtagGeneralConfig;\r\n promoConfig?: IUtagPromoConfig;\r\n productConfig?: IProductConfig;\r\n customerConfig?: ICustomerConfig;\r\n productImpressionConfig?: IProductImpressionConfig;\r\n}\r\n\r\nexport const fireAnalyticsLink = ({\r\n searchTerm = null,\r\n searchType = null,\r\n eventName = null,\r\n eventCategory = null,\r\n eventAction = null,\r\n eventLabel = null,\r\n eventType = null,\r\n eventNoninteraction = 'false',\r\n enhancedAction = null,\r\n generalConfig = {},\r\n promoConfig = {},\r\n productConfig = {},\r\n customerConfig = {},\r\n productImpressionConfig = {}\r\n}: IAnalyticsConfiguration) => {\r\n void callUtagLink({\r\n ...generalConfig,\r\n ...promoConfig,\r\n ...productConfig,\r\n ...customerConfig,\r\n ...productImpressionConfig,\r\n event: eventName,\r\n event_category: eventCategory,\r\n event_action: eventAction,\r\n event_label: eventLabel,\r\n event_type: eventType,\r\n event_noninteraction: eventNoninteraction,\r\n enhanced_action: enhancedAction,\r\n search_term: searchTerm,\r\n search_type: searchType\r\n });\r\n};","\r\n// Convert Rich Text inner text to string for analytics tagging\r\n\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\n\r\nexport const htmltoText = (html: string) => {\r\n if(MsDyn365.isBrowser) {\r\n // Create a new div element\r\n const tempDivElement = document.createElement('div');\r\n\r\n // Set the HTML content with the given value\r\n // tslint:disable-next-line: no-inner-html\r\n tempDivElement.innerHTML = html;\r\n\r\n // Retrieve the text property of the element\r\n return tempDivElement.textContent || tempDivElement.innerText || '';\r\n } else {\r\n return '';\r\n }\r\n};","import { fireAnalyticsLink } from './clickTrack';\r\n\r\ninterface IPromotionConfigs {\r\n eventLabel: string;\r\n promotionName: string[];\r\n promotionId: string[];\r\n promotionCreative: string[];\r\n promotionPosition: (string | undefined)[];\r\n}\r\n\r\nexport const firePromotionImpression = ({ eventLabel = '', promotionName = [], promotionId = [], promotionCreative = [], promotionPosition = [] }: IPromotionConfigs) => {\r\n fireAnalyticsLink({\r\n eventName: 'promotion-impression',\r\n eventCategory: 'ecommerce',\r\n eventAction: 'promotion impression',\r\n eventLabel: eventLabel,\r\n eventNoninteraction: 'true',\r\n promoConfig: {\r\n promotion_impression_name: promotionName,\r\n promotion_impression_id: promotionId,\r\n promotion_impression_creative: promotionCreative,\r\n promotion_impression_position: promotionPosition\r\n }\r\n });\r\n};\r\n\r\nexport const firePromotionClick = ({ eventLabel = '', promotionName = [], promotionId = [], promotionCreative = [], promotionPosition = [] }: IPromotionConfigs) => {\r\n fireAnalyticsLink({\r\n eventName: 'promotion-click',\r\n eventCategory: 'ecommerce',\r\n eventAction: 'promotion click',\r\n eventLabel: eventLabel,\r\n eventNoninteraction: 'false',\r\n promoConfig: {\r\n promotion_name: promotionName,\r\n promotion_id: promotionId,\r\n promotion_creative: promotionCreative,\r\n promotion_position: promotionPosition\r\n }\r\n });\r\n};","import { IAnalyticsConfiguration } from './clickTrack';\r\n\r\n// Interface for 3rd-party function. AKA utag.\r\ninterface ITealium {\r\n link(data: {}): void | false;\r\n view(data: {}): void | false;\r\n data(data: {}): void | false;\r\n}\r\n\r\nexport interface IPromotionConfig {\r\n event?: string | null;\r\n event_name?: string | null;\r\n search_term?: string | null;\r\n search_type?: string | null;\r\n event_category?: string | null;\r\n event_action?: string | null;\r\n event_label?: string | null;\r\n event_type?: string | null;\r\n event_noninteraction?: string;\r\n enhanced_action?: string | null;\r\n customer_email?: string | undefined;\r\n customer_phone_number?: string | undefined;\r\n first_name?: string | undefined;\r\n last_name?: string | undefined;\r\n address1?: string | undefined;\r\n address2?: string | undefined;\r\n city?: string | undefined;\r\n state?: string | undefined;\r\n zip_code?: string | undefined;\r\n order_subtotal?: string | undefined;\r\n order_currency?: string | undefined;\r\n country?: string | undefined;\r\n // productConfig?: IProductDataConfig;\r\n checkout_step?: string;\r\n checkout_option?:(string | undefined)[];\r\n checkout_type?:(string | undefined)[];\r\n product_id?: (string | undefined)[];\r\n product_name?: (string | undefined)[];\r\n product_category?: (string | undefined)[];\r\n product_brand?: (string | undefined)[];\r\n product_variant?: (string | undefined | number)[];\r\n product_price?: (string | undefined)[];\r\n product_quantity?: (string | undefined)[];\r\n product_url?: (string | undefined)[];\r\n product_size?: (string | undefined)[];\r\n product_image_url?: (string | undefined)[];\r\n}\r\n\r\ninterface IProductDataConfig {\r\n product_variant?: (string | undefined)[];\r\n product_price?: (string | undefined)[];\r\n}\r\n\r\nexport interface IAnalyticsConfigurationData {\r\n productConfig?: IProductDataConfig;\r\n}\r\n\r\n\r\n// Legacy function\r\nexport const callUtag = async (objToCall: IPromotionConfig) => {\r\n void await callUtagLink(objToCall);\r\n};\r\n\r\n/**\r\n * Tealium dispatch click tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagLink = async (objToCall: IPromotionConfig | IAnalyticsConfiguration) => {\r\n try {\r\n Object.keys(objToCall).forEach(\r\n key => {\r\n if (objToCall[key] === null) {\r\n delete objToCall[key];\r\n }\r\n }\r\n );\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.link(objToCall); }\r\n\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Tealium dispatch view tracking.\r\n * @param objToCall\r\n */\r\nexport const callUtagView = async (objToCall: {}) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n if(utag) { utag.view(objToCall); }\r\n } catch (e) {\r\n console.log('utag View Error', e);\r\n }\r\n};\r\n\r\n/**\r\n * Not currently implemented.\r\n * @param objToCall\r\n * @param dataType\r\n */\r\nexport const callUtagData = ({ productConfig = {} }: IAnalyticsConfigurationData , dataType: string) => {\r\n try {\r\n // If utag doesn't exist in the global scope, set as false.\r\n const utag: ITealium = global.hasOwnProperty('utag') ? global[\"utag\"] : false;\r\n switch (dataType) {\r\n case 'data':\r\n // @ts-ignore\r\n if(utag) { utag.data = {...utag.data, ...productConfig}; }\r\n break;\r\n case '_data':\r\n // @ts-ignore\r\n utag_data = {...utag_data , ...productConfig};\r\n break;\r\n default:\r\n null;\r\n }\r\n } catch (e) {\r\n console.log('Utag Error', e);\r\n }\r\n};","import { IProductRefinerHierarchy } from '@msdyn365-commerce/commerce-entities';\r\nimport { IRequestContext } from '@msdyn365-commerce/core';\r\nimport { ProductRefinerValue } from '@msdyn365-commerce/retail-proxy';\r\nexport interface IVirtualRefinersConfig {\r\n order: number;\r\n refinerName: string;\r\n enableForMattresses: boolean;\r\n enableForOtherCategories: boolean;\r\n allowDuplicate: boolean;\r\n}\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const origin = requestUrl.origin;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `${origin}/${filteredPath}`;\r\n};\r\n\r\nexport const filteredURL = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n const filteredPath = urlParts?.join('/');\r\n\r\n return `/${filteredPath}`;\r\n};\r\n\r\n/**\r\n * This will create the canonicalURL as per 7924 requirement\r\n * @param requestContext\r\n * @returns string of canonical URL\r\n */\r\nexport const canonicalURLWithoutBaseUrl = (requestContext: IRequestContext): string => {\r\n const requestUrl = requestContext.url.requestUrl;\r\n const path = requestUrl.pathname.toLowerCase();\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('\\/').splice(1);\r\n\r\n // remove double values containing pipe sign\r\n if (path.match(/%7c/)) {\r\n urlParts = removePipeSignValue(urlParts);\r\n }\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n return urlParts?.join('\\/');\r\n};\r\n\r\n/**\r\n * This will remove the Pipe sign value set from urlParts\r\n * @param urlParts\r\n * @returns\r\n */\r\nexport const removePipeSignValue = (urlParts: string[]) => {\r\n // urlParts.forEach((part, index) => {\r\n // const indexOfValue = urlParts.indexOf('%7c');\r\n // if (indexOfValue !== -1) {\r\n // urlParts.splice(indexOfValue, 1);\r\n // }\r\n // });\r\n\r\n if (urlParts !== undefined && urlParts.length > 0) {\r\n urlParts = urlParts.filter(urlPart => urlPart.indexOf('%7c') === -1);\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will remove the keywords from urlParts array which were received from\r\n * the app.settings.json/CMS Extensions\r\n * @param urlParts\r\n * @param requestContext\r\n * @returns urlParts array filtered\r\n */\r\nexport const removeKeywords = (urlParts: string[], requestContext: IRequestContext): string[] => {\r\n const removeKeywordFromUrl = requestContext.app.config.removeKeywordFromUrl;\r\n\r\n if (urlParts.length > 0 && removeKeywordFromUrl && removeKeywordFromUrl.length > 0) {\r\n const removeKeywordFromUrlArray: string[] = removeKeywordFromUrl?.trim().split(',');\r\n removeKeywordFromUrlArray?.length > 0 &&\r\n urlParts.forEach(_part => {\r\n removeKeywordFromUrlArray.forEach(removeKeyword => {\r\n const trimmedKeyword = removeKeyword.trim().toLowerCase();\r\n const indexOfValue = urlParts.indexOf(trimmedKeyword);\r\n if (trimmedKeyword.length > 0 && indexOfValue !== -1) {\r\n urlParts.splice(indexOfValue, 1);\r\n }\r\n });\r\n });\r\n }\r\n\r\n return urlParts;\r\n};\r\n\r\n/**\r\n * This will sort the Virtual refiner config based on order and return\r\n * only active virtual refiner configs based on isMattress category will\r\n * be returned\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getSortedVirtualRefinerConfig = (\r\n requestContext: IRequestContext,\r\n isMattressesCategory: boolean | undefined\r\n): IVirtualRefinersConfig[] | undefined => {\r\n let appConfigSorted = getVirtualRefinerConfig(requestContext);\r\n\r\n // sort the config by provided config\r\n if (appConfigSorted) {\r\n if (isMattressesCategory === true) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForMattresses;\r\n });\r\n } else if (isMattressesCategory === false) {\r\n appConfigSorted = appConfigSorted.filter(appConfig => {\r\n return appConfig.enableForOtherCategories;\r\n });\r\n }\r\n appConfigSorted.sort((a: IVirtualRefinersConfig, b: IVirtualRefinersConfig) => {\r\n return a.order - b.order;\r\n });\r\n }\r\n\r\n return appConfigSorted;\r\n};\r\n\r\n/**\r\n * Virtual refiner names from the app.settings.json will be returned which can be used\r\n * to filter out refiners data based upon active virtual refiners\r\n * @param requestContext\r\n * @param isMattressesCategory boolean | undefined\r\n * @returns string[]\r\n */\r\nexport const getVirtualRefinerNames = (requestContext: IRequestContext, isMattressesCategory: boolean | undefined): string[] => {\r\n const sortedVirtualRefinerConfig = getSortedVirtualRefinerConfig(requestContext, isMattressesCategory);\r\n\r\n const appConfigRefinerNames: string[] = [];\r\n\r\n sortedVirtualRefinerConfig &&\r\n sortedVirtualRefinerConfig.forEach(sortedConfig => {\r\n appConfigRefinerNames.push(sortedConfig.refinerName.trim().toLowerCase());\r\n });\r\n\r\n return appConfigRefinerNames;\r\n};\r\n\r\n/**\r\n * This will return the value of virtual refiner configuration\r\n * @param requestContext\r\n * @returns IVirtualRefinersConfig[] | undefined\r\n */\r\nexport const getVirtualRefinerConfig = (requestContext: IRequestContext): IVirtualRefinersConfig[] => {\r\n return requestContext.app.config.urlModifications;\r\n};\r\n\r\nexport async function getVirtualRefinerValues(\r\n requestContext: IRequestContext,\r\n virtualRefiners: IProductRefinerHierarchy[]\r\n): Promise {\r\n const virtualRefinerValues: ProductRefinerValue[] = [];\r\n if (virtualRefiners.length === 0) {\r\n return virtualRefinerValues;\r\n }\r\n const requestUrl = requestContext.url.requestUrl;\r\n // const origin = requestUrl.origin;\r\n const path = requestUrl.pathname;\r\n\r\n // separate out url parts split on forward / and remove first empty index\r\n let urlParts = path?.split('/').splice(1);\r\n\r\n // remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // remove category id {categoryid}.c\r\n const categoryIdToken = requestContext.urlTokens.recordId;\r\n const categoryId = categoryIdToken ? `${categoryIdToken}.c` : undefined;\r\n\r\n if (categoryId) {\r\n urlParts.splice(-1);\r\n }\r\n\r\n // run loop for each url part and get values from refiners for further usage\r\n const finalizedUrlParts: string[] = [];\r\n urlParts.forEach(plainUrlPart => {\r\n const urlPart = decodeURIComponent(plainUrlPart);\r\n if (urlPart.indexOf('|') !== -1) {\r\n const splitOnPipeSign = urlPart?.split('|');\r\n const filteredParts = splitOnPipeSign.filter(part => part.length > 0);\r\n filteredParts.forEach(filteredPart => {\r\n finalizedUrlParts.push(filteredPart.toLowerCase().trim());\r\n });\r\n }\r\n finalizedUrlParts.push(urlPart);\r\n });\r\n finalizedUrlParts.forEach((urlPart) => {\r\n virtualRefiners.forEach((mainRefiner) => {\r\n mainRefiner.Values.forEach((refinerValue) => {\r\n const refinerValueKeyName = refinerValue.LeftValueBoundString?.toLowerCase().trim().split(' ')?.join('-').replace(/\\&/g, 'and').replace(regExSpecialChars(requestContext.app.config.canonicalUrlspecialCharIncludeList), '-');\r\n if (refinerValueKeyName && refinerValueKeyName === urlPart) {\r\n virtualRefinerValues.push(refinerValue);\r\n }\r\n });\r\n });\r\n });\r\n\r\n return virtualRefinerValues;\r\n}\r\n\r\n/**\r\n * For navigation menu links, it will remove keywords configured in global configurations from the navigation link\r\n * and clp link and return url path string\r\n * @param link\r\n * @param requestContext\r\n * @returns string\r\n */\r\nexport const navLinkKeywordRemoval = (link: string, requestContext: IRequestContext): string => {\r\n // Using the rest operator in case there is a weirdly formatted URL with multiple question marks.\r\n const [linkBase, ...linkParams] = link?.split('?');\r\n\r\n // Only apply to category links, which end in .c. Check that a keyword is configured.\r\n if (!linkBase.endsWith('.c') || !requestContext.app.config) {\r\n return link;\r\n }\r\n\r\n // Separate out url parts split on forward /\r\n let urlParts = linkBase?.split('\\/');\r\n\r\n // Remove unwanted keywords from url\r\n urlParts = removeKeywords(urlParts, requestContext);\r\n\r\n // Glue the URL params back together\r\n const linkParam = linkParams.map(param => `?${param}`)?.join('');\r\n\r\n // Rebuild URL by joining with forward slash and appending any URL parameters\r\n const filteredLink = `${urlParts?.join('/')}${linkParam}`;\r\n return `${filteredLink}`;\r\n};\r\nexport const regExSpecialChars = (includeConfigList: string): RegExp => {\r\n let includeConfig = '';\r\n if (includeConfigList !== undefined && includeConfigList !== '') {\r\n includeConfig = includeConfigList?.trim().split(',')?.join('\\\\\\\\');\r\n includeConfig = includeConfig && includeConfig !== '' ? `\\\\\\\\${includeConfig}` : '';\r\n const pattern = `[^\\\\w\\\\&\\\\|${includeConfig}]`;\r\n return new RegExp(pattern, 'gi');\r\n } else {\r\n\r\n const pattern = `[^\\\\w\\\\&\\\\|]`;\r\n return new RegExp(pattern, 'gi');\r\n }\r\n};\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n/* tslint:disable: no-duplicate-imports */\r\nimport { IModuleProps, INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport * as Msdyn365 from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IMfrmRestAssuredPromiseProps } from './mfrm-rest-assured-promise.props.autogenerated';\r\n\r\nexport interface IIMfrmRestAssuredPromisePropsViewProps extends IMfrmRestAssuredPromiseProps<{}> {\r\n title?: React.ReactNode;\r\n text?: React.ReactNode;\r\n image?: React.ReactNode;\r\n className?: string;\r\n restAssuredPromiseContainer: IModuleProps;\r\n imageContainer: INodeProps;\r\n detailsContainer: INodeProps;\r\n restAssuredPromiseAnchorTag?: INodeProps;\r\n imageAriaLabel?: string;\r\n link?: string;\r\n isPromotion: boolean;\r\n}\r\n/**\r\n *\r\n * MFRM Rest Assured Promise component\r\n * Module Cloned from ContentBlock\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nclass MfrmRestAssuredPromise extends React.PureComponent> {\r\n public render(): JSX.Element | null {\r\n const { heading, paragraph, image, className, imageAriaLabel, enhancedEcommTracking } = this.props.config;\r\n\r\n const restAssuredPromiseTitle = heading && (\r\n \r\n );\r\n const imageProps = {\r\n gridSettings: this.props.context.request.gridSettings || {},\r\n imageSettings: image && image.imageSettings\r\n };\r\n\r\n const restAssuredPromiseText = paragraph && (\r\n \r\n );\r\n const restAssuredPromiseImage = image && (\r\n \r\n );\r\n\r\n if (!restAssuredPromiseTitle && !restAssuredPromiseText && !restAssuredPromiseImage) {\r\n this.props.context.telemetry.error('Rest Assured Promise block is empty, module wont render.');\r\n return null;\r\n }\r\n\r\n const isPromotion = enhancedEcommTracking === 'promotion';\r\n\r\n const restAssuredPromiseviewProps = {\r\n ...this.props,\r\n title: restAssuredPromiseTitle,\r\n text: restAssuredPromiseText,\r\n image: restAssuredPromiseImage,\r\n moduleClass: this.props.config.className,\r\n restAssuredPromiseContainer: {\r\n moduleProps: this.props,\r\n className: classnames('ms-content-block', className)\r\n },\r\n imageContainer: { className: 'ms-content-block__image' },\r\n detailsContainer: { className: 'ms-content-block__details' },\r\n restAssuredPromiseAnchorTag: {\r\n tag: 'a',\r\n className: 'ms-content-block__link',\r\n role: 'link',\r\n href: this._getLink()\r\n },\r\n imageAriaLabel,\r\n isPromotion\r\n };\r\n\r\n return this.props.renderView(restAssuredPromiseviewProps) as React.ReactElement;\r\n }\r\n public handleTextChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n public handleParagraphChange = (event: Msdyn365.ContentEditableEvent) => (this.props.config.paragraph = event.target.value);\r\n\r\n private _getLink(): string | null {\r\n const { link } = this.props.config;\r\n if (link) {\r\n return link.destinationUrl;\r\n }\r\n return null;\r\n }\r\n}\r\n\r\nexport default MfrmRestAssuredPromise;\r\n","/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License. See License.txt in the project root for license information.\r\n *--------------------------------------------------------------------------------------------*/\r\n/* tslint:disable: no-duplicate-imports */\r\nimport { Module, Node } from '@msdyn365-commerce-modules/utilities';\r\nimport MsDyn365 from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport { useInView } from 'react-intersection-observer';\r\nimport { fireAnalyticsLink } from '../../Utilities/analytics/clickTrack';\r\nimport { htmltoText } from '../../Utilities/analytics/htmlToText';\r\nimport { firePromotionClick, firePromotionImpression } from '../../Utilities/analytics/promotionClickTrack';\r\nimport { navLinkKeywordRemoval } from '../../Utilities/plp-url-utils';\r\nimport { getAnalyticsConfig, getPromoAnalyticsConfig } from './analytics';\r\nimport { IIMfrmRestAssuredPromisePropsViewProps } from './mfrm-rest-assured-promise';\r\n\r\nconst MfrmRestAssuredPromiseView: React.FC = props => {\r\n const {\r\n restAssuredPromiseContainer,\r\n imageContainer,\r\n detailsContainer,\r\n title,\r\n text,\r\n image,\r\n restAssuredPromiseAnchorTag,\r\n isPromotion,\r\n config\r\n } = props;\r\n\r\n const [paragraphText, setParagraphText] = React.useState('');\r\n\r\n const pagePath = MsDyn365.isBrowser\r\n ? window.location.href.split(location.host)[1].includes('?')\r\n ? window.location.href.split(location.host)[1].split('?')[0]\r\n : window.location.href.split(location.host)[1]\r\n : '';\r\n\r\n const analyticsConfig = getAnalyticsConfig(pagePath, paragraphText, config.tealiumEvent);\r\n const promoAnalyticsConfig = getPromoAnalyticsConfig(\r\n props.config.image,\r\n restAssuredPromiseAnchorTag,\r\n pagePath,\r\n paragraphText,\r\n config.tealiumPromotion\r\n );\r\n\r\n const handleAnalytics = () => {\r\n if (MsDyn365.isBrowser) {\r\n fireAnalyticsLink({ ...analyticsConfig });\r\n if (isPromotion) {\r\n firePromotionClick({ ...promoAnalyticsConfig });\r\n }\r\n\r\n if (restAssuredPromiseAnchorTag?.href) {\r\n window.location.href = navLinkKeywordRemoval(restAssuredPromiseAnchorTag.href, props.context.request);\r\n }\r\n }\r\n };\r\n\r\n const [ref, inView] = useInView({\r\n triggerOnce: true,\r\n rootMargin: '25px'\r\n });\r\n\r\n React.useEffect(() => {\r\n if (MsDyn365.isBrowser && isPromotion && inView) {\r\n firePromotionImpression({ ...promoAnalyticsConfig });\r\n }\r\n setParagraphText(config.paragraph ? htmltoText(config.paragraph.toString()).trim() : '');\r\n }, [inView, paragraphText]);\r\n\r\n return (\r\n \r\n ) => {\r\n event.preventDefault();\r\n handleAnalytics();\r\n }}\r\n >\r\n {image}\r\n \r\n {title}\r\n {text}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default MfrmRestAssuredPromiseView;\r\n","import { INodeProps } from '@msdyn365-commerce-modules/utilities';\r\nimport { IImageData } from '@msdyn365-commerce/core';\r\nimport { ITealiumEventData, ITealiumPromotionData } from './mfrm-rest-assured-promise.props.autogenerated';\r\n\r\nexport const getPromoAnalyticsConfig = (image: IImageData | undefined, restAssuredPromiseAnchorTag: INodeProps | undefined, pagePath: string, paragraphText: string, tealiumPromotion: ITealiumPromotionData | undefined) => {\r\n // Use Configured Paragraph text as Promotion Name\r\n const promoName = tealiumPromotion?.promotion_name || paragraphText;\r\n // Use Configured Link as Promotion ID\r\n const promoID = tealiumPromotion?.promotion_id || restAssuredPromiseAnchorTag?.href || '';\r\n // Use Configured Image URL as default Creative\r\n const promoCreative = tealiumPromotion?.promotion_creative_version || image?.title || image?.altText || '';\r\n const promoPosition = tealiumPromotion?.promotion_position || undefined;\r\n\r\n return {\r\n eventLabel: `${promoName} from ${pagePath}`,\r\n promotionName: [promoName],\r\n promotionId: [promoID],\r\n promotionCreative: [promoCreative],\r\n promotionPosition: [promoPosition]\r\n };\r\n};\r\n\r\nexport const getAnalyticsConfig = (pagePath: string, paragraphText: string, tealiumEvent: ITealiumEventData | undefined) => {\r\n return {\r\n eventName: tealiumEvent?.event || 'rap-module',\r\n eventCategory: tealiumEvent?.event_category || 'rest assured promise module',\r\n eventAction: tealiumEvent?.event_action || `${paragraphText} click`,\r\n eventLabel: tealiumEvent?.event_label || pagePath\r\n };\r\n};","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['mfrm-rest-assured-promise'] = {\n c: () => require('partner/modules/mfrm-rest-assured-promise/mfrm-rest-assured-promise.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-rest-assured-promise',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-rest-assured-promise'\n });\n \n\n \n window.__bindings__ = window.__bindings__ || {};\n window.__bindings__.modules = {\n ...window.__bindings__.modules || {},\n ...binding.modules\n };\n \n window.__bindings__.dataActions = {\n ...window.__bindings__.dataActions || {},\n ...binding.dataActions\n };\n export const viewDictionary = {};\n viewDictionary['__local__|__local__|modules|mfrm-rest-assured-promise|mfrm-rest-assured-promise'] = {\n c: () => require('partner/modules/mfrm-rest-assured-promise/mfrm-rest-assured-promise.view.tsx'),\n cn: '__local__-__local__-mfrm-rest-assured-promise'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["fireAnalyticsLink","searchTerm","searchType","eventName","eventCategory","eventAction","eventLabel","eventType","eventNoninteraction","enhancedAction","generalConfig","promoConfig","productConfig","customerConfig","productImpressionConfig","callUtagLink","event","event_category","event_action","event_label","event_type","event_noninteraction","enhanced_action","search_term","search_type","htmltoText","html","MsDyn365","tempDivElement","document","createElement","innerHTML","textContent","innerText","firePromotionImpression","promotionName","promotionId","promotionCreative","promotionPosition","promotion_impression_name","promotion_impression_id","promotion_impression_creative","promotion_impression_position","firePromotionClick","promotion_name","promotion_id","promotion_creative","promotion_position","callUtag","async","objToCall","Object","keys","forEach","key","utag","global","hasOwnProperty","link","e","console","log","callUtagView","view","canonicalURL","requestContext","requestUrl","url","origin","path","pathname","toLowerCase","urlParts","split","splice","match","removePipeSignValue","removeKeywords","filteredPath","join","filteredURL","undefined","length","filter","urlPart","indexOf","removeKeywordFromUrl","app","config","removeKeywordFromUrlArray","trim","_part","removeKeyword","trimmedKeyword","indexOfValue","getSortedVirtualRefinerConfig","isMattressesCategory","appConfigSorted","getVirtualRefinerConfig","appConfig","enableForMattresses","enableForOtherCategories","sort","a","b","order","getVirtualRefinerNames","sortedVirtualRefinerConfig","appConfigRefinerNames","sortedConfig","push","refinerName","urlModifications","getVirtualRefinerValues","virtualRefiners","virtualRefinerValues","categoryIdToken","urlTokens","recordId","finalizedUrlParts","plainUrlPart","decodeURIComponent","part","filteredPart","mainRefiner","Values","refinerValue","refinerValueKeyName","LeftValueBoundString","replace","regExSpecialChars","canonicalUrlspecialCharIncludeList","navLinkKeywordRemoval","linkBase","linkParams","endsWith","linkParam","map","param","filteredLink","includeConfigList","includeConfig","pattern","RegExp","MfrmRestAssuredPromise","React","constructor","handleTextChange","this","props","heading","text","target","value","handleParagraphChange","paragraph","render","image","className","imageAriaLabel","enhancedEcommTracking","restAssuredPromiseTitle","Msdyn365","tag","editProps","onEdit","context","request","imageProps","gridSettings","imageSettings","restAssuredPromiseText","restAssuredPromiseImage","telemetry","error","isPromotion","restAssuredPromiseviewProps","title","moduleClass","restAssuredPromiseContainer","moduleProps","classnames","imageContainer","detailsContainer","restAssuredPromiseAnchorTag","role","href","_getLink","renderView","destinationUrl","paragraphText","setParagraphText","pagePath","window","location","host","includes","analyticsConfig","tealiumEvent","getAnalyticsConfig","promoAnalyticsConfig","tealiumPromotion","promoName","promoID","promoCreative","promotion_creative_version","altText","promoPosition","getPromoAnalyticsConfig","ref","inView","useInView","triggerOnce","rootMargin","toString","Module","Node","onClick","preventDefault","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}