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GAC1B1F,EAAAA,cAAAA,EAAAA,SAAAA,KACKuG,EACAD,EACAsB,EACAI,EACAxB,GAIR9B,GACG1E,EAAAA,cAAAA,MAAAA,CAAKvB,UAAU,qCACV0I,EACAR,EACAC,GAIRlB,GACG1F,EAAAA,cAAAA,MAAAA,CAAKvB,UAAU,mCACV4I,EACAS,EACAjB,8mBClEzB,MAAMgE,EAAU,CAAEC,QAAS,GAAIC,YAAa,IAEvCF,EAAQC,QAAQ,iCAAmC,CAChDE,EAAG,IAAMC,EAAQ,MACjBC,MAAO,gBACPC,GAAI,GAEJC,KAAK,EACLC,GAAI,YACJC,EAAG,gCACHC,EAAG,YAEHC,IAAK,GAGLC,GAAI,6CAKR3G,OAAO4G,aAAe5G,OAAO4G,cAAgB,GAC7C5G,OAAO4G,aAAaZ,QAApB,OACOhG,OAAO4G,aAAaZ,SAAW,IAC/BD,EAAQC,SAGXhG,OAAO4G,aAAaX,YAApB,OACGjG,OAAO4G,aAAaX,aAAe,IACnCF,EAAQE,aAEY,MAAMY,EAAiB,GAC9BA,EAAe,2FAA6F,CACpHX,EAAG,IAAMC,EAAQ,MACjBW,GAAI,qDAEpB9G,OAAO4G,aAAe5G,OAAO4G,cAAgB,GAC7C5G,OAAO4G,aAAaC,eAApB,OAC2B7G,OAAO4G,aAAaC,gBAAkB,IACtCA,UCtC3BE,EAAOC,QAAU9L,cCAjB6L,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-email-subscription-modal/components/text-input-group.tsx?c082","webpack://mattressfirm/./src/modules/mfrm-email-subscription-modal/components/input-group-mailing-list.tsx?20ec","webpack://mattressfirm/./src/modules/mfrm-email-subscription-modal/mfrm-email-subscription-modal.tsx?e25c","webpack://mattressfirm/./src/modules/mfrm-email-subscription-modal/mfrm-email-subscription-modal.view.tsx?a75f","webpack://mattressfirm/./lib/mfrm-email-subscription-modal/module-registration.js?594c","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","import classnames from 'classnames';\r\nimport { observable } from 'mobx';\r\nimport { observer } from 'mobx-react';\r\nimport * as React from 'react';\r\ninterface ITextInputGroupProps {\r\n useDatePicker?: boolean;\r\n label?: string;\r\n placeholder?: string;\r\n id: string;\r\n initialValue?: string;\r\n maxLength?: number;\r\n htmlProps?: React.DetailedHTMLProps, HTMLInputElement>;\r\n isValid(curValue: string, id: string): string | void;\r\n onChange(value: string, currentValidity: boolean, id: string): void;\r\n}\r\n\r\n/**\r\n * TextInputGroup is a wrapper that allows you to validate text values from the\r\n * user and returns the correct value after\r\n */\r\n@observer\r\nexport class TextInputGroup extends React.Component {\r\n @observable private _internalValue: string = '';\r\n @observable private _errorMessage: string = '';\r\n @observable private _isFirstBlur: boolean = true;\r\n\r\n constructor(props: ITextInputGroupProps) {\r\n super(props);\r\n\r\n if (props.initialValue) {\r\n this._internalValue = props.initialValue;\r\n }\r\n\r\n this._valueChanged = this._valueChanged.bind(this);\r\n this._blurred = this._blurred.bind(this);\r\n }\r\n\r\n public render(): JSX.Element {\r\n let type = 'text';\r\n const { label } = this.props;\r\n if (this.props.useDatePicker) {\r\n type = 'date';\r\n }\r\n return (\r\n
\r\n 0 && 'field-control--value',\r\n this._errorMessage.length > 0 && 'field-control--error'\r\n )}\r\n type={type}\r\n onChange={this._valueChanged}\r\n value={this._internalValue}\r\n onBlur={this._blurred}\r\n maxLength={this.props.maxLength}\r\n {...this.props.htmlProps}\r\n />\r\n \r\n
\r\n );\r\n }\r\n\r\n private _blurred(event: React.ChangeEvent): void {\r\n this._isFirstBlur = false;\r\n this._valueChanged(event);\r\n }\r\n\r\n private _valueChanged(event: React.ChangeEvent): void {\r\n this._internalValue = event.target.value;\r\n const currentlyInvalid = this.props.isValid(this._internalValue, this.props.id);\r\n const isValid = currentlyInvalid ? false : true;\r\n\r\n // we only want to show an error if a user has clicked away and its\r\n // still wrong\r\n if (currentlyInvalid && !this._isFirstBlur) {\r\n this._errorMessage = currentlyInvalid;\r\n } else {\r\n this._errorMessage = '';\r\n }\r\n\r\n this.props.onChange(this._internalValue, isValid, this.props.id);\r\n }\r\n}\r\n","import { IAny, ICoreContext, IGeneric } from '@msdyn365-commerce/core';\r\nimport * as React from 'react';\r\nimport { TextInputGroup } from './text-input-group';\r\n\r\nexport type mailingData = {\r\n name: string;\r\n email: string;\r\n};\r\n\r\nexport type inputGroup = {\r\n labelText?: string;\r\n validationText?: string;\r\n placeholder?: string;\r\n};\r\n\r\nexport interface IMailingListInputGroup {\r\n submitText?: string;\r\n name: inputGroup;\r\n email: inputGroup;\r\n context: ICoreContext>;\r\n onFinish(dataSet: mailingData): void;\r\n}\r\n\r\nexport interface ISubmittingState {\r\n isSubmitting?: boolean;\r\n}\r\n\r\ntype mailingListFormStructureGroup = {\r\n validity: boolean;\r\n value: string;\r\n externalGroup?: inputGroup;\r\n regex?: RegExp;\r\n maxLength?: number;\r\n};\r\n\r\ntype mailingListFormStructure = {\r\n [fieldName: string]: mailingListFormStructureGroup;\r\n};\r\n\r\n/**\r\n * Constructs only the necessary components of the mailing list inputs\r\n *\r\n * To add a new field, add it to the internal form structure object and\r\n * the external props typing\r\n */\r\nexport class MailingListInputGroup extends React.Component {\r\n\r\n private _formStructure: mailingListFormStructure = {\r\n name: {\r\n validity: false,\r\n value: ''\r\n },\r\n email: {\r\n validity: false,\r\n value: '',\r\n // eslint-disable-next-line security/detect-unsafe-regex\r\n regex: /^[-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 };\r\n constructor(props: IMailingListInputGroup) {\r\n super(props);\r\n this.state = {\r\n isSubmitting: false\r\n };\r\n this._handleValidityUpdate = this._handleValidityUpdate.bind(this);\r\n this._handleValueFinish = this._handleValueFinish.bind(this);\r\n this._handleFormExport = this._handleFormExport.bind(this);\r\n }\r\n\r\n public render(): JSX.Element {\r\n this._setExternalGroups();\r\n return (\r\n \r\n {Object.keys(this._formStructure).map(fieldName => {\r\n const field = this._formStructure[fieldName];\r\n return (\r\n \r\n );\r\n })}\r\n \r\n {this.props.submitText || 'Submit'}\r\n \r\n \r\n );\r\n }\r\n\r\n private _setExternalGroups(): void {\r\n this._formStructure.name.externalGroup = this.props.name;\r\n this._formStructure.email.externalGroup = this.props.email;\r\n }\r\n private _handleFormExport(event: React.MouseEvent): void {\r\n this.props.onFinish({\r\n email: this._formStructure.email.value,\r\n name: this._formStructure.name.value\r\n });\r\n this.setState({ // disabled button to prevent duplicates\r\n isSubmitting: true\r\n });\r\n event.preventDefault();\r\n }\r\n\r\n private _handleValueFinish(value: string, isValid: boolean, id: string): void {\r\n const fieldData = this._formStructure[id];\r\n fieldData.validity = isValid;\r\n fieldData.value = value;\r\n\r\n if (isValid) {\r\n this.setState({ // enable button when email is valid\r\n isSubmitting: false\r\n });\r\n }\r\n\r\n // re-render, no reason to use mobx for this\r\n this.setState({});\r\n }\r\n\r\n private _handleValidityUpdate(value: string, id: string): string | void {\r\n const fieldData = this._formStructure[id];\r\n\r\n // should always be true but just in case\r\n if (fieldData) {\r\n const validationText = fieldData.externalGroup!.validationText;\r\n if (value.length === 0 && id !== 'name') {\r\n return validationText;\r\n }\r\n if (value.length > 0 && fieldData.regex && !fieldData.regex.test(value)) {\r\n return validationText;\r\n }\r\n }\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\r\n// import { RichText, RichTextComponent, Text } from '@msdyn365-commerce/core';\r\nimport MsDyn365, { ICookieValue, RichTextComponent, Text } from '@msdyn365-commerce/core';\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 { inputGroup, mailingData, MailingListInputGroup } from './components/input-group-mailing-list';\r\nimport { IMfrmEmailSubscriptionModalData } from './mfrm-email-subscription-modal.data';\r\nimport { IMfrmEmailSubscriptionModalProps } from './mfrm-email-subscription-modal.props.autogenerated';\r\nexport interface IMfrmEmailSubscriptionModalViewProps extends IMfrmEmailSubscriptionModalProps {\r\n isOpen: boolean;\r\n isSubscribeSuccessfully: boolean;\r\n className: string;\r\n isError: boolean;\r\n heading: JSX.Element;\r\n subHeading: JSX.Element;\r\n sucessMsgHeading: JSX.Element;\r\n errorMsgHeading: JSX.Element;\r\n disclosures: JSX.Element;\r\n successContent: JSX.Element;\r\n form: JSX.Element;\r\n successCTA: JSX.Element;\r\n errorCTA: JSX.Element;\r\n errorBlock: JSX.Element;\r\n emailValidationBlock: JSX.Element;\r\n onCloseModal?(): void;\r\n}\r\n\r\ninterface IPopupModalState {\r\n isModalOpen: boolean;\r\n isError: boolean;\r\n isSubscribeSuccessfully: boolean;\r\n // tslint:disable-next-line: no-any\r\n errorMsg: any;\r\n isEmailValid: boolean;\r\n popupReady: boolean;\r\n}\r\n\r\nexport type popupModalCookie = {\r\n name: string;\r\n age: number | undefined;\r\n};\r\n\r\n/**\r\n *\r\n * MfrmEmailSubscriptionModal component\r\n * @extends {React.PureComponent, IPopupModalState>}\r\n */\r\nclass MfrmEmailSubscriptionModal extends React.Component,IPopupModalState> {\r\n private _cookie: popupModalCookie;\r\n private _delayStarted: boolean = false;\r\n\r\n constructor(props: IMfrmEmailSubscriptionModalProps) {\r\n super(props);\r\n this._closeModal = this._closeModal.bind(this);\r\n this.onFinished = this.onFinished.bind(this);\r\n this.state = {\r\n isModalOpen: true,\r\n isError: false,\r\n isSubscribeSuccessfully: false,\r\n errorMsg: '',\r\n isEmailValid: true,\r\n popupReady: false\r\n };\r\n this._cookie = {\r\n name: 'Mattress-Firm_email_sub',\r\n age: props.config.remindTime || undefined\r\n };\r\n }\r\n\r\n public componentDidMount(): void {\r\n this.setState({ isModalOpen: true });\r\n }\r\n\r\n public render(): JSX.Element | null {\r\n if (!this.props.config.enableModal) {\r\n return null;\r\n }\r\n // we add this._cookieRecievedPreForm because that means *this module did not introduce the cookie*\r\n // this means we want to notify them that the form was successfully made and not just\r\n // closing down immediately\r\n if (this._cookieExist(this._cookie.name)) {\r\n return null;\r\n }\r\n const { isModalOpen, isSubscribeSuccessfully, isError, isEmailValid } = this.state;\r\n const {\r\n className,\r\n heading,\r\n subHeading,\r\n disclosures,\r\n successHeading,\r\n errorHeading,\r\n successContent,\r\n successCTA,\r\n errorCTA\r\n } = this.props.config;\r\n {\r\n this._startDelay();\r\n }\r\n const viewProps = {\r\n ...this.props,\r\n ...this.state,\r\n className: className,\r\n isOpen: isModalOpen,\r\n heading: heading && this._renderHeading,\r\n subHeading: subHeading && this._renderSubHeading,\r\n sucessMsgHeading: successHeading && this._renderSucessMsgHeading,\r\n errorMsgHeading: errorHeading && this._renderErrorMsgHeading,\r\n disclosures: disclosures && this._renderDisclosures,\r\n successContent: successContent && this._renderSuccessContent,\r\n successCTA: successCTA && this._renderSuccessCTA,\r\n errorCTA: errorCTA && this._renderErrorCTA,\r\n isSubscribed: isSubscribeSuccessfully,\r\n isError: isError,\r\n form: this._mailingListJSX,\r\n errorBlock: this._renderErrorBlock,\r\n emailValidationBlock: !isEmailValid && this._renderValidationError,\r\n onCloseModal: this._closeModal\r\n };\r\n if (!this.state.popupReady) {\r\n return null;\r\n }\r\n\r\n return this.props.renderView(viewProps) as React.ReactElement;\r\n }\r\n\r\n public onFinished = async (dataSet: mailingData) => {\r\n const { errorContent, showErrorException } = this.props.config;\r\n\r\n if (dataSet.email === '' || !emailRegex(dataSet.email)) {\r\n this.setState({\r\n isEmailValid: false,\r\n isSubscribeSuccessfully: false\r\n });\r\n } else {\r\n const { cookies } = this.props.context.request;\r\n const zipCode = cookies.get('zip_code').value as string;\r\n\r\n const emailSignup: IMFIEmailSubscription = {\r\n PersonaSleepStyle: '',\r\n unique_id: uuid.v4(),\r\n Email: dataSet.email,\r\n LeadSource: 'modal',\r\n PersonaMattressPreference: '',\r\n Lastname: '',\r\n LeadDate: new Date().toISOString(),\r\n Firstname: dataSet.name,\r\n PostalCode: zipCode ? zipCode : '',\r\n LeadPage: this.props.context.request.telemetryPageName?.substring(0, 120),\r\n LeadPlatform: 'D365'\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 this.setState({ isSubscribeSuccessfully: true, isEmailValid: true });\r\n\r\n {\r\n /* VSI Customization - START - 44020*/\r\n }\r\n const pageURL = MsDyn365.isBrowser && window.location.pathname;\r\n const email = dataSet.email;\r\n const { submitCTA } = this.props.config;\r\n // @ts-ignore\r\n if(MsDyn365.isBrowser && 'utag' in window){\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'popup-modal-email-signup',\r\n event_category: 'email signup tracking',\r\n event_action: 'click ' + `${submitCTA}`,\r\n event_label: 'from email signup modal: ' + `${pageURL}`,\r\n event_noninteraction: 'false',\r\n event_type: 'email_capture',\r\n customer_email: email\r\n });\r\n }\r\n } else {\r\n this.setState({\r\n isError: true,\r\n errorMsg: showErrorException ? response.Message : errorContent,\r\n isEmailValid: true\r\n });\r\n }\r\n } catch (error) {\r\n this.setState({\r\n isError: true,\r\n errorMsg: showErrorException ? error : errorContent,\r\n isEmailValid: true\r\n });\r\n }\r\n }\r\n };\r\n\r\n public constructMailingListGroupsFromResources(): { [groupName: string]: inputGroup } {\r\n const { emailLabel, emailValidation, nameLabel, nameValidation } = this.props.resources;\r\n\r\n return {\r\n name: {\r\n labelText: nameLabel,\r\n validationText: nameValidation,\r\n placeholder: nameLabel\r\n },\r\n email: {\r\n labelText: emailLabel,\r\n validationText: emailValidation,\r\n placeholder: emailLabel\r\n }\r\n };\r\n }\r\n\r\n // Heading for email subscription modal\r\n private get _renderHeading(): JSX.Element {\r\n const { heading } = this.props.config;\r\n return ;\r\n }\r\n\r\n // Renders Sub Heading for email subscription modal\r\n private get _renderSubHeading(): JSX.Element {\r\n const { subHeading } = this.props.config;\r\n return ;\r\n }\r\n\r\n // Renders disclosures for email subscription modal\r\n private get _renderDisclosures(): JSX.Element {\r\n const { disclosures } = this.props.config;\r\n return ;\r\n }\r\n\r\n // Renders errors occurs while email subscription\r\n private get _renderValidationError(): JSX.Element {\r\n return (\r\n
\r\n

{this.props.resources.emailValidation}

\r\n
\r\n );\r\n }\r\n\r\n // Renders errors occurs while email subscription\r\n private get _renderErrorBlock(): JSX.Element {\r\n const { errorMsg } = this.state;\r\n return ;\r\n }\r\n\r\n // Heading for Success Message after successfully email subscription\r\n private get _renderSucessMsgHeading(): JSX.Element {\r\n const { successHeading } = this.props.config;\r\n return ;\r\n }\r\n // Heading for Success Message after successfully email subscription\r\n private get _renderErrorMsgHeading(): JSX.Element {\r\n const { errorHeading } = this.props.config;\r\n return ;\r\n }\r\n\r\n // Renders success message content after successfully email subscription\r\n private get _renderSuccessContent(): JSX.Element {\r\n const { successContent } = this.props.config;\r\n return ;\r\n }\r\n\r\n private get _renderSuccessCTA(): JSX.Element {\r\n const { successCTA } = this.props.config;\r\n return (\r\n \r\n {successCTA?.linkText}\r\n \r\n );\r\n }\r\n\r\n private get _renderErrorCTA(): JSX.Element {\r\n const { errorCTA } = this.props.config;\r\n return (\r\n \r\n {errorCTA?.linkText}\r\n \r\n );\r\n }\r\n\r\n // Delays the modal to show after specific time span as per delay config\r\n private _startDelay(): void {\r\n if (!this._delayStarted) {\r\n const delayTime = this.props.config.delay || 0;\r\n this._delayStarted = true;\r\n MsDyn365.isBrowser &&\r\n setTimeout(() => {\r\n this.setState({ popupReady: true }, () => {\r\n // @ts-ignore\r\n if ('utag' in window) {\r\n const pageURL = MsDyn365.isBrowser && window.location.pathname;\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'popup-modal-loaded',\r\n event_category: 'email signup tracking',\r\n event_action: 'auto-show-email-signup-modal',\r\n event_label: 'from email signup modal: ' + `${pageURL}`,\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n });\r\n }, delayTime * 1000);\r\n }\r\n }\r\n\r\n private _setCookie(name: string, deltaDaysFromToday: number): void {\r\n const { cookies } = this.props.context.request;\r\n const expirationDate = new Date(Date.now());\r\n expirationDate.setTime(expirationDate.getTime() + (deltaDaysFromToday * 24 * 60 * 60 * 1000));\r\n\r\n cookies.set(name, false, {\r\n expires: deltaDaysFromToday ? expirationDate : null,\r\n isEssential: true\r\n } as {});\r\n }\r\n\r\n private _cookieExist(name: string): boolean {\r\n const { cookies } = this.props.context.request;\r\n // if cookie exists, don't display\r\n if (\r\n // unfortunetly the type does not match the class. isEssential does\r\n // not exist on cookies.get but is required in this function.\r\n // override the type to add it\r\n (cookies.get as (name: string, isEssential: boolean) => ICookieValue)(name, true).status === 'FOUND'\r\n ) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // method to close modal and reset states\r\n private _closeModal(): void {\r\n const remindTime = this.props.config.remindTime || 0;\r\n this._setCookie(this._cookie.name, remindTime);\r\n // @ts-ignore\r\n if (this.state.isSubscribeSuccessfully === false && MsDyn365.isBrowser && 'utag' in window) {\r\n const pageURL = MsDyn365.isBrowser && window.location.pathname;\r\n // @ts-ignore\r\n // tslint:disable-next-line: object-literal-key-quotes\r\n utag.link({\r\n event: 'close-email-signup-modal',\r\n event_category: 'email signup tracking',\r\n event_action: 'modal close',\r\n event_label: 'from email signup modal: ' + `${pageURL}`,\r\n event_noninteraction: 'false'\r\n });\r\n }\r\n\r\n this.setState({\r\n isModalOpen: false,\r\n isSubscribeSuccessfully: false,\r\n isError: false,\r\n errorMsg: '',\r\n popupReady: false\r\n });\r\n }\r\n\r\n private get _mailingListJSX(): JSX.Element {\r\n const groups = this.constructMailingListGroupsFromResources();\r\n const { submitCTA } = this.props.config;\r\n return (\r\n
\r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nexport default MfrmEmailSubscriptionModal;\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 { Modal, ModalBody, ModalHeader } from '@msdyn365-commerce-modules/utilities';\r\nimport * as React from 'react';\r\nimport { IMfrmEmailSubscriptionModalViewProps } from './mfrm-email-subscription-modal';\r\n\r\nexport default (props: IMfrmEmailSubscriptionModalViewProps) => {\r\n const {\r\n isOpen,\r\n heading,\r\n subHeading,\r\n form,\r\n sucessMsgHeading,\r\n errorMsgHeading,\r\n disclosures,\r\n errorBlock,\r\n successContent,\r\n successCTA,\r\n errorCTA,\r\n emailValidationBlock,\r\n isSubscribeSuccessfully,\r\n isError,\r\n onCloseModal\r\n } = props;\r\n return (\r\n \r\n \r\n {