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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,QAAU/L,cCAjB8L,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":["export const emailRegex = (emailValue: string) => {\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","// 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 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 {