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EAAe,6FAA+F,CACtHX,EAAGA,IAAMC,EAAQ,MACjBW,GAAI,sDAEpB1E,OAAOwE,aAAexE,OAAOwE,cAAgB,GAC7CxE,OAAOwE,aAAaC,eAAcrC,EAAAA,EAAA,GACPpC,OAAOwE,aAAaC,gBAAkB,IACtCA,UCtC3BE,EAAOC,QAAU1G,cCAjByG,EAAOC,QAAUC","sources":["webpack://mattressfirm/./src/Utilities/allRegex.ts?9889","webpack://mattressfirm/./src/actions/EmailSubscriptionDataServiceEntities.g.ts?1320","webpack://mattressfirm/./src/actions/EmailSubscriptionDataActionExtension.g.ts?6673","webpack://mattressfirm/./src/modules/mfrm-footer-email-subscription/mfrm-footer-email-subscription.tsx?9e42","webpack://mattressfirm/./src/modules/mfrm-footer-email-subscription/mfrm-footer-email-subscription.view.tsx?28fe","webpack://mattressfirm/./lib/mfrm-footer-email-subscription/module-registration.js?f5c0","webpack://mattressfirm/external var \"React\"?0d3b","webpack://mattressfirm/external var \"ReactDOM\"?853b"],"sourcesContent":["import { ICoreContext } from '@msdyn365-commerce/core';\r\nexport const emailRegex = (emailValue: string) => {\r\n // eslint-disable-next-line security/detect-unsafe-regex\r\n const validationEmail = /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(?:\\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@(?:[a-z0-9]+(?:-+[a-z0-9]+)*\\.)+(?:xn--[a-z0-9]+|[a-z]{2,16})$/i;\r\n\r\n return validationEmail.test(emailValue);\r\n};\r\n\r\n/**\r\n * Method to remove special characters for product name from product URL\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialChars = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n return str?.replace(/[^a-zA-Z0-9- ]/g, '');\r\n }\r\n return str;\r\n};\r\n\r\n\r\n/**\r\n * Method to remove special characters for product URL's path\r\n * @param str string\r\n * @param ctx ICoreContext\r\n * @returns string\r\n */\r\n\r\nexport const removeSpecialCharsFromURLPath = (str: string, ctx: ICoreContext): string => {\r\n if (ctx && ctx.request.app?.config.removeSpecialCharsPDP) {\r\n const urlPath = decodeURIComponent(str.split('.p')[0])?.replace(/[^a-zA-Z0-9-/ ]/g, '');\r\n return `${urlPath}.p`;\r\n }\r\n return str;\r\n};\r\n\r\n// Following phone format is used on customer info section at checkout page\r\nexport const customerInfoPhoneRegex = /^\\(?([2-9][0-8][0-9])\\)?[ . ]?([2-9][0-9]{2})[\\-\\. ]?([0-9]{4})(\\s*x[0-9]+)?$/; // Valid USA number in format (xxx) xxx-xxxx\r\n\r\n/*\r\nThis regex object has 2 patterns:\r\n'nameRegex' matches names with letters, spaces, apostrophes, periods, and dashes.\r\n'addressInputRegex' matches alphanumeric characters and printable ASCII symbols.\r\n*/\r\nexport const inputRegexObj = {\r\n nameRegex: /^[\\p{L}\\s.'-]+$/u,\r\n addressInputRegex: /^[a-zA-Z0-9\\x20-\\x7E]*$/,\r\n phoneNumerRegex: customerInfoPhoneRegex\r\n};\r\n\r\n// This regex allows us to effectively validate and extract delivery messages\r\nexport const cartDeliveryMsgRegex = /[A-Za-z]{3} \\d{1,2}(?: - [A-Za-z]{3} \\d{1,2})?/;","// tslint:disable\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as Entities from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceTypes.g';\r\n\r\n/**\r\n * MFIEmailSubscription entity interface.\r\n */\r\nexport interface IMFIEmailSubscription {\r\n PersonaSleepStyle?: string;\r\n unique_id: string;\r\n Email?: string;\r\n LeadSource?: string;\r\n PersonaMattressPreference?: string;\r\n Lastname?: string;\r\n LeadDate?: string;\r\n Firstname?: string;\r\n PostalCode?: string;\r\n LeadPage?: string;\r\n LeadPlatform?: string;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIEmailSignupResponse entity interface.\r\n */\r\nexport interface IMFIEmailSignupResponse {\r\n Status?: string;\r\n Unique_id?: string;\r\n Message?: string;\r\n ExtensionProperties?: Entities.CommerceProperty[];\r\n}\r\n\r\n/**\r\n * MFIEmailSubscription entity class.\r\n */\r\nexport class MFIEmailSubscriptionExtensionClass implements IMFIEmailSubscription {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PersonaSleepStyle: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public unique_id: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Email: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public LeadSource: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PersonaMattressPreference: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Lastname: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public LeadDate: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Firstname: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public PostalCode: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public LeadPage: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public LeadPlatform: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PersonaSleepStyle = odataObject.PersonaSleepStyle;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.unique_id = odataObject.unique_id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Email = odataObject.Email;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.LeadSource = odataObject.LeadSource;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PersonaMattressPreference = odataObject.PersonaMattressPreference;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Lastname = odataObject.Lastname;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.LeadDate = odataObject.LeadDate;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Firstname = odataObject.Firstname;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.PostalCode = odataObject.PostalCode;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.LeadPage = odataObject.LeadPage;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.LeadPlatform = odataObject.LeadPlatform;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * MFIEmailSignupResponse entity class.\r\n */\r\nexport class MFIEmailSignupResponseExtensionClass implements IMFIEmailSignupResponse {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Status: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Unique_id: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public Message: string;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n public ExtensionProperties: Entities.CommerceProperty[];\r\n\r\n // Navigation properties names\r\n\r\n /**\r\n * Construct an object from odata response.\r\n * @param {any} odataObject The odata result object.\r\n */\r\n constructor(odataObject?: any) {\r\n odataObject = odataObject || {};\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Status = odataObject.Status;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Unique_id = odataObject.Unique_id;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.Message = odataObject.Message;\r\n\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties = undefined;\r\n if (odataObject.ExtensionProperties) {\r\n this.ExtensionProperties = [];\r\n for (let i = 0; i < odataObject.ExtensionProperties.length; i++) {\r\n if (odataObject.ExtensionProperties[i]) {\r\n if (odataObject.ExtensionProperties[i]['@odata.type']) {\r\n let className: string = odataObject.ExtensionProperties[i]['@odata.type'];\r\n className = className.substr(className.lastIndexOf('.') + 1).concat('Class');\r\n if (EntityClasses[className]) {\r\n this.ExtensionProperties[i] = new EntityClasses[className](odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n this.ExtensionProperties[i] = new EntityClasses.CommercePropertyClass(odataObject.ExtensionProperties[i]);\r\n }\r\n } else {\r\n // @ts-ignore - TODO bug fix #23427261 - remove ts-ignore - https://microsoft.visualstudio.com/DefaultCollection/OSGS/_workitems/edit/23427261/\r\n this.ExtensionProperties[i] = undefined;\r\n }\r\n }\r\n }\r\n }\r\n}\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n * THIS FILE IS AN AUTOGENERATED TYPESCRIPT PROXY EXTENSION.\r\n * TO USE THIS FILE, IT MUST BE ADDED TO A D365COMMERCE APPLICATION\r\n */\r\n// tslint:disable\r\nimport { AsyncResult, callActionOrExecute, DataServiceQuery, IContext, IDataServiceRequest } from '@msdyn365-commerce/retail-proxy';\r\n// @ts-ignore\r\nimport * as EntityClasses from '@msdyn365-commerce/retail-proxy/dist/Entities/CommerceModels.g';\r\nimport * as DataServiceEntities from './EmailSubscriptionDataServiceEntities.g';\r\n\r\n// @ts-ignore\r\nfunction emailSubscriptionsQuery(unique_id?: string): DataServiceQuery {\r\n const key = unique_id ? { unique_id: unique_id } : null;\r\n return new DataServiceQuery('EmailSubscriptions', 'MFIEmailSubscription', DataServiceEntities.MFIEmailSubscriptionExtensionClass, key);\r\n}\r\n\r\nexport function createMFIEmailSubscriptionInput(emailSignup: DataServiceEntities.IMFIEmailSubscription): IDataServiceRequest {\r\n const query = emailSubscriptionsQuery();\r\n return query.createDataServiceRequestForOperation(\r\n 'MFIEmailSubscription',\r\n true,\r\n DataServiceEntities.MFIEmailSignupResponseExtensionClass,\r\n 'false',\r\n { bypassCache: 'get', returnEntity: 'DataServiceEntities.IMFIEmailSignupResponse' },\r\n { emailSignup: emailSignup }\r\n );\r\n}\r\n\r\nexport function mFIEmailSubscriptionAsync(\r\n context: IContext,\r\n emailSignup: DataServiceEntities.IMFIEmailSubscription\r\n): AsyncResult {\r\n const request = createMFIEmailSubscriptionInput(emailSignup);\r\n return callActionOrExecute(request, context.callerContext);\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\r\nimport MsDyn365, { ContentEditableEvent, msdyn365Commerce, RichTextComponent, Text } from '@msdyn365-commerce/core';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport uuid from 'uuid';\r\nimport { mFIEmailSubscriptionAsync } from '../../actions/EmailSubscriptionDataActionExtension.g';\r\nimport { IMFIEmailSubscription } from '../../actions/EmailSubscriptionDataServiceEntities.g';\r\nimport { emailRegex } from '../../Utilities/allRegex';\r\nimport { IMfrmFooterEmailSubscriptionData } from './mfrm-footer-email-subscription.data';\r\nimport { IMfrmFooterEmailSubscriptionProps } from './mfrm-footer-email-subscription.props.autogenerated';\r\n\r\nexport interface IMfrmFooterEmailSubscriptionViewProps extends IMfrmFooterEmailSubscriptionProps {\r\n title: JSX.Element;\r\n form: JSX.Element;\r\n alertMessage: JSX.Element;\r\n className: string;\r\n}\r\n\r\ninterface IFooterEmailSubscriptionState {\r\n isSignedUpSuccess: boolean;\r\n // tslint:disable-next-line: no-any\r\n errorMsg: any;\r\n isError: boolean;\r\n emailValue: string;\r\n}\r\n\r\n/**\r\n *\r\n * MfrmFooterEmailSubscription component\r\n * @extends {React.PureComponent, IFooterEmailSubscriptionState>}\r\n */\r\nclass MfrmFooterEmailSubscription extends React.PureComponent<\r\n IMfrmFooterEmailSubscriptionProps,\r\n IFooterEmailSubscriptionState\r\n> {\r\n private _successMsgTimeOut: number = 6000;\r\n\r\n constructor(props: IMfrmFooterEmailSubscriptionProps) {\r\n super(props);\r\n this.state = {\r\n isSignedUpSuccess: false,\r\n errorMsg: '',\r\n isError: false,\r\n emailValue: ''\r\n };\r\n this.onFinished = this.onFinished.bind(this);\r\n this.handleChange = this.handleChange.bind(this);\r\n if (msdyn365Commerce.isBrowser) {\r\n document.documentElement.style.setProperty('--ftr-msg-timeout-duration', `${this._successMsgTimeOut}`);\r\n }\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n const viewProps = {\r\n ...this.props,\r\n ...this.state,\r\n title: this._renderTitle,\r\n form: this._mailingListJSX,\r\n alertMessage: this._renderAlertMessage,\r\n className: this.props.config.className\r\n };\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n private get _mailingListJSX(): JSX.Element {\r\n const { emailLabel, emailPlaceholder } = this.props.resources;\r\n const { emailValue, errorMsg, isError } = this.state;\r\n return (\r\n
\r\n
\r\n 0 && 'field-control--value',\r\n errorMsg.length > 0 && isError && 'field-control--error'\r\n )}\r\n value={this.state.emailValue}\r\n placeholder={emailPlaceholder}\r\n onChange={this.handleChange}\r\n />\r\n \r\n
\r\n \r\n
\r\n );\r\n }\r\n\r\n private get _renderTitle(): JSX.Element {\r\n const { heading } = this.props.config;\r\n return ;\r\n }\r\n\r\n private get _renderAlertMessage(): JSX.Element | null {\r\n const { isError, isSignedUpSuccess, errorMsg } = this.state;\r\n const { successText } = this.props.config;\r\n if (isError || isSignedUpSuccess) {\r\n return (\r\n
\r\n {isSignedUpSuccess && (\r\n \r\n )}\r\n {isError && (\r\n \r\n )}\r\n
\r\n );\r\n }\r\n return null;\r\n }\r\n public handleTextChange = (event: ContentEditableEvent) => (this.props.config.heading!.text = event.target.value);\r\n\r\n public onFinished = async (event: React.FormEvent) => {\r\n event.preventDefault();\r\n const { emailValue } = this.state;\r\n\r\n if (emailValue === '' || !emailRegex(emailValue)) {\r\n this.setState({\r\n isError: true,\r\n errorMsg: `

${this.props.resources.emailValidation}

`,\r\n isSignedUpSuccess: false\r\n });\r\n } else {\r\n const { errorText, showErrorException } = this.props.config;\r\n const emailSignup: IMFIEmailSubscription = {\r\n PersonaSleepStyle: '',\r\n unique_id: uuid.v4(),\r\n Email: emailValue,\r\n LeadSource: 'footer',\r\n PersonaMattressPreference: '',\r\n Lastname: '',\r\n LeadDate: new Date().toISOString(),\r\n Firstname: '',\r\n PostalCode: '',\r\n LeadPage: this.props.context.request.telemetryPageName?.substring(0,120),\r\n LeadPlatform: 'D365'\r\n };\r\n\r\n try {\r\n const response = await mFIEmailSubscriptionAsync({ callerContext: this.props.context.actionContext }, emailSignup);\r\n if (response.Status === 'Success') {\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n // @ts-ignore\r\n utag.link({\r\n event: this.props.config.tealiumEvent?.event ? this.props.config.tealiumEvent.event : 'footer-email-signup',\r\n event_category: this.props.config.tealiumEvent?.event_category ? this.props.config.tealiumEvent.event_category : 'email signup tracking',\r\n event_action: this.props.config.tealiumEvent?.event_action ? this.props.config.tealiumEvent.event_action : `click ${this.props.config.submitCTAText || 'Submit'}`,\r\n event_label: this.props.config.tealiumEvent?.event_label ? this.props.config.tealiumEvent.event_label : `from footer: ${MsDyn365.isBrowser && window.location.href}`,\r\n event_noninteraction: 'false',\r\n event_type: this.props.config.tealiumEvent?.event_type ? this.props.config.tealiumEvent.event_type : 'email_capture',\r\n customer_email: emailValue?.toLowerCase()?.trim()\r\n });\r\n }\r\n this.setState({ isSignedUpSuccess: true, errorMsg: '', isError: false, emailValue: '' });\r\n MsDyn365.isBrowser && setTimeout(() => this.setState({ isSignedUpSuccess: false }), this._successMsgTimeOut);\r\n } else {\r\n this.setState({\r\n isError: true,\r\n errorMsg: showErrorException ? response.Message : errorText,\r\n isSignedUpSuccess: false\r\n });\r\n }\r\n } catch (error) {\r\n this.setState({\r\n isError: true,\r\n errorMsg: showErrorException ? error : errorText,\r\n isSignedUpSuccess: false\r\n });\r\n }\r\n }\r\n };\r\n\r\n public handleChange = (e: React.FormEvent): void => {\r\n const currentlyInvalid = this.state.emailValue.length > 0 && !emailRegex(this.state.emailValue);\r\n if (currentlyInvalid) {\r\n this.setState({ emailValue: e.currentTarget.value, isError: false });\r\n } else {\r\n this.setState({ emailValue: e.currentTarget.value, isError: true });\r\n }\r\n };\r\n}\r\n\r\nexport default MfrmFooterEmailSubscription;\r\n","/*!\r\n * Copyright (c) Microsoft Corporation.\r\n * All rights reserved. See LICENSE in the project root for license information.\r\n */\r\n\r\nimport { Node } from '@msdyn365-commerce-modules/utilities';\r\nimport classnames from 'classnames';\r\nimport * as React from 'react';\r\nimport { IMfrmFooterEmailSubscriptionViewProps } from './mfrm-footer-email-subscription';\r\n\r\nexport default (props: IMfrmFooterEmailSubscriptionViewProps) => {\r\n const { title, form, alertMessage, className } = props;\r\n return (\r\n \r\n {title}\r\n {form}\r\n {alertMessage}\r\n \r\n );\r\n};\r\n","const binding = { modules: {}, dataActions: {} };\n\n (binding.modules['mfrm-footer-email-subscription'] = {\n c: () => require('partner/modules/mfrm-footer-email-subscription/mfrm-footer-email-subscription.tsx'),\n $type: 'contentModule',\n da: [],\n \n iNM: false,\n ns: '__local__',\n n: 'mfrm-footer-email-subscription',\n p: '__local__',\n \n pdp: '',\n \n \n md: 'src/modules/mfrm-footer-email-subscription'\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-footer-email-subscription|mfrm-footer-email-subscription'] = {\n c: () => require('partner/modules/mfrm-footer-email-subscription/mfrm-footer-email-subscription.view.tsx'),\n cn: '__local__-__local__-mfrm-footer-email-subscription'\n };\nwindow.__bindings__ = window.__bindings__ || {};\nwindow.__bindings__.viewDictionary = {\n ...window.__bindings__.viewDictionary || {},\n ...viewDictionary\n };","module.exports = React;","module.exports = ReactDOM;"],"names":["emailRegex","emailValue","test","removeSpecialChars","str","ctx","_ctx$request$app","request","app","config","removeSpecialCharsPDP","replace","removeSpecialCharsFromURLPath","_ctx$request$app2","_decodeURIComponent","decodeURIComponent","split","customerInfoPhoneRegex","inputRegexObj","nameRegex","addressInputRegex","phoneNumerRegex","cartDeliveryMsgRegex","MFIEmailSubscriptionExtensionClass","constructor","odataObject","this","PersonaSleepStyle","unique_id","Email","LeadSource","PersonaMattressPreference","Lastname","LeadDate","Firstname","PostalCode","LeadPage","LeadPlatform","ExtensionProperties","undefined","i","length","className","substr","lastIndexOf","concat","EntityClasses","MFIEmailSignupResponseExtensionClass","Status","Unique_id","Message","createMFIEmailSubscriptionInput","emailSignup","key","DataServiceQuery","DataServiceEntities","emailSubscriptionsQuery","createDataServiceRequestForOperation","bypassCache","returnEntity","mFIEmailSubscriptionAsync","context","callActionOrExecute","callerContext","MfrmFooterEmailSubscription","React","props","super","_successMsgTimeOut","handleTextChange","event","heading","text","target","value","onFinished","async","preventDefault","state","_this$props$context$r","errorText","showErrorException","uuid","Date","toISOString","telemetryPageName","substring","response","actionContext","_this$props$config$te","_this$props$config$te2","_this$props$config$te3","_this$props$config$te4","_this$props$config$te5","_emailValue$toLowerCa","window","utag","link","tealiumEvent","event_category","event_action","submitCTAText","event_label","MsDyn365","isBrowser","location","href","event_noninteraction","event_type","customer_email","toLowerCase","trim","setState","isSignedUpSuccess","errorMsg","isError","setTimeout","error","resources","emailValidation","handleChange","e","currentTarget","bind","msdyn365Commerce","document","documentElement","style","setProperty","render","viewProps","_objectSpread","title","_renderTitle","form","_mailingListJSX","alertMessage","_renderAlertMessage","renderView","emailLabel","emailPlaceholder","onSubmit","noValidate","type","classnames","placeholder","onChange","Text","tag","successText","RichTextComponent","Node","Object","assign","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}