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AAI,YACJC,EAAG,iCACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,8CAKR1D,OAAO2D,aAAe3D,OAAO2D,cAAgB,GAC7C3D,OAAO2D,aAAaZ,QAApB,OACO/C,OAAO2D,aAAaZ,SAAW,IAC/BD,EAAQC,SAGX/C,OAAO2D,aAAaX,YAApB,OACGhD,OAAO2D,aAAaX,aAAe,IACnCF,EAAQE,aAEY,MAAMY,EAAiB,GAC9BA,EAAe,6FAA+F,CACtHX,EAAG,IAAMC,EAAQ,MACjBW,GAAI,sDAEpB7D,OAAO2D,aAAe3D,OAAO2D,cAAgB,GAC7C3D,OAAO2D,aAAaC,eAApB,OAC2B5D,OAAO2D,aAAaC,gBAAkB,IACtCA,UCtC3BE,EAAOC,QAAU7F,cCAjB4F,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/**\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","// 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) {\r\n // @ts-ignore\r\n utag.link({\r\n event: 'footer-email-signup',\r\n event_category: 'email signup tracking',\r\n event_action: `click ${this.props.config.submitCTAText || 'Submit'}`,\r\n event_label: `from footer: ${MsDyn365.isBrowser && window.location.href}`,\r\n event_noninteraction: 'false',\r\n event_type: 'email_capture',\r\n customer_email: emailValue\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","request","app","config","removeSpecialCharsPDP","replace","removeSpecialCharsFromURLPath","urlPath","decodeURIComponent","split","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","errorText","showErrorException","uuid","Date","toISOString","telemetryPageName","substring","response","actionContext","utag","link","event_category","event_action","submitCTAText","event_label","MsDyn365","window","location","href","event_noninteraction","event_type","customer_email","setState","isSignedUpSuccess","errorMsg","isError","setTimeout","error","resources","emailValidation","handleChange","e","currentTarget","bind","msdyn365Commerce","document","documentElement","style","setProperty","render","viewProps","title","_renderTitle","form","_mailingListJSX","alertMessage","_renderAlertMessage","renderView","emailLabel","emailPlaceholder","onSubmit","noValidate","type","classnames","placeholder","onChange","Text","tag","successText","RichTextComponent","Node","Object","binding","modules","dataActions","c","require","$type","da","iNM","ns","n","p","pdp","md","__bindings__","viewDictionary","cn","module","exports","ReactDOM"],"sourceRoot":""}