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,EAAuBh9B,EAAAA,WAAmChF,MAAS,EAM5D2F,EAAmBX,EAAAA,aAAyB,CACvDC,KAAMA,IAAM+8B,EAAqB,GAAK19B,EAAAA,GAAYc,QAAQ,GAAGO,iBAAiB,EAC9Es8B,MAAOD,EACPl8B,gBAAiB,EACnB,CAAC,EAGKo8B,EAAwBl9B,EAAAA,WAAmChF,MAAS,EAM7DsG,EAAoBtB,EAAAA,aAAyB,CACxDC,KAAMA,IACJU,EAAiB,IAAMu8B,EAAsB,GAAK59B,EAAAA,GAAYc,QAAQ,GAAGiG,oBAAoB,GAC/F42B,MAAOC,EACPp8B,gBAAiB,EACnB,CAAC,EAEYO,EAA2BrB,EAAAA,aACtC,IAAM+8B,EAAqB,GAAGjsB,SAAW,UAC3C,EAEaqsB,EAAwBn9B,EAAAA,aACnC,IAAMa,EAA+B,GAAKF,EAAiB,GAAK,CAACU,EAAyB,CAC5F,EAEa+7B,EAAmBp9B,EAAAA,aAC9B,IAAMqB,EAAyB,GAAKy7B,EAAwB,CAC9D,C","sources":["webpack:///./components/dialogs/Dialog.tsx","webpack:///./components/rich-text-formatting.tsx","webpack:///./features/approvals/types/ApprovalsFilter.ts","webpack:///./features/approvals/types/ApprovalsTab.ts","webpack:///./features/i18n/commonMessages.ts","webpack:///./features/persona/utils/availability.ts","webpack:///./features/persona/components/InquiryDialog.tsx","webpack:///./features/persona/components/UnableToVerify.tsx","webpack:///./features/persona/services/phoneVerification.ts","webpack:///./features/persona/utils/validatePhoneNumber.ts","webpack:///./features/persona/components/steps/Step.tsx","webpack:///./features/persona/components/steps/EnterPhoneNumber.tsx","webpack:///./features/persona/components/steps/EnterVerificationCode.tsx","webpack:///./features/persona/components/steps/VerifyNumberSuccess.tsx","webpack:///./features/persona/components/VerifyNumber.tsx","webpack:///./legacy/components/user/onboardingWizard/company/ownershipInformation/services/ownershipInformationService.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/helper.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/CodeMessageFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/CodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/DisableVerificationFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/SmsPhoneFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/QrCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/ScanCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/UserOtpQrCodeFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/VerificationProviderFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorStepper.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialogContents.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/defaultMethod/presentation/LoginPopupDefaultMethodDialog.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/business/LoginPopupMultiple.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/business/LoginPopupMultiple.handleQueries.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/useLoginPopupMultipleMethods.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/LoginPopupMultipleMethods.presentation.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/multipleMethods/presentation/LoginPopupMultipleMethods.bindings.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.presentation.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/business/LoginPopup.reducer.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/business/LoginPopup.handleQueries.ts","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/useLoginPopup.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.bindings.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment.tsx","webpack:///./legacy/components/user/twoFactorAuthentication/shared/constants.ts","webpack:///./legacy/features/user/singleSignOn/services/api.ts","webpack:///./legacy/features/user/twoFactorAuthentication/recaptcha/recaptcha.helpers.ts","webpack:///./legacy/modals/genericInfoModal.ts","webpack:///./legacy/modals/react/TitleMessageDialog.tsx","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeout.reducer.ts","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeoutDialog.tsx","webpack:///./legacy/components/user/signin/sessionTimeout/SessionTimeoutFragment.tsx","webpack:///./legacy/components/user/signin/ssoSessionTimeout/SsoSessionTimeoutDialog.tsx","webpack:///./legacy/modals/sessionTimeout.ts","webpack:///./legacy/services/UnsavedChangedConfirmationService.ts","webpack:///./legacy/services/company/promoCodes.ts","webpack:///./legacy/services/routers.ts","webpack:///./legacy/services/sessionTimeout.ts","webpack:///./legacy/services/verification/verificationUser.ts","webpack:///./legacy/utils/reactHelpers.ts","webpack:///./legacy/features/companies/serviceSubscriptions/modals/billingDebitFailedModal.ts","webpack:///./legacy/viewmodels/shell.ts","webpack:///./routes/durandal.ts","webpack:///./utils/verification.ts"],"sourcesContent":["import { ReactNode } from 'react';\nimport { useIntl } from 'react-intl';\nimport { Close } from '@mui/icons-material';\nimport {\n Dialog,\n DialogProps,\n DialogTitle,\n IconButton,\n PaperProps as MuiPaperProps,\n} from '@mui/material';\n\nimport commonMessages from '@/features/i18n/commonMessages';\n\ninterface Props extends Omit {\n children: ReactNode;\n PaperProps?: MuiPaperProps;\n isOpen?: boolean;\n isClosable?: boolean;\n onDialogClose?: () => void;\n title?: ReactNode;\n}\n\nconst PlootoDialog = ({\n children,\n isClosable = true,\n isOpen = false,\n onDialogClose,\n PaperProps = undefined,\n title,\n ...dialogProps\n}: Props) => {\n const { formatMessage } = useIntl();\n\n return (\n \n {isClosable ? (\n \n \n \n ) : null}\n {title ? {title} : null}\n {children}\n \n );\n};\n\nexport default PlootoDialog;\nexport { Props as DialogProps };\n","import { ReactNode } from 'react';\nimport { Link } from '@mui/material';\n\n/** Rich Text Formatting that wraps text in an tag. */\nexport const Emphasis = (chunks: Array) => {chunks};\n\n/** Rich Text Formatting that wraps text in a tag. */\nexport const Strong = (chunks: Array) => {chunks};\n\n/** Rich Text Formatting that wraps text in an underline component. */\nexport const Underline = (chunks: Array) => (\n {chunks}\n);\n\n/** Rich Text Formatting that wraps text in a link tag with a `tel` href. */\nexport const PhoneLink = (chunk: Array) => {chunk};\n\n/** Rich Text Formatting that wraps text in a link tag with a `mailto` href. */\nexport const EmailLink = (chunk: Array) => {chunk};\n\n/** Support email address as a link tag with a `mailto` href. */\nexport const SupportEmailLink = EmailLink(['support@plooto.com']);\n","export enum ApprovalsFilter {\n Mine = 'my',\n All = 'all',\n}\n","export enum ApprovalsTab {\n Payments = 'payments',\n Controls = 'controls',\n}\n","import { defineMessages } from 'react-intl';\n\nconst commonMessages = defineMessages({\n approve: {\n defaultMessage: 'Approve',\n },\n back: {\n defaultMessage: 'Back',\n },\n cancel: {\n defaultMessage: 'Cancel',\n },\n close: {\n defaultMessage: 'Close',\n },\n closeDialog: {\n defaultMessage: 'Close dialog',\n },\n comingSoon: {\n defaultMessage: 'Coming Soon',\n },\n continue: {\n defaultMessage: 'Continue',\n },\n delete: {\n defaultMessage: 'Delete',\n },\n emDash: {\n defaultMessage: '—',\n },\n goPlanName: {\n defaultMessage: 'Go',\n },\n gotIt: {\n defaultMessage: 'Got it',\n },\n growPlanName: {\n defaultMessage: 'Grow',\n },\n growUnlimitedPlanName: {\n defaultMessage: 'Grow Unlimited',\n },\n learnMore: {\n defaultMessage: 'Learn more',\n },\n loading: {\n defaultMessage: 'Loading…',\n },\n logout: {\n defaultMessage: 'Logout',\n },\n new: {\n defaultMessage: 'New',\n },\n none: {\n defaultMessage: 'None',\n },\n okay: {\n defaultMessage: 'Okay',\n },\n or: {\n defaultMessage: 'or',\n },\n other: {\n defaultMessage: 'Other',\n },\n reject: {\n defaultMessage: 'Reject',\n },\n save: {\n defaultMessage: 'Save',\n },\n showLess: {\n defaultMessage: 'Show less',\n },\n showMore: {\n defaultMessage: 'Show more',\n },\n skipForNow: {\n defaultMessage: 'Skip for now',\n },\n subtotal: {\n defaultMessage: 'Subtotal',\n },\n tryAgain: {\n defaultMessage: 'Try again',\n },\n typeToSearch: {\n defaultMessage: 'Type to search',\n },\n unlimited: {\n defaultMessage: 'Unlimited',\n },\n});\n\nexport default commonMessages;\n","import * as ko from 'knockout';\n\nimport { FeatureFlag, FeatureToggleService } from '@/features/feature-flags';\nimport { Instance as companyService } from '@/legacy/services/company';\nimport { Instance as userService } from '@/legacy/services/user';\nimport {\n identitySubmitted,\n identityVerified,\n isCompanyVerificationCompleted,\n isCompanyVerificationInProgress,\n isUnableToVerifyIdentity,\n} from '@/utils/verification';\n\nexport const isPersonaEnabled = userService.UserId.mapAsync(\n (userId) => FeatureToggleService.isFeatureEnabled(FeatureFlag.SPR5_24_ONBOARDING_PERSONA, userId),\n { initialValue: null }\n);\n\nexport const isPersonaActive = ko.pureComputed({\n read: () => {\n const isSubjectToPersonaOnboarding = companyService.profile()?.isSubjectToPersonaOnboarding();\n const isAccountingFirm = companyService.profile()?.isAccountingFirm();\n const hasAccountingFirmCompanyId = Boolean(companyService.profile()?.accountingFirmCompanyId());\n\n const isCompanySubjectToOnboarding =\n isSubjectToPersonaOnboarding && !isAccountingFirm && !hasAccountingFirmCompanyId;\n\n const isUserVerified = userService.profile()?.identityVerified();\n const isCompanyVerified = isCompanyVerificationCompleted();\n\n const isUserAndCompanyVerified = isUserVerified && isCompanyVerified;\n\n return isCompanySubjectToOnboarding && !isUserAndCompanyVerified;\n },\n deferEvaluation: true,\n});\n\nexport async function getIsPartOfPersonaCohort(): Promise {\n const featureFlagEnabled = await isPersonaEnabled.skipUntil((enabled) => enabled !== null);\n const enabledInBackend = isPersonaActive();\n return enabledInBackend || featureFlagEnabled;\n}\n\nexport const isPersonaKycStep = ko.pureComputed(\n () =>\n (isCompanyVerificationCompleted() || isCompanyVerificationInProgress()) &&\n !(isUnableToVerifyIdentity() || identityVerified() || identitySubmitted())\n);\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport app from 'durandal/app';\nimport { Box, CircularProgress, DialogContent, DialogTitle, styled } from '@mui/material';\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { useConfirm } from 'material-ui-confirm';\nimport { Inquiry } from 'persona';\nimport { InquiryAttributes } from 'persona/dist/lib/interfaces';\n\nimport Dialog from '@/components/dialogs/Dialog';\nimport { ApiService } from '@/features/api';\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport OwnershipInformationService from '@/legacy/components/user/onboardingWizard/company/ownershipInformation/services/ownershipInformationService';\nimport { Instance as companyService } from '@/legacy/services/company';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { Instance as verificationService } from '@/legacy/services/verification/verification';\nimport { Instance as verificationUserService } from '@/legacy/services/verification/verificationUser';\nimport {\n isCompanyVerificationCompleted,\n isCompanyVerificationInProgress,\n} from '@/utils/verification';\n\nimport { isPersonaKycStep } from '../utils/availability';\n\ntype PersonaVerificationBindingModel = {\n companyInformation?: {\n address: {\n address: string;\n city: string;\n country: string;\n state: string;\n suite: string;\n zipCode: string;\n };\n businessUrl: string;\n companyId: string;\n corporationType: string;\n name: string;\n operatingName: string;\n };\n userInformation: {\n userId: string;\n };\n};\n\nconst mapPersonaCorporationType = (corporationType: string) => {\n if (!corporationType) {\n return '';\n }\n\n const corporationTypeMap: { [key: string]: string } = {\n 'Sole Prop': 'Sole Proprietorship',\n Corporation: 'Business Corporation',\n 'LLC/Etc': 'Condominium Corporation',\n Charity: 'Nonprofit or Charity (Registered)',\n };\n\n return corporationTypeMap[corporationType] || '';\n};\n\nfunction mapToPersonaVerificationBindingModel(\n fields: InquiryAttributes,\n companyId: string,\n userId: string,\n isKyc: boolean\n): PersonaVerificationBindingModel {\n if (isKyc) {\n return {\n userInformation: {\n userId,\n },\n };\n }\n return {\n companyInformation: {\n companyId,\n name: fields['business-name']?.value,\n operatingName: fields['operating-business-name']?.value,\n corporationType: mapPersonaCorporationType(fields['entity-type']?.value),\n businessUrl: fields['company-website']?.value,\n address: {\n address: fields['business-registered-address-street-1']?.value,\n city: fields['business-registered-address-city']?.value,\n country: fields['business-registered-address-country-code']?.value,\n state: fields['business-registered-address-subdivision']?.value,\n suite: '',\n zipCode: fields['business-registered-address-postal-code']?.value,\n },\n },\n userInformation: {\n userId,\n },\n };\n}\n\nconst PersonaFlowContainer = styled(Box)(({ theme }) => ({\n '& > iframe': {\n minHeight: '600px',\n minWidth: '400px',\n },\n [theme.breakpoints.down('sm')]: {\n '& > iframe': {\n minWidth: '300px',\n },\n },\n}));\n\ntype InquiryDialogProps = { isOpen: boolean; onClose: () => void };\n\nexport const InquiryDialog = ({ isOpen, onClose }: InquiryDialogProps) => {\n const queryClient = useQueryClient();\n const errorDialogConfirm = useConfirm();\n const companyId = useSyncKoObservable(companyService.CompanyId);\n const companyProfile = useSyncKoObservable(companyService.profile);\n const userId = useSyncKoObservable(userService.UserId);\n const userProfile = useSyncKoObservable(userService.profile);\n const hasCompletedCompanyVerification = useSyncKoObservable(isCompanyVerificationCompleted);\n const hasSubmittedCompanyVerification = useSyncKoObservable(isCompanyVerificationInProgress);\n const referenceId = `${hasCompletedCompanyVerification || hasSubmittedCompanyVerification ? 'kyc' : 'kyb'}:${companyId}:${userId}`;\n let existingInquiryId: string | undefined;\n try {\n existingInquiryId = localStorage.getItem(referenceId);\n } catch (_) {\n // Ignore error\n }\n const { data: ownershipInformation, isLoading: isOwnershipInformationLoading } = useQuery({\n queryFn: OwnershipInformationService.get,\n queryKey: ['company', companyId, 'owners'],\n });\n const userEmail = useSyncKoObservable(userProfile.email);\n const isUbo = useMemo(\n (): boolean =>\n ownershipInformation?.some(\n (owner) => owner.email?.toLowerCase() === userEmail?.toLowerCase()\n ),\n [ownershipInformation, userEmail]\n );\n const { data: companyPersonaMetadata, isFetching: isCompanyPersonaMetadataLoading } = useQuery({\n enabled: isUbo,\n queryFn: async () =>\n ApiService.get<{ caseId: string }>(\n `${import.meta.env.APP_URLS_API_URL}/v1/companies/${companyId}/companyPersonaMetadata`\n ),\n queryKey: ['companies', companyId, 'companyPersonaMetadata'],\n });\n const { data: userVerifications, isFetching: isUserVerificationsLoading } = useQuery({\n enabled: isUbo,\n queryFn: async () =>\n Promise.resolve(verificationUserService.GetVerifyIdentityStatus(companyId, userId)),\n queryKey: ['companies', companyId, 'verification', 'users', userId, 'status'],\n });\n const isUboLoading =\n isOwnershipInformationLoading || isCompanyPersonaMetadataLoading || isUserVerificationsLoading;\n const isPersonaKycStepNonUbo = useSyncKoObservable(isPersonaKycStep);\n const shouldRenderKyc = isUbo\n ? (isCompanyVerificationInProgress || isCompanyVerificationCompleted) &&\n !(userVerifications.isIdentitySubmitted || userVerifications.isIdentityVerified)\n : isPersonaKycStepNonUbo;\n const templateId = useMemo(() => {\n if (existingInquiryId) {\n return null;\n }\n if (shouldRenderKyc) {\n return import.meta.env.PERSONA_KYC_TEMPLATE_ID;\n }\n return import.meta.env.PERSONA_GET_STARTED_TEMPLATE_ID;\n }, [existingInquiryId, shouldRenderKyc]);\n const onSuccessfulSubmission = useCallback((): void => {\n queryClient.invalidateQueries(['companies', companyId, 'onboarding', 'status']);\n queryClient.invalidateQueries([\n 'companies',\n companyId,\n 'verification',\n 'outstandingVerificationItems',\n ]);\n app.trigger('onboarding:company:updated');\n app.trigger('onboarding:identity:updated');\n try {\n localStorage.removeItem(referenceId);\n } catch (_) {\n // Ignore error\n }\n onClose();\n }, [companyId, onClose, queryClient, referenceId]);\n const prefilledPersonaFields = useMemo(() => {\n const caseId = companyPersonaMetadata?.caseId;\n const res = caseId ? { caseId } : {};\n if (shouldRenderKyc) {\n return caseId ? res : undefined;\n }\n return {\n ...res,\n email_address: userProfile.email(), // Business/work email address\n form_filler_email_address: userProfile.email(), // User's email address\n business_name: companyProfile.name(),\n business_physical_address_country_code: companyProfile.country(),\n name_first: userProfile.firstName(),\n name_last: userProfile.lastName(),\n phone_number: companyProfile.businessPhone(),\n };\n }, [companyPersonaMetadata?.caseId, companyProfile, userProfile, shouldRenderKyc]);\n const onUnsuccessfulSubmission = useCallback(\n (error: any): void => {\n const errorMessage = error?.message ?? error?.type;\n errorDialogConfirm({\n description: errorMessage ? (\n \n ) : (\n \n ),\n hideCancelButton: true,\n title: ,\n });\n },\n [errorDialogConfirm]\n );\n const { mutate: submitVerification } = useMutation({\n mutationFn: verificationService.postPersonaVerification,\n onError: onUnsuccessfulSubmission,\n onSuccess: onSuccessfulSubmission,\n });\n const handleComplete = useCallback(\n ({ fields }) => {\n const bindingModel = mapToPersonaVerificationBindingModel(\n fields,\n companyId,\n userId,\n shouldRenderKyc\n );\n submitVerification(bindingModel);\n },\n [companyId, shouldRenderKyc, submitVerification, userId]\n );\n const handleEvent = useCallback(\n (name: string, metadata: Record): void => {\n if (name === 'start' && metadata.inquiryId && !existingInquiryId) {\n try {\n localStorage.setItem(referenceId, metadata.inquiryId as string);\n } catch (_) {\n // Ignore error\n }\n }\n },\n [existingInquiryId, referenceId]\n );\n return (\n \n \n \n \n \n {isUboLoading ? (\n \n \n \n ) : (\n \n \n \n )}\n \n \n );\n};\n","import { FormattedMessage } from 'react-intl';\nimport { Link, Stack, Typography } from '@mui/material';\n\nexport const UnableToVerify = () => (\n \n \n \n \n \n verification@plooto.com,\n }}\n />\n \n \n);\n","import { ApiService } from '@/features/api';\n\nexport type VerifyResponse = {\n status: 'pending' | 'verified';\n valid: boolean;\n};\n\nexport const phoneVerificationService = {\n /**\n * Sends an SMS to the provided phone number. Phone number must be in E.164 format. Only `+1` is\n * supported.\n * @param phoneNumber The phone number to send the SMS to.\n */\n sendCode: async (phoneNumber: string): Promise =>\n ApiService.post(`${import.meta.env.APP_URLS_API_URL}/v1/users/verification/phone`, {\n body: { phoneNumber },\n }),\n verify: async (code: string, phoneNumber: string): Promise =>\n ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/users/verification/phone/verificationToken`,\n {\n body: { code, phoneNumber },\n }\n ),\n} as const;\n","export function validatePhoneNumber(phoneNumber: string): boolean {\n if (phoneNumber.match(/[a-zA-Z]/)) {\n return false;\n }\n const onlyNumbers = phoneNumber.replace(/\\D/g, '');\n return onlyNumbers.length === 10 || (onlyNumbers[0] === '1' && onlyNumbers.length === 11);\n}\n","import { FormattedMessage } from 'react-intl';\nimport { Card, Stack, Typography } from '@mui/material';\n\nexport type StepProps = {\n children: React.ReactNode;\n};\n\nexport const Step = ({ children }: StepProps): React.JSX.Element => (\n \n \n \n \n \n \n \n \n \n \n \n \n {children}\n \n \n \n);\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport Person from '@mui/icons-material/Person';\nimport SecurityUpdateGoodOutlined from '@mui/icons-material/SecurityUpdateGoodOutlined';\nimport { Stack, Typography } from '@mui/material';\nimport { Field, Form, FormikHelpers, FormikProvider, useFormik } from 'formik';\nimport { TextField } from 'formik-mui';\nimport { object, string } from 'yup';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport { validatePhoneNumber } from '@/features/persona/utils/validatePhoneNumber';\nimport { SessionTimeoutService } from '@/legacy/services/sessionTimeout';\n\nimport { Step } from './Step';\n\nexport type EnterPhoneNumberProps = {\n onComplete: (phoneNumber: string) => void;\n onSendSms: (phoneNumber: string) => Promise;\n};\n\nexport const EnterPhoneNumber = ({\n onComplete,\n onSendSms,\n}: EnterPhoneNumberProps): React.JSX.Element => {\n const { formatMessage } = useIntl();\n const validationSchema = useMemo(\n () =>\n object({\n phoneNumber: string()\n .required(formatMessage({ defaultMessage: 'Please enter a phone number' }))\n .test(\n 'is-valid-phone-number',\n formatMessage({ defaultMessage: 'Please enter a valid phone number' }),\n validatePhoneNumber\n ),\n }),\n [formatMessage]\n );\n const onSubmit = useCallback(\n async (\n data: { phoneNumber: string },\n { setFieldError }: FormikHelpers<{ phoneNumber: string }>\n ): Promise => {\n try {\n let formattedNumber = data.phoneNumber.replace(/\\D/g, '');\n switch (formattedNumber.substring(0, 2)) {\n case '+1':\n break;\n case '1':\n formattedNumber = `+${formattedNumber}`;\n break;\n default:\n formattedNumber = `+1${formattedNumber}`;\n break;\n }\n await onSendSms(formattedNumber);\n onComplete(formattedNumber);\n } catch (error) {\n if (error.type === 'invalid.session') {\n await SessionTimeoutService.showTimeout();\n return;\n }\n if (error.type === 'invalid.parameter') {\n setFieldError('phoneNumber', formatMessage({ defaultMessage: 'Invalid phone number' }));\n }\n const message = error.message\n ? formatMessage(\n { defaultMessage: 'Unable to send SMS: {errorMessage}' },\n { errorMessage: error.message }\n )\n : formatMessage({ defaultMessage: 'Unable to send SMS' });\n setFieldError('phoneNumber', message);\n }\n },\n [formatMessage, onComplete, onSendSms]\n );\n const formik = useFormik({ initialValues: { phoneNumber: '' }, onSubmit, validationSchema });\n const { isSubmitting } = formik;\n return (\n \n \n \n \n \n \n
\n \n }\n name=\"phoneNumber\"\n sx={{ maxWidth: 300 }}\n type=\"tel\"\n />\n \n \n \n \n \n \n \n
\n
\n
\n );\n};\n","import { useCallback, useMemo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport CheckCircle from '@mui/icons-material/CheckCircle';\nimport Person from '@mui/icons-material/Person';\nimport { Link, Typography } from '@mui/material';\nimport { Stack } from '@mui/system';\nimport { Field, Form, FormikHelpers, FormikProvider, useFormik } from 'formik';\nimport { TextField } from 'formik-mui';\nimport { object, string } from 'yup';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport {\n phoneVerificationService,\n VerifyResponse,\n} from '@/features/persona/services/phoneVerification';\nimport { SessionTimeoutService } from '@/legacy/services/sessionTimeout';\n\nimport { Step } from './Step';\n\nexport type EnterVerificationCodeRendererProps = {\n lastPhoneDigits: string;\n onComplete: () => void;\n onResendCode: () => Promise;\n onVerifyCode: (verificationCode: string) => Promise;\n};\n\nexport const EnterVerificationCodeRenderer = ({\n lastPhoneDigits,\n onComplete,\n onResendCode,\n onVerifyCode,\n}: EnterVerificationCodeRendererProps) => {\n const { formatMessage } = useIntl();\n const validationSchema = useMemo(\n () =>\n object({\n verificationCode: string()\n .required(formatMessage({ defaultMessage: 'Please enter a verification code' }))\n .length(6, formatMessage({ defaultMessage: 'Verification code must be 6 digits' })),\n }),\n [formatMessage]\n );\n const onSubmit = useCallback(\n async (\n data: { verificationCode: string },\n { setFieldError }: FormikHelpers<{ verificationCode: string }>\n ): Promise => {\n try {\n const result = await onVerifyCode(data.verificationCode);\n if (!result.valid) {\n setFieldError(\n 'verificationCode',\n formatMessage({ defaultMessage: 'The code you have entered is incorrect' })\n );\n } else {\n onComplete();\n }\n } catch (error) {\n if (error.type === 'invalid.authentication') {\n await SessionTimeoutService.showTimeout();\n return;\n }\n const message = error.message\n ? formatMessage(\n {\n defaultMessage: 'Unable to verify code: {errorMessage}',\n },\n { errorMessage: error.message }\n )\n : formatMessage({ defaultMessage: 'Unable to verify code' });\n setFieldError('verificationCode', message);\n }\n },\n [formatMessage, onComplete, onVerifyCode]\n );\n const formik = useFormik({ initialValues: { verificationCode: '' }, onSubmit, validationSchema });\n const { isSubmitting } = formik;\n return (\n \n \n \n \n \n \n
\n \n }\n name=\"verificationCode\"\n sx={{ maxWidth: 300 }}\n type=\"text\"\n />\n \n \n \n \n \n \n \n
\n
\n \n \n \n \n {/* This is valid because MUI will render a button element */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n \n \n \n \n
\n );\n};\n\nexport type EnterVerificationCodeProps = {\n onComplete: () => Promise;\n onResendCode: () => Promise;\n phoneNumber: string;\n};\n\nexport const EnterVerificationCode = ({\n onComplete,\n onResendCode,\n phoneNumber,\n}: EnterVerificationCodeProps) => {\n const onVerifyCode = useCallback(\n async (code: string) => phoneVerificationService.verify(code, phoneNumber),\n [phoneNumber]\n );\n const lastPhoneDigits = useMemo(() => (phoneNumber ? phoneNumber.slice(-4) : ''), [phoneNumber]);\n return (\n \n );\n};\n","import { useMemo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Button, Card, Stack, Typography } from '@mui/material';\n\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { durandalRoutes } from '@/routes/durandal';\n\nexport const VerifyNumberSuccess = (): React.JSX.Element => {\n const totalAccountingFirmMemberships = useSyncKoObservable(userService.accountingFirmMemberships);\n const totalUserMemberships = useSyncKoObservable(userService.memberships);\n const buttonHref = useMemo(() => {\n const totalAccountingFirmMembershipsCount = totalAccountingFirmMemberships?.length ?? 0;\n const totalUserMembershipsCount = totalUserMemberships?.length ?? 0;\n const totalMembershipsCount = totalAccountingFirmMembershipsCount + totalUserMembershipsCount;\n if (totalMembershipsCount === 0) {\n return durandalRoutes.user.tutorials.companyInfo;\n }\n return durandalRoutes.user.dashboard;\n }, [totalAccountingFirmMemberships?.length, totalUserMemberships?.length]);\n return (\n \n \n \n \n \n \n \n \n );\n};\n","import { useCallback, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport router from 'plugins/router';\nimport { Button, Stack } from '@mui/material';\n\nimport { useSyncKoObservable } from '@/hooks/useSyncKoObservable';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { durandalRoutes } from '@/routes/durandal';\n\nimport { phoneVerificationService } from '../services/phoneVerification';\n\nimport { EnterPhoneNumber } from './steps/EnterPhoneNumber';\nimport { EnterVerificationCode } from './steps/EnterVerificationCode';\nimport { VerifyNumberSuccess } from './steps/VerifyNumberSuccess';\n\nexport const VerifyNumber = (): React.JSX.Element => {\n const userProfile = useSyncKoObservable(userService.profile);\n const isCompleted = useSyncKoObservable(userProfile.isSignupPhoneVerificationDone);\n const [step, setStep] = useState<'add' | 'success' | 'verify'>(isCompleted ? 'success' : 'add');\n const [phoneNumber, setPhoneNumber] = useState(null);\n const onCompleteEnterPhoneNumber = useCallback((addedPhoneNumber: string) => {\n setStep('verify');\n setPhoneNumber(addedPhoneNumber);\n }, []);\n const totalAccountingFirmMemberships = useSyncKoObservable(userService.accountingFirmMemberships);\n const totalUserMemberships = useSyncKoObservable(userService.memberships);\n const onCompleteEnterVerificationCode = useCallback(async () => {\n const totalAccountingFirmMembershipsCount = totalAccountingFirmMemberships?.length ?? 0;\n const totalUserMembershipsCount = totalUserMemberships?.length ?? 0;\n const totalMembershipsCount = totalAccountingFirmMembershipsCount + totalUserMembershipsCount;\n try {\n await userService.LoadProfile(); // Reload profile to update phoneVerification status.\n } catch (_err) {\n // ignore error\n }\n if (totalMembershipsCount === 0) {\n router.navigate(durandalRoutes.user.tutorials.companyInfo);\n } else {\n router.navigate(durandalRoutes.user.dashboard);\n }\n }, [totalAccountingFirmMemberships, totalUserMemberships]);\n const onSendSms = useCallback(\n async (addedPhoneNumber: string): Promise =>\n phoneVerificationService.sendCode(addedPhoneNumber),\n []\n );\n const onResendSms = useCallback(\n async (): Promise => phoneVerificationService.sendCode(phoneNumber),\n [phoneNumber]\n );\n const handleLogOut = useCallback(() => {\n userService.Logout();\n }, []);\n return (\n \n {step === 'add' ? (\n \n ) : null}\n {step === 'verify' ? (\n \n ) : null}\n {step === 'success' ? : null}\n \n \n );\n};\n","import { OwnerInformation } from '@/legacy/components/user/onboardingWizard/company/ownershipInformation/model/OwnerInformation';\nimport AuthFetchService from '@/legacy/services/authFetch';\nimport * as companyService from '@/legacy/services/company';\nimport { ErrorModel } from '@/legacy/utils/reactHelpers';\n\nclass OwnershipInformationService {\n public static async get(): Promise> {\n const companyId: string = companyService.Instance.CompanyId();\n const url = `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/company/${companyId}/owners`;\n const response = await AuthFetchService.httpGet(url);\n\n if (response.ok) {\n return response.json();\n }\n\n throw new Error(response.statusText);\n }\n\n public static async update(\n owners: Array\n ): Promise | ErrorModel> {\n const companyId: string = companyService.Instance.CompanyId();\n const url = `${import.meta.env.FEATURE_VERIFICATION_BASE_URL}/company/${companyId}/owners`;\n const response = await AuthFetchService.httpPut(url, JSON.stringify(owners));\n\n if (response.ok) {\n return response.json();\n }\n\n if (response.status === 400) {\n return Promise.reject(await response.json());\n }\n\n throw new Error(response.statusText);\n }\n}\n\nexport default OwnershipInformationService;\n","enum SmsCountry {\n CA = 'CA',\n US = 'US',\n}\n\nenum VerificationStep {\n SelectVerificationProvider = 'SelectVerificationProvider',\n EnterPhoneNumber = 'EnterPhoneNumber',\n EnterDisableSmsCode = 'EnterDisableSmsCode',\n EnterSmsCode = 'EnterSmsCode',\n OtpQrCode = 'OtpQrCode',\n ConfirmDisableOtpCode = 'ConfirmDisableOtpCode',\n ConfirmOtpCode = 'ConfirmOtpCode',\n SelectDisabler = 'SelectDisabler',\n}\n\nexport { SmsCountry, VerificationStep };\n","import { Dispatch } from 'react';\n\nimport { ApiError } from '@/features/api';\nimport TwoFactorAuthenticationService, {\n TwoFactorAuthentication,\n TwoFactorAuthenticationStatus,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport * as companyService from '@/legacy/services/company';\nimport { Instance as UserService } from '@/legacy/services/user';\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport Constants from '../shared/constants';\n\nimport { SmsCountry, VerificationStep } from './helper';\n\nenum ActionType {\n AddErrors = 'AddErrors',\n\n SetSteps = 'SetSteps',\n NextStep = 'NextStep',\n PreviousStep = 'PreviousStep',\n\n SetFormPhoneNumber = 'SetFormPhoneNumber',\n SetFormCountry = 'SetFormCountry',\n SetFormVerificationMethod = 'SetFormVerificationMethod',\n SetDisableVerificationMethod = 'SetDisableVerificationMethod',\n SetCode = 'SetCode',\n\n HandleFormFieldErrors = 'HandleFormFieldErrors',\n ShowDialog = 'ShowDialog',\n CloseDialog = 'CloseDialog',\n ShowFieldError = 'ShowFieldError',\n UnableToScan = 'UnableToScan',\n ResendSmsCode = 'ResendSmsCode',\n CallUser = 'CallUser',\n\n // Queries\n QuerySubmitPhoneNumber = 'QuerySubmitPhoneNumber',\n QuerySubmitTwoFactorStatus = 'QuerySubmitTwoFactorStatus',\n QuerySendDisableCode = 'QuerySendDisableCode',\n QueryGenerateOtp = 'QueryGenerateOtp',\n QueryCallSetupCode = 'QueryCallSetupCode',\n}\n\ninterface DialogProps {\n title: string;\n message: string;\n closeModal?: boolean;\n}\n\ninterface NewFieldError {\n fieldName: string;\n errorMessage: string;\n}\n\ninterface FieldError {\n errors: Array;\n name: string;\n}\n\ninterface StepperStep {\n blockBack?: boolean;\n isFinal?: boolean;\n step: VerificationStep;\n title: string;\n}\n\ninterface GenerateOtpResponse {\n secretKey: string;\n temporaryMfaSetupId: string;\n}\n\ninterface GenerateSmsResponse {\n temporaryMfaSetupId: string;\n}\n\ninterface State {\n isLoading: boolean;\n isEnabled: boolean;\n\n phoneNumber: string;\n smsCountry: SmsCountry;\n code: string;\n\n verificationMethod: TwoFactorAuthenticationType;\n verificationStep: number;\n\n steps: Array;\n\n queries: Array>;\n fieldErrors: Array;\n dialog: DialogProps | null;\n otpSecretKey: string | null;\n temporaryMfaSetupId: string | null;\n isUnableToScan: boolean;\n otpAccountName: string;\n\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n\n /**\n * If an existing method was selected\n */\n twoFactorAuthentication?: TwoFactorAuthentication;\n /**\n * If any exist (during new 2FA addition)\n */\n twoFactorAuthentications?: Array;\n isMaxNumberOfAuthMethodsReachedForCurrentType: boolean;\n}\n\nfunction reducer(state: State, action: Action): State {\n const { type, payload } = action;\n switch (type) {\n case ActionType.AddErrors:\n return {\n ...state,\n isLoading: false,\n };\n\n case ActionType.SetFormPhoneNumber: {\n const phoneNumber = (payload as string).replace(/[^0-9]+/g, ''); // Don't\n if (phoneNumber.length > 10) {\n // Max phone length\n return state;\n }\n\n // clear any field errors.\n const fieldErrors = state.fieldErrors.filter((e) => e.name !== 'phoneNumber');\n\n return {\n ...state,\n phoneNumber,\n fieldErrors,\n };\n }\n\n case ActionType.SetFormCountry:\n return {\n ...state,\n smsCountry: payload,\n };\n\n case ActionType.UnableToScan:\n return {\n ...state,\n isUnableToScan: true,\n };\n\n case ActionType.SetCode: {\n const code = (payload as string).replace(/[^0-9]+/g, '');\n if (code.length > 6) {\n // Max sms code length\n return state;\n }\n\n // clear any field errors.\n const fieldErrors = state.fieldErrors.filter((e) => e.name !== 'code');\n\n return {\n ...state,\n code,\n fieldErrors,\n };\n }\n\n case ActionType.SetFormVerificationMethod:\n return {\n ...state,\n verificationMethod: payload,\n isMaxNumberOfAuthMethodsReachedForCurrentType: isMaxNumberOfTwoFactorAuthReached(\n payload,\n state.twoFactorAuthentications\n ),\n };\n\n case ActionType.PreviousStep:\n return {\n ...state,\n verificationStep: state.verificationStep - 1,\n };\n\n case ActionType.NextStep: {\n const currentStep = state.steps[state.verificationStep];\n switch (currentStep.step) {\n case VerificationStep.SelectVerificationProvider: {\n if (state.verificationMethod !== TwoFactorAuthenticationType.Otp) {\n break;\n }\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QueryGenerateOtp,\n payload: {},\n },\n ],\n };\n }\n\n case VerificationStep.EnterPhoneNumber: {\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitPhoneNumber,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n },\n ],\n };\n }\n\n case VerificationStep.ConfirmOtpCode:\n case VerificationStep.EnterSmsCode: {\n /**\n * If we're disabling 2FA.\n */\n const { twoFactorAuthenticationDisabler, twoFactorAuthentication } = state;\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitTwoFactorStatus,\n payload: {\n code: state.code,\n temporaryMfaSetupId: state.temporaryMfaSetupId,\n type: state.verificationMethod,\n closeOnSuccess: currentStep.isFinal,\n /**\n * If we're disabling 2FA\n */\n twoFactorAuthentication: twoFactorAuthenticationDisabler,\n twoFactorAuthenticationIdToUpdate: twoFactorAuthentication?.id,\n },\n },\n ],\n };\n }\n\n case VerificationStep.ConfirmDisableOtpCode:\n case VerificationStep.EnterDisableSmsCode: {\n // @todo handle state change\n return {\n ...state,\n };\n }\n\n case VerificationStep.SelectDisabler:\n if (state.twoFactorAuthenticationDisabler.type === TwoFactorAuthenticationType.Otp) {\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n };\n }\n\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n },\n },\n ],\n };\n }\n\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n };\n }\n\n case ActionType.ResendSmsCode: {\n const query = state.isEnabled\n ? {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n },\n }\n : {\n type: ActionType.QuerySubmitPhoneNumber,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n };\n\n return {\n ...state,\n isLoading: true,\n queries: [query],\n };\n }\n\n case ActionType.CallUser: {\n const query = state.isEnabled\n ? {\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler: state.twoFactorAuthenticationDisabler,\n shouldCallUser: true,\n },\n }\n : {\n type: ActionType.QueryCallSetupCode,\n payload: {\n phoneCountry: state.smsCountry.toString(),\n phoneNumber: state.phoneNumber,\n },\n };\n\n return {\n ...state,\n queries: [query],\n };\n }\n\n case ActionType.SetSteps: {\n const newSteps = [];\n if (state.isEnabled && state.twoFactorAuthentications.length > 1) {\n newSteps.push({\n step: VerificationStep.SelectDisabler,\n title: 'Choose your Two-Step Provider to Disable Old Two-Step Provider',\n });\n }\n\n if (!state.isEnabled) {\n newSteps.push({\n step: VerificationStep.SelectVerificationProvider,\n title: `Choose Your ${state.isEnabled ? 'New ' : ''}Two-Step Provider`,\n blockBack: true,\n });\n\n const methodSpecificActivation =\n state.verificationMethod === TwoFactorAuthenticationType.Otp\n ? [\n { step: VerificationStep.OtpQrCode, title: 'Add to Authenticator (Scan QR Code)' },\n { step: VerificationStep.ConfirmOtpCode, title: 'Verify Authenticator' },\n ]\n : [\n { step: VerificationStep.EnterPhoneNumber, title: 'Enter Verification Details' },\n { step: VerificationStep.EnterSmsCode, title: 'Enter SMS Verification Code' },\n ];\n\n newSteps.push(...methodSpecificActivation);\n } else if (state.verificationMethod === TwoFactorAuthenticationType.Otp) {\n newSteps.push({ step: VerificationStep.ConfirmOtpCode, title: 'Enter Authenticator Code' });\n } else {\n newSteps.push({\n step: VerificationStep.EnterSmsCode,\n title: 'Enter SMS Verification Code',\n });\n }\n\n newSteps[newSteps.length - 1].isFinal = true;\n return {\n ...state,\n steps: newSteps,\n };\n }\n\n case ActionType.ShowDialog: {\n const dialog = payload as DialogProps;\n\n return {\n ...state,\n dialog,\n isLoading: false,\n };\n }\n\n case ActionType.CloseDialog:\n return {\n ...state,\n dialog: null,\n };\n\n case ActionType.ShowFieldError: {\n const { fieldName, errorMessage } = payload as NewFieldError;\n\n return {\n ...state,\n code: '', // Clear code\n isLoading: false,\n fieldErrors: [{ name: fieldName, errors: [errorMessage] }],\n };\n }\n\n case ActionType.HandleFormFieldErrors: {\n const { fields: fieldErrors } = payload;\n\n return {\n ...state,\n isLoading: false,\n fieldErrors,\n };\n }\n\n case ActionType.SetDisableVerificationMethod:\n return {\n ...state,\n twoFactorAuthenticationDisabler: payload,\n verificationMethod: payload.type,\n };\n\n // Handle Query responses\n case ActionType.QuerySubmitTwoFactorStatus:\n case ActionType.QuerySubmitPhoneNumber:\n case ActionType.QueryCallSetupCode:\n case ActionType.QuerySendDisableCode: {\n const queries = [];\n const nextStep = state.steps[state.verificationStep + 1];\n if (nextStep?.step === VerificationStep.EnterDisableSmsCode) {\n queries.push({ type: ActionType.QuerySendDisableCode });\n }\n\n const { temporaryMfaSetupId } = payload as GenerateSmsResponse;\n return {\n ...state,\n verificationStep: state.verificationStep + (nextStep ? 1 : 0),\n code: '',\n queries,\n isLoading: false,\n fieldErrors: [],\n temporaryMfaSetupId,\n };\n }\n\n case ActionType.QueryGenerateOtp: {\n const { secretKey, temporaryMfaSetupId } = payload as GenerateOtpResponse;\n\n return {\n ...state,\n verificationStep: state.verificationStep + 1,\n isLoading: false,\n otpSecretKey: secretKey,\n temporaryMfaSetupId,\n };\n }\n }\n\n return state;\n}\n\nasync function handleQueries(\n queries: Array>,\n dispatch: Dispatch>,\n onClose: { (close: boolean): void }\n): Promise {\n const handleError = (error: ApiError) => {\n if (error && error.type) {\n const getErrorDialog = (): DialogProps => {\n switch (error.type) {\n case 'invalid.code':\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: error.message,\n fieldName: 'code',\n } as NewFieldError,\n });\n return undefined;\n\n case 'invalid.status.enabled':\n return {\n title: 'Already enabled',\n message: 'This two-step authentication is already enabled.',\n closeModal: true,\n };\n\n case 'invalid.status.disabled':\n return {\n title: 'Is not enabled',\n message: 'You can only disable two-step authentications that are already enabled.',\n closeModal: true,\n };\n\n case 'invalid.switch.status.disabled':\n return {\n title: 'Is not enabled',\n message: 'You can only switch two-step authentications that are already enabled.',\n closeModal: true,\n };\n\n case 'invalid.switch.number.duplicate':\n return {\n title: 'Duplicate phone number',\n message: 'You can only switch the authentication to a new number.',\n closeModal: true,\n };\n\n case 'invalid.twoFactorForced':\n return {\n title: 'Two Factor is mandatory',\n message:\n 'You can not disable your two-step authentication because your company administrator has requested a mandatory two-step authentication.',\n closeModal: true,\n };\n\n case 'invalid.twoFactorCompliance':\n return {\n title: 'Two Factor is mandatory',\n message:\n \"You can not disable your two factor authentication because your account is required to have it enabled as per Plooto's security requirements.\",\n closeModal: true,\n };\n\n case 'duplicate.phone.generate.code':\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: error.message,\n fieldName: 'phoneNumber',\n } as NewFieldError,\n });\n return undefined;\n\n case 'duplicate.phone.add.mfa':\n return {\n title: 'Duplicate phone number',\n message:\n 'This phone number is already registered for multi-factor authentication via SMS.',\n closeModal: true,\n };\n\n case 'invalid.phoneCountry':\n return {\n title: 'Unsupported country',\n message: error.message,\n closeModal: true,\n };\n\n case 'rateLimit.smsSetup':\n return {\n title: 'Rate limit error',\n message:\n 'Only 5 codes for new device registration allowed per hour. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId':\n return {\n title: 'Invalid setup ID',\n message: 'Invalid MFA setup ID or it has expired. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.userId':\n return {\n title: 'Invalid user ID',\n message: 'Invalid user ID. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.isDeleted':\n return {\n title: 'An issue with this MFA setup',\n message: 'There was an issue with this MFA setup. Please try again later.',\n closeModal: true,\n };\n\n case 'invalid.temporaryMfaSetupId.deviceId':\n return {\n title: 'Invalid Cookie Settings',\n message:\n 'Your browser privacy settings must allow cookies to be set to enable Two Factor Authentication.',\n closeModal: true,\n };\n\n default: {\n return {\n title: 'Unexpected Error',\n message: `There was an error submitting your code. Please try again later. Error code: ${error.type}`,\n };\n }\n }\n };\n\n switch (error.type) {\n case 'invalid.parameter':\n dispatch({ type: ActionType.HandleFormFieldErrors, payload: error });\n return;\n\n default: {\n const errorDialog = getErrorDialog();\n if (errorDialog) {\n dispatch({ type: ActionType.ShowDialog, payload: errorDialog });\n }\n }\n }\n } else {\n const errorDialog: DialogProps = {\n title: 'Unexpected Error',\n message: 'There was an error submitting your code. Please try again later.',\n };\n // @todo log error to App Insights\n dispatch({ type: ActionType.ShowDialog, payload: errorDialog });\n }\n };\n\n queries.forEach(async (query) => {\n const { type, payload } = query;\n\n switch (type) {\n case ActionType.QuerySubmitPhoneNumber: {\n const { phoneCountry, phoneNumber } = payload;\n\n if (!phoneNumber) {\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage: 'Phone Number is required',\n fieldName: 'phoneNumber',\n } as NewFieldError,\n });\n return;\n }\n\n try {\n const smsCodeResponse = await TwoFactorAuthenticationService.generateSmsCode({\n phoneCountry,\n phoneNumber,\n });\n dispatch({ type, payload: smsCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QueryCallSetupCode: {\n const { phoneCountry, phoneNumber } = payload;\n\n try {\n const smsCodeResponse = await TwoFactorAuthenticationService.generateSmsCode({\n phoneCountry,\n phoneNumber,\n shouldCallUser: true,\n });\n dispatch({ type, payload: smsCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QuerySubmitTwoFactorStatus: {\n const {\n code,\n temporaryMfaSetupId,\n type: mfaType,\n closeOnSuccess,\n twoFactorAuthentication,\n twoFactorAuthenticationIdToUpdate,\n } = payload;\n\n if (!code) {\n let errorMessage: string;\n switch (mfaType) {\n case TwoFactorAuthenticationType.Otp:\n errorMessage = 'Authenticator Code is required';\n break;\n case TwoFactorAuthenticationType.Sms:\n errorMessage = 'SMS Code is required';\n break;\n }\n\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n errorMessage,\n fieldName: 'code',\n } as NewFieldError,\n });\n return;\n }\n\n try {\n if (!twoFactorAuthentication) {\n await TwoFactorAuthenticationService.addTwoFactorAuthentication({\n code,\n temporaryMfaSetupId,\n type: mfaType,\n });\n } else {\n await TwoFactorAuthenticationService.updateTwoFactorAuthentication(\n twoFactorAuthentication.id,\n {\n code,\n status: TwoFactorAuthenticationStatus.Disabled,\n twoFactorAuthenticationIdToUpdate,\n }\n );\n }\n\n if (closeOnSuccess) {\n onClose(true);\n } else {\n dispatch({ type });\n }\n } catch (e) {\n handleError(e);\n }\n\n break;\n }\n\n case ActionType.QuerySendDisableCode: {\n const { id } = payload.twoFactorAuthenticationDisabler as TwoFactorAuthentication;\n const { shouldCallUser } = payload;\n\n try {\n const smsSettings = await TwoFactorAuthenticationService.sendDisableCode(id, {\n shouldCallUser,\n });\n dispatch({ type, payload: smsSettings });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n\n case ActionType.QueryGenerateOtp: {\n try {\n const otpCodeResponse = await TwoFactorAuthenticationService.generateOtpCode();\n dispatch({ type, payload: otpCodeResponse });\n } catch (e) {\n handleError(e);\n }\n break;\n }\n }\n });\n}\n\ninterface StateInitialValues {\n twoFactorAuthentication: TwoFactorAuthentication | null;\n twoFactorAuthentications: Array | null;\n}\n\nconst isMaxNumberOfTwoFactorAuthReached = (\n twoFactorAuthenticationType: TwoFactorAuthenticationType,\n twoFactorAuthentications: Array\n) =>\n twoFactorAuthentications?.filter((tfa) => tfa.type === twoFactorAuthenticationType)?.length ===\n Constants.MAX_NUMBER_OF_2FAS_PER_TYPE;\n\nfunction getInitialState(initialValues: StateInitialValues): State {\n const { twoFactorAuthentication, twoFactorAuthentications } = initialValues;\n\n const queries = [];\n\n const isMaxNumberOfOtpTwoFactorAuthReached = isMaxNumberOfTwoFactorAuthReached(\n TwoFactorAuthenticationType.Otp,\n twoFactorAuthentications\n );\n\n const isMaxNumberOfSmsTwoFactorAuthReached = isMaxNumberOfTwoFactorAuthReached(\n TwoFactorAuthenticationType.Sms,\n twoFactorAuthentications\n );\n\n let verificationMethod: TwoFactorAuthenticationType;\n if (isMaxNumberOfOtpTwoFactorAuthReached) {\n verificationMethod = TwoFactorAuthenticationType.Sms;\n } else if (isMaxNumberOfSmsTwoFactorAuthReached) {\n verificationMethod = TwoFactorAuthenticationType.Otp;\n } else {\n verificationMethod = TwoFactorAuthenticationType.Otp;\n }\n\n let isMaxNumberOfAuthMethodsReachedForCurrentType;\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Otp:\n isMaxNumberOfAuthMethodsReachedForCurrentType = isMaxNumberOfOtpTwoFactorAuthReached;\n break;\n case TwoFactorAuthenticationType.Sms:\n isMaxNumberOfAuthMethodsReachedForCurrentType = isMaxNumberOfSmsTwoFactorAuthReached;\n break;\n }\n\n let twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n if (twoFactorAuthentication) {\n // Only 1 possible disable method.\n if (!twoFactorAuthentications.length || twoFactorAuthentications.length === 1) {\n twoFactorAuthenticationDisabler = twoFactorAuthentication;\n\n verificationMethod = twoFactorAuthenticationDisabler.type;\n\n if (twoFactorAuthenticationDisabler.type === TwoFactorAuthenticationType.Sms) {\n queries.push({\n type: ActionType.QuerySendDisableCode,\n payload: {\n twoFactorAuthenticationDisabler,\n },\n });\n }\n } else {\n [twoFactorAuthenticationDisabler] = twoFactorAuthentications;\n }\n }\n\n return {\n isLoading: false,\n isEnabled: !!twoFactorAuthentication,\n\n phoneNumber: '',\n smsCountry:\n companyService.Instance.CompanyCountry() === SmsCountry.CA ? SmsCountry.CA : SmsCountry.US,\n\n // Ensure we always have something filled in case 2FA was required and email couldn't be loaded.\n // We'll try their email, then their name, then their User ID, and then in the weird case where\n // we have nothing, the URL of the Plooto environment they signed up from (which should surely\n // never be used, but it will always be defined).\n otpAccountName:\n UserService.DisplayEmail() ||\n UserService.DisplayName() ||\n UserService.UserId() ||\n import.meta.env.APP_URLS_APP_URL,\n\n code: '',\n\n otpSecretKey: null,\n temporaryMfaSetupId: null,\n\n steps: [],\n\n verificationMethod,\n verificationStep: 0,\n\n queries,\n fieldErrors: [],\n dialog: null,\n isUnableToScan: false,\n twoFactorAuthentication, // Currently selected 2FA method\n twoFactorAuthentications, // Previously created 2FAs,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n twoFactorAuthenticationDisabler,\n };\n}\n\nexport { State, ActionType, getInitialState, handleQueries, reducer };\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Typography } from '@mui/material';\n\nimport { Strong } from '@/components/rich-text-formatting';\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n isEnabled?: boolean;\n phoneNumber: string;\n verificationMethod: TwoFactorAuthenticationType;\n}\n\nconst CodeMessage = (props: Props): React.JSX.Element => {\n const { isEnabled, phoneNumber, verificationMethod } = props;\n\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Sms:\n return (\n \n {isEnabled ? (\n DISABLE
your two-step authentication:\"\n values={{ Strong }}\n />\n ) : (\n {phoneNumber} . Enter this code in the field below to enable your two-step authentication:\"\n values={{ Strong, phoneNumber }}\n />\n )}\n \n );\n\n case TwoFactorAuthenticationType.Otp:\n return (\n \n {isEnabled ? (\n DISABLE your two-step authentication:\"\n values={{ Strong }}\n />\n ) : (\n \n )}\n \n );\n\n default:\n return null;\n }\n};\n\nexport default memo(CodeMessage);\n","import { ChangeEvent, memo } from 'react';\nimport { Box, FormControl, TextField } from '@mui/material';\n\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { getFieldError } from '@/legacy/utils/reactHelpers';\n\nimport SmsBackupOptions from '../shared/SmsBackupOptionsFragment';\n\nimport CodeMessage from './CodeMessageFragment';\n\ninterface FieldError {\n errors: Array;\n name: string;\n}\n\ninterface Props {\n code: string;\n fieldErrors: Array;\n isEnabled: boolean;\n isLoading: boolean;\n onCodeChange: { (e: ChangeEvent): void };\n onResendCode: () => void;\n onCallMe: () => void;\n phoneNumber: string;\n verificationMethod: TwoFactorAuthenticationType;\n}\n\nconst Code = (props: Props): React.JSX.Element => {\n const {\n code,\n fieldErrors,\n isEnabled,\n isLoading,\n onCodeChange,\n onResendCode,\n onCallMe,\n phoneNumber,\n verificationMethod,\n } = props;\n\n const getCodeLabel = () => {\n switch (verificationMethod) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n };\n\n return (\n <>\n \n \n \n \n \n \n \n\n {verificationMethod === TwoFactorAuthenticationType.Sms && (\n \n )}\n \n \n );\n};\n\nexport default memo(Code);\n","import { ChangeEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n FormControl,\n FormHelperText,\n InputLabel,\n MenuItem,\n Select,\n Typography,\n} from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n errorMessage?: string;\n isLoading?: boolean;\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n}\n\nconst VerificationProvider = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n errorMessage = undefined,\n isLoading,\n onTwoFactorAuthenticationDisablerChange,\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n } = props;\n\n const handleVerificationChange = useCallback(\n (e: ChangeEvent) => {\n const newMethod = twoFactorAuthenticationDisablers.find(\n (method) => method.id === e.target.value\n );\n\n onTwoFactorAuthenticationDisablerChange(newMethod);\n },\n [onTwoFactorAuthenticationDisablerChange, twoFactorAuthenticationDisablers]\n );\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n\n \n {twoFactorAuthenticationDisablers.map((method) => (\n \n {method.displayName}\n \n ))}\n \n\n {errorMessage && {errorMessage}}\n \n \n \n );\n};\n\nexport default memo(VerificationProvider);\n","import { ChangeEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n FormControl,\n Grid,\n InputLabel,\n MenuItem,\n Select,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport { SmsCountry } from './helper';\n\ninterface Props {\n isLoading?: boolean;\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onSmsCountryChange: {\n (e: ChangeEvent): void;\n };\n phoneNumber: string;\n phoneNumberErrorMessage: string;\n smsCountry: string;\n}\n\nconst SmsPhoneFragment = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n isLoading,\n onPhoneNumberChange,\n onSmsCountryChange,\n phoneNumber,\n phoneNumberErrorMessage,\n smsCountry,\n } = props;\n\n const SecondaryText = useCallback(\n (chunk) => (\n \n \n {chunk}\n \n \n ),\n []\n );\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n (+1)\"\n values={{\n SecondaryText,\n }}\n />\n \n\n \n (+1)\"\n values={{\n SecondaryText,\n }}\n />\n \n \n \n \n\n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(SmsPhoneFragment);\n","import { Component, memo } from 'react';\nimport * as QRCode from 'qrcode';\n\ninterface Props {\n data: string;\n}\n\nclass QrCodeFragment extends Component {\n componentDidMount(): void {\n const { data } = this.props;\n\n const generateQRCode = (qrCodeData: string) => {\n QRCode.toCanvas(document.getElementById('qrCodeContainer'), qrCodeData, {}, (error) => {\n if (error) {\n console.error(error);\n }\n });\n };\n\n generateQRCode(data);\n }\n\n render(): React.JSX.Element {\n return (\n
\n \n
\n );\n }\n}\n\nexport default memo(QrCodeFragment);\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Button, Paper } from '@mui/material';\n\ninterface Props {\n isUnableToScan?: boolean;\n onUnableToScan: { (): void };\n otpSecretKey: string;\n}\n\nconst ScanCode = (props: Props): React.JSX.Element => {\n const { isUnableToScan, onUnableToScan, otpSecretKey } = props;\n\n if (isUnableToScan) {\n return (\n \n \n \n \n \n\n {otpSecretKey}\n \n \n );\n }\n\n return (\n \n );\n};\n\nexport default memo(ScanCode);\n","import { memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Typography } from '@mui/material';\n\nimport QrCodeFragment from './QrCodeFragment';\nimport ScanCode from './ScanCodeFragment';\n\ninterface Props {\n isUnableToScan?: boolean;\n onUnableToScan: { (): void };\n otpSecretKey: string;\n otpAccountName: string;\n}\n\nconst UserOtpQrCodeFragment = (props: Props): React.JSX.Element => {\n const { isUnableToScan, onUnableToScan, otpSecretKey, otpAccountName: otpAccountNameRaw } = props;\n\n if (!otpSecretKey) {\n return null;\n }\n\n // This will show up as Plooto () in authenticator with the associated user email\n const otpAccountName = encodeURIComponent(otpAccountNameRaw);\n const qrCodeData = `otpauth://totp/Plooto:${otpAccountName}?secret=${otpSecretKey}&issuer=Plooto`;\n\n return (\n <>\n \n \n \n \n\n \n
    \n
  1. \n \n
  2. \n
  3. \n \n
  4. \n
  5. \n \n
  6. \n
\n
\n
\n \n \n\n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(UserOtpQrCodeFragment);\n","import { ChangeEvent, memo, ReactNode, useCallback } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, MenuItem, TextField, Typography } from '@mui/material';\n\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\ninterface Props {\n isLoading?: boolean;\n onVerificationMethodChange: {\n (e: ChangeEvent): void;\n };\n verificationMethod: TwoFactorAuthenticationType;\n isMaxNumberOfAuthMethodsReachedForCurrentType: boolean;\n}\n\nconst VerificationProvider = (props: Props): React.JSX.Element => {\n const {\n isLoading,\n onVerificationMethodChange,\n verificationMethod,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n } = props;\n\n const SecondaryText = useCallback(\n (chunk: ReactNode) => (\n \n {chunk}\n \n ),\n []\n );\n\n return (\n <>\n \n \n \n \n \n \n }\n autoFocus\n disabled={isLoading}\n error={isMaxNumberOfAuthMethodsReachedForCurrentType}\n helperText={\n isMaxNumberOfAuthMethodsReachedForCurrentType ? (\n \n ) : null\n }\n >\n \n (Recommended)\"\n values={{ SecondaryText }}\n />\n \n \n \n \n \n \n \n );\n};\n\nexport default memo(VerificationProvider);\n","import * as React from 'react';\nimport { ChangeEvent, memo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport { Box, Button, Step, StepContent, StepLabel, Stepper, Typography } from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { getFieldError } from '@/legacy/utils/reactHelpers';\n\nimport Code from './CodeFragment';\nimport DisableVerification from './DisableVerificationFragment';\nimport { VerificationStep } from './helper';\nimport SmsPhoneFragment from './SmsPhoneFragment';\nimport { State } from './TwoFactorSetupDialog.reducer';\nimport UserOtpQrCodeFragment from './UserOtpQrCodeFragment';\nimport VerificationProvider from './VerificationProviderFragment';\n\ninterface Props {\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n state: State;\n onCodeChange: { (e: React.ChangeEvent): void };\n onNextStep: { (): void };\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onPreviousStep: { (): void };\n onSmsCountryChange: { (e: ChangeEvent): void };\n onVerificationChange: { (e: ChangeEvent): void };\n onUnableToScan: { (): void };\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst TwoFactorStepper = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n state,\n onCodeChange,\n onNextStep,\n onPhoneNumberChange,\n onPreviousStep,\n onSmsCountryChange,\n onVerificationChange,\n onUnableToScan,\n onTwoFactorAuthenticationDisablerChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const {\n code,\n fieldErrors,\n isEnabled,\n isLoading,\n isUnableToScan,\n otpSecretKey,\n phoneNumber,\n smsCountry,\n steps,\n verificationMethod,\n otpAccountName,\n twoFactorAuthentication,\n isMaxNumberOfAuthMethodsReachedForCurrentType,\n } = state;\n\n const currentStep = state.verificationStep;\n\n const getStepContent = (step: VerificationStep): React.JSX.Element => {\n switch (step) {\n case VerificationStep.SelectVerificationProvider:\n return (\n \n );\n\n case VerificationStep.EnterPhoneNumber:\n return (\n \n );\n\n case VerificationStep.EnterSmsCode:\n case VerificationStep.ConfirmOtpCode:\n case VerificationStep.EnterDisableSmsCode:\n case VerificationStep.ConfirmDisableOtpCode:\n return (\n \n );\n\n case VerificationStep.OtpQrCode:\n return (\n \n );\n\n case VerificationStep.SelectDisabler:\n return (\n \n );\n\n default:\n return null;\n }\n };\n\n return (\n \n {steps.map(({ step, title, blockBack }, stepIndex) => (\n \n {title}\n\n \n {getStepContent(step)}\n
\n
\n {currentStep !== 0 && (\n \n \n \n \n \n )}\n\n \n {stepIndex === steps.length - 1\n ? formatMessage({ defaultMessage: 'Finish' })\n : formatMessage({ defaultMessage: 'Continue' })}\n \n
\n
\n
\n
\n ))}\n
\n );\n};\n\nexport default memo(TwoFactorStepper);\n","import * as React from 'react';\nimport { ChangeEvent, FC, FormEvent, memo } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport TitleMessageDialog from '@/legacy/modals/react/TitleMessageDialog';\n\nimport { State } from './TwoFactorSetupDialog.reducer';\nimport TwoFactorStepper from './TwoFactorStepper';\n\ninterface Props {\n twoFactorAuthenticationDisabler: TwoFactorAuthentication;\n twoFactorAuthenticationDisablers: Array;\n state: State;\n isOpen: boolean;\n onSubmit: () => void;\n onClose: () => void;\n onCodeChange: { (e: React.ChangeEvent): void };\n onNextStep: { (): void };\n onPhoneNumberChange: { (e: ChangeEvent): void };\n onPreviousStep: { (): void };\n onSmsCountryChange: { (e: ChangeEvent): void };\n onVerificationChange: { (e: ChangeEvent): void };\n onUnableToScan: { (): void };\n onTwoFactorAuthenticationDisablerChange: (verification: TwoFactorAuthentication) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst TwoFactorSetupDialogContents: FC = (props: Props): React.JSX.Element => {\n const {\n twoFactorAuthenticationDisabler,\n twoFactorAuthenticationDisablers,\n state,\n isOpen,\n onSubmit,\n onClose,\n onCodeChange,\n onNextStep,\n onPhoneNumberChange,\n onPreviousStep,\n onSmsCountryChange,\n onVerificationChange,\n onUnableToScan,\n onTwoFactorAuthenticationDisablerChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const handeClose = () => {\n onClose();\n };\n\n const getDialog = () => {\n const { dialog } = state;\n if (!dialog) {\n return null;\n }\n\n return (\n {\n handeClose();\n }}\n />\n );\n };\n\n const getDialogTitle = (): string => {\n if (state.isEnabled) {\n return 'Disable';\n }\n\n return 'Enable';\n };\n\n const handleSubmit = (e: FormEvent) => {\n e.preventDefault();\n onSubmit();\n\n return false;\n };\n\n // @todo These need to be updated once we remove React.ChangeEvent\n const handleCodeChange = onCodeChange;\n const handleNextStep = onNextStep;\n const handlePhoneNumberChange = onPhoneNumberChange;\n const handlePreviousStep = onPreviousStep;\n const handleSmsCountryChange = onSmsCountryChange;\n const handleVerificationChange = onVerificationChange;\n const handleUnableToScan = onUnableToScan;\n const handleResendCode = onResendCode;\n const handleCallMe = onCallMe;\n\n return (\n <>\n {getDialog()}\n \n \n \n \n\n \n \n
\n \n \n
\n
\n\n \n \n \n \n\n
\n\n \n \n \n \n );\n};\n\nexport default memo(TwoFactorSetupDialogContents);\n","import { ChangeEvent, FC, memo, useCallback, useEffect, useReducer } from 'react';\n\nimport {\n TwoFactorAuthentication,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport { SmsCountry } from './helper';\nimport {\n ActionType,\n getInitialState,\n handleQueries,\n reducer,\n State,\n} from './TwoFactorSetupDialog.reducer';\nimport TwoFactorSetupDialogContents from './TwoFactorSetupDialogContents';\n\ninterface Props {\n isOpen: boolean;\n onClose: { (isSuccess: boolean): void };\n\n /**\n * If passed in identifies which TwoFactorAuthentication we're updating\n * If not specified user will be adding a new authentication method\n */\n twoFactorAuthentication?: TwoFactorAuthentication;\n /**\n * If passed, it can be used to find out any information about currently set up\n * two factor authentications for current user.\n */\n twoFactorAuthentications?: Array;\n}\n\nconst TwoFactorSetupDialog: FC = (props: Props): React.JSX.Element => {\n const { isOpen, onClose, twoFactorAuthentication, twoFactorAuthentications } = props;\n\n const [state, dispatch] = useReducer(\n reducer,\n getInitialState({\n twoFactorAuthentication,\n twoFactorAuthentications,\n })\n );\n\n // We'll pass down state without queries so we don't re-render if queries change\n const { queries, ...stateWithoutQueries } = state;\n\n useEffect(\n () => {\n handleQueries(queries, dispatch, onClose);\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [queries]\n );\n\n // @todo move this business logic into the reducer\n useEffect(() => {\n dispatch({ type: ActionType.SetSteps });\n }, [state.isEnabled, state.verificationMethod]);\n\n const handleSmsCountryChange = useCallback(\n (e) => dispatch({ type: ActionType.SetFormCountry, payload: e.target.value as SmsCountry }),\n []\n );\n\n const handlePhoneNumberChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetFormPhoneNumber,\n payload: e.target.value as string,\n }),\n []\n );\n\n const handleUnableToScan = useCallback(() => dispatch({ type: ActionType.UnableToScan }), []);\n\n const handleVerificationChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetFormVerificationMethod,\n payload: e.target.value as TwoFactorAuthenticationType,\n }),\n []\n );\n\n const handleNextStep = useCallback(() => dispatch({ type: ActionType.NextStep }), []);\n\n const handlePreviousStep = useCallback(() => dispatch({ type: ActionType.PreviousStep }), []);\n\n const handleCodeChange = useCallback(\n (e: ChangeEvent) =>\n dispatch({\n type: ActionType.SetCode,\n payload: e.target.value as string,\n }),\n []\n );\n\n const handleSubmit = useCallback(() => {\n dispatch({ type: ActionType.NextStep });\n }, []);\n\n const handleClose = () => {\n dispatch({ type: ActionType.CloseDialog });\n onClose(false);\n };\n\n const handleDisableVerificationChange = useCallback((verification: TwoFactorAuthentication) => {\n if (!verification) {\n dispatch({\n type: ActionType.ShowFieldError,\n payload: {\n fieldName: 'disableVerification',\n errorMessage: \"Please select a verification method to verify it's really you.\",\n },\n });\n } else {\n dispatch({\n type: ActionType.SetDisableVerificationMethod,\n payload: verification,\n });\n }\n }, []);\n\n const handleResendCode = useCallback(() => dispatch({ type: ActionType.ResendSmsCode }), []);\n\n const handleCallMe = useCallback(() => dispatch({ type: ActionType.CallUser }), []);\n\n return (\n \n );\n};\n\nexport default memo(TwoFactorSetupDialog);\n","import { ChangeEvent, FormEvent, memo, useCallback } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n Button,\n Checkbox,\n CircularProgress,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n FormControl,\n FormControlLabel,\n TextField,\n} from '@mui/material';\n\nimport { Strong } from '@/components/rich-text-formatting';\nimport SmsBackupOptions from '@/legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment';\nimport { TwoFactorAuthenticationType } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nfunction getCodeLabel(twoFactorAuthentication: TwoFactorAuthenticationType): string {\n switch (twoFactorAuthentication) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n}\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen: boolean;\n onCodeUpdate: (code: string) => void;\n onSubmitCode: () => void;\n onSwitchToMultipleMode: () => void;\n onClose: () => void;\n onResendCode: () => void;\n onCallMe: () => void;\n twoFactorDisplayName: string;\n twoFactorAuthenticationType: TwoFactorAuthenticationType;\n numberOfTwoFactorAuthentications: number;\n rememberDevice: boolean;\n onRememberDeviceChange: (rememberDevice: boolean) => void;\n}\n\nconst LoginPopupDefaultMethodDialog = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n code,\n errorMessage,\n isLoading = false,\n isOpen,\n onCodeUpdate,\n onResendCode,\n onCallMe,\n twoFactorDisplayName,\n twoFactorAuthenticationType,\n numberOfTwoFactorAuthentications,\n onSubmitCode,\n onSwitchToMultipleMode,\n onRememberDeviceChange,\n onClose,\n rememberDevice,\n } = props;\n\n const handleCodeSubmit = useCallback(\n (e: FormEvent) => {\n e.preventDefault();\n onSubmitCode();\n },\n [onSubmitCode]\n );\n\n const handleCodeChange = useCallback(\n (e: ChangeEvent) => {\n onCodeUpdate(e.target.value);\n },\n [onCodeUpdate]\n );\n\n const handleRememberDeviceChange = useCallback(\n (e: ChangeEvent) => onRememberDeviceChange(e.target.checked),\n [onRememberDeviceChange]\n );\n\n return (\n \n
\n \n \n \n {isLoading && (\n \n \n \n \n \n )}\n {!isLoading && (\n \n \n {twoFactorDisplayName}:\"\n values={{ twoFactorDisplayName, Strong }}\n />\n \n\n \n \n \n\n {twoFactorAuthenticationType === TwoFactorAuthenticationType.Sms && (\n \n )}\n\n \n }\n label={formatMessage({\n defaultMessage: 'Remember this device for the next 30 days',\n })}\n />\n\n {numberOfTwoFactorAuthentications === 1 && (\n \n My Profile > Two-Step Authentication.\"\n values={{ Strong }}\n />\n \n )}\n\n {numberOfTwoFactorAuthentications > 1 && (\n <>\n \n \n \n \n My Profile > Two-Step Authentication.\"\n values={{\n twoFactorDisplayName,\n Strong,\n }}\n />\n \n \n )}\n \n )}\n \n \n \n \n
\n
\n );\n};\n\nexport default memo(LoginPopupDefaultMethodDialog);\nexport type { Props };\n","import { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nenum ActionType {\n AdvanceStep = 'AdvanceStep',\n RegressStep = 'RegressStep',\n SetStep = 'SetStep',\n QuerySubmitCode = 'QuerySubmitCode',\n QueryClosePopup = 'QueryClosePopup',\n QueryClearInput = 'QueryClearInput',\n}\n\nenum LoginStep {\n ChooseProvider,\n VerifyAuthenticator,\n}\n\ninterface State extends QueryState {\n step: LoginStep;\n}\n\nfunction getInitialState(): State {\n return {\n step: LoginStep.ChooseProvider,\n queries: [],\n };\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case ActionType.AdvanceStep: {\n if (state.step === LoginStep.VerifyAuthenticator) {\n return {\n ...state,\n queries: [\n {\n type: ActionType.QuerySubmitCode,\n },\n ],\n };\n }\n\n return {\n ...state,\n step: state.step + 1,\n };\n }\n\n case ActionType.RegressStep: {\n if (state.step === LoginStep.ChooseProvider) {\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryClosePopup,\n },\n ],\n };\n }\n\n return {\n ...state,\n step: state.step - 1,\n queries: [\n {\n type: ActionType.QueryClearInput,\n },\n ],\n };\n }\n\n case ActionType.SetStep:\n return {\n ...state,\n step: action.payload,\n };\n\n default:\n return { ...state };\n }\n}\n\nexport default reducer;\nexport type { State };\nexport { ActionType, LoginStep, getInitialState };\n","import { Dispatch } from 'react';\n\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport { ActionType } from './LoginPopupMultiple.reducer';\n\ninterface ActionCallbacks {\n onSubmitCode: () => void;\n onClose: () => void;\n onClearInput: () => void;\n}\n\nfunction handleQueries(\n queries: Array>,\n dispatch: Dispatch>,\n callbacks: ActionCallbacks\n): void {\n queries.forEach(async (query) => {\n switch (query.type) {\n case ActionType.QuerySubmitCode: {\n callbacks.onSubmitCode();\n break;\n }\n case ActionType.QueryClosePopup: {\n callbacks.onClose();\n break;\n }\n case ActionType.QueryClearInput: {\n callbacks.onClearInput();\n break;\n }\n }\n });\n}\n\nexport default handleQueries;\nexport { ActionCallbacks };\n","import { useCallback, useEffect, useReducer } from 'react';\n\nimport handleQueries, { ActionCallbacks } from '../business/LoginPopupMultiple.handleQueries';\nimport reducer, {\n ActionType,\n getInitialState,\n LoginStep,\n State,\n} from '../business/LoginPopupMultiple.reducer';\n\ninterface Actions {\n stepForward: () => void;\n stepBack: () => void;\n}\n\ntype Props = ActionCallbacks;\n\nfunction useLoginPopupMultipleMethods(props: Props): [State, Actions] {\n const { onClose, onSubmitCode, onClearInput } = props;\n\n const [state, dispatch] = useReducer(reducer, getInitialState());\n\n useEffect(\n () => {\n handleQueries(state.queries, dispatch, { onClose, onSubmitCode, onClearInput });\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.queries]\n );\n\n const stepForward = useCallback(() => dispatch({ type: ActionType.AdvanceStep }), []);\n\n const stepBack = useCallback(() => dispatch({ type: ActionType.RegressStep }), []);\n\n return [\n state,\n {\n stepForward,\n stepBack,\n },\n ];\n}\n\nexport default useLoginPopupMultipleMethods;\nexport { ActionType, getInitialState, LoginStep, reducer };\nexport type { Actions, Props };\n","import { ChangeEvent, memo, MouseEvent, useCallback, useEffect, useRef, useState } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Box,\n Button,\n Checkbox,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n FormControlLabel,\n FormHelperText,\n MenuItem,\n Popover,\n Select,\n Step,\n StepContent,\n StepLabel,\n Stepper,\n TextField,\n} from '@mui/material';\n\nimport LoadingButton from '@/components/LoadingButton';\nimport { Strong } from '@/components/rich-text-formatting';\nimport SmsBackupOptions from '@/legacy/components/user/twoFactorAuthentication/shared/SmsBackupOptionsFragment';\nimport {\n TwoFactorAuthentication,\n TwoFactorAuthenticationType,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport { LoginStep } from './useLoginPopupMultipleMethods';\n\nfunction getCodeLabel(twoFactorAuthentication: TwoFactorAuthenticationType): string {\n switch (twoFactorAuthentication) {\n case TwoFactorAuthenticationType.Sms:\n return 'Enter SMS Code';\n\n case TwoFactorAuthenticationType.Otp:\n return 'Enter Authenticator Code';\n\n default:\n return null;\n }\n}\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen?: boolean;\n onBackPressed: () => void;\n onCodeUpdated: (code: string) => void;\n onNextPressed: () => void;\n onProviderChange: (selectedTwoFactorAuthentication: TwoFactorAuthentication) => void;\n onRememberDeviceChange: (isChecked: boolean) => void;\n onResendCode: () => void;\n onCallMe: () => void;\n rememberDevice: boolean;\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n step: LoginStep;\n twoFactorAuthentications: Array;\n}\n\nconst LoginPopupMultipleMethodsPresentation = (props: Props): React.JSX.Element => {\n const { formatMessage } = useIntl();\n\n const {\n errorMessage,\n step,\n twoFactorAuthentications,\n isLoading,\n selectedTwoFactorAuthentication,\n rememberDevice,\n code,\n isOpen,\n onBackPressed,\n onNextPressed,\n onProviderChange,\n onCodeUpdated,\n onRememberDeviceChange,\n onResendCode,\n onCallMe,\n } = props;\n\n const codeInputRef = useRef(null);\n\n const [popoverAnchor, setPopoverAnchor] = useState(null);\n\n // If we get an error while entering code re-focus the code entry\n // Also re-focus once we finish loading two factor authentications\n useEffect(() => {\n if (\n step === LoginStep.VerifyAuthenticator &&\n (errorMessage || !isLoading) &&\n codeInputRef.current\n ) {\n codeInputRef.current.focus();\n }\n }, [errorMessage, step, isLoading]);\n\n const handleCodeUpdated = useCallback(\n (e: ChangeEvent) => onCodeUpdated(e.target.value),\n [onCodeUpdated]\n );\n\n const handleRememberDeviceChange = useCallback(\n (e: ChangeEvent) => onRememberDeviceChange(e.target.checked),\n [onRememberDeviceChange]\n );\n\n const handleProviderChange = useCallback(\n (e: ChangeEvent) => {\n const matchingTwoFactorAuthentication = twoFactorAuthentications.find(\n (twoFactorAuthentication) => twoFactorAuthentication.id === e.target.value\n );\n\n onProviderChange(matchingTwoFactorAuthentication);\n },\n [onProviderChange, twoFactorAuthentications]\n );\n\n const handleOpenPopover = useCallback((e: MouseEvent) => {\n setPopoverAnchor(e.currentTarget);\n }, []);\n\n const handleClosePopover = useCallback(() => setPopoverAnchor(null), []);\n\n const handleResendCode = useCallback(() => {\n onResendCode();\n setPopoverAnchor(null);\n }, [onResendCode]);\n\n return (\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n {twoFactorAuthentications.map((method) => (\n \n {method.displayName}\n \n ))}\n \n\n {errorMessage && {errorMessage}}\n \n \n \n\n \n \n \n \n\n \n \n {twoFactorDisplayName}:\"\n values={{\n twoFactorDisplayName: selectedTwoFactorAuthentication?.displayName,\n Strong,\n }}\n />\n \n\n \n \n\n {selectedTwoFactorAuthentication?.type === TwoFactorAuthenticationType.Sms && (\n \n )}\n \n\n {selectedTwoFactorAuthentication?.type === TwoFactorAuthenticationType.Sms && (\n <>\n \n \n \n\n \n \n \n \n \n \n )}\n\n \n \n }\n label={formatMessage({\n defaultMessage: 'Remember this device for the next 30 days',\n })}\n />\n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(LoginPopupMultipleMethodsPresentation);\n","import { memo, useCallback } from 'react';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport LoginPopupMultipleMethodsPresentation from './LoginPopupMultipleMethods.presentation';\nimport useLoginPopupMultipleMethods from './useLoginPopupMultipleMethods';\n\ninterface Props {\n code: string;\n errorMessage: string;\n isLoading: boolean;\n isOpen?: boolean;\n onClose: () => void;\n onCodeUpdate: (code: string) => void;\n onRememberDeviceChange: (rememberDevice: boolean) => void;\n onSubmitCode: () => void;\n onTwoFactorAuthenticationChange: (\n selectedTwoFactorAuthentication: TwoFactorAuthentication\n ) => void;\n onClearInput: () => void;\n onCallMe: () => void;\n rememberDevice: boolean;\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n twoFactorAuthentications: Array;\n onResendCode: () => void;\n}\n\nconst LoginPopupMultipleMethods = (props: Props): React.JSX.Element => {\n const {\n code,\n errorMessage,\n isLoading = true,\n isOpen = false,\n onClose,\n onCodeUpdate,\n onRememberDeviceChange,\n onSubmitCode,\n onClearInput,\n onTwoFactorAuthenticationChange,\n onResendCode,\n onCallMe,\n rememberDevice,\n selectedTwoFactorAuthentication,\n twoFactorAuthentications,\n } = props;\n\n const [state, actions] = useLoginPopupMultipleMethods({\n onClose,\n onSubmitCode,\n onClearInput,\n });\n\n const handleCodeUpdated = useCallback(\n (verificationCode: string) => {\n const filteredCode = verificationCode.replace(/[^0-9]+/g, '');\n onCodeUpdate(filteredCode);\n },\n [onCodeUpdate]\n );\n\n return (\n \n );\n};\n\nexport default memo(LoginPopupMultipleMethods);\n","import { memo } from 'react';\n\nimport LoginPopupDefaultMethod from '../../defaultMethod/presentation/LoginPopupDefaultMethodDialog';\nimport LoginPopupMultipleMethods from '../../multipleMethods/presentation/LoginPopupMultipleMethods.bindings';\n\nimport { Handlers, State } from './useLoginPopup';\n\ninterface Props {\n handlers: Handlers;\n state: State;\n}\n\nconst LoginPopupPresentation = (props: Props): React.JSX.Element => {\n const { handlers, state } = props;\n\n if (!state.isOpen) {\n return null;\n }\n\n return state.isDefaultTwoFactorAuthenticationMode ? (\n \n ) : (\n \n );\n};\n\nexport default memo(LoginPopupPresentation);\n","import { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nconst localConfig = {\n /**\n * How many digits is the code that is sent to the user (exact digits)\n */\n exactCodeLength: 6,\n};\n\nenum ActionType {\n ResendCode = 'ResendCode',\n BeginCallAuthentication = 'BeginCallAuthentication',\n SelectTwoFactorAuthentication = 'SelectTwoFactorAuthentication',\n SetIsAuthenticationStarted = 'SetIsAuthenticationStarted',\n SetErrorMessage = 'SetErrorMessage',\n SetIsDefaultTwoFactorAuthenticationMode = 'SetIsDefaultTwoFactorAuthenticationMode',\n SetIsLoading = 'SetIsLoading',\n SetIsOpen = 'SetIsOpen',\n SetIsRememberDevice = 'SetIsRememberDevice',\n SetTwoFactorAuthentications = 'SetTwoFactorAuthentications',\n SubmitCode = 'SubmitCode',\n UpdateCode = 'UpdateCode',\n\n QueryBeginAuthentication = 'QueryBeginAuthentication',\n QueryGetTwoFactorAuthentications = 'QueryGetTwoFactorAuthentications',\n QuerySubmitCode = 'QuerySubmitCode',\n QueryBeginCallAuthentication = 'QueryBeginCallAuthentication',\n}\n\n/**\n * The state of the hook.\n */\ninterface State extends QueryState {\n /**\n * The two-factor authentication code.\n */\n code: string;\n /**\n * Any message to display to the user in the case of an unhappy flow.\n */\n errorMessage: string;\n /**\n * Used to track whether the default or alternative two-factor authentication should be used.\n */\n isDefaultTwoFactorAuthenticationMode: boolean;\n /**\n * Tracks loading state.\n */\n isLoading: boolean;\n /**\n * Tracks whether the dialog is displayed.\n */\n isOpen: boolean;\n /**\n * Lets the user select this device as a \"trusted\" device.\n */\n isRememberDevice: boolean;\n /**\n * The default method or the method chosen by the user.\n */\n selectedTwoFactorAuthentication: TwoFactorAuthentication;\n /**\n * A list of all authentication methods associated with this user.\n */\n twoFactorAuthentications: Array;\n}\n\nfunction getInitialState(initializer?: Partial): State {\n const initialState: State = {\n code: '',\n errorMessage: '',\n isDefaultTwoFactorAuthenticationMode: true,\n isLoading: true,\n isOpen: false,\n isRememberDevice: false,\n queries: [],\n selectedTwoFactorAuthentication: undefined,\n twoFactorAuthentications: [],\n };\n\n if (initializer) {\n return { ...initialState, ...initializer };\n }\n\n return initialState;\n}\n\nfunction reducer(state: State, action: Action): State {\n switch (action.type) {\n case ActionType.ResendCode:\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: state.selectedTwoFactorAuthentication?.id,\n },\n ],\n };\n\n case ActionType.SelectTwoFactorAuthentication: {\n const selectedTwoFactorAuthentication = action.payload as TwoFactorAuthentication;\n\n return {\n ...state,\n selectedTwoFactorAuthentication,\n errorMessage: null, // Clear any previous error message during MFA selection\n code: null,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: selectedTwoFactorAuthentication.id,\n },\n ],\n };\n }\n\n case ActionType.SetIsDefaultTwoFactorAuthenticationMode:\n return {\n ...state,\n isDefaultTwoFactorAuthenticationMode: action.payload,\n errorMessage: null, // Clear any previous error message\n code: null, // Clear any previously introduced OTP code\n };\n\n case ActionType.SetIsRememberDevice:\n return {\n ...state,\n isRememberDevice: action.payload,\n };\n\n case ActionType.SetErrorMessage:\n return {\n ...state,\n errorMessage: action.payload,\n isLoading: false,\n };\n\n case ActionType.SubmitCode:\n return {\n ...state,\n isLoading: true,\n queries: [\n {\n type: ActionType.QuerySubmitCode,\n payload: {\n id: state.selectedTwoFactorAuthentication?.id,\n rememberDevice: state.isRememberDevice,\n code: state.code,\n },\n },\n ],\n };\n\n case ActionType.SetIsOpen: {\n const isOpen = action.payload as boolean;\n\n if (isOpen) {\n return {\n ...state,\n isOpen,\n code: '',\n isLoading: true,\n isRememberDevice: false,\n isDefaultTwoFactorAuthenticationMode: true,\n errorMessage: '',\n queries: [\n {\n type: ActionType.QueryGetTwoFactorAuthentications,\n },\n ],\n };\n }\n\n return {\n ...state,\n isOpen,\n };\n }\n\n case ActionType.SetTwoFactorAuthentications: {\n const twoFactorAuthentications = action.payload as Array;\n const defaultTwoFactorAuthentication = twoFactorAuthentications.find((tfa) => tfa.isDefault);\n\n const errorMessage = '';\n const isLoading = false;\n\n if (defaultTwoFactorAuthentication) {\n return {\n ...state,\n errorMessage,\n isLoading,\n isDefaultTwoFactorAuthenticationMode: true,\n selectedTwoFactorAuthentication: defaultTwoFactorAuthentication,\n twoFactorAuthentications,\n queries: [\n {\n type: ActionType.QueryBeginAuthentication,\n payload: defaultTwoFactorAuthentication.id,\n },\n ],\n };\n }\n\n return {\n ...state,\n errorMessage,\n isLoading,\n twoFactorAuthentications: action.payload,\n };\n }\n\n case ActionType.UpdateCode: {\n const code = (action.payload as string).replace(/[^0-9]+/g, '');\n if (code.length > localConfig.exactCodeLength) {\n return state;\n }\n\n return {\n ...state,\n errorMessage: null, // Clear error message when user starts typing\n code,\n };\n }\n\n case ActionType.BeginCallAuthentication:\n return {\n ...state,\n queries: [\n {\n type: ActionType.QueryBeginCallAuthentication,\n payload: state.selectedTwoFactorAuthentication?.id,\n },\n ],\n };\n\n default:\n return { ...state };\n }\n}\n\nexport default reducer;\nexport type { State };\nexport { ActionType, getInitialState };\n","import { ApiError } from '@/features/api';\nimport TwoFactorAuthenticationService, {\n EventType,\n UserSessionTwoFactorStatus,\n} from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\nimport EventsService from '@/legacy/services/eventsService';\nimport { Action } from '@/legacy/utils/reactHelpers';\n\nimport { ActionType } from './LoginPopup.reducer';\n\ntype Dispatchable = (value: T) => void;\n\n/**\n * Callbacks passed to the hook to enable it to interact with external functionality.\n */\ninterface Callbacks {\n /**\n * Requests the view to close.\n */\n onClose: () => void;\n /**\n * Requests to proceed with the login successfully.\n */\n onSuccessfulTwoFactorChallenge: () => void;\n}\n\nfunction handleQueries(\n queries: Array>,\n dispatch: Dispatchable>,\n callbacks: Callbacks\n): void {\n queries.forEach(async (query) => {\n switch (query.type) {\n case ActionType.QueryBeginAuthentication: {\n try {\n const isAuthenticationStarted = await TwoFactorAuthenticationService.beginAuthentication(\n query.payload\n );\n\n if (isAuthenticationStarted) {\n dispatch({\n type: ActionType.SetIsAuthenticationStarted,\n payload: isAuthenticationStarted,\n });\n } else {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n } catch (err) {\n if (err.type && err.type === 'rateLimit.smsAuth') {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Maximum attempts reached. Please try again later.',\n });\n\n break;\n }\n\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n break;\n }\n\n case ActionType.QueryBeginCallAuthentication: {\n const errorMessage = 'Failed initializing authentication via phone call. Please try again.';\n\n try {\n const isAuthenticationStarted =\n await TwoFactorAuthenticationService.beginCallAuthentication(query.payload);\n\n if (isAuthenticationStarted) {\n dispatch({\n type: ActionType.SetIsAuthenticationStarted,\n payload: isAuthenticationStarted,\n });\n } else {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: errorMessage,\n });\n }\n } catch (err) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: errorMessage,\n });\n }\n break;\n }\n\n case ActionType.QueryGetTwoFactorAuthentications: {\n try {\n const twoFactorAuthentications =\n await TwoFactorAuthenticationService.getTwoFactorAuthentications();\n\n dispatch({\n type: ActionType.SetTwoFactorAuthentications,\n payload: twoFactorAuthentications,\n });\n } catch (err) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'Failed initiating authentication. Please try again.',\n });\n }\n break;\n }\n\n case ActionType.QuerySubmitCode: {\n const { onClose, onSuccessfulTwoFactorChallenge } = callbacks;\n const { code, id, rememberDevice } = query.payload;\n\n if (!code) {\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: 'This field is required.',\n });\n return;\n }\n\n try {\n const authenticationResponse = await TwoFactorAuthenticationService.authenticate(id, {\n code,\n rememberDevice,\n });\n\n // Authorized is the only expected response in this case\n if (authenticationResponse.status === UserSessionTwoFactorStatus.Authorized) {\n onSuccessfulTwoFactorChallenge();\n\n EventsService.emit(EventType.UserTwoFactorAuthenticationSuccess);\n } else {\n onClose(); // If we got a different response close the dialog\n dispatch({ type: ActionType.SetIsOpen, payload: false });\n }\n } catch (err) {\n const getErrorMessage = () => {\n const apiError = err as ApiError;\n\n switch (apiError.type) {\n case 'invalid.deviceId':\n // This can happen when SameSite cookie is not set (or cookies were cleared)\n return '3rd party cookies are disabled. Please check your browser configuration.';\n }\n\n return apiError.message;\n };\n\n dispatch({\n type: ActionType.SetErrorMessage,\n payload: getErrorMessage(),\n });\n }\n break;\n }\n }\n });\n}\n\nexport default handleQueries;\n","import { useCallback, useEffect, useReducer } from 'react';\n\nimport { TwoFactorAuthentication } from '@/legacy/features/user/twoFactorAuthentication/twoFactorAuthentication';\n\nimport handleQueries from '../business/LoginPopup.handleQueries';\nimport reducer, { ActionType, getInitialState, State } from '../business/LoginPopup.reducer';\n\n/**\n * All possible callbacks and actions for the LoginPopup hook.\n */\ninterface Handlers {\n /**\n * Switch to multiple authentication mode.\n */\n handleSwitchToMultipleMode: () => void;\n /**\n * Update the two-factor authentication code.\n *\n * ## Example:\n * ```ts\n * const handleCodeChange = useCallback(\n * (e: ChangeEvent) => {\n * handleCodeUpdate(e.target.value);\n * }, [handleCodeUpdate],\n * );\n * ```\n */\n handleCodeUpdate: (code: string) => void;\n /**\n * Submit the two-factor authentication code for verification.\n */\n handleCodeSubmit: () => void;\n /**\n * Sets the \"Remember Device\" checkbox.\n */\n handleRememberDeviceChange: (rememberDevice: boolean) => void;\n /**\n * Sets the selected two-factor authentication.\n */\n handleTwoFactorAuthenticationChange: (twoFactorAuthentication: TwoFactorAuthentication) => void;\n /**\n * Resend the code to the user, if using SMS.\n */\n handleResendCode: () => void;\n /**\n * Call user instead of sending SMS code.\n */\n handleCallMe: () => void;\n /**\n * Closes the dialog.\n */\n handleClose: () => void;\n /**\n * Clears code and error.\n */\n handleClearInput: () => void;\n}\n\ninterface Props {\n isOpen: boolean;\n /**\n * Requests the view to close.\n */\n onClose: () => void;\n /**\n * Requests to proceed with the login successfully.\n */\n onSuccessfulTwoFactorChallenge: () => void;\n}\n\n/**\n * React hook to encapsulate Login Popup business logic.\n * @param callbacks To enable the hook to work with with external modules.\n * {@link Callbacks More information here}.\n * @returns The {@link State state} for the component and all possible {@link Handlers actions}.\n */\nfunction useLoginPopup(props: Props): [State, Handlers] {\n const { isOpen, onClose, onSuccessfulTwoFactorChallenge } = props;\n const [state, dispatch] = useReducer(reducer, getInitialState({ isOpen }));\n\n const handleSwitchToMultipleMode = useCallback(\n () => dispatch({ type: ActionType.SetIsDefaultTwoFactorAuthenticationMode, payload: false }),\n []\n );\n\n const handleCodeUpdate = useCallback(\n (code: string) => dispatch({ type: ActionType.UpdateCode, payload: code }),\n []\n );\n\n const handleCodeSubmit = useCallback(() => dispatch({ type: ActionType.SubmitCode }), []);\n\n const handleRememberDeviceChange = useCallback(\n (rememberDevice: boolean) =>\n dispatch({ type: ActionType.SetIsRememberDevice, payload: rememberDevice }),\n []\n );\n\n const handleTwoFactorAuthenticationChange = useCallback(\n (twoFactorAuthentication: TwoFactorAuthentication) =>\n dispatch({\n type: ActionType.SelectTwoFactorAuthentication,\n payload: twoFactorAuthentication,\n }),\n []\n );\n\n const handleResendCode = useCallback(() => dispatch({ type: ActionType.ResendCode }), []);\n\n const handleCallMe = useCallback(\n () => dispatch({ type: ActionType.BeginCallAuthentication }),\n []\n );\n\n const handleClose = useCallback(() => {\n dispatch({ type: ActionType.SetIsOpen, payload: false });\n onClose();\n }, [onClose]);\n\n const handleClearInput = useCallback(\n () => dispatch({ type: ActionType.UpdateCode, payload: '' }),\n []\n );\n\n useEffect(\n () => {\n handleQueries(state.queries, dispatch, { onClose, onSuccessfulTwoFactorChallenge });\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [state.queries]\n );\n\n // Knockout (or React) will eventually set isOpen to true which will initiate open dialog logic\n useEffect(() => {\n dispatch({ type: ActionType.SetIsOpen, payload: isOpen });\n }, [isOpen]);\n\n return [\n state,\n {\n handleSwitchToMultipleMode,\n handleCodeUpdate,\n handleCodeSubmit,\n handleRememberDeviceChange,\n handleTwoFactorAuthenticationChange,\n handleResendCode,\n handleClose,\n handleClearInput,\n handleCallMe,\n },\n ];\n}\n\nexport default useLoginPopup;\nexport type { Handlers, Props, State };\n","import { memo } from 'react';\n\nimport LoginPopupPresentation from './LoginPopup.presentation';\nimport useLoginPopup, { Props as LoginPopupHookProps } from './useLoginPopup';\n\ntype Props = LoginPopupHookProps;\n\nconst LoginPopupBindings = (props: Props): React.JSX.Element => {\n const [state, handlers] = useLoginPopup(props);\n return ;\n};\n\nexport default memo(LoginPopupBindings);\n","import { memo, MouseEvent, useCallback, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Box, Link, MenuItem, Popover } from '@mui/material';\n\ninterface Props {\n onResendCode: () => void;\n onCallMe: () => void;\n}\n\nconst SmsBackupOptions = (props: Props): React.JSX.Element => {\n const { onCallMe, onResendCode } = props;\n\n const [popoverAnchor, setPopoverAnchor] = useState(null);\n\n const handleClosePopover = useCallback(() => {\n setPopoverAnchor(null);\n }, []);\n\n const handleResendCode = useCallback(() => {\n onResendCode();\n setPopoverAnchor(null);\n }, [onResendCode]);\n\n const handleCallMe = useCallback(() => {\n onCallMe();\n setPopoverAnchor(null);\n }, [onCallMe]);\n\n const handleOpenPopover = useCallback((e: MouseEvent) => {\n setPopoverAnchor(e.currentTarget);\n }, []);\n\n return (\n <>\n \n {/* FIXME: make this anchor a button */}\n {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}\n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default memo(SmsBackupOptions);\n","export default class Constants {\n static readonly MAX_NUMBER_OF_2FAS_PER_TYPE = 2;\n}\n","import { ApiService } from '@/features/api';\n\nimport SingleSignOnLoginRequest from '../models/singleSignOnLoginRequest';\n\nfunction getSingleSignOnLoginRequest(email: string): Promise {\n return ApiService.post(\n `${import.meta.env.APP_URLS_API_URL}/v1/singleSignOn/login`,\n {\n body: email,\n }\n );\n}\n\nfunction getUserSessionFromCode(code: string): Promise {\n return ApiService.get(\n `${import.meta.env.APP_URLS_API_URL}/v1/singleSignOn/userSession?code=${code}`,\n null,\n true\n );\n}\n\nexport { getSingleSignOnLoginRequest, getUserSessionFromCode };\n","/* eslint-disable arrow-body-style */\n\nimport { once } from 'lodash-es';\n\nimport { RECAPTCHA_V2_KEY } from '@/config/env';\n\nconst recaptchaKey = RECAPTCHA_V2_KEY;\n\n/** Resolves when reCAPTCHA has finished loading. */\nconst waitForReady = once(\n () =>\n new Promise((resolve) => {\n window.grecaptcha.ready(resolve);\n })\n);\n\n/**\n * Takes in an HTML element and binds Google reCAPTCHA to it.\n * @returns widgetId that can be used on grecaptcha.getResponse() and grecaptcha.execute()\n */\nconst getRecaptchaWidgetId = async (\n recaptchaElement: HTMLElement | string,\n callback: () => void\n): Promise => {\n if (!recaptchaKey) {\n return ''; // No recaptcha required if key is not set for localhost testing\n }\n\n await waitForReady();\n\n const recaptchaWidgetId = window.grecaptcha.render(recaptchaElement, {\n sitekey: recaptchaKey,\n\n // This callback is triggered after .getResponse()/.execute() is called in QuerySubmitLoginForm\n callback,\n size: 'invisible',\n });\n\n return recaptchaWidgetId;\n};\n\n/**\n * Takes in a widgetId that was generated from getRecaptchaWidgetId()\n * @returns reCAPTCHA response that needs to be passed together with a form to backend\n */\nconst getRecaptchaResponse = async (recaptchaWidgetId: string): Promise => {\n if (!recaptchaKey) {\n return 'NOT_REQUIRED'; // Not required in localhost\n }\n\n await waitForReady();\n\n const recaptchaResponse = window.grecaptcha.getResponse(recaptchaWidgetId);\n\n if (!recaptchaResponse) {\n window.grecaptcha.execute(recaptchaWidgetId);\n }\n\n return recaptchaResponse;\n};\n\n/**\n * Returns true if reCAPTCHA is configured (by default there is no key on localhost)\n */\nconst isRecaptchaEnabled = (): boolean => {\n return !!recaptchaKey;\n};\n\n/**\n * Resets reCAPTCHA state on current Window object\n */\nconst resetRecaptcha = async (): Promise => {\n try {\n if (isRecaptchaEnabled()) {\n await waitForReady();\n window.grecaptcha.reset();\n }\n } catch (recaptchaErr) {\n // ignore error\n }\n};\n\nexport { getRecaptchaResponse, getRecaptchaWidgetId, isRecaptchaEnabled, resetRecaptcha };\n","import * as dialog from 'plugins/dialog';\n\nimport BaseModal from '@/legacy/modals/BaseModal';\n\ndeclareModules({\n 'modals/genericInfoModal.html': () => import('@/legacy/modals/genericInfoModal.html'),\n});\n\ninterface GenericInfoButton {\n title: string;\n cssClass: string;\n}\ninterface ViewModelParams {\n message: string;\n title: string;\n continueButtonLabel?: string;\n cancelButtonLabel?: string;\n /**\n * If set the Yes/No buttons locations will be swapped and \"No\" option will have primary color\n * */\n swapButtons?: boolean;\n}\n\nclass StyledModal extends BaseModal {\n view = 'modals/genericInfoModal';\n\n public params: ViewModelParams;\n\n constructor(params: ViewModelParams) {\n super();\n params.continueButtonLabel = params.continueButtonLabel ? params.continueButtonLabel : 'Yes';\n params.cancelButtonLabel = params.cancelButtonLabel ? params.cancelButtonLabel : 'No';\n params.swapButtons = !!params.swapButtons;\n\n this.params = params;\n }\n\n public close(): void {\n return dialog.close(this, 'Yes');\n }\n\n public cancel(): void {\n return dialog.close(this, 'No');\n }\n\n public static show(params: ViewModelParams): JQueryPromise {\n return dialog.show(new StyledModal(params));\n }\n}\n\nexport default StyledModal;\n","import * as React from 'react';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\ninterface Props {\n title: React.ReactNode;\n message: React.ReactNode;\n onClose: () => void;\n}\nconst TitleMessageDialog: React.FC = ({ title, message, onClose }) => (\n \n {title}\n \n {message}\n \n \n \n \n \n);\n\nexport default React.memo(TitleMessageDialog);\n","/* eslint-disable no-await-in-loop */ // Effecting query/pattern usability\n\nimport { Dispatch } from 'react';\n\nimport {\n getRecaptchaResponse,\n getRecaptchaWidgetId,\n isRecaptchaEnabled,\n} from '@/legacy/features/user/twoFactorAuthentication/recaptcha/recaptcha.helpers';\nimport * as UserService from '@/legacy/services/user';\nimport { UserLoginResponse } from '@/legacy/services/user';\nimport { Action, QueryState } from '@/legacy/utils/reactHelpers';\n\nenum ActionType {\n SubmitForm = 'SubmitForm',\n UpdatePassword = 'UpdatePassword',\n UpdateErrorMessage = 'UpdateErrorMessage',\n Logout = 'Logout',\n UpdateRecaptchaWidgetId = 'UpdateRecaptchaWidgetId',\n StartFormSubmit = 'StartFormSubmit',\n\n ShowTwoFactorCodeDialog = 'ShowTwoFactorCodeDialog',\n CloseTwoFactorCodeDialog = 'CloseTwoFactorCodeDialog',\n\n ShowTwoFactorSignupDialog = 'ShowTwoFactorSignupDialog',\n CloseTwoFactorSignupDialog = 'CloseTwoFactorSignupDialog',\n\n QuerySubmitLoginForm = 'QuerySubmitLoginForm',\n QueryLogout = 'QueryLogout',\n QueryRecaptchaWidget = 'QueryRecaptchaWidget',\n QueryLoginSuccess = 'QueryLoginSuccess',\n}\n\ninterface QuerySubmitLoginFormPayload {\n email: string;\n password: string;\n recaptchaWidgetId: string;\n}\n\ninterface UpdateErrorMessagePayload {\n errorMessage: string;\n\n /**\n * If an error is \"blocking\" then the entire form is disabled (logout button still works)\n */\n isBlocking?: boolean;\n\n /**\n * If set to true clears the password\n */\n resetPassword?: boolean;\n}\n\ninterface CloseTwoFactorCodeDialogPayload {\n /**\n * If true the 2FA code challenge was entered successfully\n * If false the user clicked back button in 2FA entry popup\n */\n isSuccessful: boolean;\n}\n\ninterface LoginCallbacks {\n onLoginSuccess?: () => void;\n onLogout?: () => void;\n}\n\ninterface State extends QueryState {\n email: string;\n password: string;\n errorMessage: string | null;\n isLoading: boolean;\n\n /**\n * This is reCAPTCHA widget id that is sent from QueryRecaptchaWidget query (on load)\n */\n recaptchaWidgetId?: string;\n\n isTwoFactorCodePopupOpen: boolean;\n isTwoFactorSignupOpen: boolean;\n}\nconst getInitialState = (initializer?: Partial): State => {\n const initialState: State = {\n email: '',\n password: '',\n errorMessage: null,\n isLoading: true, // By default we'll be loading until recaptcha is fully loaded\n isTwoFactorCodePopupOpen: false, // Shows when 2fa code is required\n isTwoFactorSignupOpen: false, // Shows when 2fa signup is required\n\n queries: [\n {\n type: ActionType.QueryRecaptchaWidget, // On load bind to recaptcha\n },\n ],\n };\n\n return {\n ...initialState,\n ...initializer,\n };\n};\n\nconst localConfig = {\n /**\n * This maximum password length matches the backend binding model\n */\n maxPasswordLength: 100,\n};\n\nconst reducer = (state: State, action: Action): State => {\n const { payload, type } = action;\n\n switch (type) {\n case ActionType.SubmitForm: {\n const { email, password, recaptchaWidgetId } = state;\n\n return {\n ...state,\n errorMessage: null, // Clear any errors\n\n queries: [\n {\n type: ActionType.QuerySubmitLoginForm,\n payload: {\n email,\n password,\n recaptchaWidgetId,\n } as QuerySubmitLoginFormPayload,\n },\n ],\n };\n }\n\n case ActionType.UpdatePassword: {\n if (payload.length >= localConfig.maxPasswordLength) {\n return state;\n }\n\n return {\n ...state,\n password: payload as string,\n errorMessage: null, // Clear any errors\n };\n }\n\n case ActionType.ShowTwoFactorCodeDialog:\n return {\n ...state,\n isTwoFactorCodePopupOpen: true,\n password: '',\n isLoading: false,\n };\n\n case ActionType.CloseTwoFactorCodeDialog: {\n const { isSuccessful } = payload as CloseTwoFactorCodeDialogPayload;\n const getSuccessQuery = () => {\n if (!isSuccessful) {\n return {};\n }\n\n // If user entered 2FA code then we'll close the code and callback props.onLoginSuccess\n return {\n queries: [\n {\n type: ActionType.QueryLoginSuccess,\n },\n ],\n };\n };\n\n return {\n ...state,\n isTwoFactorCodePopupOpen: isSuccessful, // If it's successful we'll show the popup until the whole dialog is closed\n ...getSuccessQuery(),\n };\n }\n\n case ActionType.ShowTwoFactorSignupDialog:\n return {\n ...state,\n isTwoFactorSignupOpen: true,\n password: '',\n isLoading: false,\n };\n\n case ActionType.CloseTwoFactorSignupDialog:\n return {\n ...state,\n isTwoFactorSignupOpen: false,\n };\n\n case ActionType.UpdateErrorMessage: {\n const { errorMessage, isBlocking, resetPassword } = payload as UpdateErrorMessagePayload;\n\n return {\n ...state,\n errorMessage,\n password: resetPassword ? '' : state.password, // Optionally clears password entry on error\n isLoading: isBlocking, // Re-enables form (if non-blocking)\n };\n }\n case ActionType.UpdateRecaptchaWidgetId: {\n return {\n ...state,\n recaptchaWidgetId: payload as string,\n isLoading: false,\n };\n }\n\n case ActionType.StartFormSubmit: {\n return {\n ...state,\n isLoading: true,\n };\n }\n\n case ActionType.Logout: {\n return {\n ...state,\n queries: [{ type: ActionType.QueryLogout }],\n };\n }\n\n default:\n return { ...state };\n }\n};\n\nconst handleQueries = async (\n queries: Array>,\n dispatch: Dispatch>,\n callbacks: LoginCallbacks\n): Promise => {\n const showPasswordError = ({\n errorMessage,\n isBlocking = false,\n resetPassword = true,\n }: UpdateErrorMessagePayload) => {\n // @todo figure out how to focus on error field\n dispatch({\n type: ActionType.UpdateErrorMessage,\n payload: {\n errorMessage,\n isBlocking,\n resetPassword,\n },\n });\n };\n\n for (const { type, payload } of queries) {\n switch (type) {\n case ActionType.QueryRecaptchaWidget: {\n // If we fail loading recaptcha or for some reason element isn't in DOM block form.\n const recaptchaElement = document.getElementById('sessionTimeout-recaptcha');\n if (!recaptchaElement) {\n showPasswordError({\n errorMessage: 'Failed loading Google reCAPTCHA. Please logout to continue.',\n isBlocking: true,\n });\n break;\n }\n\n try {\n const recaptchaWidgetId = await getRecaptchaWidgetId(recaptchaElement, () => {\n // Re-submit the form (which will trigger QuerySubmitLoginForm again)\n dispatch({\n type: ActionType.SubmitForm,\n });\n });\n\n dispatch({\n type: ActionType.UpdateRecaptchaWidgetId,\n payload: recaptchaWidgetId,\n });\n } catch (err) {\n showPasswordError({\n errorMessage: 'Failed binding Google reCAPTCHA. Please logout to continue.',\n isBlocking: true,\n });\n break;\n }\n\n break;\n }\n case ActionType.QueryLogout: {\n if (callbacks.onLogout) {\n callbacks.onLogout();\n }\n break;\n }\n case ActionType.QueryLoginSuccess: {\n if (callbacks.onLoginSuccess) {\n callbacks.onLoginSuccess();\n }\n break;\n }\n\n case ActionType.QuerySubmitLoginForm: {\n try {\n const { email, password, recaptchaWidgetId } = payload as QuerySubmitLoginFormPayload;\n\n const recaptchaV2Response = await getRecaptchaResponse(recaptchaWidgetId);\n if (!recaptchaV2Response) {\n return;\n }\n\n // If we get here the user has successfully completed recaptcha\n dispatch({\n type: ActionType.StartFormSubmit,\n });\n\n const userLoginResult = await UserService.Instance.Login({\n email,\n passphrase: password,\n recaptchaV2Response,\n });\n\n const userLoginResponse = userLoginResult.userLoginResponse as UserLoginResponse;\n switch (userLoginResponse) {\n case UserLoginResponse.TwoFactorAuthenticationRequired:\n dispatch({\n type: ActionType.ShowTwoFactorCodeDialog,\n });\n break;\n case UserLoginResponse.Successful:\n if (callbacks.onLoginSuccess) {\n callbacks.onLoginSuccess();\n }\n break;\n case UserLoginResponse.TwoFactorComplianceRequired:\n case UserLoginResponse.TwoFactorSignupRequired:\n dispatch({\n type: ActionType.ShowTwoFactorSignupDialog,\n });\n break;\n }\n } catch (err) {\n if (!err || !err.error) {\n showPasswordError({\n errorMessage: 'Could not connect to Plooto login server. Please try again later.',\n });\n return;\n }\n\n switch (err.type) {\n case 'invalid.user':\n showPasswordError({\n errorMessage: 'Incorrect password. Please try again.',\n });\n break;\n case 'invalid.recaptchav2':\n case 'incorrect.captcha':\n showPasswordError({\n errorMessage: 'Incorrect captcha response. Please try again.',\n });\n break;\n case 'rateLimit.login':\n showPasswordError({\n errorMessage: 'Login rate limited exceeded. Please try again later.',\n });\n break;\n\n default:\n showPasswordError({\n errorMessage: 'Unexpected login error. Please try again later.',\n });\n break;\n }\n\n // Attempt to reset recaptcha on any error\n try {\n if (isRecaptchaEnabled()) {\n window.grecaptcha.reset();\n }\n } catch (recaptchaErr) {\n // Silently handled\n }\n }\n }\n }\n }\n};\n\nexport { State, ActionType, getInitialState, handleQueries, reducer, LoginCallbacks };\n","import { FormEvent, memo } from 'react';\nimport { FormattedMessage, useIntl } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n TextField,\n Typography,\n} from '@mui/material';\n\nimport LoadingButton from '@/components/LoadingButton';\n\nimport { State } from './SessionTimeout.reducer';\n\ninterface Props {\n state: Pick;\n isOpen: boolean;\n\n onSubmit: () => void;\n onLogout: () => void;\n onChangePassword: (password: string) => void;\n}\n\nconst SessionTimeoutDialog = ({ state, isOpen, onSubmit, onLogout, onChangePassword }: Props) => {\n const { formatMessage } = useIntl();\n\n const handleSubmit = (event: FormEvent) => {\n event.preventDefault();\n onSubmit();\n };\n\n return (\n <>\n \n \n \n \n \n \n \n \n \n \n \n onChangePassword(event.target.value)}\n autoComplete=\"off\"\n error={!!state.errorMessage}\n helperText={state.errorMessage}\n disabled={state.isLoading}\n margin=\"normal\"\n />\n \n \n \n \n \n \n \n \n {/* This element is used for reCAPTCHA (bound in QueryRecaptchaWidget on load) */}\n
\n \n );\n};\n\nexport type { Props as SessionTimeoutDialogProps };\nexport default memo(SessionTimeoutDialog);\n","import { useEffect, useReducer } from 'react';\n\nimport LoginPopup from '@/legacy/components/user/twoFactorAuthentication/loginPopupTwoFactor/root/presentation/LoginPopup.bindings';\nimport TwoFactorSetupDialog from '@/legacy/components/user/twoFactorAuthentication/TwoFactorSetupDialog/TwoFactorSetupDialog';\n\nimport {\n ActionType,\n getInitialState,\n handleQueries,\n LoginCallbacks,\n reducer,\n State,\n} from './SessionTimeout.reducer';\nimport SessionTimeoutDialog from './SessionTimeoutDialog';\n\ninterface Props extends LoginCallbacks {\n email: string;\n}\n\nconst SessionTimeoutFragment = (props: Props): React.JSX.Element => {\n const { email } = props;\n\n const initialState = getInitialState({\n email,\n });\n\n const [state, dispatch] = useReducer(reducer, initialState);\n\n // We'll pass down state without queries so we don't re-render if queries change\n const { queries, ...stateWithoutQueries } = state;\n\n useEffect(\n () => {\n handleQueries(queries, dispatch, props);\n /**\n * Queries need to be cleared so that it's safe to call handleQueries multiple times.\n * @todo (Mark) investigate this.\n */\n },\n // Intentionally only run this effect when state.queries changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [queries]\n );\n\n // @todo add useCallbacks here\n\n const handleLogout = () => {\n dispatch({\n type: ActionType.Logout,\n });\n };\n\n const handleSubmit = () => {\n dispatch({\n type: ActionType.SubmitForm,\n });\n };\n\n const handleChangePassword = (password: string) => {\n dispatch({\n type: ActionType.UpdatePassword,\n payload: password,\n });\n };\n\n const handleCloseTwoFactorCodePopup = () => {\n dispatch({\n type: ActionType.CloseTwoFactorCodeDialog,\n payload: { isSuccessful: false },\n });\n };\n\n const handleSuccessfulTwoFactorChallenge = () => {\n dispatch({\n type: ActionType.CloseTwoFactorCodeDialog,\n payload: { isSuccessful: true },\n });\n };\n\n const handleCloseSignupDialog = () => {\n dispatch({\n type: ActionType.CloseTwoFactorSignupDialog,\n });\n };\n\n return (\n <>\n \n \n \n \n );\n};\n\nexport default SessionTimeoutFragment;\n","import { useRef } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogContentText,\n DialogTitle,\n} from '@mui/material';\n\nimport { LoginCallbacks } from '@/legacy/components/user/signin/sessionTimeout/SessionTimeout.reducer';\nimport { getSingleSignOnLoginRequest } from '@/legacy/features/user/singleSignOn/services/api';\n\ninterface SsoSessionTimeoutDialogProps extends LoginCallbacks {\n email: string;\n isOpen: boolean;\n}\n\nfunction getRoute(): string {\n return window.location.hash;\n}\n\nconst SsoSessionTimeoutDialog = (props: SsoSessionTimeoutDialogProps): React.JSX.Element => {\n const { email, isOpen, onLogout } = props;\n const formRef = useRef(null);\n const samlRequestRef = useRef(null);\n\n const handleLogout = () => {\n onLogout();\n };\n\n const handleLogin = () => {\n getSingleSignOnLoginRequest(email).then((response) => {\n formRef.current.action = response.url;\n samlRequestRef.current.value = response.samlRequest;\n formRef.current.submit();\n });\n };\n\n return (\n \n \n \n \n \n \n \n \n\n
\n \n \n
\n\n \n \n\n \n \n
\n \n );\n};\n\nexport { SsoSessionTimeoutDialogProps };\nexport default SsoSessionTimeoutDialog;\n","import * as app from 'durandal/app';\nimport * as dialog from 'plugins/dialog';\nimport * as segmentAnalytics from 'segmentAnalytics';\n\nimport SessionTimeoutFragment from '@/legacy/components/user/signin/sessionTimeout/SessionTimeoutFragment';\nimport SsoSessionTimeoutDialog from '@/legacy/components/user/signin/ssoSessionTimeout/SsoSessionTimeoutDialog';\nimport BaseModal from '@/legacy/modals/BaseModal';\nimport RealtimeEvent from '@/legacy/services/realtime/models/realtimeEvent';\nimport * as userService from '@/legacy/services/user';\n\nimport { EventName, FormEventType } from '../features/analytics/helper';\n\ndeclareModules({\n 'modals/sessionTimeout.html': () => import('@/legacy/modals/sessionTimeout.html'),\n});\n\nclass SessionTimeout extends BaseModal {\n view = 'modals/sessionTimeout';\n\n public react = {\n fragments: {\n SessionTimeoutFragment,\n SsoSessionTimeoutDialog,\n },\n };\n\n public email: string;\n\n public showSsoTimeoutModal = ko.pureComputed({\n read: () =>\n userService.Instance.isSsoUser() && !userService.Instance.profile()?.isSsoAdminUser(),\n deferEvaluation: true,\n });\n\n /**\n * This field ensures that only one SessionTimeout dialog is rendered, and de-duplicates calls\n * that happen in error handlers and whatnot. It should resolve when the dialog closes.\n */\n private static dialogPromise: Promise | null = null;\n\n constructor(email: string) {\n super();\n this.email = email;\n }\n\n public onLoginSuccess() {\n dialog.close(this, true);\n }\n\n public onLogout() {\n segmentAnalytics.track(EventName.UserSignedOut, {\n source: FormEventType.ButtonClicked,\n });\n\n segmentAnalytics.reset();\n\n userService.Instance.Logout();\n }\n\n public static show(email: string): Promise {\n if (SessionTimeout.dialogPromise != null) {\n return SessionTimeout.dialogPromise;\n }\n\n const sessionTimeoutDialog = new SessionTimeout(email);\n SessionTimeout.dialogPromise = Promise.resolve(dialog.show(sessionTimeoutDialog)).then(Boolean);\n\n // If we lose connection with SignalR while timeout is visible logout the user\n const realtimeListener = app.on(RealtimeEvent.Offline).then(() => {\n dialog.close(sessionTimeoutDialog, undefined); // This will call Logout()\n }, this);\n\n SessionTimeout.dialogPromise.finally(() => {\n SessionTimeout.dialogPromise = null;\n realtimeListener.off();\n });\n\n return SessionTimeout.dialogPromise;\n }\n\n /** Returns `true` if the SessionTimeout dialog is currently displayed. */\n public static get isDisplayed() {\n return this.dialogPromise != null;\n }\n}\n\nexport default SessionTimeout;\n","class UnsavedChangesConfirmationService {\n public hasChanges = (): boolean => null;\n\n public showConfirmationDialog = false;\n}\n\nconst Instance = new UnsavedChangesConfirmationService();\nexport default Instance;\n","import * as app from 'durandal/app';\nimport * as system from 'durandal/system';\n\nimport * as companyService from '@/legacy/services/company';\nimport * as companyPaymentService from '@/legacy/services/company/payment';\nimport * as userService from '@/legacy/services/user';\nimport * as plootoUtils from '@/legacy/utils/plooto';\n\nconst API_PREFIX = 'v1';\n\nexport class PromoCodeApplyCodeViewModel {\n public id: string;\n\n public expiry: string;\n\n public totalFreeTransactions: number;\n\n public addedFreeTransactions: number;\n}\n\nexport class PromoCodeService {\n private companyService: companyService.CompanyService;\n\n private userService: userService.UserService;\n\n constructor() {\n this.companyService = companyService.Instance;\n this.userService = userService.Instance;\n\n this.BindPaymentEventCallbacks();\n }\n\n private BindPaymentEventCallbacks() {\n // Bind to a few extra events so we can adjust our free transactions accordingly\n app.on('payment:create').then((createdPayment: companyPaymentService.Payment) => {\n const { freeTransactions } = this.companyService.profile();\n if (createdPayment.freeTransactionUsed()) {\n freeTransactions(freeTransactions() - 1); // Remove 1 free transaction\n }\n });\n\n const decreaseFreeTransaction = (deletedPayment: companyPaymentService.Payment) => {\n const { freeTransactions } = this.companyService.profile();\n if (deletedPayment.freeTransactionUsed()) {\n freeTransactions(freeTransactions() + 1); // Add back 1 free transaction\n }\n };\n\n app.on('payment:delete').then(decreaseFreeTransaction);\n app.on('payment:reject').then(decreaseFreeTransaction);\n }\n\n public PutApplyCode(code: string): JQueryPromise {\n const companyId: string = this.companyService.CompanyId();\n if (companyId === undefined) {\n return undefined;\n }\n\n return system\n .defer((dfd) => {\n this.userService\n .AuthorizedPut(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/promoCodes/applyCode`,\n {\n code,\n }\n )\n .done((exchangeRateData) => {\n if (\n plootoUtils.IsNullOrUndefined(exchangeRateData) ||\n exchangeRateData.error === true\n ) {\n dfd.reject(exchangeRateData);\n return;\n }\n dfd.resolve(exchangeRateData);\n })\n .fail(() => {\n dfd.reject();\n });\n })\n .promise();\n }\n}\n\nexport const Instance = new PromoCodeService();\n","class Routers {\n public static Root: DurandalRouter = null;\n\n public static User: DurandalRouter = null;\n\n public static Settings: DurandalRouter = null;\n}\n\nexport default Routers;\n","import app from 'durandal/app';\nimport $ from 'jquery';\n\nimport { ApiService } from '@/features/api';\nimport SessionTimeout from '@/legacy/modals/sessionTimeout';\nimport * as userService from '@/legacy/services/user';\n\n/** Time to wait before presenting a session reactivation dialog. */\nconst SESSION_TIMEOUT = 16 * 60 * 1000;\n\n/** Time to wait for session reactivation before automatically killing it. */\nconst SESSION_KILL = 5 * 60 * 1000;\n\n/** Time between user activity pings (mouse movement, etc.) */\nconst PING_INTERVAL = 10 * 60 * 1000;\n\nclass SessionTimeoutService {\n private sessionTimeout: ReturnType;\n\n private sessionKill: ReturnType;\n\n private lastPing: number;\n\n constructor() {\n // To avoid creating a circular dependency chain between this and UserService (and the dialog\n // viewmodel), expose the public methods to the Durandal event bus so that indirect calls can be\n // made after module initialization.\n app.on('user:keepSessionAlive').then(this.keepSessionAlive);\n app.on('user:resetSessionTimeout').then(this.resetSessionTimeout);\n app.on('user:showSessionTimeout').then(this.showTimeout);\n $(window).on('focus resize mousemove keyup', this.keepSessionAlive);\n }\n\n private keepSessionAlive = () => {\n if (userService.Instance.IsAuthenticated() && !SessionTimeout.isDisplayed) {\n if (this.lastPing == null || Date.now() - this.lastPing > PING_INTERVAL) {\n this.resetSessionTimeout();\n this.ping();\n }\n }\n };\n\n private setLastSessionActionToNow() {\n try {\n localStorage.setItem('lastSessionAction', Date.now().toString());\n } catch {\n // do nothing\n }\n }\n\n private getLastSessionAction() {\n try {\n const valueAsString = localStorage.getItem('lastSessionAction');\n const value = valueAsString ? Number.parseInt(valueAsString, 10) : Number.NaN;\n return Number.isNaN(value) ? null : value;\n } catch {\n return null;\n }\n }\n\n private getTimeSinceLastSession() {\n const lastSessionAction = this.getLastSessionAction();\n return lastSessionAction != null ? Date.now() - lastSessionAction : null;\n }\n\n private disconnectSession() {\n userService.Instance.clearAuthenticationToken();\n\n if (!userService.Instance.IsAuthenticated()) {\n return;\n }\n\n this.showTimeout();\n\n // force session termination if timer runs out\n const resetSessionKill = (waitMs: number) => {\n if (this.sessionKill != null) {\n clearTimeout(this.sessionKill);\n this.sessionKill = undefined;\n }\n\n this.sessionKill = setTimeout(() => {\n this.sessionKill = undefined;\n\n // Ensure user didn't interact with any other Plooto windows. If they did, keep this session\n // alive.\n const timeSinceLastSession = this.getTimeSinceLastSession();\n if (timeSinceLastSession != null) {\n const nextWaitMs = SESSION_TIMEOUT + SESSION_KILL - timeSinceLastSession;\n if (nextWaitMs > 0) {\n resetSessionKill(nextWaitMs);\n return;\n }\n }\n\n // check if connection is still available\n userService.Instance.Logout();\n }, waitMs);\n };\n\n resetSessionKill(SESSION_KILL);\n }\n\n private resetSessionTimeout = () => {\n // Only set last action in localStorage if user has a valid token. We'll use this timestamp for\n // cross-window sessions.\n if (userService.Instance.hasAuthenticationToken()) {\n this.setLastSessionActionToNow();\n }\n\n if (this.sessionKill != null) {\n clearTimeout(this.sessionKill);\n this.sessionKill = undefined;\n }\n\n const startSessionTimeout = (waitMs: number) => {\n if (this.sessionTimeout != null) {\n clearTimeout(this.sessionTimeout);\n this.sessionTimeout = undefined;\n }\n\n this.sessionTimeout = setTimeout(() => {\n this.sessionTimeout = undefined;\n\n // Ensure user didn't interact with any other Plooto windows. If they did, keep this session\n // alive.\n const timeSinceLastSession = this.getTimeSinceLastSession();\n if (timeSinceLastSession != null) {\n const nextWaitMs = SESSION_TIMEOUT - timeSinceLastSession;\n if (nextWaitMs > 0) {\n startSessionTimeout(nextWaitMs);\n return;\n }\n }\n\n this.disconnectSession();\n }, waitMs);\n };\n\n startSessionTimeout(SESSION_TIMEOUT);\n };\n\n public showTimeout = (eventArgs?: { reloadAfterAuthenticate?: boolean }) =>\n SessionTimeout.show(userService.Instance.DisplayEmail()).then((didAuthenticate) => {\n if (didAuthenticate && eventArgs?.reloadAfterAuthenticate === true) {\n window.location.reload();\n }\n return didAuthenticate;\n });\n\n private ping(): void {\n this.lastPing = Date.now();\n ApiService.post(`${import.meta.env.APP_URLS_API_URL}/v1/user/ping`);\n }\n}\n\nconst Instance = new SessionTimeoutService();\n\nexport { Instance as SessionTimeoutService };\n","import * as system from 'durandal/system';\n\nimport * as userService from '@/legacy/services/user';\nimport * as verificationService from '@/legacy/services/verification/verification';\nimport * as plootoUtils from '@/legacy/utils/plooto';\nimport * as viewModels from '@/legacy/viewmodels/viewModels';\n\nconst API_PREFIX = 'v1';\n\nexport enum AccountVerificationStatus {\n Pending = 0,\n PinPending,\n PinSent,\n PinFailed,\n UploadRequired,\n Completed,\n Processing,\n}\nexport class AccountVerificationResult {\n public status: AccountVerificationStatus;\n\n public accountId: string;\n\n public priority: boolean;\n\n public currency: string;\n\n public microDepositStatus: string;\n\n public microDepositError: string;\n\n public displayName: string;\n\n public maskedAccountNumber: string;\n}\n\nexport class VerificationUserService {\n public VerifyIdentity(formData: FormData): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedUpload(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/users/verification`,\n formData\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostIdentityPersonalInformation(\n personalInformation: verificationService.PersonalInformationBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/users/verification/personalInformation`,\n personalInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public PostIdentityAddressInformation(\n addressInformation: verificationService.AddressInformationBindingModel\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedPost(\n `${import.meta.env.APP_URLS_API_URL}/${API_PREFIX}/users/verification/addressInformation`,\n addressInformation\n )\n .done((verificationInfo: verificationService.VerificationStatus) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo as any);\n })\n .fail((verificationInfo: verificationService.VerificationStatus) => {\n dfd.reject(verificationInfo);\n });\n })\n .promise();\n }\n\n public GetVerifyIdentityStatus(\n companyId: string,\n userId: string\n ): JQueryPromise {\n return system\n .defer((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/users/${userId}/status`\n )\n .then((verificationInfo) => {\n if (plootoUtils.IsNullOrUndefined(verificationInfo) || verificationInfo.error) {\n dfd.reject(verificationInfo);\n return;\n }\n dfd.resolve(verificationInfo);\n })\n .fail((error) => {\n dfd.reject(error);\n });\n })\n .promise();\n }\n\n public GetAccountVerificationStatus(companyId): JQueryPromise> {\n return system\n .defer>((dfd) => {\n userService.Instance.AuthorizedGet(\n `${\n import.meta.env.APP_URLS_API_URL\n }/${API_PREFIX}/companies/${companyId}/verification/accounts`\n )\n .then((accountVerificationStatus: any) => {\n if (\n plootoUtils.IsNullOrUndefined(accountVerificationStatus) ||\n accountVerificationStatus.error\n ) {\n dfd.reject(accountVerificationStatus);\n return;\n }\n dfd.resolve(accountVerificationStatus);\n })\n .fail((accountVerificationStatus) => {\n dfd.reject(accountVerificationStatus);\n });\n })\n .promise();\n }\n}\nexport const Instance = new VerificationUserService();\n","import { ApiDateFormat, DisplayDateFormat, formatLocalDate } from '@/utils/formatDate';\n\n// For reducer queries\n\n/**\n * @deprecated Use Action or PayloadAction from App\\utils\\stateManagementModels instead.\n */\ninterface Action {\n type: T;\n payload?: any;\n}\n\ninterface ErrorModel {\n error: boolean;\n fields: Array;\n}\n\ninterface FieldError {\n name: string;\n errors: Array;\n}\n\n/**\n * Boilerplate for the queries pattern.\n * @deprecated Use QueryState from App\\utils\\stateManagementModels instead\n */\ninterface QueryState {\n readonly queries: Array>;\n}\n\nconst getFieldError = (fieldName: string, fieldErrors: Array) => {\n // Try to find and return first error for the field with this name\n const matchingField = fieldErrors.find((fieldError) => fieldError.name === fieldName);\n if (matchingField && matchingField.errors.length > 0) {\n return matchingField.errors[0];\n }\n\n return null;\n};\n\nconst areScalarArraysEqualIgnoreOrder = (array1: Array, array2: Array): boolean => {\n if (array1.length != array2.length) {\n return false;\n }\n\n const array2Sorted = array2.slice().sort();\n\n return array1\n .slice()\n .sort()\n .every((value, index) => value === array2Sorted[index]);\n};\n\n/// any arrays items are considered to be of primitive type\n/// arrays are compared ignoring order\n\nfunction areObjectsEqual(object1: T, object2: T, ignoredFields?: Array): boolean {\n if (object1 === object2) {\n return true;\n }\n\n if (!(object1 instanceof Object) || !(object2 instanceof Object)) {\n return false;\n }\n\n if (Array.isArray(object1) && Array.isArray(object2)) {\n return areScalarArraysEqualIgnoreOrder(object1, object2);\n }\n\n const uniqueKeys = Object.keys(object1)\n .concat(Object.keys(object2))\n .filter((value, index, self) => self.indexOf(value) === index);\n\n for (let i = 0; i <= uniqueKeys.length; i += 1) {\n const key = uniqueKeys[i];\n\n const shouldSkip = ignoredFields?.some((field) => field === key);\n if (!shouldSkip) {\n const value1 = object1[key];\n const value2 = object2[key];\n\n if (!areObjectsEqual(value1, value2)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\nfunction getFixedDate(value: string | Date): Date {\n let fixedDate: Date;\n if (!(value instanceof Date)) {\n const objectDate = new Date(value);\n fixedDate = new Date(objectDate.getTime() + objectDate.getTimezoneOffset() * 60000);\n } else {\n fixedDate = value;\n }\n\n return fixedDate;\n}\n\nfunction dateToYYYYMMDD(date: string | Date, delimiter = '-'): string {\n const fixedDate = getFixedDate(date);\n return formatLocalDate(fixedDate, ApiDateFormat.DateOnly);\n}\n\nfunction dateToString(date: string | Date): string {\n const fixedDate = getFixedDate(date);\n const result = formatLocalDate(fixedDate, DisplayDateFormat.ShortDate);\n return result;\n}\n\nexport {\n Action,\n ErrorModel,\n FieldError,\n QueryState,\n getFieldError,\n areScalarArraysEqualIgnoreOrder,\n areObjectsEqual,\n dateToYYYYMMDD,\n dateToString,\n};\n","import * as dialog from 'plugins/dialog';\nimport * as router from 'plugins/router';\n\nimport * as companyService from '@/legacy/services/company';\n\nclass BillingDebitFailedModal {\n view = 'features/companies/serviceSubscriptions/modals/billingDebitFailedModal';\n\n /* Because SelectCompany can be called multiple times (ex: during invitation) we want to ensure we\n never show more than 1 of these modals */\n public static isVisible = false;\n\n public companyService = companyService.Instance;\n\n public Close(): void {\n BillingDebitFailedModal.isVisible = false;\n dialog.close(this, false);\n }\n\n public Continue(): void {\n BillingDebitFailedModal.isVisible = false;\n dialog.close(this, true);\n router.navigate('user/settings/billing');\n }\n\n public static show(): JQueryPromise {\n if (BillingDebitFailedModal.isVisible) {\n return;\n }\n\n BillingDebitFailedModal.isVisible = true;\n dialog.show(new BillingDebitFailedModal());\n }\n}\n\nexport default BillingDebitFailedModal;\n","import * as app from 'durandal/app';\nimport * as system from 'durandal/system';\nimport * as router from 'plugins/router';\nimport * as ko from 'knockout';\nimport CssBaseline from '@mui/material/CssBaseline';\n\nimport { isPersonaActive, isPersonaEnabled } from '@/features/persona';\nimport BillingDebitFailedModal from '@/legacy/features/companies/serviceSubscriptions/modals/billingDebitFailedModal';\nimport genericInfoModal from '@/legacy/modals/genericInfoModal';\nimport * as companyService from '@/legacy/services/company';\nimport * as promoCodesService from '@/legacy/services/company/promoCodes'; // Leave this here because we initialize an event inside\nimport routers from '@/legacy/services/routers';\nimport unsavedChangedConfirmationService from '@/legacy/services/UnsavedChangedConfirmationService';\nimport * as userService from '@/legacy/services/user';\n\ndeclareModules({\n 'components/user/companies/capabilities/freeTrialEndedBanner': () =>\n import('@/legacy/components/user/companies/capabilities/freeTrialEndedBanner'),\n 'components/user/companies/capabilities/freeTrialEndedBanner.html': () =>\n import('@/legacy/components/user/companies/capabilities/freeTrialEndedBanner.html'),\n 'components/user/layout/navbar-footer': () =>\n import('@/legacy/components/user/layout/navbar-footer'),\n 'components/user/layout/navbar-footer.html': () =>\n import('@/legacy/components/user/layout/navbar-footer.html'),\n 'components/user/layout/navbar-top': () => import('@/legacy/components/user/layout/navbar-top'),\n 'components/user/layout/navbar-top.html': () =>\n import('@/legacy/components/user/layout/navbar-top.html'),\n 'components/user/onboarding/parts/reminderBar': () =>\n import('@/legacy/components/user/onboarding/parts/reminderBar'),\n 'components/user/onboarding/parts/reminderBar.html': () =>\n import('@/legacy/components/user/onboarding/parts/reminderBar.html'),\n 'viewmodels/contacts/shell': () => import('@/legacy/viewmodels/contacts/shell'),\n 'viewmodels/emailmoneytransfer/shell': () =>\n import('@/legacy/viewmodels/emailmoneytransfer/shell'),\n 'viewmodels/emailSubscriptions': () => import('@/legacy/viewmodels/emailSubscriptions'),\n 'viewmodels/forgotPassphrase': () => import('@/legacy/viewmodels/forgotPassphrase'),\n 'viewmodels/notFound': () => import('@/legacy/viewmodels/notFound'),\n 'viewmodels/oauth/shell': () => import('@/legacy/viewmodels/oauth/shell'),\n 'viewmodels/quickbooksonline/shell': () => import('@/legacy/viewmodels/quickbooksonline/shell'),\n 'viewmodels/register': () => import('@/legacy/viewmodels/register'),\n 'viewmodels/requests/shell': () => import('@/legacy/viewmodels/requests/shell'),\n 'viewmodels/resetPassphrase': () => import('@/legacy/viewmodels/resetPassphrase'),\n 'viewmodels/signin': () => import('@/legacy/viewmodels/signin'),\n 'viewmodels/signup': () => import('@/legacy/viewmodels/signup'),\n 'viewmodels/ssoLoadingPage': () => import('@/legacy/viewmodels/ssoLoadingPage'),\n 'viewmodels/ssoLogin': () => import('@/legacy/viewmodels/ssoLogin'),\n 'viewmodels/user/shell': () => import('@/legacy/viewmodels/user/shell'),\n 'viewmodels/verificationEmailSent': () => import('@/legacy/viewmodels/verificationEmailSent'),\n 'viewmodels/verify/onetimeLogin': () => import('@/legacy/viewmodels/verify/onetimeLogin'),\n 'viewmodels/verify/verifyEmail': () => import('@/legacy/viewmodels/verify/verifyEmail'),\n 'viewmodels/verifyNewEmail': () => import('@/legacy/viewmodels/verifyNewEmail'),\n 'viewmodels/xero/shell': () => import('@/legacy/viewmodels/xero/shell'),\n 'views/contacts/shell.html': () => import('@/legacy/views/contacts/shell.html'),\n 'views/emailmoneytransfer/shell.html': () =>\n import('@/legacy/views/emailmoneytransfer/shell.html'),\n 'views/emailSubscriptions.html': () => import('@/legacy/views/emailSubscriptions.html'),\n 'views/forgotPassphrase.html': () => import('@/legacy/views/forgotPassphrase.html'),\n 'views/notFound.html': () => import('@/legacy/views/notFound.html'),\n 'views/oauth/shell.html': () => import('@/legacy/views/oauth/shell.html'),\n 'views/quickbooksonline/shell.html': () => import('@/legacy/views/quickbooksonline/shell.html'),\n 'views/register.html': () => import('@/legacy/views/register.html'),\n 'views/requests/shell.html': () => import('@/legacy/views/requests/shell.html'),\n 'views/resetPassphrase.html': () => import('@/legacy/views/resetPassphrase.html'),\n 'views/signin.html': () => import('@/legacy/views/signin.html'),\n 'views/signup.html': () => import('@/legacy/views/signup.html'),\n 'views/ssoLoadingPage.html': () => import('@/legacy/views/ssoLoadingPage.html'),\n 'views/ssoLogin.html': () => import('@/legacy/views/ssoLogin.html'),\n 'views/user/shell.html': () => import('@/legacy/views/user/shell.html'),\n 'views/verificationEmailSent.html': () => import('@/legacy/views/verificationEmailSent.html'),\n 'views/verify/onetimeLogin.html': () => import('@/legacy/views/verify/onetimeLogin.html'),\n 'views/verify/verifyEmail.html': () => import('@/legacy/views/verify/verifyEmail.html'),\n 'views/verifyNewEmail.html': () => import('@/legacy/views/verifyNewEmail.html'),\n 'views/xero/shell.html': () => import('@/legacy/views/xero/shell.html'),\n});\n\nexport class ViewModel {\n public router: DurandalRouter;\n\n public userService: userService.UserService;\n\n public companyService: companyService.CompanyService;\n\n private promoCodesService: promoCodesService.PromoCodeService = promoCodesService.Instance;\n\n private showBillingDebitFailedModalSubscription: DurandalEventSubscription;\n\n constructor() {\n this.router = router;\n this.companyService = companyService.Instance;\n this.userService = userService.Instance;\n }\n\n public react = {\n fragments: {\n /**\n * CssBaseline uses Emotion's GlobalStyle API under the hood, which bypasses the cache. Init\n * it once globally here to avoid creating thousands of redundant CSSStyleSheet instances in\n * the DOM. */\n CssBaseline,\n },\n };\n\n public NavigateHome(): void {\n // don't navigate anywhere when tutorial is visible\n\n if ($('body').hasClass('tutorial-visible')) {\n router.navigate('user/tutorials/companyInfo');\n return;\n }\n\n if (this.userService.IsAuthenticated() === false) {\n router.navigate('https://www.plooto.com/');\n } else {\n router.navigate('user');\n }\n $('html, body').scrollTop(0);\n }\n\n public navigateVerifyPhoneNumber(): void {\n router.navigate('user/tutorials/addPhoneNumber');\n }\n\n public ShowSignIn(): void {\n router.navigate('signin');\n }\n\n public SwitchCompany(): void {\n router.navigate('user/company/select');\n }\n\n public attached(view: HTMLElement, parent: HTMLElement): void {\n $(view)\n .find('[data-toggle=popover]')\n .popover({\n trigger: 'manual',\n html: true,\n content() {\n return $(this).parent().find('.content').html();\n },\n })\n .click(function (evt) {\n evt.stopPropagation();\n $(this).popover('show');\n });\n $('html').on('click', (e) => {\n if (\n typeof $(e.target).data('original-title') === 'undefined' &&\n !$(e.target).parents().is('.popover.in')\n ) {\n $('[data-original-title]').popover('hide');\n }\n });\n\n const showBillingDebitFailedModalSubscription = app\n .on('billing:showDebitFailedModal')\n .then(() => BillingDebitFailedModal.show());\n }\n\n public detached(): void {\n this.showBillingDebitFailedModalSubscription?.off();\n }\n\n public IsDemoCompany: KnockoutComputed = ko.pureComputed({\n read: () => this.companyService.IsDemo(),\n deferEvaluation: true,\n });\n\n public FooterClass: KnockoutComputed = ko.pureComputed({\n read: () => (this.userService.IsAuthenticated() ? 'authenticated' : 'not-authenticated'),\n deferEvaluation: true,\n });\n\n public IsLimitedDomesticPaymentsCompanyFeatureEnabled: KnockoutComputed =\n ko.pureComputed({\n read: () =>\n this.userService.IsAuthenticated() &&\n this.companyService.CompanyId() &&\n this.companyService.isLimitedDomesticPaymentsFeatureEnabled(),\n });\n\n public SignInVisible: KnockoutComputed = ko.pureComputed({\n read: () => {\n const instruction = router.activeInstruction();\n if (!instruction) {\n return false;\n }\n\n return (\n instruction.fragment != 'qbo_connect' && instruction.config.route != 'requests*details'\n );\n },\n deferEvaluation: true,\n });\n\n public isFooterPadded: KnockoutComputed = ko.pureComputed({\n read: () => {\n const instruction = router.activeInstruction();\n if (!instruction) {\n return false;\n }\n\n return instruction.fragment.indexOf('user/onboardingWizard') !== 0;\n },\n deferEvaluation: true,\n });\n\n public activate(): JQueryPromise {\n let lastRouteChecksum;\n\n router.activeInstruction.subscribe((newValue: DurandalRouteInstruction) => {\n if (!newValue || !newValue.config) {\n return;\n }\n const { moduleId } = newValue.config;\n\n let newRouteChecksum = newValue.config.hash;\n if (newValue.params.length > 0 && newValue.params[0] != null) {\n newRouteChecksum += '[params]';\n }\n\n if (lastRouteChecksum == newRouteChecksum) {\n return;\n }\n\n lastRouteChecksum = newRouteChecksum;\n\n $(document.body).toggleClass('state_authenticated', this.userService.IsAuthenticated());\n\n $(document.body).toggleClass('view_home', /^viewmodels\\/home$/.test(moduleId));\n\n const navbar = $('.navbar');\n navbar.removeClass('deactivated');\n navbar.removeClass('active');\n });\n\n $(window).scroll(() => {\n const MIN_SCROLL_ADD = 200;\n const MIN_SCROLL_REMOVE = 100;\n const body = $(document.body);\n\n if (body.hasClass('view_home')) {\n const scrollTop = $(window).scrollTop();\n const navbar = $('.navbar');\n\n if (scrollTop > MIN_SCROLL_ADD && !navbar.hasClass('active')) {\n navbar.removeClass('deactivated');\n navbar.addClass('active');\n }\n if (scrollTop < MIN_SCROLL_REMOVE && navbar.hasClass('active')) {\n navbar.removeClass('active');\n navbar.addClass('deactivated');\n }\n }\n });\n\n const retVal = router\n .map([\n {\n route: [\n '',\n 'signin(/:resumeFragment)',\n 'signin/company/:companyId(/:resumeFragment)',\n 'signin/dialog/twoFactorSettings',\n ],\n title: 'Sign In',\n moduleId: 'viewmodels/signin',\n nav: true,\n },\n { route: 'signup(/:email)', title: 'Sign Up', moduleId: 'viewmodels/signup', nav: true },\n\n {\n route: 'forgotPassphrase',\n title: 'Forgot Password',\n moduleId: 'viewmodels/forgotPassphrase',\n nav: true,\n },\n {\n route: 'ssoLogin',\n title: 'SSO Login',\n moduleId: 'viewmodels/ssoLogin',\n nav: true,\n },\n {\n route: 'ssoLoadingPage',\n title: 'Loading',\n moduleId: 'viewmodels/ssoLoadingPage',\n nav: false,\n },\n {\n route: 'resetPassphrase(/:userId)(/:verificationCode)',\n title: 'Reset Password',\n moduleId: 'viewmodels/resetPassphrase',\n nav: true,\n },\n\n {\n route: 'forwardSession/:key1/:key2/:key3',\n title: 'Logging In...',\n moduleId: 'viewmodels/verify/onetimeLogin',\n nav: true,\n },\n {\n route: 'verifyEmail/:userId/:verificationCode',\n title: 'Email Verification',\n moduleId: 'viewmodels/verify/verifyEmail',\n nav: true,\n },\n\n {\n route: 'verificationEmailSent(/:email)',\n title: 'Almost Done',\n moduleId: 'viewmodels/verificationEmailSent',\n nav: true,\n },\n {\n route: 'verifyNewEmail(/:userId)(/:verificationCode)',\n title: 'Verify New Email',\n moduleId: 'viewmodels/verifyNewEmail',\n nav: false,\n },\n\n {\n route: 'user*details',\n title: 'Dashboard',\n moduleId: 'viewmodels/user/shell',\n nav: false,\n hash: 'user',\n },\n\n {\n route: 'quickbooksonline*details',\n title: 'QuickBooks Online',\n moduleId: 'viewmodels/quickbooksonline/shell',\n nav: false,\n hash: 'quickbooksonline',\n },\n {\n route: 'requests*details',\n title: 'Requests',\n moduleId: 'viewmodels/requests/shell',\n nav: false,\n hash: 'requests',\n },\n\n {\n route: 'emailmoneytransfer*details',\n title: 'Email Money Transfer',\n moduleId: 'viewmodels/emailmoneytransfer/shell',\n nav: false,\n hash: 'emailmoneytransfer',\n },\n {\n route: 'contacts*details',\n title: 'Contact',\n moduleId: 'viewmodels/contacts/shell',\n nav: false,\n hash: 'contacts',\n },\n\n {\n route: 'xero*details',\n title: 'Xero',\n moduleId: 'viewmodels/xero/shell',\n nav: false,\n hash: 'xero',\n },\n {\n route: 'oauth*details',\n title: '',\n moduleId: 'viewmodels/oauth/shell',\n nav: false,\n hash: 'oauth',\n },\n {\n route: 'register(/:email)(/:verificationCode)',\n title: 'Set Password',\n moduleId: 'viewmodels/register',\n nav: false,\n },\n {\n route: 'emailSubscriptions(/:email)(/:groupId)',\n title: 'Email Subscriptions',\n moduleId: 'viewmodels/emailSubscriptions',\n nav: false,\n },\n ])\n .buildNavigationModel()\n .mapUnknownRoutes('viewmodels/notFound');\n retVal.guardRoute = (\n instance: Record,\n instruction: DurandalRouteInstruction\n ): JQueryPromise =>\n system\n .defer(async (dfd) => {\n if (\n unsavedChangedConfirmationService.showConfirmationDialog &&\n unsavedChangedConfirmationService.hasChanges()\n ) {\n await genericInfoModal\n .show({\n title: 'Leave page?',\n message:\n 'You have unsaved changes. Are you sure you want to leave the page without saving?',\n swapButtons: true,\n })\n .then((result) => {\n if (result === 'No') {\n dfd.resolve(false);\n }\n });\n }\n\n if (\n instruction.fragment.indexOf('tutorials/') >= 0 ||\n instruction.fragment.indexOf('forwardSession/') >= 0 ||\n instruction.fragment.indexOf('user/onboardingWizard') >= 0 ||\n instruction.fragment.indexOf('user/your-first-payment/') >= 0\n ) {\n $('body').addClass('tutorial-visible');\n } else {\n $('body').removeClass('tutorial-visible');\n }\n\n if (\n this.userService.IsAuthenticated() &&\n this.userService.profile()?.isSignupPhoneVerificationRequired() &&\n !this.userService.profile()?.isSignupPhoneVerificationDone() &&\n (isPersonaActive() || isPersonaEnabled())\n ) {\n this.navigateVerifyPhoneNumber();\n }\n\n if (instruction.fragment == 'home' && this.userService.IsAuthenticated()) {\n dfd.resolve('user');\n return;\n }\n\n if (instruction.fragment == 'user' || /^user\\//.test(instruction.fragment)) {\n if (!this.userService.IsAuthenticated()) {\n dfd.resolve(`signin/${encodeURIComponent(instruction.fragment)}`);\n return;\n }\n }\n\n // checks if the verify email route has an associated email\n if (\n this.userService.IsAuthenticated() &&\n instruction.config.moduleId === 'viewmodels/verify/verifyEmail'\n ) {\n dfd.resolve('user/company/select');\n return;\n }\n\n dfd.resolve(true);\n })\n .promise();\n\n routers.Root = retVal;\n\n return router.activate();\n }\n}\n","import { ApprovalsFilter } from '@/features/approvals/types/ApprovalsFilter';\nimport { ApprovalsTab } from '@/features/approvals/types/ApprovalsTab';\n\nconst ApprovalsTabToKey: Record = {\n [ApprovalsTab.Controls]: 'controls',\n [ApprovalsTab.Payments]: 'payments',\n};\n\n/** Durandal routes map */\nexport const durandalRoutes = {\n clients: {\n addNewClient: '#user/tutorials/companyInfo',\n inviteAsClient: '#user/settings/accountingFirm/dialog/companyAccountingFirmInvite',\n },\n user: {\n dashboard: '#user',\n onboarding: {\n connectBankAccountDialog: '#user/dashboard/dashboardWizard/dialog/newBankAccount',\n firstPayWizard: '#user/your-first-payment',\n outstandingVerificationItems: '#user/dashboard/outstandingVerificationItems',\n validateCompanyDialog: '#user/dashboard/dashboardWizard/dialog/validateCompany',\n verifyIdentity: '#user/dashboard/dashboardWizard/dialog/validateIdentity',\n wizard: '#user/dashboard/dashboardWizard',\n },\n integrations: {\n creditCards: '#user/integrations/creditCardLanding',\n },\n payments: {\n locked: '#user/payments/locked',\n },\n referrals: '#user/referrals',\n settings: {\n accountingSoftware: '#user/settings/users/integrations',\n controls: '#user/settings/controls',\n profile: '#user/settings',\n billing: '#user/settings/billing',\n sso: '#user/settings/sso',\n userManagement: '#user/settings/users',\n accountingFirmClients: '#user/settings/accountingFirm',\n },\n transferFunds: {\n index: '#user/transferFunds',\n prefundCad: '#user/transferFunds/prefund_PI_CAD',\n prefundUsd: '#user/transferFunds/prefund_PI_USD',\n },\n tutorials: {\n complete: '#user/tutorials/complete',\n companyInfo: '#user/tutorials/companyInfo',\n selectPaymentPlan: '#user/tutorials/selectPaymentPlan',\n },\n capture: '#user/documents',\n payables: '#user/payments',\n paymentAdd: '#user/payments/add',\n paymentDetails: (paymentId: string) => `#user/payments/view/${paymentId}`,\n receivables: '#user/requests',\n contacts: '#user/payees',\n contactDetails: (payeeId: string) => `#user/payees/view/${payeeId}`,\n accounts: '#user/bank',\n approvals: {\n default: '#user/approvals',\n tab({\n isRestrictedToMyPayments,\n activeTab,\n itemId,\n }: {\n isRestrictedToMyPayments: boolean;\n activeTab: ApprovalsTab;\n itemId?: string;\n }) {\n const filter = isRestrictedToMyPayments ? ApprovalsFilter.Mine : ApprovalsFilter.All;\n const tab = ApprovalsTabToKey[activeTab];\n return itemId\n ? `#user/approvals/${filter}/${tab}/${itemId}`\n : `#user/approvals/${filter}/${tab}`;\n },\n },\n companySelect: '#user/company/select',\n },\n} as const;\n","import * as ko from 'knockout';\n\nimport { Instance as companyService } from '@/legacy/services/company';\nimport { Instance as userService } from '@/legacy/services/user';\nimport { Instance as verificationService } from '@/legacy/services/verification/verification';\nimport { Instance as verificationUserService } from '@/legacy/services/verification/verificationUser';\n\nexport const companyOnboardingStatus = companyService.CompanyId.mapAsync((companyId) => {\n if (!companyId) {\n return undefined;\n }\n return new Promise((resolve, reject) => {\n verificationService\n .getOnboardingWizardStatus(companyId)\n .then((result) => resolve(result.companyVerificationStatus))\n .fail(reject);\n });\n});\n\nexport const isCompanyVerificationCompleted = ko.pureComputed(\n () => companyOnboardingStatus() === 'COMPLETED'\n);\n\nexport const isCompanyVerificationInProgress = ko.pureComputed({\n read: () =>\n companyOnboardingStatus() !== null &&\n companyOnboardingStatus() !== 'COMPLETED' &&\n companyOnboardingStatus() !== 'REJECTED',\n});\n\nexport const isUnableToVerifyCompany = ko.pureComputed(\n () => companyOnboardingStatus() === 'REJECTED'\n);\n\nconst companyAndUserId = ko.computed(() => [companyService.CompanyId(), userService.UserId()]);\n\nexport const userOnboardingStatus = companyAndUserId.mapAsync(\n ([companyId, userId]) =>\n companyId &&\n userId &&\n Promise.resolve(verificationUserService.GetVerifyIdentityStatus(companyId, userId))\n);\n\n/** Backing field for {@see identityVerified} */\nconst identityVerifiedHack = ko.observable(undefined);\n\n/**\n * Identity verification doesn't trigger any app invalidations. SignalR doesn't fire a user updated\n * event. We do some hacking to pretend that all that stuff worked.\n */\nexport const identityVerified = ko.pureComputed({\n read: () => identityVerifiedHack() ?? userService.profile()?.identityVerified(),\n write: identityVerifiedHack,\n deferEvaluation: true,\n});\n\n/** Backing field for {@see identitySubmitted} */\nconst identitySubmittedHack = ko.observable(undefined);\n\n/**\n * Identity verification doesn't trigger any app invalidations. SignalR doesn't fire a user updated\n * event. We do some hacking to pretend that all that stuff worked.\n */\nexport const identitySubmitted = ko.pureComputed({\n read: () =>\n identityVerified() || (identitySubmittedHack() ?? userService.profile()?.isIdentitySubmitted()),\n write: identitySubmittedHack,\n deferEvaluation: true,\n});\n\nexport const isUnableToVerifyIdentity = ko.pureComputed(\n () => userOnboardingStatus()?.status === 'REJECTED'\n);\n\nexport const isOnboardingCompleted = ko.pureComputed(\n () => isCompanyVerificationCompleted() && identityVerified() && !isUnableToVerifyIdentity()\n);\n\nexport const isUnableToVerify = ko.pureComputed(\n () => isUnableToVerifyIdentity() || isUnableToVerifyCompany()\n);\n"],"names":["PlootoDialog","children","isClosable","isOpen","onDialogClose","PaperProps","undefined","title","dialogProps","formatMessage","useIntl","_jsxs","_Dialog","open","_jsx","_IconButton","sx","position","top","right","mt","mr","onClick","_Close","titleAccess","commonMessages","closeDialog","_DialogTitle","pr","Emphasis","chunks","Strong","Underline","style","textDecoration","PhoneLink","chunk","_Link","href","EmailLink","SupportEmailLink","ApprovalsFilter","ApprovalsTab","defineMessages","approve","id","defaultMessage","back","cancel","close","comingSoon","continue","delete","emDash","goPlanName","gotIt","growPlanName","growUnlimitedPlanName","learnMore","loading","logout","new","none","okay","or","other","reject","save","showLess","showMore","skipForNow","subtotal","tryAgain","typeToSearch","unlimited","isPersonaEnabled","userService","UserId","mapAsync","userId","FeatureToggleService","isFeatureEnabled","FeatureFlag","SPR5_24_ONBOARDING_PERSONA","initialValue","isPersonaActive","ko","read","isSubjectToPersonaOnboarding","companyService","profile","isAccountingFirm","hasAccountingFirmCompanyId","Boolean","accountingFirmCompanyId","isCompanySubjectToOnboarding","isUserVerified","identityVerified","isCompanyVerified","isCompanyVerificationCompleted","deferEvaluation","getIsPartOfPersonaCohort","featureFlagEnabled","skipUntil","enabled","isPersonaKycStep","isCompanyVerificationInProgress","isUnableToVerifyIdentity","identitySubmitted","mapPersonaCorporationType","corporationType","Corporation","Charity","mapToPersonaVerificationBindingModel","fields","companyId","isKyc","userInformation","companyInformation","name","value","operatingName","businessUrl","address","city","country","state","suite","zipCode","PersonaFlowContainer","_styled","_Box","theme","minHeight","minWidth","breakpoints","down","InquiryDialog","onClose","queryClient","useQueryClient","errorDialogConfirm","useConfirm","useSyncKoObservable","CompanyId","companyProfile","userProfile","hasCompletedCompanyVerification","hasSubmittedCompanyVerification","referenceId","existingInquiryId","localStorage","getItem","data","ownershipInformation","isLoading","isOwnershipInformationLoading","useQuery","queryFn","OwnershipInformationService","get","queryKey","userEmail","email","isUbo","useMemo","some","owner","toLowerCase","companyPersonaMetadata","isFetching","isCompanyPersonaMetadataLoading","ApiService","Object","create","globalThis","import_meta_env","APP_URLS_API_URL","userVerifications","isUserVerificationsLoading","Promise","resolve","verificationUserService","GetVerifyIdentityStatus","isUboLoading","isPersonaKycStepNonUbo","shouldRenderKyc","isIdentitySubmitted","isIdentityVerified","templateId","PERSONA_KYC_TEMPLATE_ID","PERSONA_GET_STARTED_TEMPLATE_ID","onSuccessfulSubmission","useCallback","invalidateQueries","app","removeItem","prefilledPersonaFields","caseId","res","email_address","form_filler_email_address","business_name","business_physical_address_country_code","name_first","firstName","name_last","lastName","phone_number","businessPhone","onUnsuccessfulSubmission","error","errorMessage","message","type","description","FormattedMessage","values","hideCancelButton","mutate","submitVerification","useMutation","mutationFn","verificationService","postPersonaVerification","onError","onSuccess","handleComplete","bindingModel","handleEvent","metadata","inquiryId","setItem","Dialog","fullWidth","maxWidth","py","_DialogContent","alignItems","display","justifyContent","_CircularProgress","Inquiry","environmentId","PERSONA_GET_STARTED_ENVIRONMENT_ID","onComplete","onEvent","UnableToVerify","_Stack","_Typography","gutterBottom","textAlign","variant","emailLink","phoneVerificationService","sendCode","phoneNumber","post","body","verify","code","validatePhoneNumber","match","onlyNumbers","replace","length","Step","spacing","_Card","p","EnterPhoneNumber","onSendSms","validationSchema","object","string","required","test","onSubmit","setFieldError","formattedNumber","substring","SessionTimeoutService","showTimeout","formik","useFormik","initialValues","isSubmitting","direction","Person","fontSize","color","SecurityUpdateGoodOutlined","FormikProvider","Form","Field","component","TextField","label","LoadingButton","EnterVerificationCodeRenderer","lastPhoneDigits","onResendCode","onVerifyCode","verificationCode","valid","Stack","CheckCircle","autocomplete","inputMode","EnterVerificationCode","slice","VerifyNumberSuccess","totalAccountingFirmMemberships","accountingFirmMemberships","totalUserMemberships","memberships","buttonHref","totalAccountingFirmMembershipsCount","totalUserMembershipsCount","durandalRoutes","user","tutorials","companyInfo","dashboard","_Button","VerifyNumber","isCompleted","isSignupPhoneVerificationDone","step","setStep","useState","setPhoneNumber","onCompleteEnterPhoneNumber","addedPhoneNumber","onCompleteEnterVerificationCode","totalMembershipsCount","LoadProfile","router","onResendSms","handleLogOut","Logout","size","url","FEATURE_VERIFICATION_BASE_URL","response","AuthFetchService","httpGet","ok","json","Error","statusText","update","owners","httpPut","JSON","stringify","status","SmsCountry","VerificationStep","ActionType","reducer","action","payload","AddErrors","SetFormPhoneNumber","fieldErrors","filter","e","SetFormCountry","smsCountry","UnableToScan","isUnableToScan","SetCode","SetFormVerificationMethod","verificationMethod","isMaxNumberOfAuthMethodsReachedForCurrentType","isMaxNumberOfTwoFactorAuthReached","twoFactorAuthentications","PreviousStep","verificationStep","NextStep","currentStep","steps","SelectVerificationProvider","TwoFactorAuthenticationType","Otp","queries","QueryGenerateOtp","QuerySubmitPhoneNumber","phoneCountry","toString","ConfirmOtpCode","EnterSmsCode","twoFactorAuthenticationDisabler","twoFactorAuthentication","QuerySubmitTwoFactorStatus","temporaryMfaSetupId","closeOnSuccess","isFinal","twoFactorAuthenticationIdToUpdate","ConfirmDisableOtpCode","EnterDisableSmsCode","SelectDisabler","QuerySendDisableCode","ResendSmsCode","query","isEnabled","CallUser","shouldCallUser","QueryCallSetupCode","SetSteps","newSteps","push","blockBack","methodSpecificActivation","OtpQrCode","ShowDialog","dialog","CloseDialog","ShowFieldError","fieldName","errors","HandleFormFieldErrors","SetDisableVerificationMethod","nextStep","secretKey","otpSecretKey","handleQueries","dispatch","handleError","getErrorDialog","closeModal","errorDialog","forEach","smsCodeResponse","TwoFactorAuthenticationService","generateSmsCode","mfaType","Sms","updateTwoFactorAuthentication","TwoFactorAuthenticationStatus","Disabled","addTwoFactorAuthentication","smsSettings","sendDisableCode","otpCodeResponse","generateOtpCode","twoFactorAuthenticationType","tfa","Constants","MAX_NUMBER_OF_2FAS_PER_TYPE","getInitialState","isMaxNumberOfOtpTwoFactorAuthReached","isMaxNumberOfSmsTwoFactorAuthReached","CompanyCountry","CA","US","otpAccountName","UserService","DisplayEmail","DisplayName","APP_URLS_APP_URL","CodeMessage","props","memo","Code","onCodeChange","onCallMe","getCodeLabel","_Fragment","mb","my","_FormControl","_TextField","onChange","autoFocus","disabled","getFieldError","helperText","autoComplete","SmsBackupOptions","VerificationProvider","onTwoFactorAuthenticationDisablerChange","twoFactorAuthenticationDisablers","handleVerificationChange","newMethod","find","method","target","_InputLabel","_Select","labelId","defaultValue","map","_MenuItem","displayName","_FormHelperText","SmsPhoneFragment","onPhoneNumberChange","onSmsCountryChange","phoneNumberErrorMessage","SecondaryText","ml","_Grid","container","item","sm","md","QrCodeFragment","Component","componentDidMount","qrCodeData","QRCode","document","getElementById","console","render","ScanCode","onUnableToScan","_Paper","fontWeight","UserOtpQrCodeFragment","otpAccountNameRaw","encodeURIComponent","flexDirection","alignContent","justifyItems","onVerificationMethodChange","select","TwoFactorStepper","onNextStep","onPreviousStep","onVerificationChange","getStepContent","DisableVerification","_Stepper","activeStep","orientation","stepIndex","_Step","_StepLabel","_StepContent","TwoFactorSetupDialogContents","handeClose","getDialog","TitleMessageDialog","getDialogTitle","handleSubmit","preventDefault","handleCodeChange","handleNextStep","handlePhoneNumberChange","handlePreviousStep","handleSmsCountryChange","handleUnableToScan","handleResendCode","handleCallMe","dialogTitle","_DialogContentText","_DialogActions","rel","flexGrow","TwoFactorSetupDialog","useReducer","stateWithoutQueries","useEffect","handleClose","handleDisableVerificationChange","verification","LoginPopupDefaultMethodDialog","onCodeUpdate","twoFactorDisplayName","numberOfTwoFactorAuthentications","onSubmitCode","onSwitchToMultipleMode","onRememberDeviceChange","rememberDevice","handleCodeSubmit","handleRememberDeviceChange","checked","margin","_FormControlLabel","control","_Checkbox","LoginStep","ChooseProvider","AdvanceStep","VerifyAuthenticator","QuerySubmitCode","RegressStep","QueryClosePopup","QueryClearInput","SetStep","callbacks","onClearInput","useLoginPopupMultipleMethods","stepForward","stepBack","LoginPopupMultipleMethodsPresentation","selectedTwoFactorAuthentication","onBackPressed","onNextPressed","onProviderChange","onCodeUpdated","codeInputRef","useRef","popoverAnchor","setPopoverAnchor","current","focus","handleCodeUpdated","handleProviderChange","matchingTwoFactorAuthentication","handleOpenPopover","currentTarget","handleClosePopover","nonLinear","inputRef","_Popover","anchorEl","LoginPopupMultipleMethods","onTwoFactorAuthenticationChange","actions","filteredCode","LoginPopupPresentation","handlers","isDefaultTwoFactorAuthenticationMode","LoginPopupDefaultMethod","handleCodeUpdate","handleSwitchToMultipleMode","isRememberDevice","handleTwoFactorAuthenticationChange","handleClearInput","localConfig","exactCodeLength","initializer","initialState","ResendCode","QueryBeginAuthentication","SelectTwoFactorAuthentication","SetIsDefaultTwoFactorAuthenticationMode","SetIsRememberDevice","SetErrorMessage","SubmitCode","SetIsOpen","QueryGetTwoFactorAuthentications","SetTwoFactorAuthentications","defaultTwoFactorAuthentication","isDefault","UpdateCode","BeginCallAuthentication","QueryBeginCallAuthentication","isAuthenticationStarted","beginAuthentication","SetIsAuthenticationStarted","err","beginCallAuthentication","getTwoFactorAuthentications","onSuccessfulTwoFactorChallenge","authenticate","UserSessionTwoFactorStatus","Authorized","EventsService","emit","EventType","UserTwoFactorAuthenticationSuccess","getErrorMessage","apiError","useLoginPopup","LoginPopupBindings","cursor","underline","getSingleSignOnLoginRequest","getUserSessionFromCode","recaptchaKey","RECAPTCHA_V2_KEY","waitForReady","_once","window","grecaptcha","ready","getRecaptchaWidgetId","recaptchaElement","callback","sitekey","getRecaptchaResponse","recaptchaWidgetId","recaptchaResponse","getResponse","execute","isRecaptchaEnabled","resetRecaptcha","reset","declareModules","modals/genericInfoModal.html","StyledModal","BaseModal","view","constructor","params","continueButtonLabel","cancelButtonLabel","swapButtons","show","React","password","isTwoFactorCodePopupOpen","isTwoFactorSignupOpen","QueryRecaptchaWidget","maxPasswordLength","SubmitForm","QuerySubmitLoginForm","UpdatePassword","ShowTwoFactorCodeDialog","CloseTwoFactorCodeDialog","isSuccessful","getSuccessQuery","QueryLoginSuccess","ShowTwoFactorSignupDialog","CloseTwoFactorSignupDialog","UpdateErrorMessage","isBlocking","resetPassword","UpdateRecaptchaWidgetId","StartFormSubmit","QueryLogout","showPasswordError","onLogout","onLoginSuccess","recaptchaV2Response","Login","passphrase","userLoginResponse","UserLoginResponse","TwoFactorAuthenticationRequired","Successful","TwoFactorComplianceRequired","TwoFactorSignupRequired","SessionTimeoutDialog","onChangePassword","event","className","handleLogout","handleChangePassword","handleCloseTwoFactorCodePopup","handleSuccessfulTwoFactorChallenge","handleCloseSignupDialog","LoginPopup","getRoute","location","hash","formRef","samlRequestRef","handleLogin","then","samlRequest","submit","ref","modals/sessionTimeout.html","SessionTimeout","react","fragments","SessionTimeoutFragment","SsoSessionTimeoutDialog","showSsoTimeoutModal","pureComputed","isSsoUser","isSsoAdminUser","dialogPromise","segmentAnalytics","EventName","UserSignedOut","source","FormEventType","ButtonClicked","sessionTimeoutDialog","realtimeListener","RealtimeEvent","Offline","finally","off","isDisplayed","UnsavedChangesConfirmationService","hasChanges","showConfirmationDialog","API_PREFIX","PromoCodeApplyCodeViewModel","PromoCodeService","BindPaymentEventCallbacks","createdPayment","freeTransactions","freeTransactionUsed","decreaseFreeTransaction","deletedPayment","PutApplyCode","system","dfd","AuthorizedPut","done","exchangeRateData","plootoUtils","fail","promise","Instance","Routers","Root","User","Settings","SESSION_TIMEOUT","SESSION_KILL","PING_INTERVAL","keepSessionAlive","resetSessionTimeout","$","on","IsAuthenticated","lastPing","Date","now","ping","setLastSessionActionToNow","getLastSessionAction","valueAsString","Number","parseInt","NaN","isNaN","getTimeSinceLastSession","lastSessionAction","disconnectSession","clearAuthenticationToken","resetSessionKill","waitMs","sessionKill","clearTimeout","setTimeout","timeSinceLastSession","nextWaitMs","hasAuthenticationToken","startSessionTimeout","sessionTimeout","eventArgs","didAuthenticate","reloadAfterAuthenticate","reload","AccountVerificationStatus","AccountVerificationResult","VerificationUserService","VerifyIdentity","formData","AuthorizedUpload","verificationInfo","PostIdentityPersonalInformation","personalInformation","AuthorizedPost","PostIdentityAddressInformation","addressInformation","AuthorizedGet","GetAccountVerificationStatus","accountVerificationStatus","matchingField","fieldError","areScalarArraysEqualIgnoreOrder","array1","array2","array2Sorted","sort","every","index","areObjectsEqual","object1","object2","ignoredFields","Array","isArray","uniqueKeys","keys","concat","self","indexOf","i","key","field","value1","value2","getFixedDate","fixedDate","objectDate","getTime","getTimezoneOffset","dateToYYYYMMDD","date","delimiter","formatLocalDate","ApiDateFormat","DateOnly","dateToString","DisplayDateFormat","ShortDate","BillingDebitFailedModal","isVisible","Close","Continue","components/user/companies/capabilities/freeTrialEndedBanner","components/user/companies/capabilities/freeTrialEndedBanner.html","components/user/layout/navbar-footer","components/user/layout/navbar-footer.html","components/user/layout/navbar-top","components/user/layout/navbar-top.html","components/user/onboarding/parts/reminderBar","components/user/onboarding/parts/reminderBar.html","viewmodels/contacts/shell","viewmodels/emailmoneytransfer/shell","viewmodels/emailSubscriptions","viewmodels/forgotPassphrase","viewmodels/notFound","viewmodels/oauth/shell","viewmodels/quickbooksonline/shell","viewmodels/register","viewmodels/requests/shell","viewmodels/resetPassphrase","viewmodels/signin","viewmodels/signup","viewmodels/ssoLoadingPage","viewmodels/ssoLogin","viewmodels/user/shell","viewmodels/verificationEmailSent","viewmodels/verify/onetimeLogin","viewmodels/verify/verifyEmail","viewmodels/verifyNewEmail","viewmodels/xero/shell","views/contacts/shell.html","views/emailmoneytransfer/shell.html","views/emailSubscriptions.html","views/forgotPassphrase.html","views/notFound.html","views/oauth/shell.html","views/quickbooksonline/shell.html","views/register.html","views/requests/shell.html","views/resetPassphrase.html","views/signin.html","views/signup.html","views/ssoLoadingPage.html","views/ssoLogin.html","views/user/shell.html","views/verificationEmailSent.html","views/verify/onetimeLogin.html","views/verify/verifyEmail.html","views/verifyNewEmail.html","views/xero/shell.html","ViewModel","promoCodesService","CssBaseline","NavigateHome","hasClass","scrollTop","navigateVerifyPhoneNumber","ShowSignIn","SwitchCompany","attached","parent","popover","trigger","html","content","click","evt","stopPropagation","parents","is","showBillingDebitFailedModalSubscription","detached","IsDemoCompany","IsDemo","FooterClass","IsLimitedDomesticPaymentsCompanyFeatureEnabled","isLimitedDomesticPaymentsFeatureEnabled","SignInVisible","instruction","fragment","config","route","isFooterPadded","activate","lastRouteChecksum","subscribe","newValue","moduleId","newRouteChecksum","toggleClass","navbar","removeClass","scroll","MIN_SCROLL_ADD","addClass","MIN_SCROLL_REMOVE","retVal","nav","buildNavigationModel","mapUnknownRoutes","guardRoute","instance","unsavedChangedConfirmationService","genericInfoModal","result","isSignupPhoneVerificationRequired","routers","ApprovalsTabToKey","Controls","Payments","clients","addNewClient","inviteAsClient","onboarding","connectBankAccountDialog","firstPayWizard","outstandingVerificationItems","validateCompanyDialog","verifyIdentity","wizard","integrations","creditCards","payments","locked","referrals","settings","accountingSoftware","controls","billing","sso","userManagement","accountingFirmClients","transferFunds","prefundCad","prefundUsd","complete","selectPaymentPlan","capture","payables","paymentAdd","paymentDetails","paymentId","receivables","contacts","contactDetails","payeeId","accounts","approvals","default","tab","isRestrictedToMyPayments","activeTab","itemId","Mine","All","companySelect","companyOnboardingStatus","getOnboardingWizardStatus","companyVerificationStatus","isUnableToVerifyCompany","userOnboardingStatus","identityVerifiedHack","write","identitySubmittedHack","isOnboardingCompleted","isUnableToVerify"],"sourceRoot":""}