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,GAAM,IAAIG,EAAA,IACxDL,SACG,0BACCE,GACG,IAAIpE,GAAqB,CACrBc,OAAQsD,EAAE5I,IAAI,8BAGzB0I,SACG,+BACCE,GACG,IAAIjB,GAA0B,CAC1BG,oBAAqBc,EAAE5I,IAAI,0BAC3ByH,aAAcmB,EAAE5I,IAAI,sBAG/B0I,SAAS,mBAA6BE,GAC5B,qBAEVF,SAAS,8BAAwCE,GAAM,IAAIjF,IAC3D+E,SACG,kCACA/H,GAAYgI,SAASC,GAAM,IAAI1C,MAElCwC,SAAS,kCAA4CE,GAAM,IAAIN,KACpE,MAAM,WAAEU,KAAe,OAAcrI,G","sources":["webpack://elc-service-communications/./src/service-setup/ConfigStore.tsx","webpack://elc-service-communications/./src/api/CommunicationsApiSdk.ts","webpack://elc-service-communications/./src/internal/use-cases/UserProfileChangedUseCase.ts","webpack://elc-service-communications/./src/internal/constants/EmailOptIn.ts","webpack://elc-service-communications/./src/internal/use-cases/EmailOptInRequestUseCase.ts","webpack://elc-service-communications/./src/internal/use-cases/ClearEmailOptInUseCase.ts","webpack://elc-service-communications/./src/internal/use-cases/ProductNotifyMeRequestUseCase.ts","webpack://elc-service-communications/./src/service-setup/ServiceBusController.ts","webpack://elc-service-communications/./src/internal/domain/entities/EmailOptIn.ts","webpack://elc-service-communications/./src/internal/use-cases/EmaiOptInViewLoadedUseCase.ts","webpack://elc-service-communications/./src/internal/controllers/EmailOptInViewController.ts","webpack://elc-service-communications/./src/internal/constants/SubscribeSource.ts","webpack://elc-service-communications/./src/internal/repositories/EmailOptInRepository.ts","webpack://elc-service-communications/./src/internal/domain/entities/Product.ts","webpack://elc-service-communications/./src/internal/use-cases/LoadProductUseCase.ts","webpack://elc-service-communications/./src/internal/use-cases/ClearNotifyMeFormUseCase.ts","webpack://elc-service-communications/./src/internal/use-cases/EmailSubmittedUseCase.ts","webpack://elc-service-communications/./src/internal/controllers/ProductNotifyMeViewController.ts","webpack://elc-service-communications/./src/internal/repositories/ProductNotifyMeRepository.ts","webpack://elc-service-communications/./src/internal/domain/entities/NotifyMeForm.ts","webpack://elc-service-communications/./src/internal/controllers/ViewEmailOptInViewController.ts","webpack://elc-service-communications/./src/service-setup/diContainer.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { observable, action } from 'mobx';\n\nexport class ConfigStore {\n @observable public config: any;\n constructor(config: any) {\n this.updateConfig(config);\n }\n\n @action\n public updateConfig(config: any) {\n this.config = { ...config };\n }\n}\n","import { Api, IConfig } from '@estee/elc-service';\nimport { IEmailOptIn } from '../internal/domain/entities/EmailOptIn';\n\nconst { name, version } = __serviceInfo__;\nexport interface IEmailOptInRequest {\n emailAddress: string;\n subscribeSource: string;\n communicationType: string[];\n}\n\nexport class CommunicationsApiSdk extends Api {\n private backInStockUrl: string;\n private emailOptInUrl: string;\n\n constructor(config: IConfig) {\n super(config, name, version);\n this.backInStockUrl = '/stardust-communications-backinstock-v0/subscribers';\n this.emailOptInUrl = '/stardust-communications-subscriptions-v0/subscriptions';\n }\n\n public subscribeToBackInStockNotification = async (\n skuId: string,\n emailAddress: string,\n subscriptionType: string\n ) => {\n await this.post({\n url: this.backInStockUrl,\n body: {\n skuId,\n emailAddress,\n subscriptionType\n }\n });\n };\n\n public emailOptInRequest = async (payload: IEmailOptInRequest) => {\n const response = await this.post({\n url: this.emailOptInUrl,\n body: payload\n });\n\n return response.data;\n };\n\n public getEmailOptInRequest = async (email: string) => {\n const response = await this.get(\n `${this.emailOptInUrl}?emailAddress=${email}`\n );\n\n return response.data;\n };\n\n public updateEmailOptInRequest = async (subscriptionId: string, payload: {}) => {\n const response = await this.patch({\n url: `${this.emailOptInUrl}/${subscriptionId}`,\n body: payload\n });\n\n return response.data;\n };\n}\n","import { EmailOptInRepository } from '../repositories/EmailOptInRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { events, emit } from '@estee/elc-service-bus';\n\nexport interface IPayload {\n email: string;\n source: string;\n}\nexport class UserProfileChangedUseCase {\n private emailOptInRepository: EmailOptInRepository;\n private payload: IPayload;\n\n constructor(payload: IPayload) {\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n\n this.payload = payload;\n }\n\n public execute = async () => {\n try {\n await this.emailOptInRepository.updateEmailOptInRequest(this.payload);\n } catch (error) {\n emit(events.SAVE_FOR_LATER_UPDATE_FAILED, error);\n console.error(error);\n }\n };\n}\n","export const AUTH_SOURCE = Object.freeze({\n SIGN_UP: 'sign-up',\n SIGN_IN: 'sign-in',\n CHECKOUT_GUEST: 'checkout_guest',\n APPOINTMENT_BOOKED_GUEST: 'appointment_booked_guest'\n});\n\nexport const COMMUNICATION_TYPE = Object.freeze({\n EMAIL: 'email'\n});\n\nexport const SUBSCRIBE_SOURCE = 'subscribeSource';\nexport const UNSUBSCRIBE_SOURCE = 'unsubscribeSource';\nexport const COOKIE_USER_EMAIL = 'elc-user-email';\n","import { EmailOptInRepository, IEmailOptInPayload } from '../repositories/EmailOptInRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { AUTH_SOURCE } from '../constants/EmailOptIn';\n\nexport class EmailOptInRequestUseCase {\n private emailOptInRepository: EmailOptInRepository;\n private payload: IEmailOptInPayload;\n\n constructor(payload: IEmailOptInPayload) {\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n this.payload = payload;\n }\n\n public execute = async () => {\n try {\n const directOptInSources = [\n AUTH_SOURCE.SIGN_UP,\n AUTH_SOURCE.CHECKOUT_GUEST,\n AUTH_SOURCE.APPOINTMENT_BOOKED_GUEST\n ];\n // @ts-ignore\n if (directOptInSources.indexOf(this.payload.source) > -1) {\n await this.emailOptInRepository.emailOptInRequest(this.payload);\n } else {\n const email = this.emailOptInRepository.getUserEmail(this.payload);\n\n return await this.emailOptInRepository.getEmailOptInRequest(email);\n }\n } catch (error) {\n console.error(error);\n }\n };\n}\n","import { EmailOptInRepository } from '../repositories/EmailOptInRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\n\nexport class ClearEmailOptInUseCase {\n private emailOptInRepository: EmailOptInRepository;\n\n constructor() {\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n }\n\n public execute = () => {\n this.emailOptInRepository.clearEmailOptIn();\n };\n}\n","import { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { ProductNotifyMeRepository } from '../repositories/ProductNotifyMeRepository';\nimport { emit, events } from '@estee/elc-service-bus';\n\nexport class ProductNotifyMeRequestUseCase {\n private context?: string;\n private skuId: string;\n private email: string;\n private subscriptionType: string;\n private skuBaseId: string;\n\n private productNotifyMeRepository: ProductNotifyMeRepository;\n\n constructor(spec: {\n context?: string;\n skuId: string;\n skuBaseId: string;\n email: string;\n subscriptionType: string;\n }) {\n this.context = spec.context;\n this.skuId = spec.skuId;\n this.email = spec.email;\n this.subscriptionType = spec.subscriptionType;\n this.skuBaseId = spec.skuBaseId;\n\n this.productNotifyMeRepository = diContainer.get(serviceNames.productNotifyMeRepository);\n }\n\n public execute = async () => {\n const { context, skuId, email, subscriptionType, skuBaseId } = this;\n\n let error = false;\n\n try {\n await this.productNotifyMeRepository.subscribeToBackInStockNotification({\n skuId,\n email,\n subscriptionType\n });\n } catch (err) {\n error = true;\n }\n\n if (!error) {\n emit(events.PRODUCT_NOTIFY_ME_REQUEST_SUCCESS, {\n context,\n skuId,\n email,\n subscriptionType,\n skuBaseId\n });\n } else {\n emit(events.PRODUCT_NOTIFY_ME_REQUEST_FAILURE, {\n context,\n skuId,\n email,\n subscriptionType,\n skuBaseId\n });\n }\n };\n}\n","import {\n EmailOptInRepository,\n IEmailOptInPayload\n} from '../internal/repositories/EmailOptInRepository';\nimport {\n IPayload,\n UserProfileChangedUseCase\n} from '../internal/use-cases/UserProfileChangedUseCase';\nimport { EmailOptInRequestUseCase } from '../internal/use-cases/EmailOptInRequestUseCase';\nimport { ClearEmailOptInUseCase } from '../internal/use-cases/ClearEmailOptInUseCase';\nimport { diContainer } from './diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { ProductNotifyMeRequestUseCase } from '../internal/use-cases/ProductNotifyMeRequestUseCase';\n\ninterface IProductNotifyMeRequestData {\n context?: string;\n skuId: string;\n email: string;\n subscriptionType: string;\n skuBaseId: string;\n}\n\nexport type IProductNotifyMeRequestSuccessData = IProductNotifyMeRequestData;\n\ninterface IProductNotifyMetRequestFailureData extends IProductNotifyMeRequestData {\n error?: string;\n}\n\nexport class ServiceBusController {\n private emailOptInRepository: EmailOptInRepository;\n\n constructor() {\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n }\n\n public emailOptInRequestFromAccount = async (payload: IEmailOptInPayload) => {\n const emailOptInRequestUseCase = new EmailOptInRequestUseCase(payload);\n await emailOptInRequestUseCase.execute();\n };\n\n public emailOptInRequest = async (payload: IEmailOptInPayload) => {\n const emailOptInRequestUseCase = new EmailOptInRequestUseCase(payload);\n await emailOptInRequestUseCase.execute();\n };\n\n public appointmentBookedEmailOptInRequest = async (payload: IEmailOptInPayload) => {\n const emailOptInRequestUseCase = new EmailOptInRequestUseCase(payload);\n await emailOptInRequestUseCase.execute();\n };\n\n public guestEmailOptInRequest = async (payload: IEmailOptInPayload) => {\n const emailOptInRequestUseCase = new EmailOptInRequestUseCase(payload);\n await emailOptInRequestUseCase.execute();\n };\n\n public userProfileChanged = async (userProfile: IPayload) => {\n const userProfileChangedUseCase = new UserProfileChangedUseCase(userProfile);\n await userProfileChangedUseCase.execute();\n };\n\n public clearEmailOptIn = () => {\n const clearEmailOptInRequestUseCase = new ClearEmailOptInUseCase();\n clearEmailOptInRequestUseCase.execute();\n };\n\n public onProductNotifyMeRequest = (e: IProductNotifyMeRequestData) => {\n const useCase = new ProductNotifyMeRequestUseCase({ ...e });\n void useCase.execute();\n };\n\n public onProductNotifyMeRequestFailure = (e: IProductNotifyMetRequestFailureData) => {\n console.warn(e);\n };\n\n public emailSignUp = () => {\n return this.emailOptInRepository.emailOptIn;\n };\n}\n","import { observable, action, set, computed } from 'mobx';\n\nexport interface IEmailOptIn {\n communicationType: string;\n emailAddress: string;\n emailSubscribed: boolean;\n id: string;\n}\n\nexport class EmailOptIn {\n @observable public communicationType: string;\n @observable public emailAddress: string;\n @observable public emailSubscribed: boolean = false;\n @observable public id: string;\n @observable public source: string;\n\n public static FROM_JSON(data: IEmailOptIn) {\n const emailOptInResponse = new EmailOptIn();\n set(emailOptInResponse, data);\n\n return emailOptInResponse;\n }\n\n @action\n public toggleEmailSubscribed = () => {\n this.emailSubscribed = !this.emailSubscribed;\n };\n\n @action\n public updateEmailSubscribed = (emailSubscribed: boolean) => {\n this.emailSubscribed = emailSubscribed;\n };\n\n @action\n public clearEmailSubscribed = () => {\n this.emailSubscribed = false;\n };\n\n @computed\n public get isEmailSubscribed() {\n return this.emailSubscribed;\n }\n}\n","import { EmailOptInRepository } from '../repositories/EmailOptInRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { EmailOptIn } from '../domain/entities/EmailOptIn';\n\nexport class EmaiOptInViewLoadedUseCase {\n private emailOptInRepository: EmailOptInRepository;\n\n constructor() {\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n }\n\n public execute = async () => {\n try {\n const emailOptIn = new EmailOptIn();\n this.emailOptInRepository.setInternalEmailOptIn(emailOptIn);\n } catch (error) {\n console.error(error);\n }\n };\n}\n","import { ViewController } from '@estee/elc-service';\nimport { observable, computed, action } from 'mobx';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { EmailOptInRepository } from '../repositories/EmailOptInRepository';\nimport { EmaiOptInViewLoadedUseCase } from '../use-cases/EmaiOptInViewLoadedUseCase';\n\nexport class EmailOptInViewController extends ViewController {\n @observable private emailOptInRepository: EmailOptInRepository;\n\n constructor() {\n super();\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n }\n\n @computed\n public get data() {\n return {\n emailOptIn: this.isEmailSubscribed,\n toggleOptIn: this.emailOptIn.toggleEmailSubscribed\n };\n }\n\n @action\n public onEmailOptInCheck = () => {\n this.data.toggleOptIn();\n };\n\n @computed\n get emailOptIn() {\n return this.emailOptInRepository.emailOptIn;\n }\n\n @computed\n get isLoaded() {\n return !this.isLoading && this.emailOptIn;\n }\n @computed\n public get isEmailSubscribed() {\n return this.emailOptIn.emailSubscribed;\n }\n\n @action\n public loaded = async () => {\n this.isLoading = true;\n const emaiOptInViewLoadedUseCase = new EmaiOptInViewLoadedUseCase();\n await emaiOptInViewLoadedUseCase.execute();\n this.isLoading = false;\n };\n}\n","export const SIGN_UP_SOURCE = 'sign-up';\nexport const ACCOUNT_SOURCE = 'account';\nexport const CHECKOUT_GUEST_SOURCE = 'checkout_guest';\nexport const APPOINTMENT_BOOKED_GUEST_SOURCE = 'appointment_booked_guest';\n","import { CommunicationsApiSdk } from '../../api/CommunicationsApiSdk';\nimport { BrowserStorage } from '@estee/elc-universal-utils';\nimport { EmailOptIn, IEmailOptIn } from '../domain/entities/EmailOptIn';\nimport { observable, action, computed } from 'mobx';\nimport {\n COMMUNICATION_TYPE,\n SUBSCRIBE_SOURCE,\n UNSUBSCRIBE_SOURCE,\n COOKIE_USER_EMAIL\n} from '../constants/EmailOptIn';\n\nimport {\n SIGN_UP_SOURCE,\n ACCOUNT_SOURCE,\n CHECKOUT_GUEST_SOURCE,\n APPOINTMENT_BOOKED_GUEST_SOURCE\n} from '../constants/SubscribeSource';\nimport { emit, events } from '@estee/elc-service-bus';\n\nexport interface IEmailOptInPayload {\n source: string;\n email: string;\n}\n\nexport type IPayload = IEmailOptInPayload;\n\nexport interface IEmaiOptInRepositoryConfig {\n apiSdk: CommunicationsApiSdk;\n}\n\nexport interface IEmailOptInSources {\n [key: string]: string;\n}\n\nconst EMAIL_OPT_IN_SOURCES: IEmailOptInSources = {\n [SIGN_UP_SOURCE]: 'registration',\n [ACCOUNT_SOURCE]: 'account',\n [CHECKOUT_GUEST_SOURCE]: 'checkout_guest',\n [APPOINTMENT_BOOKED_GUEST_SOURCE]: 'appointment_booked_guest'\n};\n\nexport class EmailOptInRepository {\n @observable private api: CommunicationsApiSdk;\n @observable private internalEmailOptIn: EmailOptIn = new EmailOptIn();\n @observable private emailOptInResp: EmailOptIn | null = null;\n\n constructor(config: IEmaiOptInRepositoryConfig) {\n this.api = config.apiSdk;\n }\n\n public emailOptInRequest = async (payload: IEmailOptInPayload) => {\n if (this.internalEmailOptIn.emailSubscribed) {\n const response = await this.api.emailOptInRequest({\n emailAddress: payload.email,\n subscribeSource: EMAIL_OPT_IN_SOURCES[payload.source],\n communicationType: [COMMUNICATION_TYPE.EMAIL]\n });\n emit(events.SUBSCRIBED_FOR_EMAILS);\n this.setEmailOptInResponse(response[0]);\n }\n };\n\n public getEmailOptInRequest = async (email: string): Promise => {\n const emailOptInResponse = await this.api.getEmailOptInRequest(email);\n this.setEmailOptInResponse(emailOptInResponse[0]);\n this.setInternalEmailOptInResponse(emailOptInResponse[0]);\n\n return emailOptInResponse;\n };\n\n @action\n public setEmailOptInResponse = (emailOptInResponse: IEmailOptIn) => {\n this.emailOptInResp = EmailOptIn.FROM_JSON(emailOptInResponse);\n };\n\n @action\n public setInternalEmailOptInResponse = (emailOptInResponse: IEmailOptIn) => {\n this.internalEmailOptIn = EmailOptIn.FROM_JSON(emailOptInResponse);\n };\n\n @action\n public setInternalEmailOptIn = (emailOptIn: EmailOptIn) => {\n if (!this.internalEmailOptIn) {\n this.internalEmailOptIn = emailOptIn;\n }\n\n // update view model\n if (this.emailOptInResp) {\n this.internalEmailOptIn.updateEmailSubscribed(this.emailOptInResp.emailSubscribed);\n }\n };\n\n public updateEmailOptInRequest = async (payload: IPayload) => {\n if (this.emailOptInResponse && this.emailOptInResponse.id && this.emailOptInResp) {\n if (this.shouldUpdateSubscription) {\n const subscribeSourceKey = this.emailOptIn.emailSubscribed\n ? SUBSCRIBE_SOURCE\n : UNSUBSCRIBE_SOURCE;\n\n await this.api.updateEmailOptInRequest(this.emailOptInResponse.id, {\n fields: {\n emailSubscribed: `${this.internalEmailOptIn.emailSubscribed}`,\n [subscribeSourceKey]: EMAIL_OPT_IN_SOURCES[ACCOUNT_SOURCE]\n }\n });\n if (subscribeSourceKey === SUBSCRIBE_SOURCE) {\n emit(events.SUBSCRIBED_FOR_EMAILS);\n }\n this.emailOptInResp.updateEmailSubscribed(this.emailOptIn.emailSubscribed);\n }\n\n return;\n }\n await this.emailOptInRequest({\n email: payload.email,\n source: ACCOUNT_SOURCE\n });\n };\n\n @computed\n public get emailOptIn() {\n return this.internalEmailOptIn;\n }\n\n @computed\n public get emailOptInResponse() {\n return this.emailOptInResp;\n }\n\n private getCookieUserEmail = () => {\n return BrowserStorage.getCookie(COOKIE_USER_EMAIL);\n };\n\n public getUserEmail = (payload: IEmailOptInPayload) => {\n return payload.email || this.getCookieUserEmail() || '';\n };\n\n @computed\n public get shouldUpdateSubscription() {\n return (\n this.emailOptInResp &&\n this.emailOptIn.emailSubscribed !== this.emailOptInResp.isEmailSubscribed\n );\n }\n\n public clearEmailOptIn = () => {\n if (this.internalEmailOptIn) {\n this.internalEmailOptIn.clearEmailSubscribed();\n }\n if (this.emailOptInResponse) {\n this.emailOptInResponse.clearEmailSubscribed();\n }\n };\n}\n","import { observable, set } from 'mobx';\n\nexport interface IProductNotifyMeConfig {\n productDisplayName: string;\n productUrl: string;\n productImageUrl: string;\n skuId: string;\n skuBaseId: string;\n subscriptionType: string;\n altText: string;\n}\n\nexport class Product {\n @observable public productDisplayName: string;\n @observable public productUrl: string;\n @observable public productImageUrl: string;\n @observable public skuId: string;\n @observable public skuBaseId: string;\n @observable public subscriptionType: string;\n @observable public altText: string;\n\n public static FROM_JSON(data: IProductNotifyMeConfig) {\n const product = new Product();\n set(product, data);\n\n return product;\n }\n}\n","import { ProductNotifyMeRepository } from '../repositories/ProductNotifyMeRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { Product, IProductNotifyMeConfig } from '../domain/entities/Product';\n\nexport class LoadProductUseCase {\n private productDetails: IProductNotifyMeConfig;\n private productNotifyMeRepository: ProductNotifyMeRepository;\n\n constructor(productDetails: IProductNotifyMeConfig) {\n this.productNotifyMeRepository = diContainer.get(serviceNames.productNotifyMeRepository);\n this.productDetails = productDetails;\n }\n\n public execute = () => {\n const product = Product.FROM_JSON(this.productDetails);\n this.productNotifyMeRepository.setProduct(product);\n };\n}\n","import { ProductNotifyMeRepository } from '../repositories/ProductNotifyMeRepository';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\n\nexport class ClearNotifyMeFormUseCase {\n private productNotifyMeRepository: ProductNotifyMeRepository;\n\n constructor() {\n this.productNotifyMeRepository = diContainer.get(serviceNames.productNotifyMeRepository);\n }\n\n public execute = () => {\n const notifyMeForm = this.productNotifyMeRepository.getNotifyMeForm();\n notifyMeForm.clearStore();\n };\n}\n","import { ProductNotifyMeViewController } from '../controllers/ProductNotifyMeViewController';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\n\nexport class EmailSubmittedUseCase {\n private productNotifyMeViewController: ProductNotifyMeViewController;\n\n constructor() {\n this.productNotifyMeViewController = diContainer.get(\n serviceNames.productNotifyMeViewController\n );\n }\n\n public execute = async () => {\n this.productNotifyMeViewController.onNotifyMeSuccess();\n };\n}\n","import { ViewController } from '@estee/elc-service';\nimport { emit, events, on } from '@estee/elc-service-bus';\nimport { action, computed, observable } from 'mobx';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { ProductNotifyMeRepository } from '../repositories/ProductNotifyMeRepository';\nimport { LoadProductUseCase } from '../use-cases/LoadProductUseCase';\nimport { ClearNotifyMeFormUseCase } from '../use-cases/ClearNotifyMeFormUseCase';\nimport {\n IProductNotifyMePopUp,\n IProductNotifyMePopUpConfig\n} from '../../exported/product-notify-me/ProductNotifyMePopUp';\nimport { IWaitlist } from '../views/product-notify-me/ProductNotifyMePopUpContent';\nimport { EmailSubmittedUseCase } from '../use-cases/EmailSubmittedUseCase';\n\nexport class ProductNotifyMeViewController extends ViewController {\n private productNotifyMeRepository: ProductNotifyMeRepository;\n @observable private isProductNotifyMeConfirmationOpen: boolean = false;\n @observable private isPopUpOpen: boolean = false;\n @observable private acceptsTerms = false;\n @observable private isGdprPopupOpen: boolean = false;\n @observable private gdprConfirmation: boolean = false;\n @observable private emailEntered: boolean = false;\n private waitlist: IWaitlist;\n private skuId: string;\n private skuBaseId: string;\n private subscriptionType: string;\n\n constructor() {\n super();\n this.productNotifyMeRepository = diContainer.get(serviceNames.productNotifyMeRepository);\n }\n\n @on(events.PRODUCT_NOTIFY_ME_REQUEST_SUCCESS)\n public onProductNotifyMeSuccess = (data: {skuId: string}) => {\n if (this.skuId === data.skuId) {\n new EmailSubmittedUseCase().execute();\n this.onNotifyMeSuccess();\n }\n };\n\n @action\n public initialize(props: IProductNotifyMePopUpConfig) {\n this.waitlist = props.waitlist ?? {};\n this.skuId = props.skuId;\n this.skuBaseId = props.skuBaseId;\n this.subscriptionType = props.subscriptionType;\n }\n\n @computed\n public get data() {\n return {\n notifyMeForm: this.productNotifyMeRepository.getNotifyMeForm(),\n isProductNotifyMeConfirmationOpen: this.isProductNotifyMeConfirmationOpen,\n isPopUpOpen: this.isPopUpOpen,\n acceptsTerms: this.acceptsTerms,\n isGdprPopupOpen: this.isGdprPopupOpen,\n gdprConfirmation: this.gdprConfirmation,\n emailEntered: this.emailEntered\n };\n }\n\n @action\n public loaded = async (props: IProductNotifyMePopUp) => {\n this.isLoading = true;\n const loadProductUseCase = new LoadProductUseCase(props.config);\n loadProductUseCase.execute();\n this.isLoading = false;\n };\n\n @action\n public setAcceptsTerms = (value: boolean) => {\n this.acceptsTerms = value;\n this.gdprConfirmation = !this.acceptsTerms;\n };\n\n @action\n public onSubmitButtonClick = (gdpr: boolean) => {\n if (gdpr) {\n this.gdprConfirmation = !this.acceptsTerms;\n\n if (this.acceptsTerms) {\n this.getNotifyMeForm();\n }\n } else {\n this.getNotifyMeForm();\n }\n };\n\n private getNotifyMeForm = () => {\n const form = this.productNotifyMeRepository.getNotifyMeForm();\n\n emit(events.PRODUCT_NOTIFY_ME_REQUEST, {\n skuId: this.skuId,\n skuBaseId: this.skuBaseId,\n email: form.userEmail,\n subscriptionType: this.subscriptionType\n });\n };\n\n @action\n public onNotifyMeSuccess = () => {\n this.isProductNotifyMeConfirmationOpen = true;\n };\n\n @action\n public onCloseButtonClick = () => {\n this.isProductNotifyMeConfirmationOpen = false;\n this.isPopUpOpen = false;\n };\n\n @action\n public onNotifyMeClick = () => {\n if (this.waitlist.enableHybridModal) {\n this.onNotifyMeTriggered();\n } else {\n emit(events.PRODUCT_NOTIFY_ME_TRIGGERED, {\n skuId: this.skuId,\n skuBaseId: this.skuBaseId\n });\n }\n };\n\n @action\n private onNotifyMeTriggered = () => {\n const clearNotifyMeFormUseCase = new ClearNotifyMeFormUseCase();\n clearNotifyMeFormUseCase.execute();\n this.isProductNotifyMeConfirmationOpen = false;\n this.isPopUpOpen = true;\n };\n\n @action\n public onCloseNotifyMePopUp = () => {\n this.isPopUpOpen = false;\n this.isProductNotifyMeConfirmationOpen = false;\n };\n\n @action\n public toggleGdprPopupOpen = () => {\n this.isGdprPopupOpen = !this.isGdprPopupOpen;\n };\n}\n","import { CommunicationsApiSdk } from '../../api/CommunicationsApiSdk';\nimport { observable, action } from 'mobx';\nimport { Product } from '../domain/entities/Product';\nimport { NotifyMeForm } from '../domain/entities/NotifyMeForm';\n\nexport interface IProductNotifyMeRepository {\n communicationApiSdk: CommunicationsApiSdk;\n notifyMeForm: NotifyMeForm;\n}\n\nexport class ProductNotifyMeRepository {\n private communicationsApiSdk: CommunicationsApiSdk;\n @observable private product: Product;\n @observable private notifyMeForm: NotifyMeForm;\n\n constructor(config: IProductNotifyMeRepository) {\n this.communicationsApiSdk = config.communicationApiSdk;\n this.notifyMeForm = config.notifyMeForm;\n }\n\n public subscribeToBackInStockNotification = async ({\n skuId,\n email,\n subscriptionType\n }: {\n skuId: string;\n email: string;\n subscriptionType: string;\n }) => {\n return this.communicationsApiSdk.subscribeToBackInStockNotification(\n skuId,\n email,\n subscriptionType\n );\n };\n\n public getProduct = () => {\n return this.product;\n };\n public getNotifyMeForm = () => {\n return this.notifyMeForm;\n };\n @action\n public setProduct = (product: Product) => {\n this.product = product;\n };\n}\n","import { FormStore, FormValidator } from '@estee/elc-form';\nimport { computed } from 'mobx';\n\nexport interface INotifyMeForm {\n userEmail: string;\n}\n\nexport interface INotifyMeConfig {\n notifyMeFormValidator: FormValidator;\n}\n\nexport class NotifyMeForm extends FormStore {\n constructor(configStore: INotifyMeConfig) {\n super({\n initialValues: {\n userEmail: ''\n },\n formValidator: configStore.notifyMeFormValidator\n });\n }\n\n @computed\n get userEmail() {\n return this.values.userEmail;\n }\n}\n","import { ViewController } from '@estee/elc-service';\nimport { observable, computed } from 'mobx';\nimport { diContainer } from '../../service-setup/diContainer';\nimport serviceNames from '~setup/CommunicationsService';\nimport { EmailOptInRepository } from '../repositories/EmailOptInRepository';\n\nexport class ViewEmailOptInViewController extends ViewController {\n @observable private emailOptInRepository: EmailOptInRepository;\n\n constructor() {\n super();\n this.emailOptInRepository = diContainer.get(serviceNames.emailOptInRepository);\n }\n\n @computed\n public get data() {\n return {\n emailOptIn: this.isEmailSubscribed\n };\n }\n\n @computed\n get emailOptIn() {\n return this.emailOptInRepository.emailOptInResponse;\n }\n\n @computed\n get isLoaded() {\n return this.emailOptIn;\n }\n\n @computed\n public get isEmailSubscribed() {\n return this.emailOptIn ? this.emailOptIn.emailSubscribed : false;\n }\n}\n","import { ConfigStore } from './ConfigStore';\nimport { Container } from 'hypo-container';\nimport { CommunicationsApiSdk } from '../api';\nimport { ServiceBusController } from './ServiceBusController';\nimport { getDecorators } from '@estee/elc-service';\nimport { FormValidator } from '@estee/elc-form';\nimport { CommunicationsService } from './CommunicationsService';\nimport { root } from '@estee/elc-universal-utils';\nimport { EmailOptInViewController } from '~controllers/EmailOptInViewController';\nimport { EmailOptInRepository } from '~repositories/EmailOptInRepository';\nimport { ProductNotifyMeViewController } from '~controllers/ProductNotifyMeViewController';\nimport { ProductNotifyMeRepository } from '~repositories/ProductNotifyMeRepository';\nimport { NotifyMeForm } from '~domain/entities/NotifyMeForm';\nimport { ViewEmailOptInViewController } from '~controllers/ViewEmailOptInViewController';\nimport serviceNames from '~setup/CommunicationsService';\nexport const diContainer = new Container();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const setConfig = (configJSON: any) => {\n diContainer.config = configJSON;\n};\n\ndiContainer\n .register(\n serviceNames.configStore,\n diContainer.factory((c) => new ConfigStore(c.config))\n )\n .register(\n serviceNames.notifyMeForm,\n diContainer.factory(\n (c) =>\n new NotifyMeForm({\n notifyMeFormValidator: c.get(serviceNames.notifyMeFormValidator)\n })\n )\n )\n .register(serviceNames.serviceBusController, (c) => new ServiceBusController())\n .register(\n serviceNames.communicationsService,\n (c) =>\n new CommunicationsService((config: {}) => {\n setConfig(config);\n\n return c.get(serviceNames.serviceBusController);\n })\n )\n .register(serviceNames.communicationsApiSdk, (c) => {\n const config = {\n httpTransport: c.get(serviceNames.httpTransport)\n };\n\n return new CommunicationsApiSdk(config);\n })\n .register(serviceNames.notifyMeFormValidator, (c) => new FormValidator())\n .register(\n serviceNames.emailOptInRepository,\n (c) =>\n new EmailOptInRepository({\n apiSdk: c.get(serviceNames.communicationsApiSdk)\n })\n )\n .register(\n serviceNames.productNotifyMeRepository,\n (c) =>\n new ProductNotifyMeRepository({\n communicationApiSdk: c.get(serviceNames.communicationsApiSdk),\n notifyMeForm: c.get(serviceNames.notifyMeForm)\n })\n )\n .register(serviceNames.httpTransport, (c) => {\n return root.HttpTransport;\n })\n .register(serviceNames.emailOptInViewController, (c) => new EmailOptInViewController())\n .register(\n serviceNames.productNotifyMeViewController,\n diContainer.factory((c) => new ProductNotifyMeViewController())\n )\n .register(serviceNames.viewEmailOptInViewController, (c) => new ViewEmailOptInViewController());\nconst { lazyInject } = getDecorators(diContainer);\n\nexport { lazyInject };\n"],"names":["ConfigStore","constructor","config","this","updateConfig","name","version","CommunicationsApiSdk","Api","super","subscribeToBackInStockNotification","skuId","emailAddress","subscriptionType","post","url","backInStockUrl","body","emailOptInRequest","payload","emailOptInUrl","data","getEmailOptInRequest","email","get","updateEmailOptInRequest","subscriptionId","patch","UserProfileChangedUseCase","execute","emailOptInRepository","error","emit","events","console","diContainer","AUTH_SOURCE","Object","freeze","SIGN_UP","SIGN_IN","CHECKOUT_GUEST","APPOINTMENT_BOOKED_GUEST","COMMUNICATION_TYPE","EMAIL","SUBSCRIBE_SOURCE","EmailOptInRequestUseCase","indexOf","source","getUserEmail","ClearEmailOptInUseCase","clearEmailOptIn","ProductNotifyMeRequestUseCase","spec","context","skuBaseId","productNotifyMeRepository","err","ServiceBusController","emailOptInRequestFromAccount","emailOptInRequestUseCase","appointmentBookedEmailOptInRequest","guestEmailOptInRequest","userProfileChanged","userProfile","userProfileChangedUseCase","onProductNotifyMeRequest","e","onProductNotifyMeRequestFailure","warn","emailSignUp","emailOptIn","emailSubscribed","toggleEmailSubscribed","updateEmailSubscribed","clearEmailSubscribed","FROM_JSON","emailOptInResponse","set","isEmailSubscribed","EmailOptIn","EmaiOptInViewLoadedUseCase","setInternalEmailOptIn","EmailOptInViewController","ViewController","onEmailOptInCheck","toggleOptIn","loaded","isLoading","emaiOptInViewLoadedUseCase","isLoaded","SIGN_UP_SOURCE","ACCOUNT_SOURCE","CHECKOUT_GUEST_SOURCE","APPOINTMENT_BOOKED_GUEST_SOURCE","EMAIL_OPT_IN_SOURCES","EmailOptInRepository","internalEmailOptIn","emailOptInResp","response","api","subscribeSource","communicationType","setEmailOptInResponse","setInternalEmailOptInResponse","id","shouldUpdateSubscription","subscribeSourceKey","fields","getCookieUserEmail","apiSdk","product","Product","LoadProductUseCase","productDetails","setProduct","ClearNotifyMeFormUseCase","getNotifyMeForm","clearStore","EmailSubmittedUseCase","productNotifyMeViewController","onNotifyMeSuccess","ProductNotifyMeViewController","isProductNotifyMeConfirmationOpen","isPopUpOpen","acceptsTerms","isGdprPopupOpen","gdprConfirmation","emailEntered","onProductNotifyMeSuccess","props","setAcceptsTerms","value","onSubmitButtonClick","gdpr","form","userEmail","onCloseButtonClick","onNotifyMeClick","waitlist","enableHybridModal","onNotifyMeTriggered","onCloseNotifyMePopUp","toggleGdprPopupOpen","initialize","notifyMeForm","on","ProductNotifyMeRepository","communicationsApiSdk","getProduct","communicationApiSdk","NotifyMeForm","FormStore","configStore","initialValues","formValidator","notifyMeFormValidator","values","ViewEmailOptInViewController","Container","setConfig","configJSON","register","factory","c","CommunicationsService","httpTransport","FormValidator","lazyInject"],"sourceRoot":""}